function clickJoinNow(joinvacationerform)
  {
     var elements = joinvacationerform.elements;
     var flag = 1;
     var firstname = document.joinvacationerform.FIRST_NAME.value;
     var lastname = document.joinvacationerform.LAST_NAME.value;
     var Zip = document.joinvacationerform.ZIPCODE.value;
     var Email = document.joinvacationerform.EMAILADDRESS.value;
     var userid = document.joinvacationerform.USERNAME.value;
     var pwd = document.joinvacationerform.PASSWORD.value;
     var confirmpwd = document.joinvacationerform.CONFIRM_PASSWORD.value;

     //checking first name 
     if (firstname == "") 
     {
         alert("Please fill in your first name");
         elements[1].focus();
         flag = 0;
         return false;
     }
     else if (lastname == "") 
     {
         alert("Please fill in your last name");
         elements[2].focus();
         flag = 0;
         return false;
     }
     else if (Zip == "")
     {
         alert("Please fill in your Zip code");
         elements[7].focus();
         flag = 0;
         return false;
     }
     else if (Zip.length < 5 ) 
     {
         alert("Please enter a valid zipcode");
         elements[7].focus();
         flag = 0;
         return false;
     }
     else if (Email == "") 
     {
         alert("Please fill in your Email address");
         elements[8].focus();
         flag = 0;
         return false;
     }
     else if (userid == "") 
     {
         alert("Please fill in your user name");
         elements[9].focus();
         flag = 0;
         return false;
     }
     else if (userid.length <= 5 || userid.length >=13) 
     {
         alert("Your username should be between 6 to 12 characyers");
         elements[9].focus();
         flag = 0;
         return false;
     }
     else if (pwd == "") 
     {
         alert("Please fill in your password");
         elements[10].focus();
         flag = 0;
         return false;
     }
     else if (pwd.length <= 5 || pwd.length >=13) 
     {
         alert("Your password should be between 6 to 12 characyers");
         elements[10].focus();
         flag = 0;
         return false;
     }
     else if (confirmpwd == "") 
     {
         alert("Please fill in confirm password field");
         elements[11].focus();
         flag = 0;
         return false;
     }
     else if(pwd != confirmpwd){
     	alert("Please check the confirm password again");
     	document.joinvacationerform.CONFIRM_PASSWORD.value = "";
         elements[11].focus();
         flag = 0;
         return false;
     }
     else if(isNaN(Zip) == true){
     	alert("Please enter the zipcode as number");
     	document.joinvacationerform.ZIPCODE.value = "";
         elements[7].focus();
         flag = 0;
         return false;

     } 
     else
     {
                var chkEmail = new String(Email);
		 myRegExp1 = /\@/;
		 myRegExp2 = /\./;


		 var checkedEmail1 = chkEmail.search(myRegExp1);
		 var checkedEmail2 = chkEmail.search(myRegExp2);

		if(checkedEmail1 == -1){
			alert("Please enter a valid email with '@' ");
			document.joinvacationerform.EMAILADDRESS.value = "";
			 elements[8].focus();
			 flag = 0;
			 return false;
		}

		else if(checkedEmail2 == -1){
			alert("Please enter a valid email with '.' ");
			document.joinvacationerform.EMAILADDRESS.value = "";
			 elements[8].focus();
			 flag = 0;
			 return false;
		}
		
		var chkUserName = new String(userid);
           var chkPwd = new String(pwd);
            splChar1 = /\@/;
            splChar2 = /\ /;
            splChar3 = /\~/;
            splChar4 = /\!/;
            splChar5 = /\#/;
            splChar6 = /\$/;
            splChar7 = /\%/;
            splChar8 = /\^/;
            splChar9 = /\&/;
            splChar10 = /\*/;
            splChar11 = /\(/;
            splChar12 = /\)/;
            splChar13 = /\+/;
            splChar14 = /\=/;
            splChar15 = /\`/;
            splChar16 = /\:/;
            splChar17 = /\;/;
            splChar18 = /\"/;
            splChar19 = /\'/;
            splChar20 = /\</;
            splChar21 = /\,/;
            splChar22 = /\>/;
            splChar23 = /\./;
            splChar24 = /\?/;
            splChar25 = /\//;
            splChar26 = /\{/;
            splChar27 = /\[/;
            splChar28 = /\}/;
            splChar29 = /\]/;
            splChar30 = /\|/;
            splChar31 = /\\/;


            var checkedUserId1 = chkUserName.search(splChar1);
            var checkedUserId2 = chkUserName.search(splChar2);
            var checkedUserId3 = chkUserName.search(splChar3);
            var checkedUserId4 = chkUserName.search(splChar4);
            var checkedUserId5 = chkUserName.search(splChar5);
            var checkedUserId6 = chkUserName.search(splChar6);
            var checkedUserId7 = chkUserName.search(splChar7);
            var checkedUserId8 = chkUserName.search(splChar8);
            var checkedUserId9 = chkUserName.search(splChar9);
            var checkedUserId10 = chkUserName.search(splChar10);
            var checkedUserId11 = chkUserName.search(splChar11);
            var checkedUserId12 = chkUserName.search(splChar12);
            var checkedUserId13 = chkUserName.search(splChar12);
            var checkedUserId14 = chkUserName.search(splChar14);
            var checkedUserId15 = chkUserName.search(splChar15);
            var checkedUserId16 = chkUserName.search(splChar16);
            var checkedUserId17 = chkUserName.search(splChar17);
            var checkedUserId18 = chkUserName.search(splChar18);
            var checkedUserId19 = chkUserName.search(splChar19);
            var checkedUserId20 = chkUserName.search(splChar20);
            var checkedUserId21 = chkUserName.search(splChar21);
            var checkedUserId22 = chkUserName.search(splChar22);
            var checkedUserId23 = chkUserName.search(splChar23);
            var checkedUserId24 = chkUserName.search(splChar24);
            var checkedUserId25 = chkUserName.search(splChar25);
            var checkedUserId26 = chkUserName.search(splChar26);
            var checkedUserId27 = chkUserName.search(splChar27);
            var checkedUserId28 = chkUserName.search(splChar28);
            var checkedUserId29 = chkUserName.search(splChar29);
            var checkedUserId30 = chkUserName.search(splChar30);
            var checkedUserId31 = chkUserName.search(splChar31);
            
            var checkedPwd1 = chkPwd.search(splChar1);
            var checkedPwd2 = chkPwd.search(splChar2);
            var checkedPwd3 = chkPwd.search(splChar3);
            var checkedPwd4 = chkPwd.search(splChar4);
            var checkedPwd5 = chkPwd.search(splChar5);
            var checkedPwd6 = chkPwd.search(splChar6);
            var checkedPwd7 = chkPwd.search(splChar7);
            var checkedPwd8 = chkPwd.search(splChar8);
            var checkedPwd9 = chkPwd.search(splChar9);
            var checkedPwd10 = chkPwd.search(splChar10);
            var checkedPwd11 = chkPwd.search(splChar11);
            var checkedPwd12 = chkPwd.search(splChar12);
            var checkedPwd13 = chkPwd.search(splChar12);
            var checkedPwd14 = chkPwd.search(splChar14);
            var checkedPwd15 = chkPwd.search(splChar15);
            var checkedPwd16 = chkPwd.search(splChar16);
            var checkedPwd17 = chkPwd.search(splChar17);
            var checkedPwd18 = chkPwd.search(splChar18);
            var checkedPwd19 = chkPwd.search(splChar19);
            var checkedPwd20 = chkPwd.search(splChar20);
            var checkedPwd21 = chkPwd.search(splChar21);
            var checkedPwd22 = chkPwd.search(splChar22);
            var checkedPwd23 = chkPwd.search(splChar23);
            var checkedPwd24 = chkPwd.search(splChar24);
            var checkedPwd25 = chkPwd.search(splChar25);
            var checkedPwd26 = chkPwd.search(splChar26);
            var checkedPwd27 = chkPwd.search(splChar27);
            var checkedPwd28 = chkPwd.search(splChar28);
            var checkedPwd29 = chkPwd.search(splChar29);
            var checkedPwd30 = chkPwd.search(splChar30);
            var checkedPwd31 = chkPwd.search(splChar31);
            

           if(checkedUserId1 != -1 ){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId2 != -1 ){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId3 != -1 ){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId4 != -1 ){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId5 != -1 ){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId6 != -1 ){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId7 != -1 ){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId8 != -1 ){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId9 != -1 ){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId10 != -1 ){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId11 != -1 ){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId12 != -1 ){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId13 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId14 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId15 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId16 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId17 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId18 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId19 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId20 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId21 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId22 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId23 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId24 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId25 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId26 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId27 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId28 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId29 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId30 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedUserId31 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.USERNAME.value = "";
                    elements[9].focus();
                    flag = 0;
                    return false;
           }
           
           if(checkedPwd1 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd2 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd3 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd4 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd5 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd6 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd7 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd8 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd9 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd10 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd11 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd12 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd13 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd14 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd15 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd16 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd17 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd18 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd19 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd20 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd21 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd22 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd23 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd24 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd25 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd26 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd27 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd28 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd29 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd30 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
           else if(checkedPwd31 != -1){
                   alert("Usernames and passwords should not have special characters or spaces "); 
                   document.joinvacationerform.PASSWORD.value = "";
                    elements[10].focus();
                    flag = 0;
                    return false;
           }
         return true;
     }
  }

