$("cx7").onmouseover = function () {this.className = "over";showPopup("cx7");clearPopUpTimeout();}
$("cx7").onmouseout = function () {this.className = "";hideModelPopup();}
$("cx7").onclick = function () {window.location="/searchnewv.aspx?model=cx-7&hpForm=1";}

$("cx7_p").onmouseover = function () {showPopup("cx7");clearPopUpTimeout();}
$("cx7_p").onmouseout = function () {hideModelPopup();}
//_________________
$("cx9").onmouseover = function () {this.className = "over";showPopup("cx9");clearPopUpTimeout();}
$("cx9").onmouseout = function () {this.className = "";hideModelPopup();}
$("cx9").onclick = function () {window.location="/searchnewv.aspx?model=cx-9&hpForm=1";}

$("cx9_p").onmouseover = function () {showPopup("cx9");clearPopUpTimeout();}
$("cx9_p").onmouseout = function () {hideModelPopup();}

//_________________
$("mazda3").onmouseover = function () {this.className = "over";showPopup("mazda3");clearPopUpTimeout();}
$("mazda3").onmouseout = function () {this.className = "";hideModelPopup();}
$("mazda3").onclick = function () {window.location="/searchnewv.aspx?model=mazda3&hpForm=1";}

$("mazda3_p").onmouseover = function () {showPopup("mazda3");clearPopUpTimeout();}
$("mazda3_p").onmouseout = function () {hideModelPopup();}
//_________________
$("mazda5").onmouseover = function () {this.className = "over";showPopup("mazda5");clearPopUpTimeout();}
$("mazda5").onmouseout = function () {this.className = "";hideModelPopup();}
$("mazda5").onclick = function () {window.location="/searchnewv.aspx?model=mazda5&hpForm=1";}

$("mazda5_p").onmouseover = function () {showPopup("mazda5");clearPopUpTimeout();}
$("mazda5_p").onmouseout = function () {hideModelPopup();}
//_________________
$("mazda6").onmouseover = function () {this.className = "over";showPopup("mazda6");clearPopUpTimeout();}
$("mazda6").onmouseout = function () {this.className = "";hideModelPopup();}
$("mazda6").onclick = function () {window.location="/searchnewv.aspx?model=mazda6&hpForm=1";}

$("mazda6_p").onmouseover = function () {showPopup("mazda6");clearPopUpTimeout();}
$("mazda6_p").onmouseout = function () {hideModelPopup();}
//_________________
$("miata").onmouseover = function () {this.className = "over";showPopup("miata");clearPopUpTimeout();}
$("miata").onmouseout = function () {this.className = "";hideModelPopup();}
$("miata").onclick = function () {window.location="/searchnewv.aspx?model=miata&hpForm=1";}

$("miata_p").onmouseover = function () {showPopup("miata");clearPopUpTimeout();}
$("miata_p").onmouseout = function () {hideModelPopup();}

//_________________
$("rx8").onmouseover = function () {this.className = "over";showPopup("rx8");clearPopUpTimeout();}
$("rx8").onmouseout = function () {this.className = "";hideModelPopup();}
$("rx8").onclick = function () {window.location="/searchnewv.aspx?model=rx-8&hpForm=1";}


$("rx8_p").onmouseover = function () {showPopup("rx8");clearPopUpTimeout();}
$("rx8_p").onmouseout = function () {hideModelPopup();}

//_________________
$("tribute").onmouseover = function () {this.className = "over";showPopup("tribute");clearPopUpTimeout();}
$("tribute").onmouseout = function () {this.className = "";hideModelPopup();}
$("tribute").onclick = function () {window.location="/searchnewv.aspx?model=tribute&hpForm=1";}

$("tribute_p").onmouseover = function () {showPopup("tribute");clearPopUpTimeout();}
$("tribute_p").onmouseout = function () {hideModelPopup();}

var vehicleModels = new Array();
vehicleModels[0] = "cx7";
vehicleModels[1] = "cx9";
vehicleModels[2] = "mazda3";
vehicleModels[3] = "mazda5";
vehicleModels[4] = "mazda6";
vehicleModels[5] = "miata";
vehicleModels[6] = "rx8";
vehicleModels[7] = "tribute";

function showPopup(currentModel){
if($("modelsPopUp").style.display == "none"){
 $("modelsPopUp").style.display = "block";
 }
 for(var i = 0; i < vehicleModels.length; i++){
  if(vehicleModels[i] == currentModel){
 	 	$(vehicleModels[i]+'_p').style.display = "block";
			$(vehicleModels[i]+'_p').style.zIndex = 999;
  }
 	else{
 	 $(vehicleModels[i]+'_p').style.display = "none";
	 $(vehicleModels[i]+'_p').style.zIndex = 1;
  }

 }

}

 var popupTimeout;
function hideModelPopup(){ popupTimeout = setTimeout('new Effect.Fade("modelsPopUp");', 200); }
function clearPopUpTimeout(){  clearTimeout(popupTimeout); }

 