﻿document.write("<div style='FILTER:alpha(opacity=97);display:none;font-size:12px;position:absolute;padding:5;z-index:100000;' id='_altlayer'></div>")
function testgogo(){
x=document.getElementsByTagName('body')[0];
if(x!=null){
gogo();
}else{
setTimeout("testgogo()",1000) ;
}
}
setTimeout("testgogo()",000) ;
function gogo(){
document.body.onmousemove=quickalt;
document.body.onmouseover=getalt;
document.body.onmouseout=restorealt;
var tempalt='';
var UA=navigator.userAgent.toLowerCase();
var ISIE=(UA.indexOf("msie") > 0);
function $(hw_){return document.getElementById(hw_);}

function _Move(evn,o){
    _bW=document.body.clientWidth;
    _left1=document.body.scrollLeft+evn.clientX+10;
    _oW=o.offsetWidth;
    _left=((evn.clientX+_oW)>_bW)?(_left1-_oW-10):_left1;
    if((evn.clientX+_oW)>_bW){_left=(_oW<evn.clientX)?(_left1-_oW-10):_left1;}

    _bH=document.body.clientHeight;
    _top1=document.body.scrollTop+evn.clientY+6;
    _oH=o.offsetHeight;
    _top=((evn.clientY+_oH)>_bH)?(_top1-_oH-6):_top1;
    if((evn.clientY+_oH)>_bH){_top1=(_oH<evn.clientY)?(_top1-_oH-6):_top1;}
    o.style.left=_left;
    o.style.top=_top;
}

function getalt(hw_){

    if(ISIE==true){//是否為IE
     if(event.srcElement!=null){//不等於空在執行
       if(ISIE){evn=event}else{evn=hw_}
       var eo = evn.srcElement?evn.srcElement:evn.target;
       if(eo.title && (eo.title!=""|| (eo.title=="" && tempalt!=""))){
        o = $("_altlayer");
        _Move(evn,o);
        o.style.display='';
        tempalt=eo.title;
        //§i-O§O3]cw<a href="#" title="Title¯SRA" altbg="#FFFFFF" altcolor="#CCCCCC" altborder="#CCCCCC">
        //tempbg=eo.getAttribute("altbg");
        //tempcolor=eo.getAttribute("altcolor");
        //tempborder=eo.getAttribute("altborder");
        
        tempbg='#ffffe1';
        tempcolor='#000000';
        tempborder='#666666';
        
        eo.title='';
        o.innerHTML=tempalt;
        if (tempbg!=null){o.style.background=tempbg}else{o.style.background="/infobackground"}
        if (tempcolor!=null){o.style.color=tempcolor}else{o.style.color=tempcolor="infotext"}
        if (tempborder!=null){o.style.border="1px solid "+tempborder;}else{o.style.border="1px solid #000000";}
        setTimeout("_altlayer.style.display='none'",10000) ;
       }    
     }//不等於空在執行    
    }else{//是否為IE

       if(ISIE){evn=event}else{evn=hw_}
       var eo = evn.srcElement?evn.srcElement:evn.target;
       if(eo.title && (eo.title!=""|| (eo.title=="" && tempalt!=""))){
        o = $("_altlayer");
        _Move(evn,o);
        o.style.display='';
        tempalt=eo.title;
        //§i-O§O3]cw<a href="#" title="Title¯SRA" altbg="#FFFFFF" altcolor="#CCCCCC" altborder="#CCCCCC">
        //tempbg=eo.getAttribute("altbg");
        //tempcolor=eo.getAttribute("altcolor");
        //tempborder=eo.getAttribute("altborder");
        
        tempbg='#ffffe1';
        tempcolor='#000000';
        tempborder='#666666';
        
        eo.title='';
        o.innerHTML=tempalt;
        if (tempbg!=null){o.style.background=tempbg}else{o.style.background="/infobackground"}
        if (tempcolor!=null){o.style.color=tempcolor}else{o.style.color=tempcolor="infotext"}
        if (tempborder!=null){o.style.border="1px solid "+tempborder;}else{o.style.border="1px solid #000000";}
        setTimeout("_altlayer.style.display='none'",10000) ;
       }    

    }//是否為IE
}
function quickalt(hw_){
    if(ISIE==true){//是否為IE
     if(event.srcElement!=null){//不等於空在執行

       if(ISIE){evn=event}else{evn=hw_}
       o = $("_altlayer");
       if(o.style.display==""){
       _Move(evn,o);
       }
    
     }//不等於空在執行    
    }else{//是否為IE
    
          if(ISIE){evn=event}else{evn=hw_}
          o = $("_altlayer");
          if(o.style.display==""){
       _Move(evn,o);
         }

    }//是否為IE
}
function restorealt(hw_){
   if(ISIE==true){//是否為IE
     if(event.srcElement!=null){//不等於空在執行

           if(ISIE){evn=event}else{evn=hw_}
           var eo = evn.srcElement?evn.srcElement:evn.target;
          eo.title=tempalt;
          tempalt="";
          $("_altlayer").style.display="none";

     }//不等於空在執行    
    }else{//是否為IE
    
       if(ISIE){evn=event}else{evn=hw_}
       var eo = evn.srcElement?evn.srcElement:evn.target;
       eo.title=tempalt;
       tempalt="";
       $("_altlayer").style.display="none";

    }//是否為IE
}

}


