//<!--


function checkForm(form)
{


	if (form.name.value == ""){
	alert( "Please enter a Name" );
	form.name.focus();
	return false ;
	}

if (form.company.value == ""){
	alert( "Please enter a company Name" );
	form.company.focus();
	return false ;
	}

	
	if (form.phone.value == ""){
	alert( "Please enter a Phone Number." );
	form.phone.focus();
	return false ;
	}

	 var valid = "+0123456789 ";

         if (form.phone.value == " ")
         {
			alert ("This field is required. Please enter phone number without space or dashes!")
			form.phone.focus();
         return false;
         }

		var phon = form.phone.value;
         for (var i=0; i < phon.length; i++)
         {
         temp = "" + phon.substring(i, i+1);

         if (valid.indexOf(temp) == "-1") 
         {
			alert("Invalid characters in your phone number. Please try again.")
			form.phone.focus();
          return false;
         }
    }


	 
	if(form.email.value == "" ) {
	alert("Kindly enter your E-mail ID.");
	form.email.focus();
	return false;
    }
	if (form.email.value.length != 0){ 
		var e_check  = form.email.value;
		if(form.email.value.indexOf(" ") != -1)	{
			alert("Kindly enter correct E-Mail ID without any spaces in it.");
			form.email.focus(); 
			return false;
		}

		if(form.email.value.indexOf("@") == -1)	{
		alert("Invalid E-Mail ID! Kindly enter correct E-Mail ID.");
		form.email.focus(); 
		return false;
		}
	   	validarr = form.email.value.split("@");
	   	if(validarr[0].length==0) {
	   		alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
	   		form.email.focus(); 
	   	return false;
   		}
	  	if(validarr[1].indexOf("@") >=0) {
		   	alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
		   	form.email.focus(); 
	   	return false;
	   	}
	   	if(validarr[1].length==0) {
		   	alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
		   	form.email.focus(); 
		   	return false;
	   	}
	   	if(validarr[1].length != 0){ 
			if(validarr[1].indexOf(".") == -1){
				alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
				form.email.focus(); 
				return false;
			}
			validemail = validarr[1].split(".");
		   if(validemail[0].length==0){ 
			 alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
			 form.email.focus(); 
			 return false;
			}
			if(validemail[1].length==0){
				alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
				form.email.focus(); 
				return false;
			}
		  }
	   }

if (form.location.value == "null"){
	alert( "Kindly select a Location" );
	form.location.focus();
	return false ;
	}
		
	if (form.comments.value == ""){
	alert( "Kindly write you Comment" );
	form.comments.focus();
	return false ;
	}

	 var valid = "@://";

         var comments = form.comments.value;
         for (var i=0; i < comments.length; i++)
         {
         temp = "" + comments.substring(i, i+1);

         if (valid.indexOf(temp) != "-1") 
         {
			alert("Invalid characters in your comments. Please try again.")
			form.comments.focus();
          return false;
         }
    }
	
	if (form.comments.value.length != 0){ 
		var com_check  = form.comments.value;
		if(form.comments.value.indexOf("url") != -1)	{
			alert("Invalid Character! Kindly enter the correct statement in Comment.");
			form.comments.focus(); 
			return false;
		}

		if(form.comments.value.indexOf("href") != -1)	{
			alert("Invalid Character! Kindly enter the correct statement in Comment.");
			form.comments.focus(); 
			return false;
		}

		if(form.comments.value.indexOf("http:") != -1)	{
			alert("Invalid Character! Kindly enter the correct statement in Comment.");
			form.comments.focus(); 
			return false;
		}

		if(form.comments.value.indexOf("www") != -1)	{
			alert("Invalid Character! Kindly enter the correct statement in Comment.");
			form.comments.focus(); 
			return false;
		}

	}


if (form.validn.value == "")
	{
	alert( "Please enter character as shown in picture" );
	form.validn.focus();
	return false ;
	}


	if (form.validn.value != "")
	{
	
	
	if (form.vcode.alt == "valid-img/img1.jpg") 
		{
			if (form.validn.value != "didxha") {
			alert( "Kindly enter correct character as shown in picture" );
			form.validn.focus();
			return false ;
			}
		return true ;
		}
	
	if (form.vcode.alt == "valid-img/img2.jpg") 
		{
			if (form.validn.value != "iipivyn") {
			alert( "Kindly enter correct character as shown in picture" );
			form.validn.focus();
			return false ;
			}
		return true ;
		}

	if (form.vcode.alt == "valid-img/img3.jpg") 
		{
			if (form.validn.value != "fdssmo") {
			alert( "Kindly enter correct character as shown in picture" );
			form.validn.focus();
			return false ;
			}
		return true ;
		}
	
	if (form.vcode.alt == "valid-img/img4.jpg") 
		{
			if (form.validn.value != "ncapq") {
			alert( "Kindly enter correct character as shown in picture" );
			form.validn.focus();
			return false ;
			}
		return true ;
		}

	if (form.vcode.alt == "valid-img/img5.jpg") 
		{
			if (form.validn.value != "wrign") {
			alert( "Kindly enter correct character as shown in picture" );
			form.validn.focus();
			return false ;
			}
		return true ;
		}
	
	if (form.vcode.alt == "valid-img/img6.jpg") 
		{
			if (form.validn.value != "fyzwbil") {
			alert( "Kindly enter correct character as shown in picture" );
			form.validn.focus();
			return false ;
			}
		return true ;
		}
	
	if (form.vcode.alt == "valid-img/img7.jpg") 
		{
			if (form.validn.value != "uszpvuiv") {
			alert( "Kindly enter correct character as shown in picture" );
			form.validn.focus();
			return false ;
			}
		return true ;
		}

	if (form.vcode.alt == "valid-img/img8.jpg") 
		{
			if (form.validn.value != "lfjed") {
			alert( "Kindly enter correct character as shown in picture" );
			form.validn.focus();
			return false ;
			}
		return true ;
		}
	
	return false ;
	}

return true;
}

//-->

//------------------------------- change script---------------------------------------//
//<!-- Begin

// Set up the image files to be used.

var theImages = new Array() // do not change this

// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = 'valid-img/img1.jpg'
theImages[1] = 'valid-img/img2.jpg'
theImages[2] = 'valid-img/img3.jpg'
theImages[3] = 'valid-img/img4.jpg'
theImages[4] = 'valid-img/img5.jpg'
theImages[5] = 'valid-img/img6.jpg'
theImages[6] = 'valid-img/img7.jpg'
theImages[7] = 'valid-img/img8.jpg'

// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));

function showImage(){
document.write('<img id="vcode" name="vcode" src="'+theImages[whichImage]+'" alt="'+theImages[whichImage]+'">');
}

//  End -->

