function browserCheck() 
{
	var b = navigator.appName;
	if (b == "Netscape") 
		this.b = "ns";
	else if (b == "Microsoft Internet Explorer") 
		this.b = "ie";
	else 
		this.b = b
	this.us = navigator.userAgent;
	
	//Opera check
	
	this.opera = this.us.indexOf("Opera");
	if(this.opera != -1){
		this.opera = true;
		this.b = "";
	}
	else {
		this.opera = false;
	}
	
	//Firefox Check
	
	this.firefox = this.us.indexOf("Firefox");
	if(this.us.indexOf("Firefox")!=-1){
		this.firefox = true;	
	}else{
		this.firefox = false;	
	}
	
	//DOM Check
	
	this.DOM = (document.createElement && document.getElementsByTagName);
	
	this.version = navigator.appVersion;
	if (this.b == 'ie')
	{ 
		var ve = this.version.indexOf("MSIE")
		this.v = parseInt(this.version.substr(ve+4))
	}
	else 
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v<5)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.ie55 = (this.version.indexOf('MSIE 5.5')>0)
	this.ie6 = (this.version.indexOf('MSIE 6')>0) 
	this.min = (this.ns||this.ie)
}//end BrowserCheck() 

is = new browserCheck();

function ScreenInfo()
{
	this.w=screen.width;
	this.h=screen.height;
}

scrinfo = new ScreenInfo();

function WindowProperty(){
	if(is.ie)
	{
		this.iH = document.body.clientHeight;
		this.iW = document.body.clientWidth;	
	}
	else
	{
		this.iH = window.outerHeight;
		this.iW = window.outerWidth;	
	}
}


function Initialize(homepage)
{
	WinProp = new WindowProperty();

	ObjContent = document.getElementById("content");
	ObjContainer = document.getElementById("container");
	ObjHeader = document.getElementById("header");
	ObjStyleSheet = document.getElementById("styles");
	
	preloadImg();	
	
	if(is.ie)
	{
		if(WinProp.iW<773 || scrinfo.w==800)
		{	
			if(homepage)
			{
				ObjStyleSheet.href="common/mainpage800.css";
			}
			else
				{
				ObjStyleSheet.href="common/internal800.css";
			}	
		}	
		
		if(WinProp.iW>773 && WinProp.iW<996)
			{
				ObjContainer.style.width = WinProp.iW;
				if(homepage)
				{
					ObjContent.style.width = WinProp.iW - 470;
				}
			}
			else if(WinProp.iW>996)
			{
				ObjContainer.style.width = "960px";
				if(homepage)
				{
				ObjContent.style.width = "500px";
				}
			}	
	}
	else
	{
		if(WinProp.iW<801 || scrinfo.w==800)
		{	
			ObjContainer.style.display = "none";

			if(homepage)
			{
				ObjStyleSheet.href="common/mainpage800.css";
			}
			else
			{
				ObjStyleSheet.href="common/internal800.css";
			}	
		}		
	}
	
	
	ObjContainer.style.display = "block";
}

var preloadFlag = false;

function preloadImg() {
	if (document.images) {
		Img01 = newImage("img/buttons/button-post-over.png");
		Img02 = newImage("img/buttons/button-clear-over.png");
		Img03 = newImage("img/buttons/button-buyit-over.png");
		Img04 = newImage("img/buttons/button-download-over.png");
		Img07 = newImage("img/buttons/button-post-over.png");
		Img08 = newImage("img/buttons/button-purchase-over.png");		
		Img09 = newImage("img/buttons/button-releasenotes-over.png");				
		Img11 = newImage("img/buttons/button-tryit-over.png");		
		preloadFlag = true;
	}
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