//隱藏頁面中下拉式選單
function showgo(a){ 
if(navigator.appVersion.indexOf("MSIE 7")==-1 && navigator.appVersion.indexOf("MSIE 8")==-1){
var arurl=document.body.getElementsByTagName("select");
 if (arurl.length>0){
  for (var is=0;is<arurl.length;is++){
   arurl[is].style.display=a;
  }
 }
}
}

//加到我的最愛
function addBookmark(title, url){ 
if(navigator.appName.indexOf("Internet Explorer")!=-1){
window.external.AddFavorite(url, title); 
}else{
window.sidebar.addPanel(title, url, "") ;
}
}
//設為首頁
    function setHomepage(u) {
      if (window.ActiveXObject) {
        document.body.style.behavior = 'url(#default#homepage)';
        document.body.setHomePage(u)
        alert("設定完成！")
      } else if (window.sidebar) {
        if (window.netscape) {
          try {
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")
          } catch (e) {
            alert("此操作被瀏覽器拒絕！\n請在瀏覽器地址欄輸入「about:config」並回車\n然後將[signed.applets.codebase_principal_support]設置為'true'")
          }
        }
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
        prefs.setCharPref('browser.startup.homepage', u)
        alert("設定完成！")
      }
    };

//讀取COOKIE
function getCookie(cookieName) { 
	var allcookies = document.cookie; 
	cookieName += "="; 
	var pos = allcookies.indexOf(cookieName); 
	if( pos != -1) { 
		var start = pos + cookieName.length; 
		var end = allcookies.indexOf(";",start); 
		if(end == -1) end = allcookies.length; 
		return unescape(allcookies.substring(start,end));  
	} 
} 

