function rollover(id, state)
{
	var img = id+'_'+state;

	if(state=='')
		img = id;

	document.getElementById(id).src=eval(img + '.src');
}

/////////////////////////////////////////////////////////////////////

function divHeight(idHeight, idChange,subValue,ieValue)
{
	var h = document.getElementById(idHeight);
	var obj = document.getElementById(idChange);

	height = h.offsetHeight;

	if(navigator.appName!='Microsoft Internet Explorer')
		height-=20;

	if(navigator.appName=='Microsoft Internet Explorer')
	{
		if(ieValue!='undefined' && ieValue!=null)
			height-=ieValue;
	}

	if(subValue!='undefined' && subValue!=null)
		height-=subValue;

	//alert(height);
	if(obj!=null && obj!='undefined')
		obj.style.height=height+'px';
}

/////////////////////////////////////////////////////////////////////

// Set Footer at bottom of page

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

/////////////////////////////////////////////////////////////////////

function setFooter()
{
	if (document.getElementById)
	{
		var windowHeight = getWindowHeight();
		if (windowHeight > 0)
		{
			var content = document.getElementById('container');
			var subcontent = document.getElementById('subcontainer');

			/*if((content!='undefined' || content!=null) && (subcontent!='undefined' || subcontent!=null)) {
				contentHeight = content.offsetHeight+subcontent.offsetHeight;
			}
			else*/ if(content=='undefined' || content==null)
				var contentHeight = 370;
			else
				var contentHeight = content.offsetHeight;

			if(subcontent!=null && subcontent!="undefined")
			{
				contentHeight=eval(contentHeight);
				contentHeight+=subcontent.offsetHeight;
			}


			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			
			
			
			if (windowHeight - (contentHeight + footerHeight + 130) >= 0) {
				footerElement.style.position = 'absolute';

				if(navigator.appName=='Microsoft Internet Explorer')
				{
					if(content=='undefined' || content==null)
						footerElement.style.top = (windowHeight - footerHeight - 20) + 'px';
					else
						footerElement.style.top = (windowHeight - footerHeight) + 'px';
				}
				else
					footerElement.style.top = (windowHeight - footerHeight) + 'px';
			}
			else {
				if(navigator.appName=='Microsoft Internet Explorer')
					footerElement.style.top = contentHeight + 150 + 'px';
				else
					footerElement.style.top = contentHeight + 100 + 'px';

				footerElement.style.position = 'absolute';
			}
		}
	}
document.getElementById('footer').style.visibility = "visible";
}
window.onload = function() {
	setFooter();
}
window.onresize = function() {
	setFooter();
}

/////////////////////////////////////////////////////////////////////

function popUp(URL)
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=502,height=450,left = 50%,top = 50%');");
}

