﻿function GuElementGet(GuElementA) {
if (document.getElementById) {
return document.getElementById(GuElementA);
}
else {
if (document.all) {
return document.all[GuElementA];
}
else {
if (document.layers) {
return document.layers[GuElementA];
}
else {
return (GuElementA);
}
}
}
}
document.write("<div id='GuAltTitleLayer' style='FILTER:alpha(opacity=97);width:auto;height:auto;border:1px #525252 solid;background:#ffffe1;padding:2px 4px 2px 4px;font-size:12px;color:#000000;text-align:left;position:absolute;z-index:600;display:none;'></div>");

function GuAltTitleShow(event) {
event=event||window.event;
var GuTarget=event.srcElement?event.srcElement:event.target;

if ((GuTarget.alt!="")&&(GuTarget.alt!=null)) {
GuTarget.AltTitleNote=GuTarget.alt;
GuTarget.alt="";
}
if ((GuTarget.title!="")&&(GuTarget.title!=null)) {
GuTarget.AltTitleNote=GuTarget.title;
GuTarget.title="";
}
if ((GuTarget.AltTitleNote!="")&&(GuTarget.AltTitleNote!=null)) {
GuElementGet("GuAltTitleLayer").style.display="";
GuElementGet("GuAltTitleLayer").innerHTML=GuTarget.AltTitleNote;
GuAltTitleWidth=GuElementGet("GuAltTitleLayer").clientWidth;
GuAltTitleHeight=GuElementGet("GuAltTitleLayer").clientHeight;

if (GuAltTitleWidth>=600) {
GuAltTitleWidth=600;
}

if ((event.clientY+20+GuAltTitleHeight)>(document.body.clientHeight)) {
GuAltTitleTop=-GuAltTitleHeight-40;
}
else {
GuAltTitleTop=0;
}

if ((event.clientX+10+GuAltTitleWidth)>(document.body.clientWidth)) {
GuAltTitleLeft=-GuAltTitleWidth-20;
}
else {
GuAltTitleLeft=0;
}

if ((event.clientX)||(event.clientY)) {
if ((document.body.scrollTop)||(document.body.scrollLeft)) {
GuAltTitleTop=(event.clientY)+20+(document.body.scrollTop)+GuAltTitleTop;
GuAltTitleLeft=(event.clientX)+10+(document.body.scrollLeft)+GuAltTitleLeft;
}
else {
GuAltTitleTop=(event.clientY)+20+(document.documentElement.scrollTop)+GuAltTitleTop;
GuAltTitleLeft=(event.clientX)+10+(document.documentElement.scrollLeft)+GuAltTitleLeft;
}
}
else {
GuAltTitleTop=(event.pageY)+20+GuAltTitleTop;
GuAltTitleLeft=(event.pageX)+10+GuAltTitleLeft;
}

if (GuAltTitleTop<=0) {
GuAltTitleTop=0;
}

if (GuAltTitleLeft<=0) {
GuAltTitleLeft=0;
}

GuElementGet("GuAltTitleLayer").style.top=GuAltTitleTop+"px";
GuElementGet("GuAltTitleLayer").style.left=GuAltTitleLeft+"px";
}
else {
GuElementGet("GuAltTitleLayer").style.display="none";
GuElementGet("GuAltTitleLayer").innerHTML="";
}
}
document.onmousemove=GuAltTitleShow; //跟隨滑鼠移動
//document.onmouseover=GuAltTitleShow; //不跟隨滑鼠移動

//隱藏頁面中下拉式選單
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(include_mouse_on_title__1)
      } else if (window.sidebar) {
        if (window.netscape) {
          try {
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")
          } catch (e) {
            alert(include_mouse_on_title__2+"true")
          }
        }
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
        prefs.setCharPref('browser.startup.homepage', u)
        alert(include_mouse_on_title__3)
      }
    };

//讀取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));  
	} 
} 

//移除選單分類時首頁wid
function index_url(){
if (document.getElementById("show_background_body")!=null && getCookie(cookienum+'wid2')!=null){
 var arurl=document.getElementById("show_background_body").getElementsByTagName("a");
 if (arurl.length>0){
  for (var is=0;is<arurl.length;is++){
   if (arurl[is].innerText==all_Public_13){
   arurl[is].href=arurl[is].href.replace(getCookie(cookienum+'wid2'),'')
   }
  }
 } 
}
}
setTimeout("index_url();",100);