//賦予ID在清單連結
function myadmin_id_url(a){
     //alert(getCookie(cookienum+'estore%5Fmyidurl1'));
var arurl=document.getElementById(a).getElementsByTagName("a");
if (arurl.length>0){
 for (var is=0;is<arurl.length;is++){
  if (arurl[is].href.indexOf(location.host.replace("www.",""))!=-1){
   if (location.href.indexOf("c=system")==-1){
   arurl[is].href=arurl[is].href.replace('?c=system','');
   arurl[is].href=arurl[is].href.replace('&c=system','');
   }
   if (arurl[is].href.indexOf("q=")==-1 && arurl[is].href.indexOf("c=")==-1 && arurl[is].href.indexOf("g=")==-1){
     if (arurl[is].href.indexOf("?")!=-1){
     if (getCookie(cookienum+'estore%5Fmyidurl2')!=undefined)arurl[is].href=arurl[is].href+getCookie(cookienum+'estore%5Fmyidurl2');
     }else{
     if (getCookie(cookienum+'estore%5Fmyidurl1')!=undefined)arurl[is].href=arurl[is].href+getCookie(cookienum+'estore%5Fmyidurl1');
     }
   }    

  }
 }
}
var arurl=document.getElementById(a).getElementsByTagName("area");
if (arurl.length>0){
 for (var is=0;is<arurl.length;is++){
  if (arurl[is].href.indexOf(location.host.replace("www.",""))!=-1){
   if (location.href.indexOf("c=system")==-1){
   arurl[is].href=arurl[is].href.replace('?c=system','');
   arurl[is].href=arurl[is].href.replace('&c=system','');
   }
   if (arurl[is].href.indexOf("q=")==-1 && arurl[is].href.indexOf("c=")==-1 && arurl[is].href.indexOf("g=")==-1){
     if (arurl[is].href.indexOf("?")!=-1){
     if (getCookie(cookienum+'estore%5Fmyidurl2')!=undefined)arurl[is].href=arurl[is].href+getCookie(cookienum+'estore%5Fmyidurl2');
     }else{
     if (getCookie(cookienum+'estore%5Fmyidurl1')!=undefined)arurl[is].href=arurl[is].href+getCookie(cookienum+'estore%5Fmyidurl1');
     }
   }    
  }
 }
}
var arurl=document.getElementById(a).getElementsByTagName("form");
if (arurl.length>0){
 for (var is=0;is<arurl.length;is++){
  if (arurl[is].action.indexOf(location.host.replace("www.",""))!=-1){
   if (location.href.indexOf("c=system")==-1){
   arurl[is].action=arurl[is].action.replace('?c=system','');
   arurl[is].action=arurl[is].action.replace('&c=system','');
   }
   if (arurl[is].action.indexOf("q=")==-1 && arurl[is].action.indexOf("c=")==-1 && arurl[is].action.indexOf("g=")==-1){
     if (arurl[is].action.indexOf("?")!=-1){
     if (getCookie(cookienum+'estore%5Fmyidurl2')!=undefined)arurl[is].action=arurl[is].action+getCookie(cookienum+'estore%5Fmyidurl2');
     }else{
     if (getCookie(cookienum+'estore%5Fmyidurl1')!=undefined)arurl[is].action=arurl[is].action+getCookie(cookienum+'estore%5Fmyidurl1');
     }
   }
  }
 }
}
}




//刷新網頁
function go_reload(){ 
setTimeout('window.location.reload();',10);
}

//縮圖
function bbody(a,b){
if (b=='leftimg'){
 mmax="188"; //左自訂加框
}else if (b=='leftimga'){
 mmax="200"; //左自訂不加框
}else if (b=='rightimg'){
 mmax="751"; //右自訂加框
}else if (b=='rightimga'){
 mmax="763"; //右自訂不加框
}else if (b=='listimg'){
 mmax="740"; //商品詳細頁面
}else if (b=='newsimg'){
 mmax="740"; //新聞中心頁面
}else if (b=='pageimg'){
 mmax="763"; //客服中心與購物指南頁面
}else if (b=='maximg'){
 mmax="987"; //自訂加框
}else if (b=='maximga'){
 mmax="1003"; //自訂不加框
}else {
 mmax=b
} 
var mmax=parseInt(mmax,10)

var arurl=document.getElementById(a).getElementsByTagName("img");
 if (arurl.length>0){
  for (var is=0;is<arurl.length;is++){
   if(parseInt(arurl[is].width,10)>mmax || parseInt(arurl[is].style.width,10)>mmax){
    heightok=((parseInt(arurl[is].height,10) * mmax) / parseInt(arurl[is].width,10)).toString();
    arurl[is].width=mmax; 
    arurl[is].height=heightok;
    arurl[is].style.width=mmax;
    arurl[is].style.height=heightok;
   }
  }
 }
 
var arurl=document.getElementById(a).getElementsByTagName("embed");
 if (arurl.length>0){
  for (var is=0;is<arurl.length;is++){
   if(parseInt(arurl[is].width,10)>mmax || parseInt(arurl[is].style.width,10)>mmax){
    heightok=((parseInt(arurl[is].height,10) * mmax) / parseInt(arurl[is].width,10)).toString();
    arurl[is].width=mmax; 
    arurl[is].height=heightok;
    arurl[is].style.width=mmax;
    arurl[is].style.height=heightok;
   }
  }
 }
 
var arurl=document.getElementById(a).getElementsByTagName("table");
 if (arurl.length>0){
 for (var is=0;is<arurl.length;is++){
   if(parseInt(arurl[is].width,10)>mmax){
    arurl[is].width=mmax; 
   }
   if(parseInt(arurl[is].style.width,10)>mmax){
    arurl[is].style.width=mmax;
   }
  }
 }
 
}
//驗證
function yzmgo(size,map,g){
//瀏覽器 Firefox, Opera 8.0+, Safari, Internet Explorer 
var xmlhttp;
try { xmlhttp=new XMLHttpRequest(); }catch (e) {  try {xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e) {try {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e) { alert("Your browser does not support AJAX!"); return false;}}}
var strURL=map+'PIC/deljpg/deljpg.asp?size='+size+'&g='+g;
xmlhttp.open('GET',strURL+'&err999='+escape(new Date()),true);
xmlhttp.send(null);  
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){
if(xmlhttp.status==200){
document.getElementById(g).innerHTML="<img border='0' height='"+size+"' title='不區分大小寫' src='"+map+"PIC/deljpg/"+xmlhttp.responseText.split('|||')[1]+"'>";
//alert(xmlhttp.responseText);
}
}}
}

