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");if($.browser.opera){return a}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");if(a>$("#"+d).width()){$("#"+d).css("width",a+"px")}}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 getProperDimensions(a,h,e,c,d){if(a<=0||h<=0||(e<=0&&c<=0)||(d&&a<=e&&h<=c)){return[a,h]}var b=1;if(e<=0){b=(d&&h<=c)?1:c/h}else{if(c<=0){b=(d&&a<=e)?1:e/a}else{var g=e/a;var f=c/h;b=d?Math.min(g,f,1):Math.min(g,f)}}return[round(b*a),round(b*h)]}function visibleBox(d,b){elm1=document.getElementById("open"+d);elm2=document.getElementById("close"+d);elm3=document.getElementById("box"+d);if(!elm3){return false}if(b){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 a=getElementsByClassName("DialogBox");for(var c=0;c<a.length;c++){a[c].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(f,c,d,e,g){c=(arguments.length>1&&c!==false)?c:number_format_th;d=(arguments.length>2&&d!==false)?d:number_format_dec;e=(arguments.length>3&&e!==false)?e:number_format_point;g=(arguments.length>4&&g!==false)?currency_format:"x";if(e>0){e=Math.pow(10,e);f=Math.round(f*e)/e;var h=Math.floor(f);var a=Math.round((f-h)*e)+e}else{var h=Math.round(f);var a=0}h=h+"";a=a+"";var b=0;for(var i=h.length;i>=0;i--){if(b%3==0&&b>0&&i>0){h=h.substr(0,i)+c+h.substr(i,h.length)}b++}return g.replace("x",(a>0)?(h+d+a.substr(1,a.length)):h)}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(a,d,c){if(!c&&typeof(window.event)!="undefined"){c=event}if(c){if(c.stopPropagation){c.stopPropagation()}else{c.cancelBubble=true}}if(!a){return false}if(a.tagName!="FORM"){if(!a.form){return false}a=a.form}if(typeof(window.$)!="undefined"){var b=$(a).triggerHandler("submit");if(b===false){return false}}if(a.mode){a.mode.value=d}return a.submit()}function convert_number(a){var b=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));a=parseFloat(a.replace(" ","").replace(d,"").replace(b,"."));return Math.round(a*c)/c}function check_is_number(a){var b=new RegExp(reg_quote(number_format_dec),"gi");var c=new RegExp(reg_quote(number_format_th),"gi");a=a.replace(" ","").replace(c,"").replace(b,".");return(a.search(/^[+-]?[0-9]+(\.[0-9]+)?$/)!=-1)}function cloneObject(c){var b={};for(var a in c){if(hasOwnProperty(c,a)){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){if(!a){return false}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 viewTooltip(b,a){if(b.hasTooltip){return true}b.hasTooltip=true;$(b).tooltip({delay:300,bodyHandler:function(){return a}});return true}function viewHelp(f,i,c,g){if(!f){return false}if(f.constructor==String){f=document.getElementById(f)}if(!f||!i){return false}if(!i.helpBox){i.helpBox=f;f.helpLink=i;f.onmouseout=viewHelpOut;i.onmouseout=viewHelpOut;f.onmouseover=viewHelpOver;f.helpBoxVisible=false;f.helpBoxHideTO=false;f.helpBoxHideTTL=c?c:1000;if(g){f.style.width=g+"px"}}f.style.top=(posGetTop(i)+posGetHeight(i)+2)+"px";var j=$(f).width();var e=posGetLeft(i);if(e+j>$(window).width()){e=e-j+$(i).width()}f.style.left=e+"px";viewHelpOver.call(f);viewHelpVisible(f,true);var k=getRealWidth(f);if(k>$(f).width()){var k=Math.min(k,$(window).width()-40);$(f).width(k);var h=$(i).offset().left;var b=$(i).width();var d=$(f).offset().left;if(d+k>$(window).width()){f.style.left=(e-k+b)+"px";d=$(f).offset().left}if(d<0){f.style.left=(10)+"px";d=$(f).offset().left}}if(i.blur){i.blur()}return true}function viewHelpGetObjects(d){if(!d.tagName||(d.tagName.toUpperCase()!=="DIV"&&d.tagName.toUpperCase()!=="A"||$(d).hasClass("help-link"))){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(function(){viewHelpVisible(a,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}var xxx=0;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 extend(d,b){var a=function(){};a.prototype=b.prototype;d.prototype=new a();d.prototype.constructor=d;d.superclass=b.prototype}function hasOwnProperty(a,b){if(typeof(a)!="undefined"&&Object.prototype.hasOwnProperty){return a.hasOwnProperty(b)}return typeof(a[b])!="undefined"&&a.constructor.prototype[b]!==a[b]}var hint_timer=new Array();function hint_mouseout(a,b){$("#"+b).css("z-index",1);hint_timer[a]=setTimeout(function(){$("#"+b).hide()},50)}function hint_mouseover(a,b){if(hint_timer[a]){clearTimeout(hint_timer[a])}$("#"+b).css("z-index",999).show()}function resetDefault(a){if(!a.isReseted){a.value="";$(a).removeClass("default-value");a.isReseted=true}return true}function skipDefaultValue(a){$("input.default-value",a).each(function(){this.value=""});return true}function initResetDefault(){$("input.default-value").bind("focus",function(){if(!this.isReseted){this.defaultValue=this.value;this.value="";$(this).removeClass("default-value");this.isReseted=true}return true}).bind("change",function(){this.isContentIsChanged=true;return true}).bind("blur",function(){if(this.isReseted&&!this.isContentIsChanged&&this.defaultValue){this.value=this.defaultValue;$(this).addClass("default-value");this.isReseted=false}return true}).each(function(){if(!this.form.isSetReset){$(this.form).bind("submit",function(){$("input.default-value",this).each(function(){this.value=""});return true});this.form.isSetReset=true}})}if(window.addEventListener){window.addEventListener("load",initResetDefault,false)}else{if(window.attachEvent){window.attachEvent("onload",initResetDefault)}};
