// JavaScript Document
function isEmpty( oElement, oLable, sMessage ){
	if( oElement.value == "" || oElement.value == 0 ){
		alert( sMessage );
		oLable.className = "clsError";
		oElement.focus();
		return true;
	} else {
		oLable.className = "clsField";
		return false;
	}
}

String.prototype.isEmail = function(){
	if( this == "" ) return false;
	
	var indexOfAt	= this.indexOf("@");
	var indexOfDot	= this.indexOf(".");
	
	var foundAt		= ( indexOfAt > 0 );
	var foundDot	= ( indexOfDot > 0 && indexOfDot < ( this.length - 1 ));
	return ( foundAt && foundDot );
}

function isValidDate( iDay, iMonth, iYear ){
	var sDate = iMonth + "/" + iDay + "/" + iYear;

	var oDate=new Date(sDate);
	if(oDate.getMonth()+1==iMonth){
		return true;
	} 
	else{
		return false;
	}
}

function showDiv( sDivName, bShow ){
	document.getElementById(sDivName).style.visibility = ( bShow ? 'visible' : 'hidden' );
}