var selected;var submitter=null;var pageOverlay;Array.prototype.contains=function(a){for(var i=0;i<this.length;++i)if(this[i]==a)return true;return false};Element.Properties.selected={get:function(){return this.getSelected()},set:function(a){for(var i=0;i<this.length;i++)if($(this.options[i]).get('value')==a)this.options[i].selected=true}};Element.Properties.selectedIndex={get:function(){return this.selectedIndex},set:function(a){this.selectedIndex=a}};Element.Properties.disabled={get:function(){return this.disabled},set:function(a){this.disabled=!!a}};function submitFunction(){submitter=1}function popupWindow(a){window.open(a,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')}function rowOverEffect(a){var b=$(a);if(b.get('class')=='moduleRow')b.set('class','moduleRowOver')}function rowOutEffect(a){var b=$(a);if(b.get('class')=='moduleRowOver')b.set('class','moduleRow')}function popupImageWindow(a){window.open(a,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')}function j_rowOver(a){var b=$(a);var c=(arguments[1]?arguments[1]:'');if(b.get('class')=='row0'||b.get('class')=='row1'||b.get('class')=='rowP')b.set('class','rowOver'+c);if(b.get('class')=='sellAccountRow')b.setStyle('background-color','#FFF')}function j_rowOut(a){var b=$(a);var c=(arguments[1]?arguments[1]:0);if(b.get('class')=='rowOver'||b.get('class')=='rowOverP')b.set('class','row'+c);if(b.get('class')=='sellAccountRow')b.setStyle('background-color',(arguments[1]?'#FBDDDD':''))}function j_rowClick(a,b){var c=$(a);var d=(arguments[2]?arguments[2]:0);if(!selected)selected=$('defaultSelected');if(selected)selected.set('class','row'+d);c.set('class','rowClick'+d);selected=c;var e=$("checkout_payment").payment;if(e[b])$(e[b]).set('checked',true)}function showPageOverlay(){if(!pageOverlay){pageOverlay=new Element('div',{'id':'pageOverlay','class':'pageOverlay'});$(document.body).adopt(pageOverlay)}if(pageOverlay){var a=getDocumentHeight();if(a)pageOverlay.setStyle('height',a+'px');pageOverlay.setStyle('display','block')}}function hidePageOverlay(){if(pageOverlay)pageOverlay.setStyle('display','none')}var topSearchValue="";function clearTopSearch(){var a=$('top_input_search');if(topSearchValue.length==0)topSearchValue=a.get('value');var b=a.get('value');if(arguments[0])b=(a.get('value').length==0?topSearchValue:b);else b=(a.get('value')==topSearchValue?'':b);a.set('value',b)}function toggleImg(a,b){var c=$(a);c.set('src',b)}function submitForm(a){var b=$(a);if(b){if(arguments[1]&&arguments[2]){var c=arguments[1].split("|");var d=arguments[2].split("|");if(c.length==d.length){for(var i=0;i<c.length;i++){var e=b.getElementsByTagName(c[i]);for(var j=0;j<e.length;j++)if(e[j].value==d[i])e[j].set('disabled',true)}}}b.submit()}}function doPopup(a){var b=(arguments[1]?arguments[1]:400);var c=(arguments[2]?arguments[2]:250);var d=(arguments[3]?arguments[3]:250);var e=(arguments[4]?arguments[4]:250);var f=(a.getAttribute?a.getAttribute('href'):a.href);if(!f)return true;var g='width='+b+',height='+c+',resizable=yes,top='+d+',left='+e+',scrollbars=yes,status=yes';var h=window.open(f,'',g);return(h?false:true)}function getClientWidth(){var a=0;if(typeof(window.innerWidth)=='number')a=window.innerWidth;else if(document.documentElement&&document.documentElement.clientWidth)a=document.documentElement.clientWidth;else if(document.body&&document.body.clientWidth)a=document.body.clientWidth;return a}function getClientHeight(){var a=0;if(typeof(window.innerWidth)=='number')a=window.innerHeight;else if(document.documentElement&&document.documentElement.clientHeight)a=document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)a=document.body.clientHeight;return a}function getDocumentHeight(){var a=Math.max(Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),Math.max(document.body.offsetHeight,document.documentElement.offsetHeight),Math.max(document.body.clientHeight,document.documentElement.clientHeight));return a}function getScrollTop(){var a=0;if(document.body&&document.body.scrollTop)a=document.body.scrollTop;else a=document.documentElement.scrollTop;return a}function setCharCounter(a,b,c){var d=$(b);var e=$(a);var f=e.get('value').length;if(f>c){e.set('value',e.get('value').substring(0,c));var f=c}d.set('html',(c-f))}function scrollToElement(a,b){b++;if(b<=20){var c=$(a);if(!c)window.setTimeout("scrollToElement('"+a+"', "+b+", -20)",500);else{var d=c.getPosition();if(d.y)window.scrollTo(0,(arguments[2]?(d.y+arguments[2]):d.y))}}}Element.Events.keyesc={base:'keyup',condition:function(e){return e.key=='esc'}};var f_enableEscapeKey=function(e){e.stop();try{hideProductOptions()}catch(ev){}try{hideAccountInfo()}catch(ev){}try{closeIframe()}catch(ev){}};function enableEscapeKey(){$('body').addEvent('keyesc',f_enableEscapeKey)}function disableEscapeKey(){$('body').removeEvent('keyesc',f_enableEscapeKey)}