function redirectCheck(url){
	if (isMobile()){
		var cookie = checkCookie();
		var redirectFirstTimeOnly = true;
		//alert(cookie);
		if(!cookie || !redirectFirstTimeOnly){
			window.location = url;
		}
	}
}

function isMobile(){
	return /(iphone|ipod|android|blackberry|windows ce|palm|symbian)/i.test(navigator.userAgent);
}

function checkCookie(){
	var visitedInLast20Min = getCookie("bytelabMobile");
	if(visitedInLast20Min == "true"){
		//Dont redirect
		return true;
	} else {
		//Redirect and set cookie
		setCookie("bytelabMobile","true",20);
		return false;
	}
}
function setCookie(c_name,value,minutes){
	var exdate=new Date();
	exdate.setTime(exdate.getTime() + (minutes*60*1000));
	var c_value=escape(value) + ((minutes==null) ? "" : "; expires="+exdate.toUTCString());
	document.cookie=c_name + "=" + c_value;
}
function getCookie(c_name){
	var i,x,y,ARRcookies=document.cookie.split(";");
	for (i=0;i<ARRcookies.length;i++){
		x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
		y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
		x=x.replace(/^\s+|\s+$/g,"");
		if (x==c_name){
			return unescape(y);
		}
	}
}
