// JavaScript Document
	var objStockSelectedTab;
	var objStockSelectedTabButton;

	function eKMODZpszbebNDQ()
	{
	/* Munged addy code - YOU CAN EDIT COMMENT THIS TAG BETWEEN THE TWO STARS */ 
	var PGVLfaxSxGIwTIu=["x74","97","x78","x66","x72","x65","101","46","x65","110","113","x75","x69","x72","121","64","101","109","99","x74","97","x78","x66","x72","x65","101","x2e","x63","111","x6d"];
	var OEqAJrVjkaZXqQa=[" "];
	var xDylHwOnlAKfpfg=["116","97","120","x66","114","101","x65","x2e","101","110","x71","117","105","x72","x79","x40","x65","x6d","99","116","97","x78","102","114","101","101","x2e","99","x6f","109"];
	document.write("<a href=\"&#x6d;&#x61;&#105;&#x6c;&#116;&#x6f;&#58;");
	for (i=0; i<PGVLfaxSxGIwTIu.length; i++) document.write("&#"+PGVLfaxSxGIwTIu[i]+";");
	for (i=0; i<OEqAJrVjkaZXqQa.length; i++) document.write(OEqAJrVjkaZXqQa[i]);
	document.write("\">");
	for (i=0; i<xDylHwOnlAKfpfg.length; i++) document.write("&#"+xDylHwOnlAKfpfg[i]+";");
	document.write('</a>');
	/* Munged addy code - YOU CAN EDIT COMMENT THIS TAG BETWEEN THE TWO STARS */
	}
	
	function mPLRJLhDgzHeWaf()
	{
	/* Munged addy code - YOU CAN EDIT COMMENT THIS TAG BETWEEN THE TWO STARS */
	/* SAYS "lick here to email us an enquiry" */
	var OFglRZjoInEeMQx=["116","x61","120","x66","x72","x65","101","x2e","x65","110","113","117","105","x72","x79","x40","101","109","x63","116","x61","x78","102","114","x65","101","46","99","x6f","x6d"];
	var numEtQtmGgGGRJe=[" "];
	var UNQRUkQKeBSSTVI=["x43","x6c","105","x63","107","x20","104","101","114","101","x20","116","x6f","x20","x65","x6d","97","105","x6c","x20","117","115","32","x61","x6e","32","x65","x6e","x71","117","105","114","121"];
	document.write("<a href=\"&#x6d;&#x61;&#x69;&#x6c;&#116;&#x6f;&#58;");
	for (i=0; i<OFglRZjoInEeMQx.length; i++) document.write("&#"+OFglRZjoInEeMQx[i]+";");
	for (i=0; i<numEtQtmGgGGRJe.length; i++) document.write(numEtQtmGgGGRJe[i]);
	document.write("\">");
	for (i=0; i<UNQRUkQKeBSSTVI.length; i++) document.write("&#"+UNQRUkQKeBSSTVI[i]+";");
	document.write('</a>');
	/* Munged addy code - YOU CAN EDIT COMMENT THIS TAG BETWEEN THE TWO STARS */
	}


	$(document).ready(function()
	{
		
		//handleOnChange_vehicle_type("selectModel", null);
		
		$(".vauxhall_astra_offers_vauxhall_corsa_offers_vauxhall_from_vauxhall_offers_models ul li img").bubbleup({tooltip: false, scale:126});

	   
		$(".tax_free_cars_header li").hover ( function ()
		{ 
		//	alert("mouse over");

			$(this).children("ul").fadeIn('fast');
			
		},
		function ()
		{

			$(this).children("ul").fadeOut('fast');
			
		})
		;
		
		$(".discount_on_new_vauxhall_cars_free_call_back").click ( function ()
		{
			$("#pagefade").css('filter', 'alpha(opacity=70)'); //IE8 Bug Fix
			$("#pagefade").fadeIn('fast');
			$("#callback").fadeIn('fast');
		});


		$(".vauxhall_offers_discounted_vauxhalls_live_chat").click ( function ()
		{
			window.open('http://dm1.contactatonce.co.uk/CaoClientContainer.aspx?MerchantId=84227&ProviderId=4855&PlacementId=1&OriginationUrl='+encodeURIComponent(location.href),'','resizable=yes,toolbar=no,menubar=no,location=no,scrollbars=no,status=no,height=400,width=600');

		});


		$(".vauxhall_offers_newsletter_signup_button").click ( function ()
		{
			$("#newsletter_email").attr("value", $("#email_address_newsletter").attr("value"));
			$("#pagefade").css('filter', 'alpha(opacity=70)'); //IE8 Bug Fix
			$("#pagefade").fadeIn('fast');
			$("#newsletter").fadeIn('fast');
		});


		$("#newsletter_title img#close").click ( function ()
		{
			$("#pagefade").fadeOut('fast');
			$("#newsletter").fadeOut('fast');
		});


		$("#callback_title img#close").click ( function ()
		{
			$("#pagefade").fadeOut('fast');
			$("#callback").fadeOut('fast');
		});
	   
		//Pricing help buttons clicked
		$(".stock_pricing div img").click ( function ()
		{
			$("#pagefade").css('filter', 'alpha(opacity=70)'); //IE8 Bug Fix
			$("#pagefade").fadeIn('fast');
			$("#popup_info").fadeIn('fast');
		   
		});
		$("#popup_title img#close").click ( function ()
		{
			$("#pagefade").fadeOut('fast');
			$("#popup_info").fadeOut('fast');
			$("#popup_info_link").fadeOut('fast');
		   
		});


	


		$(".stocklistingGradientBar .stocklist_reserve, .stock_detail_button_row .reserve_online").click ( function ()
		{
			document.payment_paypal.item_name_1.value = $(this).attr("carname");

			$("#popup_payment").fadeIn('fast');


			$("#pagefade").css('filter', 'alpha(opacity=70)'); //IE8 Bug Fix
			$("#pagefade").fadeIn('fast');
			
			
			
		   
		});
		$("#popup_payment img#close").click ( function ()
		{
			$("#pagefade").fadeOut('fast');
			$("#popup_payment").fadeOut('fast');
		   
		});


		$(".stock_detail_button_row .px, .stocklistingGradientBar .px").click ( function ()
		{
			
			window.open('https://www.emcgroup.org/emc_vauxhall_offers/partexchange.php','form_px','scrollbars=yes,resizable=yes,width=1024,height=768');
		});

		$(".stock_detail_button_row .finance, .stocklistingGradientBar .finance, .manufacturer_large_buttons .finance").click ( function ()
		{

			window.open('https://www.emcgroup.org/emc_vauxhall_offers/index.php','form_finance','scrollbars=yes,resizable=yes,width=1024,height=768');
		});

		//Enquiry POPUP
		$(".stocklistingGradientBar .stocklist_enquire, .manufacturer_enquire, .stock_detail_button_row .enquire").click ( function ()
		{
			
			vehicle = "";
			if ($(this).attr("carname") != null)
				vehicle = $(this).attr("carname");
			
			window.location.href = "enquiry.php?vehicle=" + vehicle;
			/*
			
			$("#enquiry #callback_title span").html("Enquire Now");
			$("#enquiry .callback_right").html("<p>Leave your details below and we'll get back to you.</p>");
			$("#enquiry_your_offer").css("display", "none");
			
			
			
			$("#form_enquiry_vehicle").attr("value", $(this).attr("carname"));
			$("#enquiry_response").css("display", "none");
			$("#enquiry").fadeIn('fast');

			$("#pagefade").css('filter', 'alpha(opacity=70)'); //IE8 Bug Fix
			$("#pagefade").fadeIn('fast');*/
		});

		//Make an offer POPUP
		$(".stock_detail_button_row .offer").click ( function ()
		{
			$("#enquiry #callback_title span").html("Make us an Offer");
			$("#enquiry .callback_right").html("<p>Why not make us an offer? Enter your details below, together with your <cite>sensible</cite> offer and we'll get back to you!</p>");
			$("#enquiry_your_offer").css("display", "block");
			
			$("#form_enquiry_vehicle").attr("value", $(this).attr("carname"));
			$("#enquiry_response").css("display", "none");
			$("#enquiry").fadeIn('fast');

			$("#pagefade").css('filter', 'alpha(opacity=70)'); //IE8 Bug Fix
			$("#pagefade").fadeIn('fast');
		});



/*
		$(".manufacturer_enquire").click ( function ()
		{
			$("#form_enquiry_vehicle").attr("value", $(this).attr("carname"));
			$("#enquiry_response").css("display", "none");
			$("#enquiry").fadeIn('fast');

			$("#pagefade").css('filter', 'alpha(opacity=70)'); //IE8 Bug Fix
			$("#pagefade").fadeIn('fast');
		});
*/

		
		$(".network_q_header li").hover (
			function ()
			{
				$(this).find(".network_q_content_expand").clearQueue();
				$(this).find(".network_q_content_expand").css("height", "330px");
				$(this).find(".network_q_content_expand").css("z-index", "1000");
				$(this).find(".network_q_content_expand").slideDown("fast");
/*				<div class="network_q_content_expand">content</div></li>*/
//				alert("in");	
			},
			function ()
			{
				$(this).find(".network_q_content_expand").clearQueue();
				$(this).find(".network_q_content_expand").slideUp("fast");
			}
			
											   
		);
		
		
		
		$("#enquiry img#close").click ( function ()
		{
			$("#pagefade").fadeOut('fast');
			$("#enquiry").fadeOut('fast');
		   
		});




		$(".cheap_vauxhall_antara_new_cars_search_left").click ( function ()
		{
			$("#tax_free_car_search_new").css("display", "block");
			$("#tax_free_car_search_used").css("display", "none");
			newOrUsed = "new";
			
		});
		$(".discount_vauxhall_corsa_used_cars_search_right").click ( function ()
		{
			$("#tax_free_car_search_new").css("display", "none");
			$("#tax_free_car_search_used").css("display", "block");
			newOrUsed = "used";
			
		});

		$(".stock_detail_small_links .print").click ( function ()
		{
			window.print();
		});
		$(".stock_detail_small_links .email").click ( function ()
		{
			window.location.href='mailto:?subject=Vauxhall Offers Website Link&Body=Hi, I found this website and thought you might like it: ' + window.location.href.replace(/&/g, "%26");
		});

		$(".whybusfromus").click ( function ()
		{
			window.location.href="why_buy_from_us.php";
		});

	   
	

		$(".stock_tabs_top div").click ( function ()
		{
			var strObjToActivate = "#" + $(this).attr("tabToActive");
		
			//Hide previous tab


			//If no previously selected tab, unselect first tab
			if ( typeof(objStockSelectedTab) == "undefined")
				objStockSelectedTab = $("#tab_features");
			if ( typeof(objStockSelectedTabButton) == "undefined")
				objStockSelectedTabButton = $("#tab_button_features");
			
			//Hide previous tab
			objStockSelectedTab.css("display", "none");
			objStockSelectedTabButton.css("border-bottom", "1px solid white");

			//Show new tab
			$(strObjToActivate).css("display", "block");
			$(this).css("border-bottom", "none");
			
			objStockSelectedTab = $(strObjToActivate);
			objStockSelectedTabButton = $(this);
	
		});
		/*
		$(".discount_vauxhall_corsa_used_cars_search_right").click ( function ()
		{
			$("#tax_free_car_search_new").css("display", "none");
			$("#tax_free_car_search_used").css("display", "block");
			newOrUsed = "used";
			
		});*/
/*
		//Load chat if someone online
	   var im = new Image();
	   im.onerror= function() {home_liveChat(this, 'off');}
	   im.onload= function() {home_liveChat(this, 'on');}
	   im.src = "http://dm1.contactatonce.co.uk/getagentstatusimage.aspx?MerchantId=84227&ProviderId=4855&PlacementId=1";
	   
	   
	   */
	   
	   
	});
	
	function home_liveChat(objIm, onOrOff)
	{

		if (onOrOff == "on" && objIm.height > 1)
		{
			$(".discount_on_new_vauxhall_cars_free_call_back").css("display", "none");
			$(".vauxhall_offers_discounted_vauxhalls_live_chat").css("display", "block");
		}
		else 
		{
//			$(".vauxhall_offers_discounted_vauxhalls_live_chat").css("display", "none");
	//		$(".discount_on_new_vauxhall_cars_free_call_back").css("display", "block");
			
		}
	}
	








