// Email Checking
function CheckMail ( email )
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
	if ( filter.test(email) ) return true;
	else return false;
}
// Input Checking
function checkInput()
{
	var i, j=0;
	var RequiresError=new Array();
	for(i=0; i<Requires.length;i+=2) {
		if(document.all(Requires[i]).value.length<2 || document.all(Requires[i]).value.length>100 )
			RequiresError[j++] = '<u>'+Requires[(i+1)]+'</u>';
	}
	if( j==(i/2) ) {
		msg("");
		return false;
	}
	return true;
}
// Message Window
function msg( message )
{
	var outputWin = window.open("", "msgWindow", 'left=250, top=200, width=300, height=150, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0');
	var HTML = '\
		<html dir=rtl>\
		<head>\
			<title>Error!</title>\
		<style>\
		body {\
			font-family:Tahoma;\
			font-size:13px;\
		}\
		</style>\
		</head>\
		<body>\
		<br><br>\
		<div align="center">جاهاى خالى راتكميل  كنيد</div>\
		<br><br>\
		'+ message +'\
		<div align="center"><a href="javascript:window.close()" style="text-decoration:none;">بستن</a></div>\
		</body>\
		</html>\
	';
	outputWin.document.write(HTML);
}
