﻿// JScript File

function popUpImg(iName,iTitle,iDesc) {
    var scrLeft = (window.screen.width / 2) - 160;
    var scrTop = (window.screen.height / 2) - 225;
    var popUpURL='/popup.aspx?pi='+iName+'&pt='+iTitle+'&pd='+iDesc;
    var popUpInfo;
        popUpInfo='toolbar=0,';
        popUpInfo+='location=0,';
        popUpInfo+='directories=0,';
        popUpInfo+='status=0,';
        popUpInfo+='menubar=0,';
        popUpInfo+='scrollbars=0,';
        popUpInfo+='resizable=1,';
        popUpInfo+='width=200,';
        popUpInfo+='height=200,';
        popUpInfo+='left='+scrLeft+',';
        popUpInfo+='top='+scrTop;
    window.open(popUpURL,'zoomPopup',popUpInfo);
}

function EnterBtnToTab()
{
    if(event.keyCode==13)
    {
        event.keyCode = 9;
        return;
    }
}

function ViewZoomImageWWW(ipath,ititle,idesc){
	var newWindow2;
	var winTop = (screen.height / 2) - 270;
	var winLeft = (screen.width / 2) - 250;
	var windowFeatures = "width=500,height=535,resizable=1,location=0,status=0,menubar=0,directories=0,toolbar=0,";
	windowFeatures = windowFeatures + "left=" + winLeft + ",";
	windowFeatures = windowFeatures + "top=" + winTop;
	newWindow2 = window.open("","View",windowFeatures);
	newWindow2.document.write('<html><head><title>'+ititle+'</title></head><BODY><center><IMG SRC="'+ipath+'" BORDER="0" style="border-right: #cccccc 1px solid; border-top: #cccccc 1px solid; border-left: #cccccc 1px solid; border-bottom: #cccccc 1px solid;"  onError="null"><br /><strong><font size="2" face="Arial" color="#333333">'+idesc+'</font></strong></center><form><center><input type="button" value="Close Window" onClick="javascript:window.close();"><br /><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#333333">Actual colors may vary from displayed or printed images. Images are not shown at actual size. Please obtain a sample to ensure a proper color match and actual image size.</font></center></form></BODY></html>');
    newWindow2.document.close();
	}

function popupBigImage(ipath,ititle,idesc){
	var newWindow2;
	var winTop = (screen.height / 2) - 270;
	var winLeft = (screen.width / 2) - 250;
	var windowFeatures = "width=535,height=535,resizable=1,location=0,status=0,menubar=0,directories=0,toolbar=0,";
	windowFeatures = windowFeatures + "left=" + winLeft + ",";
	windowFeatures = windowFeatures + "top=" + winTop;
	newWindow2 = window.open("","View",windowFeatures);
	newWindow2.document.write('<html><head><title>'+ititle+'</title></head><BODY><center><IMG SRC="'+ipath+'" BORDER="0" style="border-right: #cccccc 1px solid; border-top: #cccccc 1px solid; border-left: #cccccc 1px solid; border-bottom: #cccccc 1px solid;" onError="null"><br /><strong><font size="2" face="Arial" color="#333333">'+idesc+'</font></strong></center><form><center><input type="button" value="Close Window" onClick="javascript:window.close();"><br /></center></form></BODY></html>');
    newWindow2.document.close();
	}
	
function popupBigImageWide(ipath,ititle,idesc){
	var newWindow2;
	var winTop = (screen.height / 2) - 270;
	var winLeft = (screen.width / 2) - 250;
	var windowFeatures = "width=550,height=475,resizable=1,location=0,status=0,menubar=0,directories=0,toolbar=0,";
	windowFeatures = windowFeatures + "left=" + winLeft + ",";
	windowFeatures = windowFeatures + "top=" + winTop;
	newWindow2 = window.open("","View",windowFeatures);
	newWindow2.document.write('<html><head><title>'+ititle+'</title></head><BODY><center><IMG SRC="'+ipath+'" BORDER="0" style="border-right: #cccccc 1px solid; border-top: #cccccc 1px solid; border-left: #cccccc 1px solid; border-bottom: #cccccc 1px solid;" onError="null"><br /><strong><font size="2" face="Arial" color="#333333">'+idesc+'</font></strong></center><form><center><input type="button" value="Close Window" onClick="javascript:window.close();"><br /></center></form></BODY></html>');
    newWindow2.document.close();
	}

