//show floating div on mouse over, for construction pages
var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
	rX = self.pageXOffset;
	rY = self.pageYOffset;
	}
else if(document.documentElement && document.documentElement.scrollTop) {
	rX = document.documentElement.scrollLeft;
	rY = document.documentElement.scrollTop;
	}
else if(document.body) {
	rX = document.body.scrollLeft;
	rY = document.body.scrollTop;
	}
if(document.all) {
	cX += rX; 
	cY += rY;
	}
d.style.left = (cX+10) + "px";
d.style.top = (cY-30) + "px";
}
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}
 
 

// facebook, twitter and rss floating div
function handle_div(){
	if (navigator.appName.indexOf("Microsoft")!=-1) {
		//toppos = document.body.clientHeight / 2 + 100;
		leftpos = document.body.clientWidth / 2 + 485;
	}
	else{
		//toppos = window.innerHeight / 2 - 100;
		leftpos = window.innerWidth / 2 + 485;
	}
	//document.getElementById('div_layer').style.top = toppos; 
	document.getElementById("div_layer").style.left = leftpos + 'px';
	//alert(leftpos + 'px');
}


// JavaScript Document
function NewWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { 
		win.window.focus(); 
	}
}

/* Bookmark site script
/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}

function hideemail() {
	if (document.subscribeform.EMAIL.value == 'enter email...') {
		document.subscribeform.EMAIL.value = '';
	}
}
function showemail() {
	if (document.subscribeform.EMAIL.value == '') {
		document.subscribeform.EMAIL.value = 'enter email...';
	}
}

function hidesearch() {
	if (document.search.keyword.value == 'Search...') {
		document.search.keyword.value = '';
	}
}
function showsearch() {
	if (document.search.keyword.value == '') {
		document.search.keyword.value = 'Search...';
	}
}



