var localIsDOM=document.getElementById?true:false;var localIsJava=navigator.javaEnabled();var localIsStrict=document.compatMode=="CSS1Compat";var localPlatform=navigator.platform;var localVersion="0";var localBrowser="";var localBFamily="";var isHttps=false;if(window.opera&&localIsDOM){localBFamily=localBrowser="Opera";if(navigator.userAgent.search(/^.*Opera.([\d.]+).*$/)!=-1){localVersion=navigator.userAgent.replace(/^.*Opera.([\d.]+).*$/,"$1")}else{if(window.print){localVersion="6"}else{localVersion="5"}}}else{if(document.all&&document.all.item){localBFamily=localBrowser="MSIE"}}if(navigator.appName=="Netscape"){localBFamily="NC";if(!localIsDOM){localBrowser="Netscape";localVersion=navigator.userAgent.replace(/^.*Mozilla.([\d.]+).*$/,"$1");if(localVersion!=""){localVersion="4"}}else{if(navigator.userAgent.indexOf("Chrome")>=0){localBrowser="Chrome"}else{if(navigator.userAgent.indexOf("Safari")>=0){localBrowser="Safari"}else{if(navigator.userAgent.indexOf("Netscape")>=0){localBrowser="Netscape"}else{if(navigator.userAgent.indexOf("Firefox")>=0){localBrowser="Firefox"}else{localBrowser="Mozilla"}}}}}}if(navigator.userAgent.indexOf("MSMSGS")>=0){localBrowser="WMessenger"}else{if(navigator.userAgent.indexOf("e2dk")>=0){localBrowser="Edonkey"}else{if(navigator.userAgent.indexOf("Gnutella")+navigator.userAgent.indexOf("Gnucleus")>=0){localBrowser="Gnutella"}else{if(navigator.userAgent.indexOf("KazaaClient")>=0){localBrowser="Kazaa"}}}}if(localVersion=="0"&&localBrowser!=""){var rg=new RegExp("^.*"+localBrowser+".([\\d.]+).*$");localVersion=navigator.userAgent.replace(rg,"$1")}var localIsCookie=((localBrowser=="Netscape"&&localVersion=="4")?(document.cookie!=""):navigator.cookieEnabled);var isHttps=document.location.protocol=="https:";function change_antibot_image(c){var a=document.getElementById(c);if(a){var b=xcart_web_dir+"/antibot_image.php?tmp="+Math.random()+"&section="+c+"&regenerate=Y";setTimeout(function(){a.src=b},200)}}function getRealWidth(c){var a=$(c).attr("scrollWidth");var b=parseInt($(c).css("padding-left"));if(!isNaN(b)){a-=b}var d=parseInt($(c).css("padding-right"));if(!isNaN(d)){a-=d}return a}function showNote(d,b){var c=$("#"+d).get();$("#"+d).remove();$("body").append(c);$("#"+d).show();var a=getRealWidth("#"+d);$("#"+d).css("left",$(b).offset().left+$(b).width()+"px");$("#"+d).css("top",$(b).offset().top+"px");$("#"+d).css("width",a+"px");$("#"+d).show()}function getElementsByClassName(f){var e,b;var a=[];var c=document.getElementsByTagName("*");for(var d=0;(e=c[d]);d++){if(e.className==f){a[a.length]=e}}return a}function visibleBox(d,a){elm1=document.getElementById("open"+d);elm2=document.getElementById("close"+d);elm3=document.getElementById("box"+d);if(!elm3){return false}if(a){elm3.style.display=(elm3.style.display=="")?"none":""}else{if(elm1){if(elm1.style.display==""){elm1.style.display="none";if(elm2){elm2.style.display=""}elm3.style.display="none";var c=getElementsByClassName("DialogBox");for(var b=0;b<c.length;b++){c[b].style.height="1%"}}else{elm1.style.display="";if(elm2){elm2.style.display="none"}elm3.style.display=""}}}return true}function switchVisibleBox(d){var b=document.getElementById(d);var c=document.getElementById(d+"_plus");var a=document.getElementById(d+"_minus");if(!b||!c||!a){return false}if(b.style.display=="none"){b.style.display="";c.style.display="none";a.style.display=""}else{b.style.display="none";a.style.display="none";c.style.display=""}return true}function urlEncode(a){return a.replace(/\s/g,"+").replace(/&/,"&amp;").replace(/"/,"&quot;")}function round(b,a){if(isNaN(b)){b=parseFloat(b)}if(!a||isNaN(a)){return Math.round(b)}a=Math.pow(10,a);return Math.round(b*a)/a}function price_format(e,a,d,c,f){a=(arguments.length>1&&a!==false)?a:number_format_th;d=(arguments.length>2&&d!==false)?d:number_format_dec;c=(arguments.length>3&&c!==false)?c:number_format_point;f=(arguments.length>4&&f!==false)?currency_format:"x";if(c>0){c=Math.pow(10,c);e=Math.round(e*c)/c;var h=Math.floor(e);var g=Math.round((e-h)*c)+c}else{var h=Math.round(e);var g=0}h=h+"";g=g+"";var b=0;for(var i=h.length;i>=0;i--){if(b%3==0&&b>0&&i>0){h=h.substr(0,i)+a+h.substr(i,h.length)}b++}sum=(g>0)?(h+d+g.substr(1,g.length)):h;return f.replace("x",sum)}function substitute(c){var b;for(var a=1;a<arguments.length;a+=2){if(arguments[a]&&arguments[a+1]){c=c.replace(new RegExp("\\{\\{"+arguments[a]+"\\}\\}","gi"),arguments[a+1]).replace(new RegExp("~~"+arguments[a]+"~~","gi"),arguments[a+1])}}return c}function getWindowOutWidth(a){if(!a){a=window}return localBFamily=="MSIE"?a.document.body.clientWidth:a.outerWidth}function getWindowOutHeight(a){if(!a){a=window}return localBFamily=="MSIE"?a.document.body.clientHeight:a.outerHeight}function getWindowWidth(a){if(!a){a=window}return localBFamily=="MSIE"?a.document.body.clientWidth:a.innerWidth}function getWindowHeight(a){if(!a){a=window}return localBFamily=="MSIE"?a.document.body.clientHeight:a.innerHeight}function getDocumentHeight(a){if(!a){a=window}return Math.max(a.document.documentElement.scrollHeight,a.document.body.scrollHeight)}function getDocumentWidth(a){if(!a){a=window}return Math.max(a.document.documentElement.scrollWidth,a.document.body.scrollWidth)}function expandWindowX(b,f,a){if(!b){b=window}if(!f){f=10}var d=true;var c=200;while(d&&c--){if(a&&getWindowOutWidth()+f>a){break}try{b.scrollTo(f,0);d=(b.document.documentElement&&b.document.documentElement.scrollLeft>0)||(b.document.body&&b.document.body.scrollLeft>0);if(d){b.resizeBy(f,0)}}catch(g){return false}}return true}function expandWindowY(b,f,a){if(!b){b=window}if(!f){f=10}var d=true;var c=200;while(d&&c--){if(a&&getWindowOutHeight()+f>a){break}try{b.scrollTo(0,f);d=(b.document.documentElement&&b.document.documentElement.scrollTop>0)||(b.document.body&&b.document.body.scrollTop>0);if(d){b.resizeBy(0,f)}}catch(g){return false}}return true}function checkMarks(d,c,e){var b=false;if(!d||d.elements.length==0){return true}for(var a=0;a<d.elements.length;a++){if(d.elements[a].name.search(c)==0&&d.elements[a].type=="checkbox"&&!d.elements[a].disabled){b=true;if(d.elements[a].checked){return true}}}if(!b){return true}if(e){alert(e)}else{if(lbl_no_items_have_been_selected){alert(lbl_no_items_have_been_selected)}}return false}function submitForm(b,d,c){if(!c&&typeof(window.event)!="undefined"){c=event}if(c){if(c.stopPropagation){c.stopPropagation()}else{c.cancelBubble=true}}if(!b){return false}if(b.tagName!="FORM"){if(!b.form){return false}b=b.form}if(typeof(window.$)!="undefined"){var a=$(b).triggerHandler("submit");if(a===false){return false}}if(b.mode){b.mode.value=d}return b.submit()}function convert_number(b){var a=new RegExp(reg_quote(number_format_dec),"gi");var d=new RegExp(reg_quote(number_format_th),"gi");var c=Math.pow(10,parseInt(number_format_point));b=parseFloat(b.replace(" ","").replace(d,"").replace(a,"."));return Math.round(b*c)/c}function check_is_number(b){var a=new RegExp(reg_quote(number_format_dec),"gi");var c=new RegExp(reg_quote(number_format_th),"gi");b=b.replace(" ","").replace(c,"").replace(a,".");return(b.search(/^[+-]?[0-9]+(\.[0-9]+)?$/)!=-1)}function reg_quote(a){return a.replace(/\./g,"\\.").replace(/\//g,"\\/").replace(/\*/g,"\\*").replace(/\+/g,"\\+").replace(/\[/g,"\\[").replace(/\]/g,"\\]")}function setCookie(a,d,g,b){if(typeof(b)=="object"){try{var h=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];var c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];if(h[b.getDay()]&&c[b.getMonth()]){b=h[b.getDay()]+" "+b.getDate()+"-"+c[b.getMonth()]+"-"+b.getFullYear()+" "+b.getHours()+":"+b.getMinutes()+":"+b.getSeconds()+" GMT"}}catch(f){}}if(typeof(b)!="string"){b=false}document.cookie=a+"="+escape(d)+(b?"; expires="+b:"")+(g?"; path="+g:"")}function deleteCookie(a){document.cookie=a+"=0; expires=Fri, 31 Dec 1999 23:59:59 GMT;"}function cloneObject(c){var b={};for(var a in c){b[a]=c[a]}return b}function getFirstCB(c,b){while(c.tagName&&c.tagName.toUpperCase()!="FORM"){c=c.parentNode}if(!c.tagName||c.tagName.toUpperCase()!="FORM"||c.elements.length==0){return false}var d=false;for(var a=0;a<c.elements.length&&!d;a++){if(c.elements[a].name.search(b)==0&&c.elements[a].type=="checkbox"&&!c.elements[a].disabled&&c.elements[a].checked){d=c.elements[a]}}if(!d){if(lbl_no_items_have_been_selected){alert(lbl_no_items_have_been_selected)}return false}return d}function _getById(c){if(typeof(c)!="string"||!c){return false}var b=document.getElementById(c);if(b&&b.id!=c){b=false;for(var a=0;a<document.all.length&&b===false;a++){if(document.all[a].id==c){b=document.all[a]}}}return b}function isset(a){return typeof(a)!="undefined"&&a!==null}function isFunction(a){return(typeof(a)=="function"||(typeof(a)=="object"&&(a+"").search(/\s*function /)===0))}function getPureLength(a){return(a&&a.replace)?a.replace(new RegExp("\r","g"),"").length:-1}function getTASelection(d){if(document.selection){d.focus();var a=document.selection.createRange();var g=a.duplicate();g.moveToElementText(d);var f=a.text;var e=String.fromCharCode(1);a.text=e;var b=g.text.indexOf(e);d.selectionStart=getPureLength((b==-1)?g.text:g.text.substring(0,b));d.selectionEnd=getPureLength(f)+d.selectionStart;a.moveStart("character",-1);a.text=f}return[d.selectionStart,d.selectionEnd]}function insert2TA(a,c){var d=getTASelection(a);var b;if(!isNaN(d[0])){a.value=a.value.substr(0,d[0])+c+a.value.substr(d[0]);b=d[0]}else{b=getPureLength(a.value);a.value+=c}setTACursorPos(a,b);return b}function setTACursorPos(b,c,a){if(!b||!b.tagName||b.tagName.toUpperCase()!="TEXTAREA"){return false}if(isNaN(c)){c=0}else{if(getPureLength(b.value)<c){c=getPureLength(b.value);a=c}}if(isNaN(a)){a=c}if(document.selection){var d=b.createTextRange();d.collapse(true);d.moveStart("character",c);d.moveEnd("character",a-c);d.select()}else{if(!isNaN(b.selectionStart)){b.selectionStart=c;b.selectionEnd=a}}if(b.focus){b.focus()}return true}function viewHelp(c,j,d,f){var h=document.getElementById(c);if(!h||!j){return false}if(!j.helpBox){j.helpBox=h;h.helpLink=j;h.onmouseout=viewHelpOut;j.onmouseout=viewHelpOut;h.onmouseover=viewHelpOver;h.helpBoxVisible=false;h.helpBoxHideTO=false;h.helpBoxHideTTL=d?d:1000;if(f){h.style.width=f+"px"}}h.style.top=(posGetTop(j)+posGetHeight(j)+2)+"px";var m=$(h).width();var g=posGetLeft(j);if(g+m>$(window).width()){g=g-m+$(j).width()}h.style.left=g+"px";viewHelpOver.call(h);viewHelpVisible(h,true);var k=getRealWidth(h);if(k>$(h).width()){var k=Math.min(k,$(window).width()-40);$(h).width(k);var i=$(j).offset().left;var b=$(j).width();var e=$(h).offset().left;if(e+k>$(window).width()){h.style.left=(g-k+b)+"px";e=$(h).offset().left}if(e<0){h.style.left=(10)+"px";e=$(h).offset().left}}if(j.blur){j.blur()}return true}function viewHelpGetObjects(d){if(!d.tagName||(d.tagName.toUpperCase()!=="DIV"&&d.tagName.toUpperCase()!=="A")){return false}if(d.helpBox){var b=d;var c=d.helpBox}else{var b=d.helpLink;var c=d}if(!b||!c||!b.helpBox||!c.helpLink){return false}return{a:b,box:c}}function viewHelpVisible(a,b){a.style.display=b?"block":"none";a.helpBoxVisible=b;return true}function viewHelpStartHide(a){a.helpBoxHideTO=setTimeout(new Function("",'var box = document.getElementById("'+a.id.replace('/"/','\\"')+'"); if (box) viewHelpVisible(box, false);'),a.helpBoxHideTTL);return true}function viewHelpOut(){var a=viewHelpGetObjects(this);if(!a){return false}return a.box.helpBoxVisible&&viewHelpStartHide(a.box)}function viewHelpOver(){var a=viewHelpGetObjects(this);if(!a){return false}if(a.box.helpBoxVisible&&a.box.helpBoxHideTO){clearTimeout(a.box.helpBoxHideTO)}return true}function posGetPageOffset(c){var a=0;var b=0;do{a+=c.offsetLeft;b+=c.offsetTop}while((c=c.offsetParent));return{left:a,top:b}}function posGetLeft(a){return posGetPageOffset(a).left}function posGetTop(a){return posGetPageOffset(a).top}function posGetWidth(a){return a.offsetWidth}function posGetHeight(a){return a.offsetHeight}function buttonOver(b){var a=b.getElementsByTagName("SPAN");if(a.length>0){a[0].className="underline"}}function buttonOut(b){var a=b.getElementsByTagName("SPAN");if(a.length>0){a[0].className="normal"}}function getMethod(d,c){var a=[];for(var b=2;b<arguments.length;b++){a[a.length]=arguments[b]}if(!c){c=window}return function(){if(!isFunction(d)){d=c[d]}return d.apply?d.apply(c,a):d()}}function lockForm(a){if(a.locked){return false}a.locked=true;setTimeout(function(){a.locked=false},1000);return true}function getPopupControl(b){var a=b;while(a&&a.tagName&&!a._popupControl){a=a.parentNode}return(a&&a._popupControl)?a._popupControl:false}function parse_url(b){if(!b||b.constructor!=String){return false}var a=b.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/);if(!a){return false}var c={scheme:a[2],host:a[4],path:a[5],query:a[7],fragment:a[9]};if(c.host){a=c.host.match(/^(?:([^:]+):)?([^@]+)@(.+)$/);if(a){c.host=a[3];c.user=a[1]?a[1]:a[2];c.password=a[1]?a[2]:false}}return c}function pngFix(b){if(!b||!b.tagName||!$.browser.msie||b.tagName.toUpperCase()!="IMG"){return false}var a=b.src.replace(/\(/g,"%28").replace(/\)/g,"%29");b.src=images_dir+"/spacer.gif";b.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+a+'",sizingMethod="scale")';return true}function getImgSrc(a){if(!a||!a.tagName||a.tagName.toUpperCase()!="IMG"||!a.src){return false}if($.browser.msie&&a.src.search(/\/spacer\.gif$/)!=-1&&a.filters["DXImageTransform.Microsoft.AlphaImageLoader"]){return a.filters["DXImageTransform.Microsoft.AlphaImageLoader"].src}return a.src}function isPngFix(a){return $.browser.msie&&a&&a.tagName&&a.tagName.toUpperCase()=="IMG"&&a.src&&a.src.search(/\/spacer\.gif$/)!=-1&&a.filters["DXImageTransform.Microsoft.AlphaImageLoader"]}var debug=function(){var a=false;return function(){if(typeof(window.$)=="undefined"){return false}if(!a){a=$(document.createElement("DIV")).css({position:"absolute",border:"1px solid black",backgroundColor:"white",display:"none",top:"0px",left:"0px",width:"200px",height:"200px",overflow:"auto",padding:"5px",margin:"0px"}).get(0);document.body.appendChild(a);a.defaultOpacity=0.9;a.ttl=0;a._extend_create=false;a._ttlTO=false;a._rowsLength=0;a.html=function(d,c){this._getBox().innerHTML=d;this.show();this.startTTL(arguments.length>1?c:this.ttl)};a.add=function(d,c){this._getBox().innerHTML+=d+"<br />\n";this.show();this.startTTL(arguments.length>1?c:this.ttl)};a.row=function(d){var e=$("div:eq("+d+")",this._getBox()).get(0);if(!e){for(var c=this._rowsLength;c<d+1;c++){e=this._getBox().appendChild(document.createElement("DIV"));e.remove=this._removeRow;e.html=this._htmlRow;e.add=this._addRow;e.box=this}this._rowsLength=d+1}return e};a._removeRow=function(){if(this.parentNode){this.box._rowsLength--;this.parentNode.removeChild(this)}};a._htmlRow=function(d,c){this.innerHTML=d;this.box.show();this.box.startTTL(arguments.length>1?c:this.parentNode.ttl)};a._addRow=function(d,c){this.innerHTML+=d;this.box.show();this.box.startTTL(arguments.length>1?c:this.parentNode.ttl)};a.clean=function(){this._rowsLength=0;this._getBox().innerHTML=""};a.hide=function(){this.style.display="none"};a.show=function(){this.style.display=""};a.opacity=function(c){c=parseFloat(c);if(isNaN(c)||c<0||c>1){return false}c=Math.round(c*100)/100;if($.browser.msie){this.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity = "+(c*100)+")"}else{this.style.opacity=c}return true};a.startTTL=function(c){if(this._ttlTO){clearTimeout(this._ttlTO)}if(c<=0){return false}var d=this;this._ttlTO=setTimeout(function(){d.hide()},c*1000);return true};a.extend=function(){if(this._extend_create){return true}var d=document.getElementsByTagName("SCRIPT");var c;var g=false;for(var e=0;e<d.length&&!g;e++){if(d[e].src&&(c=d[e].src.match(/^(.+\/)common.js/))){g=c[1]}}if(!g){return false}var f=document.createElement("SCRIPT");f.src=g+"debug.js";document.body.appendChild(f);this._extend_create=true;return true};a.is_extended=function(){return this._extend_create&&typeof(window._debug_is_extended)!="undefined"&&_debug_is_extended};a._getBox=function(){return this};if(a.defaultOpacity>0&&a.defaultOpacity<=1){a.opacity(a.defaultOpacity)}}if(typeof(window.debug_panel_ext_methods)!="undefined"&&debug_panel_ext_methods){for(var b=0;b<debug_panel_ext_methods.length;b++){a[debug_panel_ext_methods[b]]=debug_panel_ext[debug_panel_ext_methods[b]]}if(typeof(debug_panel_ext.init)!="undefined"){debug_panel_ext.init.call(a)}debug_panel_ext_methods=false;debug_panel_ext=false}return a}}();
