hld_documentReady("addEthanolMessageWindow");
hld_documentReady("addDisclaimerMessageWindow");
hld_documentReady("addFleetMessageWindow");
hld_documentReady("addEvaluationFormWindow");
hld_documentReady("addGoogleMapWindow");

function addGoogleMapWindow() {
	try {
		$("div.googlemap a").unbind(); 
		$("div.googlemap a").click(function() 
		 {		
			$("#loadAjaxMessage").jqmShow();
			$("#loadAjaxMessage").load("/Satellite?c=Page&pagename=Holden.com.au/Page/HLDDealersGoogleMap&cid=1220631020297 #gmap",
				 function(responseText) {
					fireOffPngFix();
					jQuery("#disclaimerPopupImage").attr('src', "/resources/images/Pagetitles/Page_headers/disclaimer.gif");	  
					jQuery("#closeWindow").attr('src', "/resources/images/popups/closePopup.gif");	 
					addDisclaimerCloseWindowButton();
				 } 
			 );
			 return false;
		 });
	} catch (err) {
		return false;
	}
}

function addEvaluationFormWindow() {
	try {
		$(".evaluationForm a").unbind(); 
		$(".evaluationForm a").click(function() {
			$("#inpregonumb").val('');
			var currentButton = this;
		  	$("#loadAjaxMessage").jqmShow();
			$("#loadAjaxMessage").load("/fleet/home #hpLogin2",
				 function(responseText) {
					$("#hpLogin2").show();
					$(".evaluationForm .error-registration").hide();
					fireOffPngFix();
					$("#disclaimerPopupImage").attr('src', hld_resource_path + "/images/Pagetitles/Page_headers/disclaimer.gif");	  
					$("#closeWindow").attr('src', hld_resource_path + "/images/popups/closePopup.gif");	 
					addDisclaimerCloseWindowButton();
				 } 
			 );
			 return false;
		 });
	} catch (err) {
		return false;
	}
}

function addFleetMessageWindow()
{
	try {
		$(".fleetDownload").unbind(); 
		$(".fleetDownload").click(function() 
		 {		
			var currentButton = this;
		  	$("#loadAjaxMessage").jqmShow();
			$("#loadAjaxMessage").load(hld_resource_path + "/html/BrochureDownload.html",
				 function(responseText)
				 {
					fireOffPngFix();
					$("#disclaimerPopupImage").attr('src', hld_resource_path + "/images/Pagetitles/Page_headers/disclaimer.gif");	  
					$("#closeWindow").attr('src', hld_resource_path + "/images/popups/closePopup.gif");	 
					addDisclaimerCloseWindowButton();
				 } 
			 );
			 return false;
		 });
	} catch (err) {
		return false;
	}
}

function addEthanolMessageWindow()
{
	try {
	$("#1220618342869-Bottom-GA").unbind();
	$("#1220618342869-Bottom-GA").click(function() 
	 {		
		var currentButton = this;
	  $("#loadAjaxMessage").css("left","40%");
	 	$("#loadAjaxMessage").jqmShow();
		$("#loadAjaxMessage").load(hld_resource_path + "/html/EthanolMessage.html",
			 function(responseText)
			 {
				fireOffPngFix();
				$("#disclaimerPopupImage").attr('src', hld_resource_path + "/images/Pagetitles/Page_headers/disclaimer.gif");	  
				$("#closeWindow").attr('src', hld_resource_path + "/images/popups/closePopup.gif");	 
				addDisclaimerCloseWindowButton();
			 } 
		 );
		 return false;
	 });
	} catch (err) {
		return false;
	}
}



function addDisclaimerMessageWindow()
{
	try {
		$("#loadAjaxMessage").jqm({toTop: true});
		$("#1220581998271-Bottom-GA").unbind();
		$("#1220581998271-Bottom-GA").click(function() 
		 {
			var currentButton = this;
			$("#loadAjaxMessage").jqmShow();
			$("#loadAjaxMessage").load(hld_resource_path + "/html/DisclaimerMessage.html",
				 function(responseText)
				 {
					fireOffPngFix();
					$("#disclaimerPopupImage").attr('src', hld_resource_path + "/images/Pagetitles/Page_headers/disclaimer.gif");	  
					$("#closeWindow").attr('src', hld_resource_path + "/images/popups/closePopup.gif");	 
					addDisclaimerCloseWindowButton();
				 } 
			 );
			 return false;
		 });
	} catch (err) {
		return false;
	}
}

function addDisclaimerCloseWindowButton()
{
	$("#closeWindowLink").unbind();
	$("#closeWindowLink").click(function() 
	 {
		var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1);
		var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);
//		if (jQuery.browser.msie && (ie55 || ie6)) 
//			alert("Close button clicked");
		$("#loadAjaxMessage").jqmHide();
		return false;
	 });
}



function addImportantInfoWindow()
{
	$("#loadAjaxMessage").jqm({toTop: true});
	$("#1220612194429-Bottom-GA").unbind();
	$("#1220612194429-Bottom-GA").click(function() 
	 {
		var currentButton = this;
		$("#loadAjaxMessage").jqmShow();
		$("#loadAjaxMessage").load(hld_resource_path + "/html/ImportantMessage.html",
			 function(responseText)
			 {
				fireOffPngFix();
				$("#disclaimerPopupImage").attr('src', hld_resource_path + "/images/Pagetitles/Page_headers/disclaimer.gif");	  
				$("#closeWindow").attr('src', hld_resource_path + "/images/popups/closePopup.gif");	 
				addDisclaimerCloseWindowButton();
			 } 
		 );
		 return false;
	 });
}


function addBuildAndPriceWindow()
{
	$("#loadAjaxMessage").jqm({toTop: true});
	$("#1220612194429-Bottom-GA").unbind();
	$("#1220612194429-Bottom-GA").click(function() 
	 {
		var currentButton = this;
		$("#loadAjaxMessage").jqmShow();
		$("#loadAjaxMessage").load(hld_resource_path + "/html/BuildAndPriceMessage.html",
			 function(responseText)
			 {
				fireOffPngFix();
				$("#disclaimerPopupImage").attr('src', hld_resource_path + "/images/Pagetitles/Page_headers/disclaimer.gif");	  
				$("#closeWindow").attr('src', hld_resource_path + "/images/popups/closePopup.gif");	 
				addDisclaimerCloseWindowButton();
			 } 
		 );
		 return false;
	 });
}