// $Id: loreal.js 2218 2006-03-16 01:23:49Z chrisa $ 

function dom_browser() {
	// browser identification based on dom capabilities
	this.myNav = this.navigator;
	this.version = this.navigator.appVersion;
	this.name = this.navigator.appName;
	this.ns4 = (document.layers) ? true : false;
	this.dom = (document.getElementById) ? true : false;
	this.ie4 = (document.all) ? true : false;
	this.mac = (this.version.indexOf("Mac") != -1) ? true : false;
	this.ie = (this.version.indexOf("MSIE") != -1) ? true : false;
	this.windows = (this.version.indexOf("Windows") != -1) ? true : false;
	this.hasPlugins = (this.navigator.plugins) ? true : false;
	this.ie6 = (this.version.indexOf("MSIE") != -1 && this.version.indexOf("6") != -1) ? true : false; 
		// to determine whether user is using IE version 6+
	this.ns = (this.version.indexOf("5.0 (Windows; en-US)") != -1) ? true : false; 
		// to detect Netscape browser
}
dom_browser();

// extends the globalWrap div so that the background will extend 100% vertically
function drawBg(){
	var myHeight;
	if(document.getElementById("globalWrap")) {
		document.getElementById("globalWrap").style.height = "";
		if(ie){ // for IE browsers
			if(ie6){ // for IE 6
				myHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : 0;
			} else if (mac && ie) { // for mac IE
				myHeight = document.body.offsetHeight;
			} else{ // for all other IE browsers
				myHeight = document.body.clientHeight ? document.body.clientHeight : 0;
			}
		} else if(ns){ // for Netscape browsers
			if(document.body.offsetHeight >= window.innerHeight){ 
				myHeight = document.getElementById("globalWrap").offsetHeight;
			}else{
				myHeight = window.innerHeight ? window.innerHeight : 0;
			}
		} else{ // for all other browsers
			if(document.body.scrollHeight > window.innerHeight){ 
				myHeight = document.getElementById("globalWrap").scrollHeight;
			}else{
				myHeight = window.innerHeight ? window.innerHeight : 0;
			}
		}
		document.getElementById("globalWrap").style.height= myHeight + "px"; 
	}
}

window.onload = drawBg;
window.onresize = drawBg;
