// JavaScript Document

// Confirmation for job opportunites form
function confirmjobopp(){
	var myForm = document.frmJobOpp;
	var rdoGender = document.forms['frmJobOpp'].elements['radGender'];
	
	if(myForm.txtFirstName.value == ""){
		alert("You have to enter you First Name!");	
		return false;	
	}
	else if(myForm.txtLastName.value == ""){
		alert("You have to enter you Last Name!");	
		return false;	
	}
	else if(myForm.txtEmailAddress.value == ""){
		alert("You have to enter you Email Address!");	
		return false;	
	}
	else if(CheckEmail(myForm.txtEmailAddress.value) == false){
		alert("You have to enter a valid Email Address!");	
		return false;	
	}	
	
	else if(myForm.cmbMonth.value == ""){
		alert("You have to enter a month!");	
		return false;	
	}	
	else if(myForm.cmbDay.value == ""){
		alert("You have to enter a day!");	
		return false;	
	}
	else if(myForm.cmbYear.value == ""){
		alert("You have to enter a year!");	
		return false;
	}
	
	else if(!rdoGender[0].checked && !rdoGender[1].checked){
		alert("You have to enter a Gender!");	
		return false;	
	}
	else if(myForm.txtAddress.value == ""){
		alert("You have to enter you Address!");	
		return false;	
	}
	else if(myForm.txtCity.value == ""){
		alert("You have to enter you City!");	
		return false;	
	}
	else if(myForm.cmbState.value == ""){
		alert("You have to enter you State!");	
		return false;	
	}
	else if(myForm.txtZipCode.value == ""){
		alert("You have to enter you Zip Code!");	
		return false;	
	}
	
	myForm._confirm.value = "submitted";
	myForm.action = "job-opportunities.html?action=procceed";
	myForm.submit();
	
}

//send to friend confirmation
function sendtofriend(){
	var myform = document.frmSendtoFriend;
	var ctr = 0;
	
	if(myform.txtName.value == ""){
		alert("Please enter your name!");
		myform.txtName.focus(); ctr = 1;
	}
	else if(myform.txtEmail.value == ""){
		alert("Please enter your email!");
		myform.txtEmail.focus(); ctr = 1;
	}
	else if(CheckEmail(myform.txtEmail.value) == false){
		alert("You have to enter a valid Email Address!");
		myform.txtEmail.focus();
		ctr = 1;
	}
	else if(myform.txtFriendName.value == ""){
		alert("Please enter your friend's name!");
		myform.txtFriendName.focus(); ctr = 1;
	}
	else if(myform.txtFriendEmail.value == ""){
		alert("Please enter your friend's email!");
		myform.txtFriendEmail.focus(); ctr = 1;
	}
	else if(CheckEmail(myform.txtFriendEmail.value) == false){
		alert("You have to enter a valid Email Address!");
		myform.txtFriendEmail.focus();
		ctr = 1;
	}
	else if(myform.txtSubject.value == ""){
		alert("Please enter your subject!");
		myform.txtSubject.focus(); ctr = 1;
	}
	else if(myform.txtMessage.value == ""){
		alert("Please enter your message!");
		myform.txtMessage.focus(); ctr = 1;
	}
	
	if(ctr == 0){
		myform.hidconfirm.value = "sendtofriend";
		myform.submit();
	}
	
	
	
}