//賦予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 && arurl[is].href.indexOf("l=")==-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');
     }
   }
   //===============101214=================
   if (arurl[is].href.indexOf("wid=")==-1){
     if (arurl[is].href.indexOf("?")!=-1){
     if (getCookie(cookienum+'wid2')!=undefined)arurl[is].href=arurl[is].href+getCookie(cookienum+'wid2');
     }else{
     if (getCookie(cookienum+'wid1')!=undefined)arurl[is].href=arurl[is].href+getCookie(cookienum+'wid1');
     }
   }
   //===============101214=================
   //===============100808=================
   if (arurl[is].href.indexOf("or=")==-1){
     if (arurl[is].href.indexOf("?")!=-1){
     if (getCookie(cookienum+'or2')!=undefined)arurl[is].href=arurl[is].href+getCookie(cookienum+'or2');
     }else{
     if (getCookie(cookienum+'or1')!=undefined)arurl[is].href=arurl[is].href+getCookie(cookienum+'or1');
     }
   }
   //===============100808=================
  }
 }
}
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 && arurl[is].href.indexOf("l=")==-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');
     }
   }    
   //===============101214=================
   if (arurl[is].href.indexOf("wid=")==-1){
     if (arurl[is].href.indexOf("?")!=-1){
     if (getCookie(cookienum+'wid2')!=undefined)arurl[is].href=arurl[is].href+getCookie(cookienum+'wid2');
     }else{
     if (getCookie(cookienum+'wid1')!=undefined)arurl[is].href=arurl[is].href+getCookie(cookienum+'wid1');
     }
   }
   //===============101214=================
   //===============100808=================
   if (arurl[is].href.indexOf("or=")==-1){
     if (arurl[is].href.indexOf("?")!=-1){
     if (getCookie(cookienum+'or2')!=undefined)arurl[is].href=arurl[is].href+getCookie(cookienum+'or2');
     }else{
     if (getCookie(cookienum+'or1')!=undefined)arurl[is].href=arurl[is].href+getCookie(cookienum+'or1');
     }
   }
   //===============100808=================
  }
 }
}
var arurl=document.getElementById(a).getElementsByTagName("form");
if (arurl.length>0){
 for (var is=0;is<arurl.length;is++){
   //===============100808=http:================
  if (arurl[is].action.indexOf(location.host.replace("www.",""))!=-1 || arurl[is].action.indexOf("http:")==-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 && arurl[is].action.indexOf("l=")==-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');
     }
   }
   //===============101214=================
   if (arurl[is].action.indexOf("wid=")==-1){
     if (arurl[is].action.indexOf("?")!=-1){
     if (getCookie(cookienum+'wid2')!=undefined)arurl[is].action=arurl[is].action+getCookie(cookienum+'wid2');
     }else{
     if (getCookie(cookienum+'wid1')!=undefined)arurl[is].action=arurl[is].action+getCookie(cookienum+'wid1');
     }
   }
   //===============101214=================
   //===============100808=================
   if (arurl[is].action.indexOf("or=")==-1){
     if (arurl[is].action.indexOf("?")!=-1){
     if (getCookie(cookienum+'or2')!=undefined)arurl[is].action=arurl[is].action+getCookie(cookienum+'or2');
     }else{
     if (getCookie(cookienum+'or1')!=undefined)arurl[is].action=arurl[is].action+getCookie(cookienum+'or1');
     }
   }
   //===============100808=================
  }
 }
}
}




//刷新網頁
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="763"; //商品詳細頁面
}else if (b=='newsimg'){
 mmax="763"; //新聞中心頁面
}else if (b=='pageimg'){
 mmax="763"; //客服中心與購物指南頁面
}else if (b=='maximg'){
 mmax="987"; //自訂加框
}else if (b=='maximga'){
 mmax="1003"; //自訂不加框
}else if (b=='centerimg'){
 mmax="550"; //中自訂加框
}else if (b=='centerimga'){
 mmax="563"; //中自訂不加框
}else if (b=='show_sample_list'){
 mmax="593"; //show_sample_list.asp
}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,ap,color){
//瀏覽器 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+'include/deljpg/deljpg.asp?size='+size+'&ap='+ap+'&color='+color+'&q='+q+'&g='+g+'&c='+c+'&l='+l+'';
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(ap).innerHTML="<img border='0' height='"+size+"' title='"+all_Public_40+"' src='"+map+"include/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 = include_mouse_on_title__4+" ("+parseInt(getCookie('gprint').split(',').length-1)+")"; 
   }else{
   document.getElementById("golife_groupall").innerHTML = include_mouse_on_title__5; 
   }
}

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 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(include_mouse_on_title__6);
     window.open('','_parent','');window.opener=null;window.close();
  }
}

