﻿	function joinus(){
 // Make quick references to our fields
	
	var position = document.getElementById('position');
	var name = document.getElementById('name');
	var email = document.getElementById('email');
	var mobile = document.getElementById('mobile');
	var qualification = document.getElementById('qualification');
	var role = document.getElementById('role');
	var country= document.getElementById('country');
	var present_salary = document.getElementById('present_salary');
	var expected_salary = document.getElementById('expected_salary');
	var upload_resume = document.getElementById('upload_resume');
	var verification_code= document.getElementById('Verification_Code');

	// Check each input in the order that it appears in the form!

          if(notEmpty(position, "Please enter the Position for which you Apply")){
            if(notEmpty(name, "Please enter Your Name")){
              if(emailValidator(email, "Please enter a valid Email Address")){ 
                if(isNumeric(mobile, "Please enter a valid Contact Number. Contact Number will be only Numeric")){
                  if(madeSelection(qualification, "Please Select a Educational Qualification")){
                    if(madeSelection(role, "Please Select a Significant Role Played")){
                      if(notEmpty(country, "Please enter a Country")){
                        if(notEmpty(expected_salary, "Please enter a Expected Salary")){
                          if(notEmpty(upload_resume, "Please Upload Your Current Resume")){
                            if(notEmpty(verification_code, "Please enter Verification Code")){
                              return true;
                            }
                          }
                        }  
                      }
                    }
                  }
                }
              }
            }
          }
                                                                		
	return false;
	
}

	function contactus(){
 // Make quick references to our fields
	
	var name = document.getElementById('name');
	var emailid = document.getElementById('emailid');
	var mobile = document.getElementById('mobile');
	var country= document.getElementById('country');
	var address = document.getElementById('address');
	var city = document.getElementById('city');
	var need = document.getElementById('need');
	var verification_code= document.getElementById('Verification_code');
	
	



	// Check each input in the order that it appears in the form!

          
            if(notEmpty(name, "Please enter Your Name")){
              if(notEmpty(address, "Please enter your Address")){
                if(notEmpty(city, "Please enter a City")){
                  if(isNumeric(mobile, "Please enter a valid MObile Number. Mobile Number must be a Number Only")){
                    if(emailValidator(emailid, "Please enter a valid Email Address")){ 
                      if(notEmpty(need, "Please enter Message")){
                        if(notEmpty(verification_code, "Please enter Verification Code")){
                              return true;
                            }
                          }
                        }  
                      }
                    }
                  }
                }
                                                                             		
	return false;
	
}

	function quote(){
 // Make quick references to our fields
	
	var name = document.getElementById('name');
	var email = document.getElementById('email');
	var mobile = document.getElementById('mobile');
	var address1 = document.getElementById('address1');
	var address2 = document.getElementById('address2');
	var country= document.getElementById('country');
	var city = document.getElementById('city');
	var needandcomment = document.getElementById('Needandcomment');
	var maginfo2 = document.getElementById('maginfo2');
	var verification_code= document.getElementById('Verification_Code');

	// Check each input in the order that it appears in the form!

             if(notEmpty(name, "Please enter Your Name")){
               if(emailValidator(email, "Please enter a valid Email Address")){ 
                 if(notEmpty(address1, "Please enter a Address")){
                   if(notEmpty(city, "Please enter City")){
                     if(notEmpty(country, "Please enter a Country")){
                       if(isNumeric(mobile, "Please enter a valid Contact Number. Contact Number will be only Numeric")){
                         if(notEmpty(needandcomment, "Please enter Your Requirement")){
                           if(notEmpty(verification_code, "Please enter Verification Code")){
                              return true;
                            }
                          }
                        }  
                      }
                    }
                  }
                }
              }
                                                                        		
	return false;
	
}

function notEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus(); // set the focus to this input
		return false;
	}
	else{
	return true;
	}
}


function isNumeric(elem, helperMsg){
	var numericExpression = /^[0-9]+$/;
	if(elem.value.match(numericExpression)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isAlphabet(elem, helperMsg){
	var alphaExp = /^[a-zA-Z]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isAlphanumeric(elem, helperMsg){
	var alphaExp = /^[0-9a-zA-Z]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}


function madeSelection(elem, helperMsg)  {
var myindex=elem.selectedIndex;
if (myindex==0) {
alert(helperMsg);
elem.focus();
}
else {
menu_selection=elem.options[myindex].value;
return true;
   }
}


function emailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(elem.value.match(emailExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}



