// JavaScript Document

$(document).ready(function(){

      $("#solutionsnav a").each(function(){
      var href = $(this).attr("href");
	   $(this).attr({ href: "#"});
      $(this).click(function(){   
							
         $("#ajax2").load(href); //Le damos efecto
	/*	 if(href == "services/industries.php"){ 
		 	$("#content_leftnav_solutions").removeClass("solutions");
			$("#content_leftnav_solutions").addClass("industries");
		 }else{
			if(href == "services/solutions.php"){ 
		 		$("#content_leftnav_solutions").removeClass("industries");
				$("#content_leftnav_solutions").addClass("solutions");
		      } 
		 	}*/
      });
   });
	  
	  $("#homecareernav a").each(function(){
      var href = $(this).attr("href");
	   $(this).attr({ href: "#"});
      $(this).click(function(){   
							
         $("#ajax2").load(href); //Le damos efecto
		 
      });
   });
	  
	  
   $("#applyajaxvincle").each(function(){
      var href = $(this).attr("href");
      $(this).attr({ href: "#"});
      $(this).click(function(){
         $("#ajax2").load(href);
      });
   });
   
   $("#next").each(function(){
      var href = $(this).attr("href");
      $(this).attr({ href: "#"});
      $(this).click(function(){
         $("#ajax2").load(href);
      });
   });
   
   $("#back").each(function(){
      var href = $(this).attr("href");
      $(this).attr({ href: "#"});
      $(this).click(function(){
         $("#ajax2").load(href);
      });
   });
   
   $(".jobtitle a").click(function() {
	   var id = $(this).parent().attr("id");
	   $("#description").fadeOut(10).load('apply/getjob.php?id=' + id).fadeIn();
   });
   
});

function validateJob(form) {
	var valid = false;
	for(i = 0; i < form.typeid.length; i++) {
		if(form.typeid[i].checked) {
            valid = true;
        }
    }
	if (valid == false) {
		alert('Please select a Job Type!');
		return false;
	}
	if (form.title.value == "") { alert('Please enter a Job Title!'); return false; }
	if (form.location.value == "") { alert('Please enter a Job Location!'); return false; }
	return true;
}

function confirmDelete() {
	var answer = confirm('Are you sure you want to delete this Job?');
	if (answer) {
		return true;
	}
	return false;
}
/*
$(document).ready(function(){
   $("#nav a").each(function(){
      var href = $(this).attr("href");
      $(this).click(function(){         
         $("#show").hide().load(href).fadeIn("slow"); //Le damos efecto
         $(this).attr({ href: "#"});
      });
   });
});
*/
