function check_email1 ( email )
{
var len = email.length;
if(len==0)
return "Your e-mail address can not be a blank!\n";
for(var i=0;i<len;i++)
{ var c= email.charAt(i);
if(!((c>="A"&&c<="Z")||(c>="a"&&c<="z")||(c>="0"&&c<="9")||(c=="-")||(c=="_")||(c==".")||(c=="@")))
return "Your e-mail address is the only figure in English letters and symbols'-','_' and other symbols are not used !\n";
}
if((email.indexOf("@")==-1)||(email.indexOf("@")==0)||(email.indexOf("@")==(len-1)))
return "Your e-mail address incomplete !\n";
if((email.indexOf("@")!=-1)&&(email.substring(email.indexOf("@")+1,len).indexOf("@")!=-1))
return "Your e-mail address incomplete !\n";
if((email.indexOf(".")==-1)||(email.indexOf(".")==0)||(email.lastIndexOf(".")==(len-1)))
return "Your e-mail address incomplete !\n";
return "";
}

function check_null ( column, name )
{
if( column.length == 0 )
return name + " can not be a blank !\n";
return "";
}
function check_select ( select, name )
{
if( select.options[0].selected == true )
return name + " must choose !\n";
return "";
}
function check_radio ( radio, name )
{
var error = true;
for( i=0; i <radio.length; i++ )
if( radio[i].checked == true ) {
error = false;
break;
}
if( error == true )
return name + "must choose !\n";
return "";
}
function check_passwd ( pw1, pw2 )
{
if( pw1 == '' ) {
return ("Password can't be null !\n");
}
for( var idx = 0 ; idx <pw1.length ; idx++ ) {
	if( pw1.charAt(idx) == ' ' || pw1.charAt(idx) == '\"' ) {
		return ("Password can't be null or \"\" marks !\n");
	}
	if(!((pw1.charAt(idx) >= "a" && pw1.charAt(idx) <= "z")||(pw1.charAt(idx) >= "0" && pw1.charAt(idx) <= "9"))){
        return "Only english letters or numbers for password!\n";
    }
}	
if( pw1.length < 6 || pw1.length > 12 )
return( "6 to 12 letters for password length !\n" );
if( pw1 != pw2 )
return("Password and comfirm password aren't the same!\n");
return "";
}
function check_nan( num ,name )
{
	if( Math.round( new Number(num) ) < 1 ) 
		return name + "No less than 1!\n";
	else
		return "";
}

function check_number_YN( number , name )
{
var error = false;
if( number.length <= 0 )
return name + "Not a blank !\n";
for( idx = 0 ; idx <number.length ; idx++ ) {
if( !( number.charAt(idx)>= '0' && number.charAt(idx) <= '9' ) ) {
error = true;
break;
}
}

if( error == true )
return name + "Only figures, the other symbols are not used !\n";
else
return "";
}

function check_mobilephone ( number )
{
var error = false;
if( number.length <= 0 )
return "Mobile can't be null !\n";
if( number.length >= 24 )
return "Mobile number is wrong !\n";
for( idx = 0 ; idx <number.length ; idx++ ) {
if( !( number.charAt(idx)>= '0' && number.charAt(idx) <= '9' ) && number.charAt(idx)!='-' && number.charAt(idx)!='+' ) {
error = true;
break;
}
}

if( error == true )
return "Mobile number can only be numbers !\n";
else
return "";
}
