// JavaScript Document


function Search_Field_Validator()
{


if (document.jobssearch.keywords.value == "")
{

alert("Please enter a keyword for a search");

return (false);

}

return (true);
}


function Refine_Search_Field_Validator()
{


if (document.refine_search.keywords.value == "")
{

alert("Please enter a keyword for a search");

return (false);

}

return (true);
}



function Submit_Field_Validator()
{


if (document.rec_friend.friend_name.value == "" || document.rec_friend.friend_email.value == "" && document.rec_friend.myname.value == "" || document.rec_friend.myemail.value == ""  )
{

alert("Please fill all the details");
	
return (false);

}

return (true);
}




// According function


$(document).ready(function(){
	
	
	$(".accordion h3:first").addClass("active");
	$(".accordion p:not(:first)").hide();

	$(".accordion h3").click(function(){
		$(this).next("p").slideToggle("slow")
		.siblings("p:visible").slideUp("slow");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	});

});


// slide up
$(document).ready(function(){

	$(".btn-slide").click(function(){
		$("#panel").slideToggle("slow");
		$(this).toggleClass("active"); return false;
	});
	
	 
});


// Tabbed UI

$(document).ready(function(){
$('#tabs div').hide(); // Hide all divs
$('#tabs div:first').show(); // Show the first div
$('#tabs ul li:first').addClass('active'); // Set the class of the first link to active
$('#tabs ul li a').click(function(){ //When any link is clicked
$('#tabs ul li').removeClass('active'); // Remove active class from all links
$(this).parent().addClass('active'); //Set clicked link class to active
var currentTab = $(this).attr('href'); // Set variable currentTab to value of href attribute of clicked link
$("#tabs div:visible").fadeOut("slow",function(){ //fade out visible div
$(currentTab).fadeIn("slow") //fade in target div
});return false;

});
});


// Javascript Popo Up
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=1024,height=600,left = 660,top = 400');");
}


// Clients logo scroll 
/*


*/


// email validation

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

// Form Validation
function ValidateForm(){
	var emailID=document.test_user.email
	var name = document.test_user.name
	var tel = document.test_user.tel
	
	if ((name.value == null) || (name.value == "")) {
		alert("Please enter your name")
		name.focus()
		return false
	}

	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	
		if ((tel.value == null) || (tel.value == "")) {
		alert("Please enter telephone name")
		tel.focus()
		return false
	}
	return true
 }


// Lates jobs search form
function search_again()
{
	document.refine_search.submit();
}




// Refine Search validator

function refine_validator()
{

if (document.refine_search.job_type.options[document.refine_search.job_type.options.selectedIndex].value == " ")
{

alert("Please select a job type");

return (false);

}

return (true);
}

































