// JavaScript Document
function getActiveLink(varPage, varLinkTitle, cssClass){
	var thisPage = this.location.href;
	var thisHost = this.location.protocol + "//" + this.location.host + "/";
	var newLink = "/" + thisPage.replace(thisHost, "");

	if (varPage==newLink){
		nav_class = cssClass;
		
	}else{
		nav_class = "";
	}
	document.write('<a href="' + varPage + '" class="' + nav_class + '">'+ varLinkTitle + '</a>');
	//alert(varPage);
	//alert(newLink);
	//alert('<a href="' + varPage + '" class="' + nav_class + '">'+ varLinkTitle + '</a>');
}

function clearForm(txtValue, id) {
	varText = document.getElementById(id).value;
	//alert(id);
	if ( varText== txtValue){
		document.getElementById(id).value = "";
	}
	if ( varText== ""){
		document.getElementById(id).value = txtValue;
	}
}
function openModal(id, content_id){
	if (window.innerHeight && window.scrollMaxY) {
		// Firefox         
		yWithScroll = window.innerHeight + window.scrollMaxY;         
		xWithScroll = window.innerWidth + window.scrollMaxX;     
		} else if (document.body.scrollHeight > document.body.offsetHeight){ 
		// all but Explorer Mac         
		yWithScroll = document.body.scrollHeight;         
		xWithScroll = document.body.scrollWidth;     
		} else { 
		// works in Explorer 6 Strict, Mozilla (not FF) and Safari         
		yWithScroll = document.body.offsetHeight;         
		xWithScroll = document.body.offsetWidth;       
	} 
	
	screenHeight =document.documentElement.clientHeight;
	//alert(yWithScroll);
	document.getElementById(content_id).style.display='block';
	document.getElementById('fade').style.height = yWithScroll + "px";
	document.getElementById('light').style.display='block';
	document.getElementById('fade').style.display='block';
	}
	

  
function getScreenCenterY() {   
	var y = 0;   
 	y = getScrollOffset()+(getInnerHeight()/2);   
	return(y);   
}   
  
function getScreenCenterX() {   
	return(document.body.clientWidth/2);   
}   
  
function getInnerHeight() {   
	var y;   
	if (self.innerHeight) // all except Explorer   
	{   
		y = self.innerHeight;   
	}   
	else if (document.documentElement && document.documentElement.clientHeight)   
	// Explorer 6 Strict Mode   
	{   
y = document.documentElement.clientHeight;   
}   
else if (document.body) // other Explorers   
{   
y = document.body.clientHeight;   
}   
return(y);   
}   
  
function getScrollOffset() {   
var y;   
if (self.pageYOffset) // all except Explorer   
{   
y = self.pageYOffset;   
}   
else if (document.documentElement && document.documentElement.scrollTop)   
// Explorer 6 Strict   
{   
y = document.documentElement.scrollTop;   
}   
else if (document.body) // all other Explorers   
{   
y = document.body.scrollTop;   
}   
return(y);   
}  
