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;	
	}
	
	this.version = navigator.appVersion;
	if (this.b == 'ie')
	{ // Internet Explorer aica?auaao '4.0 (compatible; MSIE 5.5...'
		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')>0) 
	this.ie7 = (this.version.indexOf('MSIE 7.0')>0) 
	this.min = (this.ns||this.ie)
}//end BrowserCheck() 

is = new browserCheck();

function WindowProperty(){
	if(is.ie){
		this.iH = document.body.clientHeight;
		this.iW = document.body.clientWidth;	
	}else{
		this.iH = window.innerHeight;
		this.iW = window.innerWidth;	
	}
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		//Img01 = newImage("images/home-over.png");
		preloadFlag = true;
	}
}

function Initialize(){

	preloadImages();
	
	WinProp = new WindowProperty();
	BodyHeight = document.body.offsetHeight;
	containerObj = document.getElementById("container");
	ContainerHeight =  containerObj.offsetHeight;
	FooterObj = document.getElementById("footer");
	

	
	
	if(BodyHeight > ContainerHeight){
		targetObj = FooterObj;
		ridgepoleHeight = BodyHeight - ContainerHeight;
/*		if(is.firefox){ridgepoleHeight = ridgepoleHeight + 8};*/
		ridgepole = document.createElement("DIV");
		ridgepole.style.height = ridgepoleHeight + "px";
		containerObj.insertBefore(ridgepole,targetObj); 
	}
	
	FooterObj.style.visibility = "visible";	
	

}

/*added by Maxim Function showBlock() allow to show/hide dynamically the text block on the web page*/
function showBlock(id) {
	if (document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display='inline';
	} 
	else {
		document.getElementById(id).style.display = 'none';
	}
}

function hideBlock(id) {
	if (document.getElementById(id).style.display == 'inline') {
		document.getElementById(id).style.display='none';
	} 
	else {
		document.getElementById(id).style.display = 'inline';
	}
}
