//SEARCH CVS
function clearContents(x){
	$("#"+x).val("");
}
//SHOW CONTACT FORM FOR CANDIDATE
function contactCandidate(){
	//var revert = $("#cv_video").html();
	//$("#hiddenVid").val(revert);
	$("#theVideo").hide();
	$("#theMessageArea").load("lib/includes/contactForm.php");
	$("#theMessageArea").show();	
}
//SEND MESSAGE
function sendMessage(){	
	var ref = $("#hiddenFrom").val();
	//alert(ref);
	if(ref == "Employer"){
		var from = "e" + $("#employerID").val();
		var to = "c" + $("#candidateID").val();
		var subject = $("#subject").val();
		var message = $("#theMessage").val();
	} else {
		var from = "c" + $("#employerID").val();
		var to = "e" + $("#candidateID").val();
		var subject = $("#subject").val();
		var message = $("#theMessage").val();
	}
	
	$.post("lib/php/sendMessage.php",{from:from,to:to,subject:subject,message:message}, function(data){
		$("#theMessageArea").hide();
		$("#theVideo").show();	
		//SHOW FEEDBACK
		$.prompt("<p style='color:green'>Message sent!</p>");
	});
}

function forgotPassword(){
	$("#loginForm").hide();
	$("#forgotForm").show();
	selectLogin('Password');
}
function hidePassword(){
	$("#loginForm").show();
	$("#forgotForm").hide();
}
function selectLogin(x){
	if(x == "Candidate"){
		$("#loginCandidate").removeClass("selected");
		$("#loginEmployer").addClass("selected");
		$("#hiddenLogin").val("Candidate");
	}else if(x == "Employer"){
		$("#loginCandidate").addClass("selected");
		$("#loginEmployer").removeClass("selected");
		$("#hiddenLogin").val("Employer");
	} else {
		$("#loginCandidate").addClass("selected");
		$("#loginEmployer").addClass("selected");
		$("#hiddenLogin").val("Password");
	}
}
function checkButton(e){
	var characterCode //literal character code will be stored in this variable
	if(e && e.which){ //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	} else {
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}
	if(characterCode == 13){
		document.log.submit();
	}
}
function quickSearchCheckButton(e){
	var characterCode //literal character code will be stored in this variable
	if(e && e.which){ //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	} else {
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}
	if(characterCode == 13){
		document.searchForm.submit();
	}
}
function sendAuthEmail(){
	
}