function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
	    for (var i = 0; i < changeImages.arguments.length; i += 2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadMenuImages() {
    if (document.images) {
		menu_home_over = newImage("images/menu_home-over.jpg");
		menu_products_over = newImage("images/menu_products-over.jpg");
		menu_knowledgecentre_over = newImage("images/informationCentre-over.gif");
		menu_aboutus_over = newImage("images/menu_aboutus-over.jpg");
		menu_contactus_over = newImage("images/menu_contactus-over.jpg");
		menu_sitemap_over = newImage("images/menu_sitemap-over.jpg");
		menu_profiles_over = newImage("images/menu_profiles-over.gif");
		preloadFlag = true;
	}
}

function openTour()
{
	var win = window.open();
	win.focus();
}

//-------------------------------------------------------------------------------------
/*
function divPosition(){
	if (document.all){
		divCompetition.style.pixelLeft = ((document.body.clientWidth/2)-(700/2))
		divCompetition.style.display = ''
		divFlash.style.display = 'none';
		divStatic.style.display = '';
	} else if (document.layers){
		document.divCompetition.style.display = ''
		document.divFlash.style.display = 'none'
		document.divStatic.style.display = ''
		document.divCompetition.left = ((window.innerWidth/2)-(document.divCompetition.width/2))
	} else {
		document.getElementById("divCompetition").style.display = ''
		document.getElementById("divCompetition").style.left = ((window.innerWidth/2)-(700/2))
		document.getElementById("divFlash").style.display = 'none'
		document.getElementById("divStatic").style.display = ''
	}
}

function killOverlay()
{
	document.getElementById("divCompetition").style.display = 'none'
	document.getElementById("divFlash").style.display = ''
	document.getElementById("divStatic").style.display = 'none'
}

function gotoPage()
{
	document.location = "Default.aspx";
	// change this to point to the calci-chews page
}

function FlashMovieControl(movieName) {
	// IE and Netscape refer to the movie object differently.
	// This function returns the appropriate syntax depending on the browser.
	if (navigator.appName.indexOf ("Microsoft") !=-1) {
		return window[movieName]
	} else {
		return document[movieName]
	}
}

function ShowMovie()
{
	divPosition();
	//FlashMovieControl('flashAdd1').play();
	setTimeout('killOverlay()',11000)
}
*/
//-------------------------------------------------------------------------------------
// flash code added by Dan2 (18/10/2004)
// detects flash player (kinda) and shows either movie or alt gif.

function detectflash(){
	var flash = false;
	noautoinstall = ""

	if(navigator.appName == "Microsoft Internet Explorer" && 
		(navigator.appVersion.indexOf("Mac") != -1 || 
		 navigator.appVersion.indexOf("3.1") != -1)){
			noautoinstall = "true";
	}

	if (navigator.appName == "Microsoft Internet Explorer" &&
		 noautoinstall != "true"){
			flash = true;
	}
	else if(navigator.plugins){
		if(navigator.plugins["Shockwave Flash"]){
			flash = true;
		}
	}
	return flash;
}


function writeFlash(strFlashSource, intWidth, intHeight, strBgcolor, strAlternativePic, strAlternativeLink){
	if (detectflash())
	{
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + intWidth + '" height="' + intHeight + '" id="gardensoundtrack" align="middle" VIEWASTEXT>');
	    document.write('	<param name="allowScriptAccess" value="sameDomain" />');	
		document.write('	<param name="movie" value="' + strFlashSource + '" />');	
		document.write('	<param name="quality" value="best" />');	
		document.write('	<param name="bgcolor" value="' + strBgcolor + '" />');	
		document.write('	<embed src="' + strFlashSource + '" quality="best" bgcolor="' + strBgcolor + '" width="' + intWidth + '" height="' + intHeight + '" name="gardensoundtrack" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');	
		document.write('</object>');
	}
	else
	{
		document.write('<a href="' + strAlternativeLink + '"><img src="' + strAlternativePic + '" border="0"/></a>');
	}
}


//-------------------------------------------------------------------------------------
		