//購物車
function showlist(){
darkBody('loadimg...');
   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&g='+g+'&l='+l+'';
   }
   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){
       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='show.asp"+getCookie(cookienum+'estore%5Fmyidurl1')+"';",3000);
          }else{
          setTimeout("location.href='show.asp?g="+g+"&l="+l+"';",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+'&g='+g+'&c='+c+'&l='+l+'&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+'&g='+g+'&c='+c+'&l='+l+'&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();
        }
     }
   }}
}
//購物車

//特賣
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='show_sample.asp?w=ok&q='+q+'&g='+g+'&c='+c+'&l='+l+'&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 = include_mouse_on_title__7;
             go_reload();
            }else{
             document.getElementById(b).innerHTML = str;
             setTimeout("special_tcheck('"+a+"','"+b+"')",1000)
            }
   }
}}
}


//報價
function quotationshowlist(){
darkBody('loadimg...');
   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='quotation.asp?action=show'+getCookie(cookienum+'estore%5Fmyidurl2');
   }else{
   var strURL='quotation.asp?action=show&g='+g+'&l='+l+'';
   }
   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("quotationshowtxt").innerHTML=xmlhttp.responseText.split('|||')[1];
       document.getElementById('sform').style.display='';
       setTimeout("lightBody();",100);
       if (xmlhttp.responseText.indexOf("checklisterror")!=-1){
         document.getElementById('sform').style.display='none';
         if (getCookie(cookienum+'estore%5Fmyidurl1')!=undefined){
          setTimeout("location.href='show.asp"+getCookie(cookienum+'estore%5Fmyidurl1')+"';",3000);
          }else{
          setTimeout("location.href='show.asp?g="+g+"&l="+l+"';",3000);
          }
       }
     }
   }}
}
function quotationdelprod(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='quotation.asp?action=del&q='+q+'&g='+g+'&c='+c+'&l='+l+'&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){
     quotationshowlist();
     }
   }}
}
function quotationupprod(a,b){
if (b<=0){
alert(include_mouse_on_title__8);
document.getElementById(a+"quantity").focus();
document.getElementById(a+"quantity").value=1;
return false;
}
   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='quotation.asp?action=up&q='+q+'&g='+g+'&c='+c+'&l='+l+'&id='+a+'&b='+b;
   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{
          quotationshowlist();
        }
     }
   }}
}
//報價

//全選2
function chkalls(input1,input2){
    var ar=document.getElementsByName(input1);
	for (var i=0;i<ar.length;i++)
	  if (document.getElementById(input2).checked == true){
	  ar[i].checked = true;
      }else{
      ar[i].checked = false;
	  }
}
//全選2

