// product.js
function newimg(id) {
  url='http://www.kozyclutter.com/Merchant2/newimg.php?id=' + id + '&n=1&t=0&w=0&h=0';
  winName='KCpics';
  winArgs='width=300,height=350,left=10,top=10,directories=0,location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0';
  popupWin = window.open(url,winName,winArgs);
}
function rd(imgsrc,name,alt,comment,wname,lg) {
  var wsize = 500;
  var hsize = 650;
  var reddevil = 'width=' + wsize + ',height=' + hsize + ',left=10,top=10,screenX=10,screenY=10';
  reddevil = reddevil + ',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0';
  if(!(imgsrc=="")) {
    popupWin=window.open('',wname,reddevil);
    if (!popupWin.opener) { popupWin.opener = self;}
    popupWin.document.open();
    popupWin.document.writeln("<html><head><META HTTP-EQUIV='imagetoolbar' CONTENT='no'>");
    popupWin.document.writeln("<title>" + name + "</title>");
    popupWin.document.writeln("<BASE HREF='http://" + location.hostname + "/Merchant2/'>");
    popupWin.document.writeln("<script language='JavaScript'>");
    popupWin.document.writeln("if (window.focus) { self.focus();}");
    popupWin.document.writeln("var message='';");
    popupWin.document.writeln("function clickIE() {if (document.all) {(message);return false;}}");
    popupWin.document.writeln("function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) {");
    popupWin.document.writeln("if (e.which==2||e.which==3) {(message);return false;}}}");
    popupWin.document.writeln("if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}");
    popupWin.document.writeln("else {document.onmouseup=clickNS;document.oncontextmenu=clickIE;}");
    popupWin.document.writeln("document.oncontextmenu=new Function('return false');");
    popupWin.document.writeln("function killWindow() {");
    popupWin.document.writeln("  killWin = window.close();} </script>");
    popupWin.document.writeln("</head>");
    popupWin.document.writeln("<body onLoad='self.focus();window.resizeTo(document.images[0].width + 50,document.images[0].height + 110);' ");
    popupWin.document.writeln("bgcolor='#fdf9ce' ");
    popupWin.document.writeln("marginheight=0 marginwidth=0 topmargin=0 ");
    popupWin.document.writeln("leftmargin=0><center>");
    popupWin.document.writeln("<table width=100% border=0 cellspacing=10 cellpadding=10>");
    popupWin.document.writeln("<tr><td><a href='' onClick='killWindow();'>");
    if (lg > 0) {popupWin.document.writeln("<center><img src='" + imgsrc + "' border=0 GALLERYIMG='no'");}
    else {popupWin.document.writeln("<center><img src='" + imgsrc + "' border=0 height=300 GALLERYIMG='no'");}
    popupWin.document.writeln("alt='" + alt + "'>");
    popupWin.document.writeln("</a><font style='font-family:\"Comic Sans MS\";font-size:10pt;color:#000066;'><center>" + comment + "</font></center>");
    popupWin.document.writeln("</td></tr></table></center>");
    popupWin.document.writeln("</body>");
    popupWin.document.writeln("</html>");
    popupWin.document.close();
  }
}

