var arw="<img src='images/arr_B.gif' border='0' alt='' valign='top' style='padding-bottom:2px;'>&nbsp; ";
var regemail = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

function financeformVal(){
	var msg=""; 
	//Your Name
	if(document.financeFrm.uname.value=="")
		{
			msg+=arw+"Name"+"<br>";
		}
	if(document.financeFrm.uname.value!=""){
		var regnext= /^[A-Za-z]+[A-Za-z\s\.]+$/;
		if((document.financeFrm.uname.value.indexOf(".")==0) || (document.financeFrm.uname.value.indexOf(" ")==0)) 
		{
		msg+=arw+"First character of Your Name should be alphabet character"+"<br>";
		}
		else if(regnext.test(document.financeFrm.uname.value) == false)
		{
		msg+=arw+"Your Name should be alphabet character"+"<br>";
		}
   }
	//Email
	if(document.financeFrm.email.value=="")
		{
			msg+=arw+"Email"+"<br>";
		}
	if(document.financeFrm.email.value!="")
		{
			var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
			var address =document.financeFrm.email.value;
			if(reg.test(address) == false) 
			{
			  msg+=arw+'Enter valid Email'+"<br>";
			}
		}
   //Branch 
   	if(document.financeFrm.branch.value=="")
		{
			msg+=arw+"Branch"+"<br>";
		}
	//Message 
   	if(document.financeFrm.message1.value=="")
		{
			msg+=arw+"Message"+"<br>";
		}

	if(msg!=''){	
		document.getElementById('dialog').innerHTML=msg;
		$('#dialog').dialog('open');
		return false;
	}else{
	document.financeFrm.submit();
	alert("Your Message has been sent Successflly");
	}
}

//Pay form
function payformVal(){
	var msg=""; 
	//Your First Name
	if(document.payForm.fname.value=="")
		{
			msg+=arw+"Your First Name"+"<br>";
		}
	//Your Last Name
	if(document.payForm.lname.value=="")
		{
			msg+=arw+"Your Last Name"+"<br>";
		}
	//Your Reference
	if(document.payForm.ref.value=="")
		{
			msg+=arw+"Your Reference"+"<br>";
		}
	//Currency
	if(document.payForm.curr.value=="")
		{
			msg+=arw+"Currency"+"<br>";
		}
	//Payment Amount
	if(document.payForm.payamt.value=="")
		{
			msg+=arw+"Name"+"<br>";
		}
	if(msg!=''){	
		document.getElementById('dialog').innerHTML=msg;
		$('#dialog').dialog('open');
		return false;
	}
}

function numbersonly(e){
var unicode=e.charCode? e.charCode : e.keyCode
	//alert("");
	//alert(unicode);
if (unicode==8||unicode==9){ }
else{//if the key isn't the backspace key (which we should allow)
if(unicode!=9 && unicode!=13 && unicode!=37 && unicode!=38 && unicode!=39 && unicode!=40 && unicode!=45 && unicode!=46){
if (unicode<48||unicode>57){ //if not a number
alert("Please enter numbers only.");
//return false //disable key press
}
}
}
}

//*****************************Enter Chars Only****************************//
function characteronly(e){
	var msg="";
	var unicode=e.charCode? e.charCode : e.keyCode
		if(unicode!=9 && unicode!=13 && unicode!=37 && unicode!=38 && unicode!=39 && unicode!=40 && unicode!=46)
		{
		//if (unicode!=8){ //if the key isn't the backspace key (which we should allow)
		if ((unicode<64||unicode>122)&&(unicode!=32)&&(unicode!=8))
			{ //if not a number
			msg+=arw+"Please enter only the characters"+"<br>";
			}
		}	
		if(msg!=''){	
		document.getElementById('dialog').innerHTML=msg;
		$('#dialog').dialog('open');
		return false;
		}
}
//*****************************Enter Chars Only****************************//

/*==========================================================================*/
function phoneNumberVal(e){
var msg="";
var unicode=e.charCode? e.charCode : e.keyCode

	if (unicode==8||unicode==9){ }
	else{//if the key isn't the backspace key (which we should allow)
			if(unicode!=9 && unicode!=13 && unicode!=32 && unicode!=37 && unicode!=38 && unicode!=39 && unicode!=40 && unicode!=43 && unicode!=45 && unicode!=46)
			{
				if (unicode<48||unicode>57)
				{ 
				msg+=arw+"Please enter only the Numbers"+"<br>";	
				}
			}
	 }
	 	if(msg!=''){	
		document.getElementById('dialog').innerHTML=msg;
		$('#dialog').dialog('open');
		return false;
	}
}
//*************************************************************************//
