function extlinks() { 
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a"); 
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "ext") anchor.target = "_blank"; 
	} 
} 

function check_epasts( epasts ) { 
	var check = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if ( check.test( epasts ) ) {
		return true ;
	} else {
		return false ;
	}
}

function js_clock(  ){
	var clock_time		= new Date();
	var clock_hours		= clock_time.getHours();
	var clock_minutes	= clock_time.getMinutes();
	var clock_seconds	= clock_time.getSeconds();
	var clock_suffix = "AM";
	//clock_hours = clock_hours - 2;
	if (clock_hours > 11){
		clock_suffix = "PM";
		//clock_hours = clock_hours - 12;
	}
	if (clock_hours == 0){
		//clock_hours = 12;
	}
	if (clock_hours < 10){
		clock_hours = "0" + clock_hours;
	}
	if (clock_minutes < 10){
		clock_minutes = "0" + clock_minutes;
	}
	if (clock_seconds < 10){
		clock_seconds = "0" + clock_seconds;
	}
	var clock_div = document.getElementById('clock');
	clock_div.innerHTML=clock_hours+":"+clock_minutes+":"+clock_seconds;
	setTimeout("js_clock()", 1000);
}

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=800,height=600,scrollbars=no');
return false;
}

// ShowHide PopUpBlocks

function InfoBlockShow(id) { document.getElementById('pop'+id).style.display = 'block'; }
function InfoBlockHide(id) { document.getElementById('pop'+id).style.display = 'none';  }

var cX = 0; var cY = 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 show(object_id,event) {
	d = document;
	de = d.documentElement;

	mouseX = event.clientX + d.body.scrollLeft;
	mouseY = event.clientY + (de.scrollTop ? de.scrollTop : d.body.scrollTop);

//	d.getElementById(object_id).style.top = (mouseY-80)+"px";

	if ((d.getElementById(object_id).clientWidth + mouseX) >= d.body.offsetWidth)
	{
		mouseX = d.body.offsetWidth - d.getElementById(object_id).clientWidth;
	}

	d.getElementById(object_id).style.left = (mouseX-3)+"px";

//	alert(d.getElementById(object_id).offsetHeight);
//	alert(d.getElementById(object_id).clientHeight);

	d.getElementById(object_id).style.display = 'block';

	d.getElementById(object_id).style.top = (mouseY-(d.getElementById(object_id).offsetHeight)-10)+"px";

}

function hide(object_id,event) { document.getElementById(object_id).style.display = 'none'; }
function show_info(object_id,event) {
	shown_object = object_id;
	show(shown_object,event);
}

function hide_info(object_id,event) {
	shown_object = object_id;
	hide(shown_object,event);
}

function move_info(object_id,event) {
//	hide_info(object_id,event);
	show_info(object_id,event);
}
