/*** Browser Checker ***/
/*** Version: 1 **/
/*** Author: s birch ***/
/*** Usage: 

if(bw.ns7){alert('ns7')} 

***/


function cm_bwcheck(){
	this.name = navigator.appName;
	this.codename = navigator.appCodeName;
	this.ver=navigator.appVersion.substring(22,25);
	this.agent=navigator.userAgent.toLowerCase();
	this.platform = navigator.platform;
	this.screenWidth = screen.width;
  	this.screenHeight = screen.height;
	
	this.dom=document.getElementById?1:0;
	//opera
	this.op5=(this.agent.indexOf("opera 5")>-1 || this.agent.indexOf("opera/5")>-1) && window.opera;
  	this.op6=(this.agent.indexOf("opera 6")>-1 || this.agent.indexOf("opera/6")>-1) && window.opera;
	//ie
  	this.ie5 = (this.agent.indexOf("msie 5")>-1 && !this.op5 && !this.op6);
  	this.ie55 = (this.ie5 && this.agent.indexOf("msie 5.5")>-1);
  	this.ie6 = (this.agent.indexOf("msie 6")>-1 && !this.op5 && !this.op6);
	this.ie4=(this.agent.indexOf("msie")>-1 && document.all &&!this.op5 &&!this.op6 &&!this.ie5&&!this.ie6);
  	this.ie = (this.ie4 || this.ie5 || this.ie55 || this.ie6);
	//ns
	this.ns7=(this.agent.indexOf("netscape/7")>-1);
	this.ns62=(this.agent.indexOf("netscape6/6.2")>-1);
	this.ns6=(this.agent.indexOf("netscape6/6.0")>-1 || window.sidebar);
	this.ns4=(!this.dom && document.layers)?1:0;
	this.ns = (this.ns4 || this.ns6 || this.ns62 || this.ns7);
	//mac
	this.mac=(this.agent.indexOf("mac")>-1);
	this.mac_ns=(this.mac && this.ns>-1);
	this.mac_ie=(this.mac && this.ie>-1);
	
	this.bw=(this.ie6 || this.ie5 || this.ie55 || this.ie4 || this.ns4 || this.ns6 || this.ns62 || this.ns7 || this.op5 || this.op6 || this.mac || this.mac_ns || this.mac_ie);
  	this.usedom= (this.ns6 || this.ns62 || this.ns7);//Use dom creation
  	this.reuse = this.ie||this.usedom; //Reuse layers
  	this.px=this.dom&&!this.op5?"px":"";
	return this;
}
var bw=new cm_bwcheck();

//Document size object ********
function doc_size(){ //Page positions - needed!
	this.x=0;this.x2=document.body.clientWidth||window.innerWidth||0;
	if(bw.ns6) this.x2-=2
	this.y=0;this.y2=document.body.clientHeight||window.innerHeight||0;
	if(bw.ns6) this.y2-=4
	if(!this.x2||!this.y2) return message('Document has no width or height') 
	this.x50=this.x2/2;     this.y50=this.y2/2;
	this.x10=(this.x2*10)/100;this.y10=(this.y2*10)/100
	this.ytop=140*100/this.y2
	this.avail=(this.y2*(100-this.ytop))/100
	this.origy=this.y2
	return this;
	
}