function popupBigImageTall(ipath,ititle,idesc){
	var newWindow2;
	var winTop = (screen.height / 2) - 270;
	var winLeft = (screen.width / 2) - 250;
	var windowFeatures = "width=500,height=600,resizable=1,location=0,status=0,menubar=0,directories=0,toolbar=0,";
	windowFeatures = windowFeatures + "left=" + winLeft + ",";
	windowFeatures = windowFeatures + "top=" + winTop;
	newWindow2 = window.open("","View",windowFeatures);
	newWindow2.document.write('<html><head><title>'+ititle+'</title></head><BODY><center><IMG SRC="'+ipath+'" BORDER="0" style="border-right: #cccccc 1px solid; border-top: #cccccc 1px solid; border-left: #cccccc 1px solid; border-bottom: #cccccc 1px solid;" onError="null"><br /><strong><font size="2" face="Arial" color="#333333">'+idesc+'</font></strong></center><form><center><input type="button" value="Close Window" onClick="javascript:window.close();"><br /></center></form></BODY></html>');
    newWindow2.document.close();
	}

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 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_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_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 FirstColumnRollOver(cchange)
{ if (!cchange.contains(event.fromElement))
	{ cchange.bgColor="#EEEDCE";}}

function FirstColumnRollOut(cchange)
{ if (!cchange.contains(event.toElement))
	{ cchange.bgColor="#DCDBB8";}}

function popUpHDMovie() {
    var scrLeft = (window.screen.width / 2) - 160;
    var scrTop = (window.screen.height / 2) - 225;
    var popUpURL='/mediafiles/WilsonartHDCommercial.html';
    var popUpInfo;
        popUpInfo='toolbar=0,';
        popUpInfo+='location=0,';
        popUpInfo+='directories=0,';
        popUpInfo+='status=0,';
        popUpInfo+='menubar=0,';
        popUpInfo+='scrollbars=0,';
        popUpInfo+='resizable=1,';
        popUpInfo+='width=320,';
        popUpInfo+='height=300,';
        popUpInfo+='left='+scrLeft+',';
        popUpInfo+='top='+scrTop;
    window.open(popUpURL,'WilsonartHDCommercial',popUpInfo);
}

function popUpDodgeMovie() {
    var scrLeft = (window.screen.width / 2) - 160;
    var scrTop = (window.screen.height / 2) - 225;
    var popUpURL='/mediafiles/MDBeforeandAfter.html';
    var popUpInfo;
        popUpInfo='toolbar=0,';
        popUpInfo+='location=0,';
        popUpInfo+='directories=0,';
        popUpInfo+='status=0,';
        popUpInfo+='menubar=0,';
        popUpInfo+='scrollbars=0,';
        popUpInfo+='resizable=1,';
        popUpInfo+='width=330,';
        popUpInfo+='height=300,';
        popUpInfo+='left='+scrLeft+',';
        popUpInfo+='top='+scrTop;
    window.open(popUpURL,'MDBeforeandAfter',popUpInfo);
}

function ViewImageAd(ipath,iwidth,iheight,slogan,ititle,isbars) {
	var newWindow;
	var winTop = (screen.height / 2) - 275;
	var winLeft = (screen.width / 2) - 275;
	var windowFeatures = "resizable=yes,width="+iwidth+",height="+iheight+",scrollbars="+isbars+",";
	windowFeatures = windowFeatures + "left=" + winLeft + ",";
	windowFeatures = windowFeatures + "top=" + winTop;
	newWindow = window.open("","View",windowFeatures);
	newWindow.document.write('<html><head><title>'+ititle+'</title><link href="/App_Themes/wilsonart/layout.css" rel="stylesheet" type="text/css" media="screen" /><meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /></head><body><center><img src="'+ ipath + '" border="0" class="imageBorder" /></center><p class="popUpParagraph">' + slogan + '</p><form><center><input type="button" value="Close Window" onClick="javascript:window.close();" class="buttonstyle" /></center></form></body></html>');
    newWindow.document.close();
	}
function popUpNewPg(ipage,iwidth,iheight,ioptions){
// Example Call:
// popUpNewPg('/tour/blueprint.aspx','375','490','scrollbars=no,resizable=yes,toolbar=no,location=no,menubar=no');"
	var newWindow;
	var newPage = ipage;
	//var winTop = (screen.height / 2) - 275;
	var winLeft = (screen.width / 2) - 275;
	var windowFeatures = "width="+iwidth+",height="+iheight+","+ioptions+",";
	windowFeatures = windowFeatures + "left=" + winLeft + ",";
	windowFeatures = windowFeatures + "top=10"; //+ winTop;
	newWindow = window.open(newPage,"View",windowFeatures);
	}