function goMaximize(a) {
 if (location.href.indexOf("localhost")!=-1){
	window.open(a, '_blank', 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,fullscreen=no');
 }else{
	window.open(a, '_blank', 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,fullscreen=yes');
 }	
}


//========================BODYDIV==========================
function closediv(){ 
//開啟後程式關閉parent.closediv();
var rightbodygo;
if (document.getElementById("show_background_body")!=null)rightbodygo=document.getElementById("show_background_body");
if (document.getElementById("golifebackground_body")!=null)rightbodygo=document.getElementById("golifebackground_body");
if (document.getElementById("golife_menu_background_right")!=null)rightbodygo=document.getElementById("golife_menu_background_right");
if (rightbodygo!=null && location.href.indexOf("index.asp")==-1 && location.pathname.indexOf("/")==-1)rightbodygo.style.width='783px';
//if (rightbodygo!=null)rightbodygo.style.width=parseInt(rightbodygo.clientWidth,10)+'px';
if (document.getElementById("allshowgo")!=null)document.getElementById("allshowgo").src="";
if (document.getElementById("bodyallbg")!=null)setTimeout('document.body.removeChild(document.getElementById("bodyallbg"));',100);
if (document.getElementById("bodyallbgiframe")!=null)setTimeout('document.body.removeChild(document.getElementById("bodyallbgiframe"));',100);
if (document.getElementById("bodyload")!=null)setTimeout('document.body.removeChild(document.getElementById("bodyload"));',100);
if (document.getElementById("framediv")!=null)setTimeout('document.body.removeChild(document.getElementById("framediv"));',100);
document.body.style.overflow='';
}

//showdiv('位子','標題','寬','高')
function showdiv(url,txt,w,h){
var wload=w; 
var hload=h; 
//透明圖層
var rightbodygo;
if (document.getElementById("show_background_body")!=null)rightbodygo=document.getElementById("show_background_body");
if (document.getElementById("golifebackground_body")!=null)rightbodygo=document.getElementById("golifebackground_body");
if (document.getElementById("golife_menu_background_right")!=null)rightbodygo=document.getElementById("golife_menu_background_right");
if (rightbodygo!=null && location.pathname.indexOf("/index.asp")==-1 && location.pathname.indexOf("/")==-1)rightbodygo.style.width='804px';

//if (rightbodygo!=null)rightbodygo.style.width=parseInt(rightbodygo.clientWidth+21,10)+'px';
document.body.style.overflow='hidden';

var b = document.createElement("div"); 
b.setAttribute("id","bodyallbg"); 
b.style.top=document.body.scrollTop;
b.style.left=0;
b.style.width=document.body.scrollWidth;
b.style.height=document.body.scrollHeight;
document.body.appendChild(b); 
//透明圖層蓋掉SWF
var aa=document.createElement("iframe");
aa.setAttribute("id", "bodyallbgiframe");
aa.style.top=document.body.scrollTop;
aa.style.left=0;
aa.width=document.body.scrollWidth;
aa.height=document.body.scrollHeight;
//aa.scrolling="no";
//aa.frameborder="0";
aa.setAttribute("frameborder", "0", 0);
aa.src="images/small/bodyallbg.gif";
document.body.appendChild(aa);

if (parseInt(w,10)==0 || parseInt(h,10)>=parseInt(document.body.clientWidth,10))w=document.body.clientWidth;    //如果是0或大於BODY大小就已BODY為準
if (parseInt(h,10)==0 || parseInt(h,10)>=parseInt(document.body.clientHeight,10))h=document.body.clientHeight;  //如果是0或大於BODY大小就已BODY為準
w=w-20; //減去外框
h=h-36; //減去外框


//內容圖層
var bb = document.createElement("div"); 
bb.setAttribute("id","framediv"); 
//如果不是BODY高 圖層就至中
if (parseInt(hload,10)!=0 && parseInt(hload,10)<=parseInt(document.body.clientHeight,10)){
  bb.style.top=parseInt((document.body.clientHeight/2-10)-(h/2)+(document.body.scrollTop),10)+'px';
}else{
  bb.style.top=document.body.scrollTop;
}
bb.style.left=parseInt((document.body.clientWidth/2-10)-(w/2),10)+'px';

if (url.indexOf("js|")==-1){ //一般

bb.innerHTML += "<table width="+w+"><tr>"+
"<td width=\"90%\"><span id=\"allshowgotxt\">"+txt+"<span></td>"+
"<td align=\"right\" width=\"10%\"><img style=\"cursor:pointer\" onclick=\"closediv()\" src='"+mymap+"images/small/cls_sqred.png'></td>"+
"</tr></table>";
bb.innerHTML += "<iframe style=\"background-color: #FFFFFF;\" frameborder=\"0\" src="+url+" name=\"allshowgo\" id=\"allshowgo\" height="+h+" width="+w+" target=\"_self\">"+include_mouse_on_title__9+"</iframe>"; 

}else if(url.indexOf("js|google")!=-1){ //地圖

bb.innerHTML += "<table width="+w+"><tr>"+
"<td width=\"90%\"><span id=\"allshowgotxt\">"+txt+"<span></td>"+
"<td align=\"right\" width=\"10%\"><img style=\"cursor:pointer\" onclick=\"closediv();locusjs();\" src='"+mymap+"images/small/cls_sqred.png'></td>"+
"</tr></table>";
bb.innerHTML += "<table height="+h+" width="+w+"><tr>"+
"<td><div id='map_canvas' style='width:"+w+"px;height:"+parseInt(h-8,10)+"px;'></div></td>"+
"</tr></table>";

}else{ //JS

bb.innerHTML += "<table width="+w+"><tr>"+
"<td width=\"90%\"><span id=\"allshowgotxt\">"+txt+"<span></td>"+
"<td align=\"right\" width=\"10%\"><img style=\"cursor:pointer\" onclick=\"closediv()\" src='"+mymap+"images/small/cls_sqred.png'></td>"+
"</tr></table>";
bb.innerHTML += "<table height="+h+" width="+w+"><tr>"+
"<td></td>"+
"</tr></table>";
}
document.body.appendChild(bb); 
if (url.indexOf("js|")!=-1){
eval(url.split("js|")[1]);
}



//載入中圖層
if (document.getElementById("allshowgo")!=null){
var b = document.createElement("div"); 
b.setAttribute("id","bodyload"); 
if (parseInt(hload,10)!=0 && parseInt(hload,10)<=parseInt(document.body.clientHeight,10)){
  b.style.top=parseInt((document.body.clientHeight/2)-(h/2)+(document.body.scrollTop),10)+'px';
}else{
  b.style.top=document.body.scrollTop+12;
}
b.style.left=parseInt((document.body.clientWidth/2-104),10)+'px';
b.innerHTML = "<img src='"+mymap+"images/small/ajax_loader.gif'>"
document.body.appendChild(b); 

document.getElementById("allshowgo").style.display="none";
var iframe = window.document.getElementById("allshowgo");
  if (iframe.attachEvent){
    iframe.attachEvent("onload", function(){
      if (document.getElementById("allshowgo")!=null)document.getElementById("allshowgo").style.display="";
      if (document.getElementById("bodyload")!=null)document.getElementById("bodyload").style.display="none";
      if (document.getElementById("allshowgo")!=null)allshowgo.document.oncontextmenu=function(){return false;};
    });
  }else{
    iframe.onload = function(){
      if (document.getElementById("allshowgo")!=null)document.getElementById("allshowgo").style.display="";
      if (document.getElementById("bodyload")!=null)document.getElementById("bodyload").style.display="none";
      if (document.getElementById("allshowgo")!=null)allshowgo.document.oncontextmenu=function(){return false;};
    };
  }
}

}
//========================BODYDIV==========================


//語言
function Language(a,b){
 var asp;
 var cookietemp;
if (window.location.href.indexOf("g=")!=-1 && window.location.href.indexOf("myadmin/")!=-1){
 asp="index.asp"+b;
 cookietemp=cookienumLanguage;
}else if (window.location.href.indexOf("g=")==-1){
 if (golifetopok=="yes"){
  asp="user_center.asp"+b;
 }else{
  asp="index.asp"+b;
 }
  cookietemp=cookienum;
}else{
 if (showtopok=="yes"){
  asp="show_user_center.asp"+b;
 }else{
  asp="show.asp"+b;
 }
 cookietemp=cookienum;
}
var expires = new Date();
expires.setTime(expires.getTime() + 1440 * 60 * 1000);
if (window.location.host.indexOf("localhost")!=-1){
document.cookie = ""+cookietemp+"Language="+a+"";
}else{
document.cookie = ""+cookietemp+"Language="+a+"; domain="+window.location.host+"; path=/;";
}
 //alert(getCookie(cookietemp+'Language'));
 //if (getCookie(cookietemp+'estore%5Fmyidurl1')!=undefined){
  //window.location.href=asp+getCookie(cookietemp+'estore%5Fmyidurl1');
 //}else{
  window.location.href=asp;
 //}
 //window.location.href=window.location.href;
}

//語言
function Language2(a){
 var cookietemp;
if (window.location.href.indexOf("g=")!=-1 && window.location.href.indexOf("myadmin/")!=-1){
 cookietemp=cookienumLanguage;
}else if (window.location.href.indexOf("g=")==-1){
  cookietemp=cookienum;
}else{
 cookietemp=cookienum;
}

var expires = new Date();
expires.setTime(expires.getTime() + 1440 * 60 * 1000);
if (window.location.host.indexOf("localhost")!=-1){
document.cookie = ""+cookietemp+"Language="+a+"";
}else{
document.cookie = ""+cookietemp+"Language="+a+"; domain="+window.location.host+"; path=/;";
}
}
