function CheckAll(x)
{

if (ISBLANK(x.fname.value) ||ISBLANK(x.lname.value) ||ISBLANK(x.emailid.value)||ISBLANK(x.mypwd.value)||ISBLANK(x.mypwd2.value) ||ISBLANK(x.vcode.value)) 
	{ 	
		    alert("All fields with * sign are compulsory !!");
    	    return false;
    }
	
	//checkemail(myemail)
	if(checkemail(x.emailid.value)==true)
	  {
	  	/// continue	
	  }
	  else
	  {
	    return false;
	  }
	 
	 /// check both password is same or not
	 if( x.mypwd.value!=x.mypwd2.value)
	 {
	  alert("Both password does not match !!");
	  return false;
	 }
	  
	 return true;
}

/// to check that perticular value is EMPTY OR NOT
function ISBLANK(xx)
{ 
        var cc=0,tt;
		for(tt=0; tt<xx.length; tt++)
		{
		     if (xx.charAt(tt)==' ')
			 {
			 	cc=cc+1; // count blank character
			 }
		}
		if (cc==xx.length)
		{
			return true;  //// means it is BLANK
		}
	     return false;	//// means it is NOT BLANK
}
/*== To check that file extention is .jpg or .jpeg ==*/
function IsValidExtension(xx) 
	{   
	    var str=xx;
		
		var dotpos=str.lastIndexOf('.');
		var rr=(str.charAt(dotpos+1)+str.charAt(dotpos+2)+str.charAt(dotpos+3)+str.charAt(dotpos+4));
		
		if (rr.toLowerCase()=='jpg' || rr.toLowerCase()=='jpeg')
		{
			return true;
		}
		else
		{
			return false;
		}
    }
	
//// check email validation	
function checkemail(myemail)
{
var str=myemail;
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
{
testresults=true;
}
else
{
	alert("Please input a valid email address!")
	testresults=false;
}
return (testresults)
}