function CheckAll(form){
for (var i=0;i<form.elements.length;i++){
var e = form.elements[i];
if (e.name != 'chkall') e.checked = form.chkall.checked; 
}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//寫入COOKIES
function saveCookie(a,b) { 
//alert(a+"="+b);
document.cookie=a+"="+b
}

//紀錄頁面名稱
function r_center_menu(a){
var arurl=document.getElementById(a).getElementsByTagName("a");
if (arurl.length>0){
 for (var is=0;is<arurl.length;is++){
  if (arurl[is].href.indexOf(siteurl)!=-1){
     if (arurl[is].href.indexOf("?")!=-1){
     arurl[is].href=arurl[is].href+"&tx="+escape(arurl[is].innerText);
     }else{
     arurl[is].href=arurl[is].href+"?tx="+escape(arurl[is].innerText);
     }
  }
 }
}
}

//隱藏/顯示資料
function mu(meval){
  var left_n=eval(meval);
  if (left_n.style.display=="none")
  { eval(meval+".style.display='';"); }
  else
  { eval(meval+".style.display='none';"); }
}

//區塊背景顏色變化
//backgroundA(區塊ID,顏色1,顏色2,1=顏色1 2=顏色2 開始,速度毫秒)
var backgroundAgo
function backgroundA(a,b,c,d,e){ 
  if (d==1 && document.getElementById(a)!=null){
     document.getElementById(a).style.background=b;
     backgroundAgo=setTimeout("backgroundA('"+a+"','"+b+"','"+c+"','2',"+e+");",e);
  }
  if (d==2 && document.getElementById(a)!=null){
     document.getElementById(a).style.background=c;
     backgroundAgo=setTimeout("backgroundA('"+a+"','"+b+"','"+c+"','1',"+e+");",e);
  }
}
//區塊內文字顏色變化
//backgroundA(區塊ID,顏色1,顏色2,1=顏色1 2=顏色2 開始,速度毫秒)
var backgroundBgo
function backgroundB(a,b,c,d,e){ 
  if (d==1 && document.getElementById(a)!=null){
     document.getElementById(a).style.color=b;
     backgroundBgo=setTimeout("backgroundB('"+a+"','"+b+"','"+c+"','2',"+e+");",e);
  }
  if (d==2 && document.getElementById(a)!=null){
     document.getElementById(a).style.color=c;
     backgroundBgo=setTimeout("backgroundB('"+a+"','"+b+"','"+c+"','1',"+e+");",e);
  }
}

function g_print_l(){ 
   if (getCookie('gprint') != undefined){
   document.getElementById("golife_groupall").innerHTML = "群組列印 ("+parseInt(getCookie('gprint').split(',').length-1)+")"; 
   }else{
   document.getElementById("golife_groupall").innerHTML = "群組列印"; 
   }
}


function g_print(a){ 
   if (getCookie('gprint') != undefined){
    if (getCookie('gprint').indexOf("'"+a+"',")==-1)document.cookie = "gprint='"+a+"',"+getCookie('gprint'); 
   }else{
    document.cookie = "gprint='"+a+"',"; 
   }
   document.getElementById("gd"+a).style.display='';
   document.getElementById("g"+a).style.display='none';
   g_print_l(); //計算數量
}

function gd_printdel(a){ 
   if (getCookie('gprint') != undefined){
    document.cookie = "gprint="+getCookie('gprint').replace("'"+a+"',",""); 
    document.getElementById("g"+a).style.display='';
    document.getElementById("gd"+a).style.display='none';
    g_print_l(); //計算數量
   } 
}


function g_printdel(a){ 
   if (getCookie('gprint') != undefined){
    document.cookie = "gprint="+getCookie('gprint').replace(a,''); 
    g_print_l(); //計算數量
    group_print(); //重新顯示
   } 
}


//移除清單連結
function del_id_url(a){
     //alert(getCookie(cookienum+'estore%5Fmyidurl1'));
var arurl=document.getElementById(a).getElementsByTagName("a");
if (arurl.length>0){
 for (var is=0;is<arurl.length;is++){
     arurl[is].href="JavaScript:";
 }
}
var arurl=document.getElementById(a).getElementsByTagName("area");
if (arurl.length>0){
 for (var is=0;is<arurl.length;is++){
     arurl[is].href="JavaScript:";
 }
}
var arurl=document.getElementById(a).getElementsByTagName("form");
if (arurl.length>0){
 for (var is=0;is<arurl.length;is++){
     arurl[is].action="JavaScript:";
 }
}
}

//特賣
function special_tcheck(a,b) {
var xmlhttp;
try { xmlhttp=new XMLHttpRequest(); }catch (e) {  try {xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e) {try {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e) { alert("Your browser does not support AJAX!"); return false;}}}
var strURL='special_time.asp?w=ok&id='+a ;
xmlhttp.open('GET',strURL+'&err999='+escape(new Date()),true);
xmlhttp.send(null);  
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){
   if(xmlhttp.status==200){
      var str = xmlhttp.responseText.split('|||')[1];
      //alert(str);
         if (str=="error"){
             document.getElementById(b).innerHTML = '結束';
             go_reload();
            }else{
             document.getElementById(b).innerHTML = str;
             setTimeout("special_tcheck('"+a+"','"+b+"')",1000)
            }
   }
}}
}

