// JavaScript Document

// OnLoadPage
function OnLoadPage( title ) {
	if( title != '' ) {
		self.status = title;
	}
}

// get object by id
function getObjectById( id ) {
	var obj = null;
	
	if( document.getElementById ) {
		obj = document.getElementById( id );
	}
	else if( document.all ) {
		obj = document.all[id];
	}
	else {
		obj = document.layer[id];
	}
	
	return obj;
}

// show hide object
function ShowHideObject( id ) {
	var obj = getObjectById( id );
	if( obj ) {
		if( obj.style.display == 'block' ) {
			obj.style.display = 'none';
		}
		else {
			obj.style.display = 'block';
		}	
	}
	return;
}

// valid input email
function validEmail( email ) {
	var filter = /^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	return filter.test(email);
}

// open new window with no menu
function openNewWindow( url, width, height, arg ) {
		
	var screenX = screen.width;
	var screenY = screen.height;
	
	if( !width ) {
		width 	= 600;
	}
	if( !height ) {
		height 	= 500;
	}
	
	width 	= width + 30;
	height 	= height + 20;
	
	var left 	= parseInt(screenX/2 - width/2);
	var top 	= parseInt(screenY/2 - height/2);

	var _arg = 'status=no,toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=no,width='+ width +',height='+ height +',top='+ top +',left='+ left;
	
	if( arg ) {
		_arg += arg;
	}
	
	var obj = window.open( url, 'win2', _arg );	
	obj.focus();
	
	return obj;
}

// LocationLink
function LocationLink( url ) {
	if( url ) {
		window.location.href = url;
	}
	else {
		window.location.href = "index.php";
	}
}

// OnMouseOver
function OnMouseOver( obj, title ) {
	if( title ) {
		self.status = title;
	}
	if( obj ) {
		obj.style.cursor = 'pointer';
	}
}

// OnMouseOut
function OnMouseOut( title ) {
	if( title ) {
		self.status = title;
	}
}