<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function js_watch2(p){

  if(p=="")alert("請先登入會員！");
  else window.location="newtalk.php";

}

function openChild(file,window) {
    childWindow=open(file,window,'resizable=no,width=400,height=300');
    if (childWindow.opener == null) childWindow.opener = self;
    }
	
function openW(file,window) {
    childWindow=open(file,window,'resizable=no,width=800,height=600');
    if (childWindow.opener == null) childWindow.opener = self;
    }
	
 function js_go(u,url){
  if(u=="")location.href="myaccount.php?redirect="+url;
  else location.href=url;
 }


//加到我的最愛------start-------------
var myfar;
var mytitle;
myfar="http://www.handbox.com.tw/";
mytitle="HandBox電子型錄網站";
function favority() {
if (navigator.appName!="Internet Explorer"){
window.external.AddFavorite(myfar, mytitle);}
else{
window.location = myfar;
}}         //加到我的最愛------end-------------
           // 設為預設首頁        background="../SHOP/image/bg1.jpg"
          //<A HREF="#" ONCLICK="this.style.behavior='url(#default#homepage)';this.setHomePage('http://web.yuntech.edu.tw/~8213045/home');">
         //<img src="../gif/1003.gif" width="131" height="30" border="0" alt="設成預設首頁"></a>background="../TRUESHOP/image/bk5.jpg"
<!--隱藏BLOCK-->
function block_showhide(id,s)
{
  var o = document.all[id];
  if (o){
    if(s==0){
    //if (o.style.display == ''){
      o.style.display = 'none';
	 // document.uform.OBILL[sid].checked = true;
    }else{
	  //document.uform.OBILL[sid].checked = true;
      o.style.display = '';

    }
  }
}

<!--service 顯示BLOCK-->
function service_show(id)
{
    var lb = document.getElementById(id).innerHTML;
    document.getElementById('show_div').innerHTML = lb;
}

<!--登出-->
 function log_out(){
  if (confirm ("確定登出?")){location.href="logout.php"}
  else {return false;}
  }

<!--帳單範圍搜尋-->
function jumpPage(form) {

   var url = new Array("",
                       "myorder.php?r=1",
                       "myorder.php?r=2",
                       "myorder.php?r=3",
                       "myorder.php?r=4",
                       "myorder.php?r=5");

    i = form.SelectMenu.selectedIndex;
    if (i == 0) return;
   window.location.href = url[i];
    }


<!--新增發言取消-->
function newtalk_cancel(){
 location.href="talking.php";
}

<!--廣告區 關閉 開啟-->

var whichOpen='';
var whichContinue='';
// 圖層id, maxh 子選單高度, 選單表格id
function menuChange(obj,maxh,obj2)
{

  if (obj.style.pixelHeight)    // 關閉目前打開的選單
     {menuHide(obj,maxh,obj2);
      whichOpen=''; whichcontinue='';
	  randomstart();
     document.getElementById("ADcontrol").innerHTML="<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='left' valign='top' ><img src='images/index_103.gif' width='46' height='21' /><img src='images/ad_border.gif' width='48' height='21'><a href='javascript:menuChange(ADlist,200,ADshow);' onmouseout=MM_swapImgRestore() onmouseover=MM_swapImage('open','','images/open_over.gif',1)><img src='images/open.gif' alt='開啟' name='open' width='45' height='21' border='0' id='open' /></a><img src='images/index_106.gif' width='18' height='21' /></td></tr></table>";
	 }
  else
     {
	 randomstop();
 	 document.getElementById("ADcontrol").innerHTML="<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='left' valign='top' ><img src='images/index_103.gif' width='46' height='21' /><img src='images/ad_border.gif' width='45' height='21'><a href='javascript:menuChange(ADlist,200,ADshow);' onmouseout=MM_swapImgRestore() onmouseover=MM_swapImage('close','','images/close_over.gif',1)><img src='images/close.gif' alt='關閉' name='close' width='48' height='21' border='0' id='close' /></a><img src='images/index_106.gif' width='18' height='21' /></td></tr></table>";

	 if (whichOpen)
	     {whichContinue=obj2; whichOpen.click();
      }
	else
	     {menuShow(obj,maxh,obj2); whichOpen=obj2; whichContinue='';
		 }
	 }
}

// 顯示指定的選單
function menuShow(obj,maxh,obj2)
{  
  if (obj.style.pixelHeight < maxh)
  {obj.style.pixelHeight+=maxh/10;
   obj.filters.alpha.opacity+=5;
   obj2.background="";
   if (obj.style.pixelHeight == maxh/5) obj.style.display='block';
   myObj=obj; myMaxh=maxh; myObj2=obj2;
   setTimeout('menuShow(myObj,myMaxh,myObj2)','5');
  }
}

// 關閉指定的選單
function menuHide(obj,maxh,obj2)
{
  if (obj.style.pixelHeight>0)
     {if (obj.style.pixelHeight == maxh/10) obj.style.display='none';
      obj.style.pixelHeight-=maxh/10;
	  obj.filters.alpha.opacity-=5;
	  obj2.background="";
	  myObj=obj; myMaxh=maxh; myObj2=obj2;
	  setTimeout('menuHide(myObj,myMaxh,myObj2)','5');
     }
  else
     if (whichContinue) whichContinue.click();
}
function randomstart(){
    document.getElementById("Adrandom").innerHTML  ="<IFRAME align=center valign='middle' src='html/Adrandom2.php' frameBorder=0 width=140 scrolling=choice  height=230 leftMargin=20 topMargin=0></IFRAME>"  
    
}
function randomstop(){
   document.getElementById("Adrandom").innerHTML  = "<IFRAME align=center valign='middle' src='html/Adrandom.php' frameBorder=0 width=134 scrolling=choice  height=210 leftMargin=0 topMargin=0></IFRAME>"
}
 

//關閉廣告區
function closeAD(){
 document.getElementById('ADlist').style.display='none';
}

// 推薦書籍,新聞
function commend(i,s){

 alert("感謝您的推薦！");
 if(s=='n')window.location="counter.php?item="+i;
 if(s=='b')window.location="bcounter.php?item="+i;
}
//for flash call new window  07/1/25
function newwindows(url,fname){
 window.open(url,fname,'width=800,height=600,scrollbars=yes,toolbar=yes,resizable=yes,menubar=yes,status=yes,location=yes');
}