//選單
//二級
function show_midcode(a,u) {
//瀏覽器 Firefox, Opera 8.0+, Safari, Internet Explorer 
var xmlhttp;
try { xmlhttp=new XMLHttpRequest(); }catch (e) {  try {xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e) {try {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e) { alert("Your browser does not support AJAX!"); return false;}}}
  var strURL='topmenucheck.asp?q='+q+'&g='+g+'&c='+c+'&id='+a;
  xmlhttp.open('GET',strURL+'&err999='+escape(new Date()),true);
  xmlhttp.send(null);  
  xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){
//  alert(xmlhttp.responseText)
    if(xmlhttp.status==200){
      if (document.getElementById('checklarcode').innerText==a){
       document.getElementById('show_midcodetxt').innerHTML=xmlhttp.responseText.split('|||')[1];
         if (u<=600){
            mapp=parseInt(u,10)+parseInt(document.getElementById('show_midcodetxt').offsetWidth,10)
            if (mapp>=1000){
               document.getElementById('show_midcodetxt').style.left=parseInt(u,10)/2+3+" px";
            }else{
               document.getElementById('show_midcodetxt').style.left=parseInt(u,10)+3+" px";
            }
         //document.getElementById('hhh').innerHTML="小於600";
         }else{
            w1=parseInt(document.getElementById('larcode2_'+a).offsetWidth,10)+10;
            mapp=parseInt(u,10)-parseInt(document.getElementById('show_midcodetxt').offsetWidth,10)
            if (mapp>=1000)document.getElementById('show_midcodetxt').style.left=parseInt(mapp,10)/2+" px";
            if (mapp<1000)document.getElementById('show_midcodetxt').style.left=(parseInt(mapp,10)+w1)+" px";
         //document.getElementById('hhh').innerHTML="超過600";
         }
       if (midcode!="" || midcode!=null)setTimeout("backgroundB('midcode"+midcodeclassid+"','"+topmenucolor3+"','"+topmenucolor2+"','1',700);",00);
       } 
    }
  }}
}
//滑入
function show_larcodeover(a,b,u) {
         if (b=="yes")document.getElementById('show_midcodetxt').innerHTML="";
         document.getElementById('checklarcode').innerHTML=a;
         show_off();
         document.getElementById('larcode1_'+a).src=topmenuimg+"4.gif"; 
         document.getElementById('larcode2_'+a).style.background='url('+topmenuimg+'5.gif)';
         document.getElementById('larcode3_'+a).src=topmenuimg+"6.gif"; 
         if (b=="yes")show_midcode(a,u);
}
//滑出
function show_larcodeout(a) {
         document.getElementById('larcode1_'+a).src=topmenuimg+"1.gif"; 
         document.getElementById('larcode2_'+a).style.background='url('+topmenuimg+'2.gif)';
         document.getElementById('larcode3_'+a).src=topmenuimg+"3.gif"; 
         setTimeout("show_larcodeover("+a+",'no');",0000);
         clearTimeout(backgroundAgo);
}

