﻿function windowHeight(){

	if( typeof( window.innerHeight ) == 'number' ) {
		//Non-IE
		wHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		wHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientHeight ) ) {
		//IE 4 compatible
		wHeight = document.body.clientHeight;
	}

	return wHeight  + 1;
	
}				

originalWindowHeight = windowHeight;	

function windowWidth(){

	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		wWidth = window.innerWidth;
	} else if( document.documentElement && ( document.documentElement.clientWidth) ) {
		//IE 6+ in 'standards compliant mode'
		wWidth = document.documentElement.clientWidth;
	} else if( document.body && ( document.body.clientWidth ) ) {
		//IE 4 compatible
		wWidth = document.body.clientWidth;
	}
	
	wWidth = wWidth - 20;

	return wWidth;
	
}			

function refreshLayer(newHeight){
	
	if(document.getElementById("site") == null){
		return;
	}	

	if(wHeight == 0){
		wHeight = windowHeight();
	}
	tmpHeight = Math.round(newHeight);
	if(wHeight > tmpHeight){
		document.getElementById("site").style.height = wHeight+"px";
	}
	else{
		document.getElementById("site").style.height = tmpHeight+"px";
	}	
	
}

function scrollPosition(){
	
	scrOfY = 0;
	
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
	} else if( document.body && ( document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
	} else if( document.documentElement && ( document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
	}

	return scrOfY;

}

function scrollToTop(){

	window.scrollTo(0,0);
	
}						

function popUp(url,width,height){

	SWFAddress.popup(url,"","width="+width+",height="+height);
	
}

function resize()
{
	if(document.getElementById("site").resizeLayer != undefined){
		document.getElementById("site").resizeLayer();
	}
}	

wHeight=0;
wWidth=0;
window.onresize = resize;
