﻿var NS4 = navigator.appName.indexOf("Netscape") != -1 && navigator.appVersion.charAt(0) == "4";
if (NS4) {
        document.write('<STYLE>');
        document.write('#space { position: relative; z-order: 200; left: 0px; top: 0px; width: 448px; height: 320px; }'); /*was 526x475 */
        document.write('</STYLE>');
}

function imgPreView(imgName) {
  if (document.images) {
    if (!NS4) {
      document["imgPrev"].src = imgName;
    } else {
      document.layers["space"].document.open();
      document.layers["space"].document.write('<span><img src="' + imgName + '" alt="" hspace=0 vspace=0 border=0 name="imgPrev"></span>');
      document.layers["space"].document.close();
    }
  } 
}
  
function openImageView(code)
{
  newwins = window.open("/viewProductImage.aspx?f1=" + code,"largeimage","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=740,height=580");
	newwins.focus();
}
function openNewWindowSize(width, height, url)
{    
	newwins = window.open(url,"newwindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height);
	newwins.focus();
}
function printPartForm()
{
  newwins = window.open("/PartAccessoriesPrint.aspx","orderform","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=580");
	newwins.focus();
}
function productTab(tabname)
{
  getObject('winGeneral').style.display = 'none';
  getObject('winImage').style.display = 'none';
  getObject('winDetail').style.display = 'none';
  
  getObject(tabname).style.display = "";
}

function getObject(objectId) {
  // checkW3C DOM, then MSIE 4, then NN 4. 
  // 
  if(document.getElementById && document.getElementById(objectId)) { 
    return document.getElementById(objectId); 
  } 
  else if (document.all && document.all(objectId)) { 
    return document.all(objectId); 
  } 
  else if (document.layers && document.layers[objectId]) { 
    return document.layers[objectId]; 
  }
  else {
    return false; 
  } 
}

function SwfAttribute()
{
	this.src = "";
	this.width = 0;
	this.height = 0;
	this.wmode = "opaque";
}

function WriteSwf(swf)
{
	var opt = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" ";
	opt += "width="+ String(swf.width) +" height="+ String(swf.height) +">";
	opt += "<param name=wmode value="+ swf.wmode +" />";
	opt += "<param name=movie value="+ swf.src +" /><param name=quality value=high />";
	opt += "<embed src="+ swf.src +" quality=high wmode="+ swf.wmode +" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" ";
	opt += "width="+ String(swf.width) +" height="+ String(swf.height) +"></embed></object>";

	document.write(opt);
}