//重設底圖
function show_off() {
   var arurl=document.getElementById("larcodetable").getElementsByTagName("img");
       if (arurl.length>0){
          for (var is=0;is<arurl.length;is++){
              if (arurl[is].id.indexOf("larcode1_")!=-1)arurl[is].src=topmenuimg+"1.gif"; 
              if (arurl[is].id.indexOf("larcode3_")!=-1)arurl[is].src=topmenuimg+"3.gif"; 
          }
       }

   var arurl=document.getElementById("larcodetable").getElementsByTagName("td");
       if (arurl.length>0){
          for (var is=0;is<arurl.length;is++){
              if (arurl[is].id.indexOf("larcode2_")!=-1) arurl[is].style.background='url('+topmenuimg+'2.gif)';
          }
       }
}

//移初選單時重設
function show_tableout() {
gno=posY("larcodetable")+48;
if (event.clientY>=gno){
       setTimeout("show_off();document.getElementById('show_midcodetxt').innerHTML='';",1000);
   }
}
//取得指定ID Y
function posY(objID) {
　　var elmt = document.getElementById(objID);
　　var y = 0;
　　//繞行 offsetParents
　　for (var e = elmt ; e ; e = e.offsetParent) { 
　　　　//把 offsetTop 值加總
　　　　y += e.offsetTop; 
　　}
　　//繞行至 document.body
　　for (e = elmt.parentNode; e && e != document.body; e = e.parentNode){
　　　　//減去捲軸值
　　　　if (e.scrollTop) y -= e.scrollTop; 
　　}
　　return y;
}
//取得指定ID X
function posX(objID) {
　　var elmt = document.getElementById(objID);
　　var x = 0;
　　//繞行 offsetParents
　　for (var e = elmt ; e ; e = e.offsetParent) { 
　　　　//把 offsetLeft 值加總
　　　　x += e.offsetLeft; 
　　}
　　//繞行至 document.body
　　for (e = elmt.parentNode; e && e != document.body; e = e.parentNode){
　　　　//減去捲軸值
　　　　if (e.scrollLeft) x -= e.scrollLeft; 
　　}
　　return x;
}


//載入已購買
function manu_lo() {
var xmlhttp;
try { xmlhttp=new XMLHttpRequest(); }catch (e) {  try {xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e) {try {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e) { alert("Your browser does not support AJAX!"); return false;}}}
var strURL='manu.asp?manu='+manu+'&prodid=l';
xmlhttp.open('GET',strURL+'&err999='+escape(new Date()),true);
xmlhttp.send(null);  
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){
   if(xmlhttp.status==200){
      var str = xmlhttp.responseText.split('|||');
         if (str[1]!="error"){
             document.getElementById("coco1").innerHTML = str[1];
             document.getElementById("coco2").innerHTML = str[2];
             document.getElementById("coco3").innerHTML = str[3];
            }
   }
}}
}

