$jQ(function(){$jQ('#updateCartForm').bind("submit",VerifyUpdate);$jQ('#nocheckout').bind('click',DontGo);$jQ('a.photo-popup-link').bind("mouseover",showImage);$jQ('.update-cart').wrap("<a href='#' class='a-update-cart'></a>");$jQ('.a-update-cart').click(updateCart)});var errorObj=new Object();var timeout=new Object();function updateCart(){if(VerifyUpdate()){$jQ('#updateCartForm')[0].submit()}return false}function VerifyUpdate(){if("#eother")$jQ('#eother').slideUp("normal",function(){$jQ('#eother').remove('#eother')});SwitchField("dontgo");$jQ('#updateCartForm input:text').each(function(a){if(isBlank($jQ(this)[0])||isNotANumber($jQ(this)[0])||$jQ(this)[0].value<0){SwitchField($jQ(this).attr("name"),"Please enter a valid quantity for "+$jQ("#name_"+$jQ(this).attr("name").substring(4)).html())}else{SwitchField($jQ(this).attr("name"))}});return errorCheck(errorObj,'#welcome')}function DontGo(){if("#eother")$jQ('#eother').slideUp("normal",function(){$jQ('#eother').remove('#eother')});SwitchField("dontgo","Your cart must contain at least $10 worth of merchandise.");return errorCheck(errorObj,'#welcome')}var timeout=new Object();function showImage(e){if(timeout[this.id]){clearTimeout(timeout[this.id])}addPop(this.id,this.href,this.title);$jQ('a[@id="'+this.id+'"]').attr("href","#");$jQ('a[@id="'+this.id+'"]').click(function(){return false});$jQ('#'+this.id).prev().children().show(2);$jQ('#'+this.id).prev().show(2);$jQ(this).bind("mouseout",hideImage)}function keepImage(){timeVar=$jQ(this).parents(".photo-popup-outer").next().attr("id");if(timeout[timeVar]){clearTimeout(timeout[timeVar])}$jQ(this).bind("mouseout",function(){if(timeout[timeVar]){clearTimeout(timeout[timeVar])}timeout[timeVar]=setTimeout("hideit('"+timeVar+"')",250)})}function hideImage(e){timeout[this.id]=setTimeout("hideit('"+this.id+"')",250)}function hideit(a){if(!$jQ.browser.msie){$jQ('#'+a).prev().children().hide(2)}if(!($jQ.browser.safari&&(navigator.userAgent.toLowerCase().match(/.+on[\/ ]([\d.]+)/)||[]).length)){$jQ('#'+a).prev().hide("normal")}}function addPop(a,b,c){if(z){delete z}var z=new Object();if($jQ('#po-'+a).length==0){$jQ('a[@id="'+a+'"]').parent().createPrepend('div',{className:'photo-popup-outer',id:'po-'+a},['div',{className:'photo-popup'},['div',{className:'photo-popup-innerwrap'},['div',{className:"photopopup-center-outer"},['div',{className:"photopopup-center-middle"},['div',{className:"photopopup-center-inner"},['h1',{style:"text-align:center;"},c,'img',{src:b,style:'border:0px;',alt:c}]]]]],'div',{className:'photo-popup-pointer'},''])}$jQ('#po-'+a).show("0",function(){$jQ('#po-'+a).children(".photo-popup").css("bottom",-150);$jQ('#po-'+a).children(".photo-popup-pointer").css("bottom",-170);z.s=jQuery.getScroll();z.c=jQuery.getClient();z.p=jQuery.getPos($jQ('#po-'+a).find('.photo-popup')[0]);if(z.p.y<z.s.t&&z.p.y!=0){objTop=(-120-(z.s.t-z.p.y));pbottom=-170}else if(z.p.y+z.p.h>z.s.t+z.c.h&&z.p.y!=0){objTop=(-160+(z.p.y+z.p.h)-(z.s.t+z.c.h));pbottom=-140}else{objTop=-170;pbottom=-170}$jQ('#po-'+a).children(".photo-popup").css("bottom",objTop);$jQ('#po-'+a).children(".photo-popup-pointer").css("bottom",pbottom);$jQ('#po-'+a).show(2)});$jQ('#po-'+a).find('div').bind('mouseover',keepImage).end().find('img').bind('mouseover',keepImage);return z}