//#######################################################
function getCookie(name) {
	var index = document.cookie.indexOf("mstarcookie");
	//alert(index);
    if (index == -1) return null;
    index = document.cookie.indexOf("=", index) + 1;
    var endstr = document.cookie.indexOf(";", index);
    if (endstr == -1) endstr = document.cookie.length;
    return unescape(document.cookie.substring(index, endstr));
  }
var today = new Date();
var expiry = new Date(today.getTime() + 30 * 24 * 60 * 60 * 1000); 
var expired = new Date(today.getTime() - 30 * 24 * 60 * 60 * 1000); 


function check_cookie()
{
	var x = getCookie('mstarcookie')
	//alert(x);
	if (x == "net")
	{
		//var location=("http://stage.mstar.net/preportal/index.asp");
        // this.location.href = location;
	}
	if (x == "metro")
	{
		var location=("http://www.mstarmetro.com");
         this.location.href = location;
	}
	if (x == null)
	{
		var location=("http://www.mstar.net/mstar_splash.html");
         this.location.href = location;
	}
}
//#######################################################
