// JavaScript Document
function toggleBasket(){
	var o=document.getElementById("basketcontainer");
	var n=document.getElementById("nav");
	o.className = (o.className=="subbasket") ? "subbasket hidden" : "subbasket";
	n.className = (n.className=="navcontent navlong") ? "navcontent navshort" : "navcontent navlong";
}

function closeSplash(){
	document.getElementById("splash").className = "splash hidden";
	doFonts();
}

function hideforsplash(){
	document.getElementById("inline").className = "inlinecontent hidden";
}

function unhideforsplash(){
	document.getElementById("inline").className = "inlinecontent";
	doFonts();
}

function popup(url,winname,w,h,feat)
{
	if (!(isNaN(w) || isNaN(h)))
	{
		var x=parseInt((screen.width-w)/2);
		var y=parseInt((screen.height-h)/2);
		if (x<0)	x=0;
		if (y<0)	y=0;
		
		if (feat!=null && feat!="")
		{
			feat=","+feat;
		}
		else
		{
			feat="";
		}
		feat="left="+x+",top="+y+",width="+w+",height="+h+feat;
	}
	window.open(url,winname,feat);
}

function browserchecker(redirecturl){
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
	{ 
		//test for MSIE x.x;
		var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		if (ieversion<=6)
		{
			document.getElementById("rssmessage").innerHTML = "<strong>You are using IE6 which doesn't have an rss reader. The url for the rss feed is: " + "http://www.cafedirect.co.uk/" + redirecturl + "</strong>";
			//alert('You are using Internet Explorer 6, and will need to download a rss reader to view this content');
			return;
		}
	}
	location=dotdotpath+redirecturl;
}

function browserchecker2(redirecturl){
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
	{ 
		//test for MSIE x.x;
		var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		if (ieversion<=6)
		{
			document.getElementById("rssmessage").innerHTML = "<strong>You are using IE6 which doesn't have an rss reader. <a href='http://www.cafedirect.co.uk/" + redirecturl + "'>Click Here</a> for the RSS feed.</strong>";
			//alert('You are using Internet Explorer 6, and will need to download a rss reader to view this content');
			return;
		}
	}
	location=dotdotpath+redirecturl;
}

function browserchecker3(redirecturl){
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
	{ 
		//test for MSIE x.x;
		var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		if (ieversion<=6)
		{
			document.getElementById("mediarssmessage").innerHTML = "<strong>You are using IE6 which doesn't have an rss reader. <a href='http://www.cafedirect.co.uk/" + redirecturl + "'>Click Here</a> for the RSS feed.</strong>";
			//alert('You are using Internet Explorer 6, and will need to download a rss reader to view this content');
			return;
		}
	}
	location=dotdotpath+redirecturl;
}
