function showHelp(C){var A="/help.php?include&help_id="+C;var B;if(browser.isIE4up){B=window.open(A,"_blank","height=600,width=800,resizable=1,scrollbars=1")}else{B=window.open(A,"Help","height=600,width=800,resizable=1,scrollbars=1")}if(window.focus){B.focus()}}function CRLF2BR(B){var A=B.replace(/\n/g,"<BR/>");return A}function BR2CRLF(A){var B=A.replace(/<BR\/>/g,"\n");return B}function SPACE2NBSP(B){var A=B.replace(/ /g,"&nbsp;");return A}function NBSP2SPACE(A){var B=A.replace(/&nbsp;/g," ");return B}function showHelpTypeId(C){var A="/help.php?include&help_type_id="+C;var B;if(browser.isIE4up){B=window.open(A,"_blank","height=600,width=800,resizable=1,scrollbars=1")}else{B=window.open(A,"Help","height=600,width=800,resizable=1,scrollbars=1")}if(window.focus){B.focus()}}function buildMenu(){var C=$("global_header_nav").childNodes;var B=C.length;for(i=0;i<B;i++){var A=C[i].className;if(A!=null){if(A.indexOf("ghnav_btn")!=-1){C[i].onmouseover=function(){this.className="ghnav_btn ghover"};if(A.indexOf("last")!=-1){C[i].onmouseout=function(){this.className="ghnav_btn last"}}else{C[i].onmouseout=function(){this.className="ghnav_btn"}}}}}}function showTerms(){var A;if(browser.isIE4up){A=window.open("/saterms.php","_blank","height=600,width=550,scrollbars=yes")}else{A=window.open("/saterms.php","Terms & Conditions","height=600,width=550,scrollbars=yes")}if(window.focus){A.focus()}}function trylogin(F){var D="username";var A="password";if(F=="gl_loginform"){D="gl_username";A="gl_password"}if(validateInput(D,A)){var E=$(F);var B="/signin.php";YAHOO.util.Connect.setForm(E,false,true);var C=YAHOO.util.Connect.asyncRequest("POST",B,callback);return false}else{return false}return false;}var callback={success:function(B){if(B.responseText!=undefined){var A=B.responseText.indexOf("[FAIL]");if(A!=-1){alert(B.responseText.substring(6))}else{blockPage(0);toggleBox("PU_main",0);location.reload(true)}}},failure:function(A){alert("ไม่สามารถเชื่อมต่อกับระบบได้")}};function validateInput(B,A){if($(B).value==""){alert("กรุณาใส่ชื่อผู้ใช้งาน");return false}else{if($(A).value==""){alert("กรุณาใส่รหัสผู้ใช้งาน");return false}else{return true}}}function showMessage(B,A){$("PU_msg").innerHTML=B;toggleBox("PU_msg",A)}function configureNewsTable(){var A=$("newstable").rows;for(i=0;i<A.length;i++){if(A[i].className.indexOf("more")==-1){A[i].onmouseover=function(){this.className="selected"};A[i].onmouseout=function(){this.className=""};A[i].onmousedown=function(){this.className="selected down"};A[i].onmouseup=function(){this.className="selected"}}}}function refresh_self(){location.reload(true)}function toggleBox(A,B){$(A).style.visibility=B?"visible":"hidden"}function blockPage(A){if(document.body.scrollLeft==0){$("PU_bg").style.width=getWindowWidth()}else{$("PU_bg").style.width=document.body.scrollWidth}if(document.body.scrollTop==0){$("PU_bg").style.height=getWindowHeight()}else{$("PU_bg").style.height=document.body.scrollHeight}if(browser.isIE4up){$("PU_bg").style.filter="alpha(opacity=50)"}toggleBox("PU_bg",A)}function showLogin(){var B=document.body.scrollLeft+(getWindowWidth()/2)-(224/2)+"px";var A=document.body.scrollTop+(getWindowHeight()/2)-(151/2)+"px";$("PU_main").style.left=B;$("PU_main").style.top=A;toggleBox("PU_main",1);blockPage(1)}function moveLogin(){if($("PU_main").style.visibility=="visible"){showLogin()}}function configurePU(){$("delbox").onmouseover=new Function("this.style.background = 'url(/images/x_red_hover.gif) no-repeat';");$("delbox").onmousedown=new Function("this.style.background = 'url(/images/x_red_down.gif) no-repeat';");$("delbox").onmouseup=new Function("this.style.background = 'url(/images/x_red.gif) no-repeat';");$("delbox").onmouseout=new Function("this.style.background = 'url(/images/x_red.gif) no-repeat';");window.onresize=function(A){if($("PU_bg").style.visibility=="visible"){blockPage(1);moveLogin()}};window.onscroll=function(A){if($("PU_bg").style.visibility=="visible"){blockPage(1);moveLogin()}}}function confirmLink(C,B){var A=confirm(C);if(A){window.location=B}}function popup(A){var B;if(browser.isIE4up){B=window.open(A,"_blank")}else{B=window.open(A,"O'Che Shop.com")}if(window.focus){B.focus()}}function $(B){if(document.all){return document.all[B]}else{if(document.getElementById){return document.getElementById(B)}else{for(var A=1;A<document.layers.length;A++){if(document.layers[A].id==B){return document.layers[A]}}}}return false}function $w(C,A){if(A.document.all){return A.document.all[C]}else{if(A.document.getElementById){return A.document.getElementById(C)}else{for(var B=1;B<A.document.layers.length;B++){if(A.document.layers[B].id==C){return A.document.layers[B]}}}}return false}function getOffsetLeft(B){var A=0;while(B){A+=parseInt(B.offsetLeft);B=B.offsetParent}return A}function getOffsetTop(A){var B=0;while(A){B+=parseInt(A.offsetTop);A=A.offsetParent}return B}function getWindowHeight(){if(typeof (window.innerHeight)=="number"){return window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientHeight)){return document.documentElement.clientHeight}else{if(document.body&&(document.body.clientHeight)){return document.body.clientHeight}else{return 0}}}}function getWindowWidth(){if(typeof (window.innerWidth)=="number"){return window.innerWidth}else{if(document.documentElement&&(document.documentElement.clientWidth)){return document.documentElement.clientWidth}else{if(document.body&&(document.body.clientWidth)){return document.body.clientWidth}else{return 0}}}}function BrowserDetect(){var A=navigator.userAgent.toLowerCase();this.isGecko=(A.indexOf("gecko")!=-1&&A.indexOf("safari")==-1);this.isAppleWebKit=(A.indexOf("applewebkit")!=-1);this.isKonqueror=(A.indexOf("konqueror")!=-1);this.isSafari=(A.indexOf("safari")!=-1);this.isOmniweb=(A.indexOf("omniweb")!=-1);this.isOpera=(A.indexOf("opera")!=-1);this.isIcab=(A.indexOf("icab")!=-1);this.isAol=(A.indexOf("aol")!=-1);this.isIE=(A.indexOf("msie")!=-1&&!this.isOpera&&(A.indexOf("webtv")==-1));this.isMozilla=(this.isGecko&&A.indexOf("gecko/")+14==A.length);this.isFirebird=(A.indexOf("firebird/")!=-1);this.isNS=((this.isGecko)?(A.indexOf("netscape")!=-1):((A.indexOf("mozilla")!=-1)&&!this.isOpera&&!this.isSafari&&(A.indexOf("spoofer")==-1)&&(A.indexOf("compatible")==-1)&&(A.indexOf("webtv")==-1)&&(A.indexOf("hotjava")==-1)));this.isIECompatible=((A.indexOf("msie")!=-1)&&!this.isIE);this.isNSCompatible=((A.indexOf("mozilla")!=-1)&&!this.isNS&&!this.isMozilla);this.geckoVersion=((this.isGecko)?A.substring((A.lastIndexOf("gecko/")+6),(A.lastIndexOf("gecko/")+14)):-1);this.equivalentMozilla=((this.isGecko)?parseFloat(A.substring(A.indexOf("rv:")+3)):-1);this.appleWebKitVersion=((this.isAppleWebKit)?parseFloat(A.substring(A.indexOf("applewebkit/")+12)):-1);this.versionMinor=parseFloat(navigator.appVersion);if(this.isGecko&&!this.isMozilla){this.versionMinor=parseFloat(A.substring(A.indexOf("/",A.indexOf("gecko/")+6)+1))}else{if(this.isMozilla){this.versionMinor=parseFloat(A.substring(A.indexOf("rv:")+3))}else{if(this.isIE&&this.versionMinor>=4){this.versionMinor=parseFloat(A.substring(A.indexOf("msie ")+5))}else{if(this.isKonqueror){this.versionMinor=parseFloat(A.substring(A.indexOf("konqueror/")+10))}else{if(this.isSafari){this.versionMinor=parseFloat(A.substring(A.lastIndexOf("safari/")+7))}else{if(this.isOmniweb){this.versionMinor=parseFloat(A.substring(A.lastIndexOf("omniweb/")+8))}else{if(this.isOpera){this.versionMinor=parseFloat(A.substring(A.indexOf("opera")+6))}else{if(this.isIcab){this.versionMinor=parseFloat(A.substring(A.indexOf("icab")+5))}}}}}}}}this.versionMajor=parseInt(this.versionMinor);this.isDOM1=(document.getElementById);this.isDOM2Event=(document.addEventListener&&document.removeEventListener);this.mode=document.compatMode?document.compatMode:"BackCompat";this.isWin=(A.indexOf("win")!=-1);this.isWin32=(this.isWin&&(A.indexOf("95")!=-1||A.indexOf("98")!=-1||A.indexOf("nt")!=-1||A.indexOf("win32")!=-1||A.indexOf("32bit")!=-1||A.indexOf("xp")!=-1));this.isMac=(A.indexOf("mac")!=-1);this.isUnix=(A.indexOf("unix")!=-1||A.indexOf("sunos")!=-1||A.indexOf("bsd")!=-1||A.indexOf("x11")!=-1);this.isLinux=(A.indexOf("linux")!=-1);this.isNS4x=(this.isNS&&this.versionMajor==4);this.isNS40x=(this.isNS4x&&this.versionMinor<4.5);this.isNS47x=(this.isNS4x&&this.versionMinor>=4.7);this.isNS4up=(this.isNS&&this.versionMinor>=4);this.isNS6x=(this.isNS&&this.versionMajor==6);this.isNS6up=(this.isNS&&this.versionMajor>=6);this.isNS7x=(this.isNS&&this.versionMajor==7);this.isNS7up=(this.isNS&&this.versionMajor>=7);this.isIE4x=(this.isIE&&this.versionMajor==4);this.isIE4up=(this.isIE&&this.versionMajor>=4);this.isIE5x=(this.isIE&&this.versionMajor==5);this.isIE55=(this.isIE&&this.versionMinor==5.5);this.isIE5up=(this.isIE&&this.versionMajor>=5);this.isIE6x=(this.isIE&&this.versionMajor==6);this.isIE6up=(this.isIE&&this.versionMajor>=6);this.isIE7x=(this.isIE&&this.versionMajor==7);this.isIE7up=(this.isIE&&this.versionMajor>=7);this.isIE4xMac=(this.isIE4x&&this.isMac)}var browser=new BrowserDetect();function escapeHTML(B){var C=document.createElement("div");var A=document.createTextNode(B);C.appendChild(A);return C.innerHTML}
