var win=null;

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 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.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}
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 preloadImages() {
  MM_preloadImages('/images/home_bar.gif','/images/1_bar.gif','/images/2_bar.gif',
  '/images/3_bar.gif','/images/4_bar.gif','/images/5_bar.gif');
}
function preloadComImages() {
  MM_preloadImages('/images/home_bar.gif','/images/c_1_bar.gif','/images/2_bar.gif',
  '/images/c_3_bar.gif','/images/c_4_bar.gif','/images/c_5_bar.gif');
}
function openWindow(windowName, url, option) {
  var winWidth = 733;
  var winHeight = 471;
  var xPos = (screen.availWidth-winWidth)/2;
  var yPos = (screen.availHeight-winHeight)/2;

  //For external site pop ups
  if (option==1) {options = "directories=yes,status=yes,menubar=yes,personalbar=yes,titlebar=yes,toolbar=yes,location=yes,top=" + yPos + ",left=" + xPos + ",width=" + winWidth + ",height=" + winHeight +",resizable=yes,scrollbars=yes";}
  //For Video pop ups
  if (option==2) {options = "top=" + yPos + ",left=" + xPos + ",width=650" + ",height=395"  +",resizable=no";}
  //For pop up files (jpg, pdf)
  if (option==3) {options = "menubar=no,personalbar=no,titlebar=no,toolbar=no,location=no,top=" + yPos + ",left=" + xPos + ",width=" + winWidth + ",height=" + winHeight +",resizable=yes,scrollbars=yes";}

  if (option==4) {options = "menubar=no,personalbar=no,titlebar=no,toolbar=no,location=no,top=" + yPos + ",left=" + xPos + ",width=472,height=675,resizable=yes,scrollbars=no";}
  //For Flash pop ups
  if (option==5) {options = "top=" + yPos + ",left=" + xPos + ",width=750" + ",height=490"  +",resizable=no";}
   // For definitions
  if (option==6) {options = "top=" + yPos + ",left=" + xPos + ",width=350" + ",height=190"  +",resizable=no,scrollbars=yes";}
  if (option==7) {options = "top=" + yPos + ",left=" + xPos + ",width=415" + ",height=380"  +",resizable=no,scrollbars=yes";}
  // For dealer map
  if (option==8) {options = "top=" + yPos + ",left=" + xPos + ",width=750" + ",height=490"  +",resizable=yes,scrollbars=yes,toolbar=no,menubar=yes";}

 // stupid ibm  if (win &&(!win.closed)) {win.close();}

  win=window.open(url, windowName, options);
}
