function GetBrowser()
{
	var sBrowser=navigator.userAgent.toLowerCase();

	if(sBrowser.indexOf("chrome") != -1)
	{
		return 'CHROME';
	}
	else if(sBrowser.indexOf("opera") != -1)
	{
		return 'OPERA';
	}
	else if(sBrowser.indexOf("netscape") != -1)
	{
		if(sBrowser.indexOf("msie") != -1){return 'IE';}
		else{return 'NETSCAPE';}
	}
	else if(sBrowser.indexOf("firefox") != -1)
	{
		return 'FIREFOX';
	}
	else if(sBrowser.indexOf("chrome") != -1)
	{
		return 'CHROME';
	}
	else if(sBrowser.indexOf("safari") != -1)
	{
		return 'SAFARI';
	}
	else if(sBrowser.indexOf("msie 7") != -1)
	{
		return 'IE7';
	}
	else if(sBrowser.indexOf("msie") != -1)
	{
		return 'IE';
	}
	else
	{
		return 'IE*';
	}
};

function GetScreenRes()
{
	var sHeight = screen.height;

	switch (GetBrowser())
	{
		case 'OPERA' :
			sHeight=(sHeight * 0.70);
			return sHeight;
		case 'NETSCAPE' :
			sHeight=sHeight-200;
			return sHeight;
		case 'IE' :
			sHeight=sHeight-250;
			return sHeight;
		case 'IE7' :
			sHeight=sHeight-250;
			return sHeight;
		case 'FIREFOX' :
			sHeight=sHeight-250;
			return sHeight;
	}
};

function GetScreenWidth()
{
	var sWidth = screen.width;
	sWidth=sWidth - (sWidth * 0.90);
	return Math.round(sWidth);
};

function GetScreenTop()
{
	var sTop = screen.height;
	sTop=sTop - (sTop * 0.88);
	return Math.round(sTop);
};

function ResizeCurrentWindow(w, h)
{ 
    var browser = GetBrowser();
    try
    {
        if(browser == 'CHROME')
        {   
            window.resizeTo(w + 10, h + 56);        
        }
        else
        {
         
            window.resizeTo(w, h);
            var myWidth = 0, myHeight = 0;
            if( typeof( window.innerWidth ) == 'number' ) {
            //Non-IE
            myWidth = window.innerWidth;
            myHeight = window.innerHeight;
            } 
            else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth;
            myHeight = document.documentElement.clientHeight;   
            myHeight = myHeight + 16;
            } 
            else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            //IE 4 compatible
            myWidth = document.body.clientWidth;
            myHeight = document.body.clientHeight;
            }
            
            var diffW = w - myWidth;
            var diffH = h - myHeight;
        }
    }
    catch(err)
    {
            return false;
    }   
}

function ResizeCurrentWindowForGame(w, h)
{ 
    var browser = GetBrowser();
    try
    {
        if(browser == 'CHROME')
        {   
            window.resizeTo(w + 10, h + 63);  
        }
        else
        {
         
            window.resizeTo(w, h);
            var myWidth = 0, myHeight = 0;
            if( typeof( window.innerWidth ) == 'number' ) {
            //Non-IE
            myWidth = window.innerWidth;
            myHeight = window.innerHeight;
            } 
            else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth;
            myHeight = document.documentElement.clientHeight;   
            myHeight = myHeight + 16;
            } 
            else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            //IE 4 compatible
            myWidth = document.body.clientWidth;
            myHeight = document.body.clientHeight;
            }
            
            var diffW = w - myWidth;
            var diffH = h - myHeight;
          
           if(browser == 'IE7')
           {
            	diffH = diffH + 15;
           	window.resizeTo(w + diffW -18, h + diffH);
           }
           else if (browser == 'IE')
           {
           	diffH = diffH + 14;
           	window.resizeTo(w + diffW, h + diffH + 2);
           }
           else
           {
           	window.resizeTo(w + diffW, h + diffH);
           }

        }
    }
    catch(err)
    {
            return false;
    }   
}