function setMobileCookie()
{
var c_name = "mobile";
var value = "mobile";
var now = new Date();
var time = now.getTime();
time += 3600 * 1000;
now.setTime(time);
var c_value=escape(value) + ((time==null) ? "" : "; expires="+ now.toGMTString());
document.cookie=c_name + "=" + c_value;
}


function getMobileCookie(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);
    }
  }
}


function checkMobileCookie()
{
var mobile=getMobileCookie("mobile");
  if (mobile!=null && mobile!="")
  {
  //alert("Welcome again Mobile Phone");
  }
else 
  {
    {
    setMobileCookie();
    }
  }
}



// Start Redirects and Checks

var mobile = getMobileCookie("mobile");

if(document.referrer.match("http://m.protons.com")){
setMobileCookie()
//alert("start");

}

else if (mobile!=null && mobile!="")
{
//alert("Welcome again Mobile Phone");
}

else{


if (navigator.userAgent.match("Nokia"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("MOT-"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("Panasonic"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("SAMSUNG-SGH-"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("Sharp"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("SIE-"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("SonyEricsson"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("NEC-"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("Siemens"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("LG"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("Sony"))
window.location.href="http://m.protons.com"; 
else if(navigator.userAgent.match("Verizon"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("Cingular"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("Sprint"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("AT&T"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("Nextel"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("Palm"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("Handspring"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("HP"))
window.location.href="http://m.protons.com"; 
else if(navigator.userAgent.match("Tungsten"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("Treo"))
window.location.href="http://m.protons.com"; 
else if(navigator.userAgent.match("T-Mobile"))
window.location.href="http://m.protons.com"; 
else if(navigator.userAgent.match("Pocket PC"))
window.location.href="http://m.protons.com"; 
else if(navigator.userAgent.match("Dell"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("Compaq"))
window.location.href="http://m.protons.com"; 
else if(navigator.userAgent.match("Erikson"))
window.location.href="http://m.protons.com"; 
else if(navigator.userAgent.match("Orange"))
window.location.href="http://m.protons.com"; 
else if(navigator.userAgent.match("Casio"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("Symbol"))
window.location.href="http://m.protons.com"; 
else if(navigator.userAgent.match("Symbian"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("NEC"))
window.location.href="http://m.protons.com"; 
else if(navigator.userAgent.match("Toshiba"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("LG"))
window.location.href="http://m.protons.com"; 
else if(navigator.userAgent.match("Blackberry"))
window.location.href="http://m.protons.com"; 
else if(navigator.userAgent.match("Motorola"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("Samsung"))
window.location.href="http://m.protons.com"; 
else if(navigator.userAgent.match("HTC"))
window.location.href="http://m.protons.com"; 
else if(navigator.userAgent.match("iphone"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("ipod"))
window.location.href="http://m.protons.com";
else if(navigator.userAgent.match("ipad"))
window.location.href="http://m.protons.com";
else if (navigator.userAgent.match("droid"))
window.location.href="http://m.protons.com";
else if (screen.width <= 699)
window.location.href="http://m.protons.com";

}
