
var hold;
hold=1000*3600*24;

var exdate=new Date();
exdate=new Date(exdate.getTime()+hold);
exdate=exdate.toGMTString();
PlugFrame="";
MessageFrame="";



function checkBrowser()
{
   	this.ver=navigator.appVersion;
   	this.dom=document.getElementById?1:0;
   	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
   	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
   	this.ie4=(document.all && !this.dom)?1:0;
   	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
   	this.ns4=(document.layers && !this.dom)?1:0;
   	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5);
	
	var bwt="0";

	if(this.ie4)
	{
		bwt="IE4";
	}

	if(this.ie5)
	{
		bwt="IE5";
	}

	if(this.ie6)
	{
		bwt="IE6";
	}

	if(this.ns4)
	{
		bwt="NS4";
	}

	if(this.ns5)
	{
		bwt="NS5";
	}
	
	document.cookie = "bwtype="+bwt+"; expires="+exdate;
	
   	return this;
}

var bw=new checkBrowser();

function getobjbyid(obj)
{								
	return bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj].document:0;
}

window.onscroll = OnScroll;

function OnScroll()
{
	if(MessageFrame)
	{
		MessageFrameOnScroll();
	}

	if(PlugFrame)
	{
		PlugFrameOnScroll();
	}
}

function newwindow(href, params)
{
	window.open(href, "_blank", params);
	return false;
}


function NW(url,wind)
{var target_win=window.open(url, wind, 'toolbar=no,location=no,status=no,menubar=no,resizable=no,directories=no,scrollbars=no,width='+240+'');
}


function emptynewwindow(href)
{
	newwindow(href, "width=1 , height=1 , resizable=no")
}

function selfwindow(href)
{
	window.open(href, "_self");
	return false;
}

function selfwindowconfirm(href, confirmstr)
{
	if(window.confirm(confirmstr))
		window.open(href, "_self");
	return false;
}


function clearPreloadPage()
{ //DOM
	if (document.getElementById)
	{
		document.getElementById('prepage').style.visibility='hidden';
	}
	else
	{
		if (document.layers)
		{ //NS4
			document.prepage.visibility = 'hidden';
		}
		else
		{ //IE4
			document.all.prepage.style.visibility = 'hidden';
		}
	}
}


