// JavaScript Document
function checkSubmitCV(form)
{
	/*if (form.cv_name.value == "")
    {
		alert("Please enter a value for the Name field.");
		form.cv_name.focus();
		return false;
	}
	if (form.cv_surname.value == "")
    {
		alert("Please enter a value for the Surname field.");
		form.cv_surname.focus();
		return false;
	}
	if (form.cv_email.value == "" || !(/\S+@\S+\.\S{2,3}/.test(form.cv_email.value)))
    {
		alert("Please enter a valid email address for the Email field.");
		form.cv_email.focus();
		return false;
	}
    
	if (form.cv_phone.value == "")
    {
		alert("Please enter a value for the Phone field.");
		form.cv_phone.focus();
		return false;
	}*/
	form.submit();
}

function checkChangeVacancyColors(form)
{
    var fout = false;
    var fckResponsibilities = FCKeditorAPI.GetInstance('Responsibilities');
    var fckQualifications = FCKeditorAPI.GetInstance('Qualifications');
    var fckExperience = FCKeditorAPI.GetInstance('Experience');
    var fckSkills = FCKeditorAPI.GetInstance('Skills');
    var fckCompany_Profile = FCKeditorAPI.GetInstance('Company_Profile');
    var fckInstructions = FCKeditorAPI.GetInstance('Instructions');
    
	if (form.Position.value == "")
        form.Position.style.backgroundColor = '#FFB3B3';
	else
	   form.Position.style.backgroundColor = '#FFFFFF';
	   
	if (form.Type.value == "" && !fout)
        form.Type.style.backgroundColor = '#FFB3B3';
	else
	   form.Type.style.backgroundColor = '#FFFFFF';
	   
	if (form.Contact_Person.value == "" && !fout)
        form.Contact_Person.style.backgroundColor = '#FFB3B3';
	else
	   form.Contact_Person.style.backgroundColor = '#FFFFFF';
	/*
	if (form.Reference.value == "" && !fout)
        form.Reference.style.backgroundColor = '#FFB3B3';
	else
	   form.Reference.style.backgroundColor = '#FFFFFF';
	 */
	if (form.Location.value == "" && !fout)
        form.Location.style.backgroundColor = '#FFB3B3';
	else
	   form.Location.style.backgroundColor = '#FFFFFF';
           
	if (fckResponsibilities.GetHTML() == "<br type=\"_moz\" />" && !fout)
        fckResponsibilities.EditorDocument.body.style.cssText += 'background-color: #FFB3B3;';
    else
        fckResponsibilities.EditorDocument.body.style.cssText += 'background-color: #FFFFFF;';
        
	if (fckQualifications.GetHTML() == "<br type=\"_moz\" />" && !fout)
        fckQualifications.EditorDocument.body.style.cssText += 'background-color: #FFB3B3;';
    else
        fckQualifications.EditorDocument.body.style.cssText += 'background-color: #FFFFFF;';
        
	if (fckExperience.GetHTML() == "<br type=\"_moz\" />" && !fout)
        fckExperience.EditorDocument.body.style.cssText += 'background-color: #FFB3B3;';
    else
        fckExperience.EditorDocument.body.style.cssText += 'background-color: #FFFFFF;';
        
	if (fckSkills.GetHTML() == "<br type=\"_moz\" />" && !fout)
        fckSkills.EditorDocument.body.style.cssText += 'background-color: #FFB3B3;';
    else
        fckSkills.EditorDocument.body.style.cssText += 'background-color: #FFFFFF;';
        
	if (form.Salary.value == "" && !fout)
        form.Salary.style.backgroundColor = '#FFB3B3';
	else
	   form.Salary.style.backgroundColor = '#FFFFFF';
	   
	if (form.Company.value == "" && !fout)
        form.Company.style.backgroundColor = '#FFB3B3';
	else
	   form.Company.style.backgroundColor = '#FFFFFF';

	if (fckCompany_Profile.GetHTML() == "<br type=\"_moz\" />" && !fout)
        fckCompany_Profile.EditorDocument.body.style.cssText += 'background-color: #FFB3B3;';
    else
        fckCompany_Profile.EditorDocument.body.style.cssText += 'background-color: #FFFFFF;';
        /*
	if (fckInstructions.GetHTML() == "<br type=\"_moz\" />" && !fout)
        fckInstructions.EditorDocument.body.style.cssText += 'background-color: #FFB3B3;';
    else
        fckInstructions.EditorDocument.body.style.cssText += 'background-color: #FFFFFF;';	
				*/
}
function checkChangeVacancy(form)
{
    checkChangeVacancyColors(form);
    var fout = false;
    var fckResponsibilities = FCKeditorAPI.GetInstance('Responsibilities');
    var fckQualifications = FCKeditorAPI.GetInstance('Qualifications');
    var fckExperience = FCKeditorAPI.GetInstance('Experience');
    var fckSkills = FCKeditorAPI.GetInstance('Skills');
    var fckCompany_Profile = FCKeditorAPI.GetInstance('Company_Profile');
    var fckInstructions = FCKeditorAPI.GetInstance('Instructions');

	/*if (form.Position.value == "")
    {
        form.Position.style.backgroundColor = '#FFB3B3';
		alert("Please enter a value for the Position field.");
		fout = true;
		form.Position.focus();
	} else
	   form.Position.style.backgroundColor = '#FFFFFF';
	   
	if (form.Type.value == "" && !fout)
    {
        form.Type.style.backgroundColor = '#FFB3B3';
		alert("Please enter a value for the Type field.");
		fout = true;
		form.Type.focus();
	}
    	   
	if (form.Contact_Person.value == "" && !fout)
    {
        form.Contact_Person.style.backgroundColor = '#FFB3B3';
		alert("Please enter a value for the Contact Person field.");
		fout = true;
		form.Contact_Person.focus();
	}
	   
	if (form.Reference.value == "" && !fout)
    {
        form.Reference.style.backgroundColor = '#FFB3B3';
		alert("Please enter a value for the Reference field.");
		fout = true;
		form.Reference.focus();
	}
	   
	if (form.Location.value == "" && !fout)
    {
        form.Location.style.backgroundColor = '#FFB3B3';
		alert("Please enter a value for the Location field.");
		fout = true;
		form.Location.focus();
	}
           
	if (fckResponsibilities.GetHTML() == "<br type=\"_moz\" />" && !fout)
	{
        fckResponsibilities.EditorDocument.body.style.cssText += 'background-color: #FFB3B3;';
		alert("Please enter a value for the Responsibilities field.");
		fout = true;
		fckResponsibilities.Focus();
    }
        
	if (fckQualifications.GetHTML() == "<br type=\"_moz\" />" && !fout)
	{
        fckQualifications.EditorDocument.body.style.cssText += 'background-color: #FFB3B3;';
		alert("Please enter a value for the Qualifications field.");
		fout = true;
		fckQualifications.Focus();
    }
        
	if (fckExperience.GetHTML() == "<br type=\"_moz\" />" && !fout)
	{
        fckExperience.EditorDocument.body.style.cssText += 'background-color: #FFB3B3;';
		alert("Please enter a value for the Experience field.");
		fout = true;
		fckExperience.Focus();
    }
        
	if (fckSkills.GetHTML() == "<br type=\"_moz\" />" && !fout)
	{
        fckSkills.EditorDocument.body.style.cssText += 'background-color: #FFB3B3;';
		alert("Please enter a value for the Skills field.");
		fout = true;
		fckSkills.Focus();
    }
        
	if ((form.Salary.value == "" || isNaN(form.Salary.value)) && !fout)
    {
        form.Salary.style.backgroundColor = '#FFB3B3';
		alert("Please enter a valid value for the Salary field.");
		fout = true;
		form.Salary.focus();
	}
	   
	if (form.Company.value == "" && !fout)
    {
        form.Company.style.backgroundColor = '#FFB3B3';
		alert("Please enter a value for the Company field.");
		fout = true;
		form.Company.focus();
	}

	if (fckCompany_Profile.GetHTML() == "<br type=\"_moz\" />" && !fout)
	{
        fckCompany_Profile.EditorDocument.body.style.cssText += 'background-color: #FFB3B3;';
		alert("Please enter a value for the Company Profile field.");
		fout = true;
		fckCompany_Profile.Focus();
    }
        
	if (fckInstructions.GetHTML() == "<br type=\"_moz\" />" && !fout)
	{
        fckInstructions.EditorDocument.body.style.cssText += 'background-color: #FFB3B3;';
		alert("Please enter a value for the Instructions field.");
		fout = true;
		fckInstructions.Focus();
    }*/
    //if (!fout)
        form.submit();
}

