var DHTML = document.getElementById || document.all || document.layers;

window.load=checkCookie();

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function checkCookie()
	{
	wsize=getCookie('wsize');
	if (wsize!=null && wsize!="")
		{
		return;
		}
	else
		{
		alertSize()
		window.location.reload();
		}
	return;
	}

function alertSize()
	{
  	var myWidth = 0, myHeight = 0;
  	if( typeof( window.innerWidth ) == 'number' ) myWidth = window.innerWidth;
  	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) myWidth = document.documentElement.clientWidth;
    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) myWidth = document.body.clientWidth;
  	if(myWidth>=1280) myWidth="1152";
  	else myWidth="900";
	cname = "wsize";
	var exdate=new Date();
	exdate.setDate(exdate.getDate());
	document.cookie=cname+"="+myWidth;
	return;
	}
