function MM_preloadImages() { //v3.0
		  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
			var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
		}

var cs_menu_timeout	= 500;
var cs_close_timer	= 0;
var cs_menu_item	= 0;

/*
// cs_menu_open
// Arguments:
// id		the id of the menu object to be shown
// slide	the slide number to direct the slideshow to
*/
function cs_menu_open(id, slide)
{

	if(id)
	{
		cs_menu_close_timer_cancel();
		
		if(cs_menu_item) cs_menu_item.style.display = 'none';
		
		cs_menu_item = document.getElementById(id);
		cs_menu_item.style.display = 'inline';
	}
	$('#home').innerFadeTo(slide - 1);
}

function cs_menu_close()
{
	if(cs_menu_item) cs_menu_item.style.display = 'none';
	
	slideshow_reset();
}

function cs_menu_close_timer()
{
	cs_close_timer = window.setTimeout(cs_menu_close, cs_menu_timeout);
}

function cs_menu_close_timer_cancel()
{
	if(cs_close_timer)
	{
		window.clearTimeout(cs_close_timer);
		cs_close_timer = null;
	}
}

document.onclick = cs_menu_close;

function subcatdivdisp(tmpcntno,tmpsubcatdivnm,tmpaction)
{
	// Redirect to new function. This function is depreciated.
	cs_menu_open(tmpsubcatdivnm, tmpcntno);
}

function subcatfaddivdisp(tmpsubcatdivnm,tmpaction)
{	
	alert('Something is still using this function. Look for subcatfaddivdisp('+tmpsubcatdivnm+','+tmpaction+') somewhere in your code.');
}

function slideshow_reset()
{
	$('#home').innerFadeUnbind();
	//$('#home').pauseSlideshow();
}

function HomePageCatalogueLink(tmpcatdivno)
{
	tmpsiteurl=GetSiteUrl();
	
	if(document.location.host=="www.comfortstyle.com.au")
	{
		if(tmpcatdivno==9)
			window.location.href=tmpsiteurl+"/furniture/clearance/1";
		else if(tmpcatdivno==10)
			window.location.href=tmpsiteurl+"/furniture/catalogue/1";
	}
	else
	{
		if(tmpcatdivno==9)
			window.location.href=tmpsiteurl+"/productlist.php?cat=cle";
		else if(tmpcatdivno==10)
			window.location.href=tmpsiteurl+"/productlist.php?cat=catalogue";
	}
}
