//Thanks to www.cross-browser.com for some of this code

function crossBrowserObject(){

this.agent=navigator.userAgent.toLowerCase();
this.agent_major=parseInt(navigator.appVersion);
this.agent_minor=parseFloat(navigator.appVersion);
this.is_ie=(this.agent.indexOf('msie')!=-1);
this.is_nn=(this.agent.indexOf('mozilla')!=-1 && this.agent.indexOf('compatible')==-1);
this.is_op=(this.agent.indexOf('opera')!=-1);
if (this.is_op && (this.is_ie || this.is_nn)){
	this.is_ie=false;
	this.is_nn=false;
	this.is_op4=(this.agent.indexOf('opera 4')!=-1);
	this.is_op4up=(this.is_op4 || this.agent.indexOf('opera 5')!=-1);
	}
else {
this.is_op4=(this.is_op && this.agent_major==4);
this.is_op4up=(this.is_op && this.agent_major>=4);
}
this.is_ie4=(this.is_ie && this.agent_major==4);
this.is_ie4up=(this.is_ie && this.agent_major>=4);
this.is_nn4=(this.is_nn && this.agent_major==4);
this.is_nn4old=(this.is_nn4 && this.agent_minor<4.04);
this.is_nn6=(this.is_nn && this.agent_major==5);
if(!this.is_ie4up && !this.is_nn4 && !this.is_nn6 && !this.is_op4up){
	alert("This site does not presently support this browser. Supported browsers include Internet Explorer 4 and 5, Netscape 4 and 6, and Opera 5");
	}

	this.getStyleById=domGetStyleById;
	this.showEle=domShowEle;
	this.hideEle=domHideEle;
	this.eleLeft=domEleLeft;
	this.eleTop=domEleTop;

if (this.is_ie4up){
	this.getAvailableWidth=ieGetAvailableWidth;
	this.getAvailableHeight=ieGetAvailableHeight;
	this.getStyleById=ieGetStyleById;
	this.eleLeft=ieEleLeft;
	this.eleTop=ieEleTop;
}
if (this.is_nn4){
	this.getAvailableWidth=nnGetAvailableWidth;
	this.getAvailableHeight=nnGetAvailableHeight;
	this.getStyleById=nnGetStyleById;
	this.showEle=nnShowEle;
	this.hideEle=nnHideEle;
	this.eleLeft=nnEleLeft;
	this.eleTop=nnEleTop;
}
if (this.is_nn6){
	this.getAvailableWidth=nnGetAvailableWidth;
	this.getAvailableHeight=nnGetAvailableHeight;
}
if (this.is_op4up){
	this.getAvailableWidth=opGetAvailableWidth;
	this.getAvailableHeight=opGetAvailableHeight;
	this.eleLeft=ieEleLeft;
	this.eleTop=ieEleTop;
}
}

function ieGetAvailableWidth(){
	var w=0;
	w=document.body.clientWidth;
	return w;
}

function nnGetAvailableWidth(){
	var w=0;
	w=window.innerWidth;
	if (document.height>window.innerHeight){
		w-=16;
		}
	return w;
}

function opGetAvailableWidth(){
	var w=0;
	w=window.innerWidth;
	return w;
}

function ieGetAvailableHeight(){
	var h=0;
	h=document.body.clientHeight;
	return h;
}

function nnGetAvailableHeight(){
	var h=0;
	h=window.innerHeight;
	if (document.width>window.innerWidth){
		h-=16;
		}
	return h;
}

function opGetAvailableHeight(){
	var h=0;
	h=window.innerHeight;
	return h;
}

function ieGetStyleById(Id){
	var style=null;
	style=document.all[Id].style;
	return style;
}

function nnGetStyleById(Id){
	var style=null;
	style=document[Id];
	return style;
}

function domGetStyleById(Id){
	var style=null;
	style=document.getElementById(Id).style;
	return style;
}

function domShowEle(Id){
	this.getStyleById(Id).visibility="visible";
}

function nnShowEle(Id){
	this.getStyleById(Id).visibility="show";
}

function domHideEle(Id){
	this.getStyleById(Id).visibility="hidden";
}

function nnHideEle(Id){
	this.getStyleById(Id).visibility="hide";
}

function domEleLeft(Id,newLeft){
	if (arguments.length==2){
		this.getStyleById(Id).left=newLeft+"px";
		}
	return this.getStyleById(Id).left;
}

function ieEleLeft(Id,newLeft){
	if (arguments.length==2){
		this.getStyleById(Id).pixelLeft=newLeft;
		}
	return this.getStyleById(Id).pixelLeft;
}

function nnEleLeft(Id,newLeft){
	if (arguments.length==2){
		this.getStyleById(Id).left=newLeft;
		}
	return this.getStyleById(Id).left;
}

function domEleTop(Id,newTop){
	if (arguments.length==2){
		this.getStyleById(Id).top=newTop+"px";
		}
	return this.getStyleById(Id).top;
}

function ieEleTop(Id,newTop){
	if (arguments.length==2){
		this.getStyleById(Id).pixelTop=newTop;
		}
	return this.getStyleById(Id).pixelTop;
}

function nnEleTop(Id,newTop){
	if (arguments.length==2){
		this.getStyleById(Id).top=newTop;
		}
	return this.getStyleById(Id).top;
}


