// JavaScript Document

function validateform()
{
	if(document.getElementById('jobid').value == "")
	{
		alert("Please enter jobid");
		document.getElementById('jobid').focus();
		return false;
	}
	if(document.getElementById('designation').value == "")
	{
		alert("Please enter designation");
		document.getElementById('designation').focus();
		return false;
	}
	if(document.getElementById('location').value == "")
	{
		alert("Please enter location");
		document.getElementById('location').focus();
		return false;
	}
	if(document.getElementById('experience').value == "")
	{
		alert("Please enter experience");
		document.getElementById('experience').focus();
		return false;
	}
	else
		return true;
}


function checksearchform()
{
	if(document.getElementById('selsearch').value != "dateposted")
	{
		if(document.getElementById('selsearch').value == "-1")
		{
			alert("select a search type");
			document.getElementById('selsearch').focus();
			return false;
		}
		if(document.getElementById('txtsearch').value == "")
		{
			alert("Please enter search text");
			document.getElementById('txtsearch').focus();
			return false;
		}
		else
			return true;
	}
}

function confirmdel()
{
	var answer = confirm("Are you sure you want to delete this posting?");
	if (answer)
		return true;
	else
		return false;
}

function showdatefield(option)
{
	if(option == "dateposted")
		document.getElementById('date_part').style.display = "block";
	else
		document.getElementById('date_part').style.display = "none";
}

function validatechangepass()
{
	if(document.getElementById('oldpassword').value == '')
	{
		alert("Please Enter Old Password");
		document.getElementById('oldpassword').focus();
		return false;
	}
	if(document.getElementById('newpassword').value == '')
	{
		alert("Please Enter New Password");
		document.getElementById('newpassword').focus();
		return false;
	}
	if(document.getElementById('confirmnew').value == '')
	{
		alert("Please Enter Confirm New Password");
		document.getElementById('confirmnew').focus();
		return false;
	}
	if(document.getElementById('newpassword').value != document.getElementById('confirmnew').value)
	{
		alert("Incorrect Confirm Password")
		document.getElementById('confirmnew').focus();
		return false;
	}
	else
		return true;
}