﻿/*===================================*/
/*-Original Information Co.,LTD.-----*/
/*-http://www.original.com.tw--------*/
/*-email:service@original.com.tw-----*/
/*===================================*/

var prod_unit=new Array();
prod_unit=["個","片","台","箱"];
var prod_label=new Array();
prod_label=["=請選擇=","新品","推薦","特價","熱賣","缺貨"];
var cost_rate=new Array();
cost_rate=["NT$","US$","JPY$","HKD$","RMB$","EUR$"];
var shop_num=new Array();
shop_num=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"];

function write_option(array,num)
    {
    for(i=1;i<=array.length;i++)
        {
        if(num!="")
            {
            document.write('<option ');
            if(num==i)
            document.write(' selected ');
            document.write(' value='+i+'>'+array[(i-1)]+'</option>');
            }
        else
            document.write('<option value='+i+'>'+array[(i-1)]+'</option>');
        }
    }

function put_shopcar(shop_no_value)
    {
    nwindow=window.open("","shopwindow","top=50,left=200,height=480,width=700,toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no")
    nwindow.close();
    nwindow=window.open("/product_db/shoppingcar.jsp?shop_count=1&shop_no="+shop_no_value,"shopwindow","top=50,left=200,height=480,width=700,toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no,location=no")	
    }

function chk_shop()
    {
    var shop_count_value=document.all.shop_count.options(document.all.shop_count.selectedIndex).value;
    var shop_no_value=document.all.shop_no.value;

    nwindow=window.open("","shopwindow","top=50,left=200,height=480,width=640,toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no")
    nwindow.close();
    nwindow=window.open("/product_db/shoppingcar.jsp?shop_no="+shop_no_value+"&shop_count="+shop_count_value,"shopwindow","top=50,left=200,height=480,width=640,toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no,location=no")
    return;

    }

function view_shop()
    {
    nwindow=window.open("","shopwindow","top=50,left=200,height=480,width=620,toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no")
    nwindow.close();
    nwindow=window.open("/product_db/shoppingcar.jsp","shopwindow","top=50,left=200,height=480,width=620,toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no,location=no")
    return;
    }
    
    
////  begin  show prod picture
var height = screen.height;
var width = screen.width;
var leftpos = 0;
var toppos = 0;
var myH = 0;
var myW = 0;
pic = new Image();

function read(url) {

  pic = new Image();
  pic.src = url;
  setTimeout("view()", 700);
}
 
function view() {
  if (eval(pic).height) {
    clearTimeout();
 
   
      myH = eval(pic).height ;
      myW = eval(pic).width;
   
    leftpos = width / 2 - myW / 2;
    toppos = height / 2 - myH / 2;  
 
    ViewWin=window.open("#","_blank","width=" + myW + ",height=" + myH + ",left=" + leftpos + ",top=" + toppos);
    
    ViewWin.document.open();
    ViewWin.document.write("<HTML><HEAD><TITLE>View Picture</TITLE></HEAD><body ondragstart=window.event.returnValue=false onselectstart=event.returnValue=false background=/adm-img/preview-bg.gif  leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0><CENTER>\n");
    ViewWin.document.write("<A HREF=\"javascript:self.close()\;\"><IMG alt='Close [x]' SRC='" + pic.src + "' BORDER=0></A>\n");
    ViewWin.document.write("</CENTER></BODY></HTML>\n");
    ViewWin.document.close();
  } else { setTimeout("view()", 500); }
}
////  end  show prod picture   