﻿document.write("<div style='FILTER:alpha(opacity=97);display:none;font-size:12px;position:absolute;padding:5;z-index:1000;' 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'",6000) ;
       }    
     }//不等於空在執行    
    }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'",6000) ;
       }    

    }//是否為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 addBookmark(title, url){ 
if(navigator.appName.indexOf("Internet Explorer")!=-1){
window.external.AddFavorite(url, title); 
}else{
window.sidebar.addPanel(title, url, "") ;
}
}

//子視窗
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;')
}

//讀取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));  
	} 
} 
//驗證
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+'include/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+"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 mu(meval){
  var left_n=eval(meval);
  if (left_n.style.display=="none")
  { eval(meval+".style.display='';"); }
  else
  { eval(meval+".style.display='none';"); }
}
//縮圖
function bbody(a,b){
if (b=='listimg') var mmax="540"; //商品詳細頁面
if (b=='newsimg') var mmax="740";
if (document.getElementById(a)!=null){

var arurl=document.getElementById(a).getElementsByTagName("img");
 if (arurl.length>0){
  for (var is=0;is<arurl.length;is++){
   if(arurl[is].width>50){
   if(arurl[is].width>mmax){
    heightok=((arurl[is].height * mmax) / arurl[is].width).toString();
    arurl[is].width=mmax; 
    arurl[is].height=heightok;
    arurl[is].style.width=mmax;
    arurl[is].style.height=heightok;
    //}else{
    //arurl[is].width=arurl[is].width; 
    //arurl[is].height=arurl[is].height; 
   }
   }
  }
 }
var arurl=document.getElementById(a).getElementsByTagName("embed");
 if (arurl.length>0){
  for (var is=0;is<arurl.length;is++){
   if(arurl[is].width>50){
   if(arurl[is].width>mmax){
    heightok=((arurl[is].height * mmax) / arurl[is].width).toString();
    arurl[is].width=mmax; 
    arurl[is].height=heightok;
    arurl[is].style.width=mmax;
    arurl[is].style.height=heightok;
    //}else{
    //arurl[is].width=arurl[is].width; 
    //arurl[is].height=arurl[is].height; 
   }
   }
  }
 }
}
}

