/* ---------------------------------------------------------------------------------------------------------------------------- */
/* Global Variables																																																							*/
/* ---------------------------------------------------------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------------------------------------------------------- */
/* Functions 																																																										*/
/* ---------------------------------------------------------------------------------------------------------------------------- */

/*
This is a workaround for an ie6 bug: http://support.microsoft.com/default.aspx?scid=kb;en-us;177378&Product=iep
Alters an iframe display from none -> inline
iframes override select elements in page positioning, as select elements do dot recognise z-index, so displays through dropdown menu
This is fixed in ie 7.....

To either enable or disable the fudge! set the iframe id of the relevant section to inline/none for both
ShowSpecificationSelects and HideSpecificationSelects

ie:
if ( document.getElementById("weights_model") )
{
	document.getElementById("weights_model").style.display = "inline";
}

*/
function ShowSpecificationSelects()
{
	/* Need to return to stop js warnings with no entries in function */
	ChangeProperty('menu_fix','','style.display','inline','DIV');
	return false;
}

/*
This is a workaround for an ie6 bug: http://support.microsoft.com/default.aspx?scid=kb;en-us;177378&Product=iep
Alters an iframe display from inline -> none
iframes override select elements in page positioning, as select elements do dot recognise z-index, so displays through dropdown menu
This is fixed in ie 7.....

To either enable or disable the fudge! set the iframe id of the relevant section to inline/none for both
ShowSpecificationSelects and HideSpecificationSelects

ie:
if ( document.getElementById("weights_model") )
{
	document.getElementById("weights_model").style.display = "none";
}

*/
function HideSpecificationSelects()
{
	/* Need to return to stop js warnings with no entries in function */
	ChangeProperty('menu_fix','','style.display','none','DIV');
	return false;
}

/* This works out the current action we are on and Loads the required Javascript if needed! */
function LoadFunction( circuit )
{
	switch( circuit )
	{
		/* Start the timer */
		case "vwcv.main":
			Timer();
			OfferTimer();
			break;
		
		/* Start the timer */
		case 'finance.introduction':
			Timer();
			break;
			
		/* Do nothing..... */
		default:
			break;
	}
}

/* Start the image rotation after a set time (to allow Flash elements to load beforehand) */
function Timer()
{
	//setTimeout('Element2DivShow()',4000);
	setTimeout('TopLeft1DivShow()',3500);
}
/* Start the image rotation after a set time (to allow Flash elements to load beforehand) */
function OfferTimer()
{
	//setTimeout('ShowCaddyMaxiOffer()',3500);
	setTimeout('ShowImageOne()',4000);
}
/* Start the image rotation after a set time (to allow Flash elements to load beforehand) */
function FinanceTimer()
{
	setTimeout('ShowFinanceOffer()',3500);
}

/* Rotates the left-upper homepage images */
function TopLeft1DivShow()
{
	return false;
	document.getElementById("top_left_element_1").style.visibility="visible";
	document.getElementById("top_left_element_2").style.visibility="hidden";
	setTimeout('TopLeft2DivShow()',4000);
}
function TopLeft2DivShow()
{
	return false;	
	document.getElementById("top_left_element_1").style.visibility="hidden";
	document.getElementById("top_left_element_2").style.visibility="visible";
	setTimeout('TopLeft1DivShow()',10000);
}

/* Rotates the homepage images */
function Element2DivShow()
{
	return false;	
	document.getElementById("offer_element_2").style.visibility="visible";
	document.getElementById("offer_element_3").style.visibility="hidden";
	setTimeout('Element3DivShow()',4000);
}
function Element3DivShow()
{
	return false;	
	document.getElementById("offer_element_2").style.visibility="hidden";
	document.getElementById("offer_element_3").style.visibility="visible";
	setTimeout('Element2DivShow()',4000);
}

/*
function Element2DivHide()
{
	document.getElementById("element_2").style.visibility="hidden";
	document.getElementById("element_1").style.visibility="visible";
	setTimeout('Element2DivShow()',4000);
}

/* Rotates the offers homepage images */
function ShowCaddyMaxiOffer()
{
	return false;
	document.getElementById("element_1").style.visibility="visible";
	document.getElementById("element_2").style.visibility="hidden";
	document.getElementById("element_3").style.visibility="hidden";
	setTimeout('ShowCaddyOffer()',2500);
}
function ShowCaddyOffer()
{
	return false;
	document.getElementById("element_1").style.visibility="hidden";
	document.getElementById("element_2").style.visibility="visible";
	document.getElementById("element_3").style.visibility="hidden";
	setTimeout('ShowTransporterOffer()',2500);
}
function ShowTransporterOffer()
{
	return false;
	document.getElementById("element_1").style.visibility="hidden";
	document.getElementById("element_2").style.visibility="hidden";
	document.getElementById("element_3").style.visibility="visible";
	setTimeout('ShowCaddyMaxiOffer()',2500);
}

/* Rotates the bottom right images */
function ShowImageOne()
{
	return false;
	document.getElementById("element_two_1").style.visibility="visible";
	document.getElementById("element_two_2").style.visibility="hidden";
	document.getElementById("element_two_3").style.visibility="hidden";
	document.getElementById("element_two_4").style.visibility="hidden";
	setTimeout('ShowImageTwo()',5000);
}
function ShowImageTwo()
{
	return false;
	document.getElementById("element_two_1").style.visibility="hidden";
	document.getElementById("element_two_2").style.visibility="visible";
	document.getElementById("element_two_3").style.visibility="hidden";
	document.getElementById("element_two_4").style.visibility="hidden";
	setTimeout('ShowImageThree()',5000);
}
function ShowImageThree()
{
	return false;
	document.getElementById("element_two_1").style.visibility="hidden";
	document.getElementById("element_two_2").style.visibility="hidden";
	document.getElementById("element_two_3").style.visibility="visible";
	document.getElementById("element_two_4").style.visibility="hidden";
	setTimeout('ShowImageFour()',5000);
}
function ShowImageFour()
{
	return false;
	document.getElementById("element_two_1").style.visibility="hidden";
	document.getElementById("element_two_2").style.visibility="hidden";
	document.getElementById("element_two_3").style.visibility="hidden";
	document.getElementById("element_two_4").style.visibility="visible";
	setTimeout('ShowImageOne()',5000);
}

/*
Reveal the details of each company in the conversions
converters section
*/

function Functionality_Conversions_Open(id) {
	ChangeProperty(id,'','style.display','block','DIV');
}

/*
Hide the details of each company in the conversions
converters section

*/
function Functionality_Conversions_Close(id,num_sections) {
	for (n=0;n<num_sections;n++)
	{
		ChangeProperty(id+n,'','style.display','none','DIV');
	}
}