//###################################################################### EMAIL 
function email(str)
{
var email=document.getElementById(str).value;
	if ( !/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email) )
      {
	   $('#notification').slideDown();
	   document.getElementById("notification").innerHTML='Not a valid phone numbers!';
	   document.getElementById("notification").style.padding="4px";
	   document.getElementById(str).style.backgroundColor="#FCC8C8";
	   document.getElementById(str).focus();
	   return false;
	 }
	 else { return true; }
}

//########################################################################## PHONE
function phonella(str1)
{
var field;
field=document.getElementById(str1).value;
	if ( !/^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]+$/.test(field) )
	{
	$('#notification').slideDown();
	document.getElementById("notification").innerHTML='Not a valid phone numbers!';
	document.getElementById("notification").style.padding="4px";
	document.getElementById(str1).style.backgroundColor="#FCC8C8";
	document.getElementById(str1).focus();
	return false;
	}
	 else { return true; }
}

//################################################################### INPUT 
function input(v)
{
var field;
field=document.getElementById(v).value;
		if ( field == "" )
		{
		$('#notification').slideDown();
		document.getElementById("notification").innerHTML='Please verify your '+v+" !";
		document.getElementById("notification").style.padding="4px";
        document.getElementById(v).style.backgroundColor="#FCC8C8";
        document.getElementById(v).focus();
	  	return false;
	  	}
		else { document.getElementById(v).style.backgroundColor="#FFFFFF"; return true; }	
}

//################################################################### CHECKBOX
function checkbox(v)
{
	if (document.getElementById(v).checked)
	{ v="on"}
	else { v="off"}
	return v ;
}


//################################################################## CONFIRM PASSWORD
function pass(v,cv)
{
var field;
var password;
field=document.getElementById(v).value;
password=document.getElementById(cv).value;

		if ( field == password ){ return true; }
	    else { 
			  $('#notification').slideDown();
	   	      document.getElementById("notification").innerHTML='Your confirmation password does not match! kindly check it up';
        	  document.getElementById(cv).style.backgroundColor="#FCC8C8";
				document.getElementById("notification").style.padding="4px";
        	  document.getElementById(cv).focus();
	   		  return false;
	        }	
		
}

//################################################################## SET VARIABLE
function va(v)
{
v=document.getElementById(v).value;
return v ;
}



//###################################################################### EMAIL 
function inputreturn(str)
{
document.getElementById(str).style.backgroundImage="url('images/input.jpg')";
document.getElementById(str).style.border="1px #999999 solid";
}


