
// Known Used Functions

//PrintBook Popup
function PrintBookPopUp(theURL,winName) { 
window.open(theURL,winName,'width=608,height=400,screenX=10,screenY=10,top=10,left=10,scrollbars=yes,menubar=no');
}




//
//
// -- Following functions are not being used as far as I know and will be deleted at 
// a later stage.... If you think that they are being used then please move them up.
//
//
//


window.onError=errHandler;

function errHandler(message, url, line){
  return true;
}

var p;

//Generic Popup window
function genPopUp(theURL, winName, myWidth, myHeight) { 
var winHandle;
winHandle=window.open(theURL,winName,'width=' + myWidth + ',height=' + myHeight + ',screenX=10,screenY=10,top=10,left=10,scrollbars=no');
winHandle.close();
winHandle=window.open(theURL,winName,'width=' + myWidth + ',height=' + myHeight + ',screenX=10,screenY=10,top=10,left=10,scrollbars=no');
}

//Popup1 window width=470,height=395 used in model/content topnav
function popUp(theURL,winName) {
window.open(theURL,winName,'width=475,height=375,screenX=10,screenY=10,top=10,left=10');
}
//Popup2 window width=300,height=350 used with PopCon, PattOrd
function popUp2(theURL,winName) { 
window.open(theURL,winName,'width=300,height=350,screenX=10,screenY=10,top=10,left=10');
}
//Popup3 window width=450,height=20 used in Equipt. Groups
function popUp3(theURL,winName) { 
window.open(theURL,winName,'width=450,height=10,screenX=10,screenY=10,top=10,left=10,scrollbars=yes');
}
//Popup4 window width=450,height=395 used with Seats
function popUp4(theURL,winName) { 
window.open(theURL,winName,'width=450,height=395,screenX=10,screenY=10,top=10,left=10,scrollbars=no');
}
//Popup5 window width=450,height=400 
function popUp5(theURL,winName) { 
window.open(theURL,winName,'width=608,height=400,screenX=10,screenY=10,top=10,left=10,scrollbars=yes');
}
//Popup6 window used in color&Trim for car color popups
function popUp6(theURL,winName) { 
window.open(theURL,winName,'width=450,height=285,screenX=10,screenY=10,top=10,left=10,scrollbars=no');
}
//Popup7 window used in color&Trim for multi car color popups
function popUp7(theURL,winName) { 
window.open(theURL,winName,'width=450,height=450,screenX=10,screenY=10,top=10,left=10,scrollbars=yes');
}
//Popup8 window width=450,height=400 
function popUp8(theURL,winName) { 
window.open(theURL,winName,'width=500,height=430,screenX=10,screenY=10,top=10,left=10,scrollbars=no');
}
//Popup9 window width=450,height=400 
function popUp9(theURL,winName) { 
window.open(theURL,winName,'width=608,height=400,screenX=10,screenY=10,top=10,left=10,scrollbars=yes,menubar=no');
}
//---------------------------------------------------------------------
var cnting=0;
var sec=0;

function backPreview(){
setTimeout("backPreview2()",1000);
}
function backPreview2(){
 popUp5('popConSet.htm','color','width=535,height=275')
 };

function chkForSelected2(){
var retVal=0;
for (var i=0;i<parent.popConContent.document.frmPrintCheck.elements.length;i++)
{
  if(parent.popConContent.document.frmPrintCheck.elements[i].checked==true)
  {
     retVal = 1;
     break;
  }
}
return(retVal);
}

function printPreview(){
setTimeout("printPreview2()",1000);
}

function printPreview2(){
if (chkForSelected2()==1)
{
parent.popConTop.document.location.replace('popcontop3.htm');
//parent.popConTop.document.location.reload();
parent.popConContent.document.frmPrintCheck.submit();
}
else
{
alert("You have not selected any item(s) to print...");
}
}

function calcServlet(brandName) {

  var myindex = 0;
  var ind = parent.parent.a.document.vehicle.select.selectedIndex;

  if (brandName == "CHT")
    myindex = parent.parent.a.document.vehicle.select.selectedIndex-1;
   else if(brandName == "GMC")
    myindex = parent.parent.a.document.vehicle.select.selectedIndex+36;	

    var page = "/servlet/calc2002.DcibrandServlet?brand=" + myindex;

genPopUp(page,"Calculator",750,600);
}