//動態購買
function manu_check(a) {
p1="";
p2="";
p3="";
id=a.replace('y','').replace('q','');
quantity=document.getElementById("q"+id).value;
quantityend=document.getElementById("qend"+id).value;

if (document.getElementById("prodidsizetext11"+id)!=null)p1=document.getElementById("prodidsizetext11"+id).value;
if (document.getElementById("prodidsizetext22"+id)!=null)p2=document.getElementById("prodidsizetext22"+id).value;
if (document.getElementById("prodidsizetext33"+id)!=null)p3=document.getElementById("prodidsizetext33"+id).value;

var xmlhttp;
try { xmlhttp=new XMLHttpRequest(); }catch (e) {  try {xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e) {try {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e) { alert("Your browser does not support AJAX!"); return false;}}}
var strURL='manu.asp?manu='+manu+'&prodid='+id+'&quantity='+quantity+'&quantityend='+quantityend+'&prodidsizetext11='+escape(p1)+'&prodidsizetext22='+escape(p2)+'&prodidsizetext33='+escape(p3)+'' ;
xmlhttp.open('GET',strURL+'&err999='+escape(new Date()),true);
xmlhttp.send(null);  
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){
   if(xmlhttp.status==200){
      var str = xmlhttp.responseText.split('|||');
      //alert(str);
         if (str[1]!="error"){
             document.getElementById("okshop"+a).innerHTML = "已加入購物車";
              setTimeout("document.getElementById('okshop"+a+"').innerHTML='';",3000)
             document.getElementById("coco1").innerHTML = str[1];
             document.getElementById("coco2").innerHTML = str[2];
             document.getElementById("coco3").innerHTML = str[3];
            }
   }
}}
}

//子視窗
function childwindow(a,b,c){
if (a.indexOf("?")!=-1){
a=a+'&err999='+escape(new Date())
}else{
a=a+'?err999='+escape(new Date())
}
window.showModalDialog(a,window,'border:thin;help:0;maximize:0;minimize:0;status:0;resizeable:1;scroll:yes;center:yes;dialogWidth:'+b+'px;dialogHeight:'+c+'px;')
}
//子視窗檢查
function checkwindow(){
  if (window.dialogArguments==null || window.dialogArguments=="undefined"){
     alert("此頁面不可以直接開啟，請由正常管道使用。");
     window.open('','_parent','');window.opener=null;window.close();
  }
}

//購物車
function showlist(){
darkBody('請稍候...');
   var xmlhttp;
   try { xmlhttp=new XMLHttpRequest(); }catch (e) {  try {xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e) {try {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e) { alert("Your browser does not support AJAX!"); return false;}}}
   if (getCookie(cookienum+'estore%5Fmyidurl1')!=undefined){
   var strURL='check.asp?action=show'+getCookie(cookienum+'estore%5Fmyidurl2');
   }else{
   var strURL='check.asp?action=show&q='+q;
   }
   xmlhttp.open('GET',strURL+'&err999='+escape(new Date()),true);
   xmlhttp.send(null);
   xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){
     if(xmlhttp.status==200){
       document.getElementById("showtxt").innerHTML=xmlhttp.responseText.split('|||')[1];
       setTimeout("lightBody();",100);
       if (xmlhttp.responseText.indexOf("checklisterror")!=-1){
         if (getCookie(cookienum+'estore%5Fmyidurl1')!=undefined){
          setTimeout("location.href='/"+getCookie(cookienum+'estore%5Fmyidurl1')+"';",3000);
          }else{
          setTimeout("location.href='/';",3000);
          }
       }
     }
   }}
}
function delprod(a,b){
   var xmlhttp;
   try { xmlhttp=new XMLHttpRequest(); }catch (e) {  try {xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e) {try {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e) { alert("Your browser does not support AJAX!"); return false;}}}
   var strURL='check.asp?action=del&q='+q+'&prodid='+a+'&id='+b;
   xmlhttp.open('GET',strURL+'&err999='+escape(new Date()),true);
   xmlhttp.send(null);  
   xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){
     if(xmlhttp.status==200){
     showlist();
     }
   }}
}
function upprod(a,b){
   var xmlhttp;
   try { xmlhttp=new XMLHttpRequest(); }catch (e) {  try {xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e) {try {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e) { alert("Your browser does not support AJAX!"); return false;}}}
   var strURL='check.asp?action=up&q='+q+'&id='+a+'&b='+b.value;
   xmlhttp.open('GET',strURL+'&err999='+escape(new Date()),true);
   xmlhttp.send(null);  
   xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){
     if(xmlhttp.status==200){
        if (xmlhttp.responseText.split('|||')[1]!="ok"){
          alert(xmlhttp.responseText.split('|||')[1]);
        }else{
          showlist();
        }
     }
   }}
}
//購物車

