function fix(id,min){
	//alert(window.navigator.userAgent);
	if(window.navigator.userAgent.indexOf("MSIE")<0)return;
	document.getElementById(id).style.width=((window.innerWidth||document.body.clientWidth)>min)?"100%":min+"px";
}

function pageHeight(content,textblock,footer){
	var windowHeight = parseInt(document.body.clientHeight);
	var rootHeight = parseInt(document.getElementById(content).offsetHeight);
	var vertHeight = parseInt(document.getElementById(textblock).offsetHeight);
	var footerHeight = parseInt(document.getElementById(footer).offsetHeight);
	if(windowHeight > vertHeight + footerHeight ){
		document.getElementById(content).style.height = windowHeight - footerHeight + "px";
	}
	else{
		document.getElementById(content).style.height = vertHeight + "px";
	}
}

/*mshover*/
function mshover() { 
	if (document.all&&document.getElementById("nav")) { 
		navRoot = document.getElementById("nav"); 
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i]; 
			//alert(node.className);
			if (node.nodeName=="DIV" && node.className=="item") { 
				node.onmouseover=function() { 
					this.className+=" over"; 
				} 
				node.onmouseout=function() { 
					this.className=this.className.replace
					(" over", ""); 
				}
			}
		}
	}
}

function openw(url,name,w1,h1)
{
w = window.open(url,name,'fullscreen=no,resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,width='+w1+', height='+h1+',scrollbars=yes');
w.focus();
}


function init() {
	if (arguments.callee.done) return;
	arguments.callee.done = true;
	if (_timer) {
		clearInterval(_timer);
		_timer = null;
	}
	// insert stuff here
	pageHeight('root','textblock','footer');
	mshover();
	// end of insert
};
/* for Mozilla */
if (document.addEventListener) {
	document.addEventListener("DOMContentLoaded", init, false);
}

/* for Internet Explorer */
/*@cc_on @*/
/*@if (@_win32)
	document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
	var script = document.getElementById("__ie_onload");
	script.onreadystatechange = function() {
		if (this.readyState == "complete") {
			init(); // call the onload handler
		}
	};
/*@end @*/

/* for Safari */
if (/WebKit/i.test(navigator.userAgent)) { // sniff
	var _timer = setInterval(function() {
		if (/loaded|complete/.test(document.readyState)) {
			init(); // call the onload handler
		}
	}, 50);
}

/* for other browsers */
window.onload = init;