function runVideo(vidSrc,name,h,w) {
  var hSize = h+80;
  var wSize = w+20;
  var winParams = 'width=' + wSize + ',height=' + hSize + ',left=10,top=10,screenX=10,screenY=10';
  popupWin=window.open('','KCvideo',winParams);
  if (!popupWin.opener) {popupWin.opener = self;}
  popupWin.document.open();
  popupWin.document.writeln("<HTML><HEAD><META HTTP-EQUIV='imagetoolbar' CONTENT='no'>");
  popupWin.document.writeln("<TITLE>" + name + "</TITLE>");
  popupWin.document.writeln("<BASE HREF='http://" + location.hostname + "/Merchant2/'>");
  popupWin.document.writeln("<script language='JavaScript'>");
  popupWin.document.writeln("if (window.focus) { self.focus();}");
  popupWin.document.writeln("function right(e) {");
  popupWin.document.writeln("if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) {");
  popupWin.document.writeln("alert(\"Sorry, right click is temporarily disabled.\");");
  popupWin.document.writeln("return false;}");
  popupWin.document.writeln("else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {");
  popupWin.document.writeln("alert(\"Sorry, right click is temporarily disabled.\");");
  popupWin.document.writeln("return false;}");
  popupWin.document.writeln("return true;}");
  popupWin.document.writeln("document.onmousedown=right;");
  popupWin.document.writeln("if (document.layers) window.captureEvents(Event.MOUSEDOWN);");
  popupWin.document.writeln("window.onmousedown=right;");
  popupWin.document.writeln("</script>");
  popupWin.document.writeln("</head>");
  popupWin.document.writeln("<BODY onbeforeunload=\'opener.play_music();'>");
  popupWin.document.writeln("<CENTER>");
  popupWin.document.writeln("<OBJECT ID='MediaPlayer' WIDTH=" + w + " HEIGHT=" + h);
  popupWin.document.writeln("  CLASSID='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95'");
  popupWin.document.writeln("  STANDBY='Loading Windows Media Player components...' ");
  popupWin.document.writeln("  TYPE='application/x-oleobject'");
  popupWin.document.writeln("  CODEBASE='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112'>");
  popupWin.document.writeln("  <PARAM name='autoStart' value='True'>");
  popupWin.document.writeln("  <PARAM name='filename' value='graphics/00000001/video/" + vidSrc + "'>");
  popupWin.document.writeln("  <PARAM name='ShowControls' value='false'>");
  popupWin.document.writeln("<EMBED TYPE='application/x-mplayer2' ");
  popupWin.document.writeln("    SRC='graphics/00000001/video/" + vidSrc + "'");
  popupWin.document.writeln("    NAME='MediaPlayer'");
  popupWin.document.writeln("    WIDTH=" + w);
  popupWin.document.writeln("    HEIGHT=" + h);
  popupWin.document.writeln("    CONTROLS=console>");
  popupWin.document.writeln("  </EMBED>");
  popupWin.document.writeln("</OBJECT>");
  popupWin.document.writeln("<BR><BR>");
  popupWin.document.writeln("<INPUT TYPE='button' VALUE='close' onClick='window.close()'>");
  popupWin.document.writeln("</CENTER>");
  popupWin.document.writeln("</BODY>");
  popupWin.document.writeln("</HTML>");
}

function runAudio(audSrc,imgSrc,name,alt) {
  var wname="audioWindow";
  var wsize = 400;
  var hsize = 200;
  var audioWin = 'width=' + wsize + ',height=' + hsize + ',left=10,top=10,screenX=10,screenY=10';
  audioWin = audioWin + ',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0';
  popupWin=window.open('',wname,audioWin);
  if (!popupWin.opener) { popupWin.opener = self;}
  popupWin.document.open();
  popupWin.document.writeln("<html><head><META HTTP-EQUIV='imagetoolbar' CONTENT='no'>");
  popupWin.document.writeln("<title>" + name + "</title>");
  popupWin.document.writeln("<BASE HREF='http://" + location.hostname + "/Merchant2/'>");
  popupWin.document.writeln("<script language='JavaScript'>");
  popupWin.document.writeln("if (window.focus) { self.focus();}");
  popupWin.document.writeln("function right(e) {");
  popupWin.document.writeln("if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) {");
  popupWin.document.writeln("alert(\"Sorry, right click is temporarily disabled.\");");
  popupWin.document.writeln("return false;}");
  popupWin.document.writeln("else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {");
  popupWin.document.writeln("alert(\"Sorry, right click is temporarily disabled.\");");
  popupWin.document.writeln("return false;}");
  popupWin.document.writeln("return true;}");
  popupWin.document.writeln("document.onmousedown=right;");
  popupWin.document.writeln("if (document.layers) window.captureEvents(Event.MOUSEDOWN);");
  popupWin.document.writeln("window.onmousedown=right;");
  popupWin.document.writeln("function killWindow() {");
  popupWin.document.writeln("  killWin = window.close();} </script>");
  popupWin.document.writeln("</head>");
  popupWin.document.writeln("<body onLoad='self.focus();window.resizeTo(document.images[0].width + 50,document.images[0].height + 130);' onbeforeunload=\'opener.play_music();' bgcolor='#fdf9ce' marginheight=0 marginwidth=0 topmargin=0 leftmargin=0>");
  popupWin.document.writeln("<center>");
  popupWin.document.writeln("<table width=100% border=0 cellspacing=10 cellpadding=10>");
  popupWin.document.writeln("<tr><td>");
  popupWin.document.writeln("<center><img src='" + imgSrc + "' border=0 GALLERYIMG='no'");
  popupWin.document.writeln("alt='" + alt + "'>");
  popupWin.document.writeln("<BR>");
  popupWin.document.writeln("<INPUT TYPE='button' VALUE='close' onClick='window.close()'>");
  popupWin.document.writeln("</center>");
  popupWin.document.writeln("</td></tr></table></center>");
  popupWin.document.writeln("<EMBED SRC='graphics/00000001/audio/" + audSrc + "' HIDDEN=TRUE VOLUME=100 LOOP=false AUTOSTART=TRUE NAME='audio_embed' MASTERSOUND>");
  popupWin.document.writeln("</body>");
  popupWin.document.writeln("</html>");
  popupWin.document.close();
}

