function Pimg(CONO,INO,WHERE,SOURCE,LIMIT){
    this.CONO = CONO;
    this.INO = INO;
    this.WHERE = WHERE;
    this.SOURCE = SOURCE;
    this.LIMIT = LIMIT;
    this.imgroute = "";
    this.imgroute1 = "";
    this.bb = this.INO+"b";
    this.cc = this.INO+"c";
    this.ss = this.INO+"s";
    this.imgb = new Image();
    this.imgc = new Image();
    this.imgs = new Image();
    this.aaa = this.CONO+"-"+this.INO+".jpg";
    this.zzz = this.CONO+"-"+this.INO+"z.gif";
    this.sss = this.CONO+"-"+this.INO+".swf";
    this.bbb = this.CONO+"-"+this.INO+"b.jpg";

    this.preload = preload;
    this.show = show;
    this.adjust = adjust;
    this.Mshow = Mshow;
    this.tshow = tshow;
    function preload(){
        if (this.CONO >= 40000000){
            this.imgroute = "http://images.ttnet.net/pi/cto/"+ gd(this.CONO) +"/";
            this.imgroute1 = "http://wenbi.ttnet.net/pi/prvspc/"+ gd(this.CONO) +"/";
        }else{
            this.imgroute = "http://images.ttnet.net/pi/eto/"+ gd(this.CONO) +"/";
            this.imgroute1 = "http://www.ttnet.net/pi/prvspc/"+ gd(this.CONO) +"/";
        }
        if (imgs[this.bb]){
            this.imgb.src = this.imgroute1+imgs[this.bb];
        }
        if (imgs[this.cc]){
            this.imgc.src = this.imgroute1+imgs[this.cc];
        }
        if (imgs[this.ss]){
            this.imgs.src = this.imgroute1+imgs[this.ss];
        }
    }
    function show(){
        if (((this.WHERE == 'a')&&(this.SOURCE != 9))||(this.SOURCE == 1)){
            this.adjust();
        }else if((this.WHERE == 'p')||(this.SOURCE == 2)||(this.SOURCE == 9)){
            if (imgs[this.bb]){
                //document.write('<img src='+this.imgb.src+' onload="this.complete?this.width>'+this.LIMIT+'?this.width='+this.LIMIT+':alert(\'ok\'):this.onload();" border=0>');
                document.write('<a href=\'javascript:productShow("'+this.imgb.src+'");\'>');
                document.write('<img src='+this.imgb.src+' id=pdt'+this.INO+'  onload="javascript:chkload(this.id,'+this.LIMIT+')" border=0>');
                document.write('<\/a>');
            }else{
                this.adjust();
            }
        }
    }
    function Mshow(){
        var imgfile = this.CONO+"-"+this.INO+"M.gif";
        if (this.WHERE == 'a'){
            if (imgs[imgfile]){
                imgfile = this.imgroute+imgfile;
                document.write('<img src='+imgfile+' border=0 onload="if (this.width>500) this.width=500">');
            }
        }else{
            var mm = this.INO+"m";
            if (imgs[mm]){
                imgfile = this.imgroute1+imgs[mm];
                document.write('<img src='+imgfile+' border=0 onload="if (this.width>500) this.width=500">');
            }else if (imgs[imgfile]){
                imgfile = this.imgroute+imgfile;
                document.write('<img src='+imgfile+' border=0 onload="if (this.width>500) this.width=500">');
            }
        }
    }
    function tshow(){
         var imgfile = this.CONO+"-"+this.INO+"t.gif";
        if (this.WHERE == 'a'){
            if (imgs[imgfile]){
                imgfile = this.imgroute+imgfile;
                document.write('<img src='+imgfile+' border=0 onload="if (this.width>500) this.width=500">');
            }
        }else{

            var mm = this.INO+"t";
            if (imgs[mm]){
                imgfile = this.imgroute1+imgs[mm];
                document.write('<img src='+imgfile+' border=0 onload="if (this.width>500) this.width=500">');
            }else if (imgs[imgfile]){
                imgfile = this.imgroute+imgfile;
                document.write('<img src='+imgfile+' border=0 onload="if (this.width>500) this.width=500">');
            }
        }
    }
    function adjust(){
        //規 swf
        if (imgs[this.sss]) {
            document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
            document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"');
            document.write('WIDTH="'+this.LIMIT+'" HEIGHT="300">');
            document.write('<param NAME=quality VALUE=high>');
            document.write('<param NAME=movie VALUE='+this.imgroute+this.sss+'>');
            document.write('<embed src='+this.imgroute+this.sss+' quality=high');
            document.write('TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" WIDTH="'+this.LIMIT+'" HEIGHT="300">');
            document.write('</embed>');
            document.write('</object>');
            if (imgs[this.bbb]) {
                document.write('<a href=\'javascript:productShow("'+this.imgroute+this.bbb+'");\' > >> </a>');
            }
        //規 gif動
        }else if (imgs[this.zzz]) {
            if (imgs[this.bbb]) {
                document.write('<a href=\'javascript:productShow("'+this.imgroute+this.bbb+'");\'>');
            }
            document.write('<img src='+this.imgroute+this.zzz+' border=0>');
            if (imgs[this.bbb]) {
                document.write('</a>');
            }
        //規 jpg
        }else if (imgs[this.aaa]) {
            if (imgs[this.bbb]) {
                document.write('<a href=\'javascript:productShow("'+this.imgroute+this.bbb+'");\'  >');
            }
            document.write('<img src='+this.imgroute+this.aaa+' border=0>');
            if (imgs[this.bbb]) {
               document.write('</a>');
            }
        }
    }
    function gd(cono){
        // mark this
        //return cono;
        var a = cono.toString();
        var b = a.replace(/(\d{2})/g, "$1/");
        //b = b.replace(/\/$/g, "");
        return b;
    }

}
function chkload(obj,imgwidth){
    var imgobj ;
    if (document.all){
        imgobj = eval(obj);
    }else{
        imgobj = eval("document."+obj);
    }
    if ((imgobj.complete)||(imgobj.width>0)){
        if (imgobj.width > imgwidth){
            imgobj.width = imgwidth;
        }
    }else{
        setTimeout("chkload("+imgobj.id+","+imgwidth+")",1000);
    }
}

/*********************************************\
      ========= 2003/08/08 gaga ==========

商空圖 --> local
imgs['3b'] ='10044641-3b.jpg';  #大
imgs['3c'] ='10044641-3c.jpg'; #中
imgs['3s'] ='10044641-3s.jpg'; #小

imgs['3m'] ='10044641-3M.jpg'; #商標圖
imgs['3t'] ='10044641-3t.jpg'; #規格明細圖

規格圖 --> img_list.cgi
var imgs = new Array();
imgs['10044641-3.gif'] ='Y';  #小
imgs['10044641-3.jpg'] ='Y';  #中
imgs['10044641-3z.gif'] ='Y'; #動
imgs['10044641-3.swf'] ='Y';  #動
imgs['10044641-3b.jpg'] ='Y'; #大

imgs['10044641-3M.gif'] ='Y'; #商標圖
imgs['10044641-3t.gif'] ='Y'; #規格明細圖

\**********************************************/
