<!-- 
function get_tag(n,d) {
  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++) {
     for (j=0;!x&&j<d.forms[i].elements.length;j++) {
        if (d.forms[i].elements[j].name==n) x=d.forms[i].elements[j];
     }
  }
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=get_tag(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n);
  return x;
}

function ImgShow(Output,img,w,h,type,layout,link,target,alt) {
   if (!img || img=='&nbsp;' || img.length<3) {
      if (Output==0) return; 
      else if (Output==1) document.write("目前無圖片");  
      else document.write(Output);
      return;
   }
   
   Iw = (w && w!='&nbsp;' && w!='0') ? ' width="'+w+'" ' : ''; Ih = (h && h!='&nbsp;' && h!='0') ? ' height="'+h+'" ' : ''; type = (type && type!='&nbsp;' && type!='0') ? type : 'IMAGE';
   switch(type) {
      case 'IMAGE':
         if (alt && alt!='&nbsp;') Ialt = ' alt="'+alt+'" '; else Ialt = '';
         str =  '<img src="'+img+'" border="0"'+Iw+Ih+Ialt+'>';
         if (!target || target=='&nbsp;' || target=='0') target= ' ';
         else target = ' target="'+target+'" '
         if (link && link!='0' && link!='&nbsp;' && link!='0') str = '<a href="'+link+'"'+target+'>'+str+'</a>';
         
      break;
      case 'FLASH':
         str = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+
         ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" '+
         Iw+Ih+'><PARAM NAME=movie VALUE="'+img+'"><PARAM NAME=quality VALUE=high><PARAM NAME=menu VALUE=false>'+
         '<EMBED src="'+img+'" quality=high '+Iw+Ih+' TYPE="application/x-shockwave-flash" '+
         'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'+
         '</EMBED></OBJECT>';
      break;
   }
   if (layout=='0') layout = false;
   if (!layout) document.write(str);
   else return str;
   
}

function ImgShow2(max,img,w,h,type,link,opt) {
   if ( isNaN(w) ) w = 0;
   if ( isNaN(h) ) h = 0;
   big = ( w >= h ) ? w : h;
   size = ( w>=h ) ? 0 : 1;
   if ( big > max ) {
      if ( size==0 ) { w=max; h=0; }
      else { h=max; w=0; }
   }
   if (opt) a = '<img src="/images/space.gif" width="'+max+'">';
   else a=0;
   ImgShow(a,img,w,h,type,0,link);
   //ImgPos1("M",img,w,h,type,link,"_self",0);
}

function ImgPos1(pos,img,w,h,type,link,target,alt) {
   if ( !img || img=='&nbsp;' || img.length<3) return;
   switch (pos) {
      case 'L':
         document.write('<table border=0 cellpadding=0 cellspacing=0 align=left><tr><td>'); ImgShow(1,img,w,h,type,0,link,target,alt);
         document.write('</td><td width=5><spacer></td></tr>');
         if (alt) document.write('<tr><td colspan=2 class=t9><table border=0 width=100% cellspacing=0><tr><td class=t9>'+alt+'</td></tr></table></td></tr>');
         document.write('<tr><td colspan=2 height=5><spacer></td></tr></table>');   
      break;
      case 'T':
         document.writeln('<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td>'); ImgShow(1,img,w,h,type,0,link,target,alt);
         document.writeln('</td></tr>');
         if (alt) document.write('<tr><td class=t9><table border=0 width=100% cellspacing=0><tr><td class=t9>'+alt+'</td></tr></table></td></tr>');
         document.write('<tr><td height=5><spacer></td></tr></table><br>');
      break;
      case 'C':
         document.write('<table border=0 cellpadding=0 cellspacing=0 align=center><tr><td>'); ImgShow(1,img,w,h,type,0,link,target,alt);
         document.write('</td></tr>');
         if (alt) document.write('<tr><td class=t9><table border=0 width=100% cellspacing=0><tr><td class=t9>'+alt+'</td></tr></table></td></tr>');
         document.write('<tr><td height=5><spacer></td></tr></table>');   
      break;
      case 'R':
         document.writeln('<table border=0 cellpadding=0 cellspacing=0 align=right><tr><td colspan=2 height=5><spacer></td></tr><tr><td width=5><spacer></td><td>');
         ImgShow(0,img,w,h,type,0,link,target,alt); document.writeln('</td></tr>');
         if (alt) document.write('<tr><td class=t9 colspan=2><table border=0 width=100% cellspacing=0><tr><td class=t9>'+alt+'</td></tr></table></td></tr>');
         document.write('</table>');
      break;
   }
}
function ImgPos2(pos,img,w,h,type,link,target,alt) {
   if ( !img || img=='&nbsp;' || img.length<3) return;
   switch(pos) {
      case 'B':
         document.writeln('<br><table width=100% border=0 cellpadding=0 cellspacing=0><tr><td height=5><spacer></td></tr><tr><td>');
         ImgShow(0,img,w,h,type,0,link,target,alt); document.writeln('</td></tr>');
         if (alt) document.write('<tr><td class=t9><table border=0 width=100% cellspacing=0><tr><td class=t9>'+alt+'</td></tr></table></td></tr>');
         document.write('</table>');
      break;
      case 'M':
         document.writeln('<br><table border=0 align=center cellpadding=0 cellspacing=0><tr><td height=5><spacer></td></tr><tr><td align=center>');
         ImgShow(0,img,w,h,type,0,link,target,alt); document.writeln('</td></tr>');
         if (alt) document.write('<tr><td class=t9><table border=0 width=100% cellspacing=0><tr><td class=t9>'+alt+'</td></tr></table></td></tr>');
         document.write('</table>');
      break;
   }
}


// DreamWeaver
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 DivShow2(Tag,status) {
   TabObj = get_tag(Tag);
   if(status) TabObj.style.display = '';
   else TabObj.style.display = 'none';
}


function CataDiv(id) {
   nam = "Xcata"+id
   obj = get_tag(nam);
   if(obj) {
      if(obj.style.display=='') obj.style.display='none';
      else obj.style.display = '';
   }
   else
      location.href = 'theme_cata.asp?cata_id='+id
}

function CataDiv2(id) {
   nam = "Xcata"+id
   obj = get_tag(nam);
   if(obj) {
      obj.style.display = '';
   }
}

function ICataDiv(id) {
   nam = "IXcata"+id
   obj = get_tag(nam);
   if(obj) {
      if(obj.style.display=='') obj.style.display='none';
      else obj.style.display = '';
   }
   else
      location.href = 'item_cata.asp?cata_id='+id
}

function ICataDiv2(id) {
   nam = "IXcata"+id
   obj = get_tag(nam);
   if(obj) {
      obj.style.display = '';
   }
}

function VCataDiv(id) {
   nam = "Xcata"+id
   obj = get_tag(nam);
   if(obj) {
      if(obj.style.display=='') obj.style.display='none';
      else obj.style.display = '';
   }
   else
      location.href = 'item_vipcata.asp?cata_id='+id
}

function CheckMe(formname,tagname,xstatus) {
   obj = get_tag(formname);
   for ( i=0; i<obj.length; i++) {
      if ( obj[i].name == tagname) {
         if (xstatus=='all' || xstatus==true) obj[i].status = true;
         else if (xstatus=='verbose') obj[i].status = !obj[i].status;
         else obj[i].status = false;
      }
   }
}
// -->