function iphonecheck(){
	//is it beign set in the get the string
	var mm = document.location.href.indexOf('nomobile');
	if(mm != -1)
	{
		//need to get the value
		mm=document.location.href.split('nomobile=');
		mm[1] = mm[1].split('&');
		mm=mm[1][0];
	}
	else
	{
		if(document.cookie.indexOf('nomobile') != -1)
		{
			var mm = document.cookie.split('nomobile=');
			mm[1] = mm[1].split(';');
			mm=mm[1][0];
		}
	}
	//alert(mm);
	document.cookie = 'nomobile=' + mm;
	if(mm == -1 && (navigator.userAgent.indexOf("iPhone") >= 0 || navigator.userAgent.indexOf("Android") >= 0))
	{
		//redirect
		//alert('Mobile found redirect shoudl begin');
		var urltest=document.location.href;
		var redurl='http://m.acu.edu.au';
		if(urltest.indexOf('www.acu.edu.au/courses/') != -1)
		{
			//courses
			redurl='http://m.acu.edu.au/nested_content/passon.php?to=' + urltest + '&mr=1';
		}
		else if(urltest.indexOf('www.acu.edu.au/library/'))
		{
			//where should we land
		}
		document.location = redurl;
	};
};
iphonecheck();
