$(document).ready(function(){
						   
	dynamicTable();		
	$(".odd").dynamicTableClick();
	$(".even").dynamicTableClick();
	
	var path = location.pathname.substring(1);
	if ( path ) $('#navigation a[@href$="' + path + '"]').addClass('current');
	var path_en = location.pathname.substring(4);
	if ( path_en ) $('#navigation a[@href$="' + path_en + '"]').addClass('current');
	var path = location.pathname.substring(1);
	if ( path ) $($('#sub_menu a[@href$="' + path + '"]').parent()).addClass('current');
	var path_en = location.pathname.substring(4);
	if ( path_en ) $($('#sub_menu a[@href$="' + path_en + '"]').parent()).addClass('current');
	
});

function openWindow( url ) {
  window.open( url, "CareerCross", "width=500,height=400,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=0" );
}

function dynamicTable() {
	$(".content_table tr").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});
	$(".content_table tr:even").addClass("even");
	$(".content_table tr:odd").addClass("odd");

	$(".design_table tr:even").addClass("even2");
	$(".design_table tr:odd").addClass("odd2");
}
//  .content_table clicked
$.fn.dynamicTableClick = function(){
	var clicked = true;
	this.click(function(){
		if(!this.clicked){
			$(this).addClass("down");
		} else {
			$(this).removeClass("down");
		}
		this.clicked = !this.clicked;
	});
};

/* Function resume progress */
function formSubmit ( selectedtype ) {
  document.resume.page.value = selectedtype ;
  document.resume.submit() ;
}

function setApplicationReply( reply_id ) {	
  var reply_hidden = document.getElementById( reply_id );
  var reply = reply_hidden.value;
  document.employer_edit_job.custom_reply.value = reply ;
}

function setApplicationResponseTemplate( reply_id ) {	
  var reply_hidden = document.getElementById( reply_id );
  var reply = reply_hidden.value;
  document.employer_application_respond.message.value = reply ;
  document.employer_application_respond.template_id.value = reply_id;
}

function setContactReply( reply_id ) {	
  var reply_hidden = document.getElementById( reply_id );
  var reply = reply_hidden.value;
  document.employer_contact_candidate.message.value = reply ;
}

function setCoverLetter( reply_id ) {	
  var reply_hidden = document.getElementById( reply_id );
  var reply = reply_hidden.value;
  document.getElementById('coverletter').value = reply ;
}

function setEmailReceiver( email_id ) {
  var email_hidden = document.getElementById( 'receiver'+email_id );
  var email = email_hidden.value;
  document.employer_forward_candidate.receiver_email.value = email ;
  var name_hidden = document.getElementById( 'name'+email_id );
  var name = name_hidden.value;
  document.employer_forward_candidate.receiver_name.value = name ;
}

function setEmailSender( email_id ) {
  var email_hidden = document.getElementById( email_id );
  var email = email_hidden.value;
  document.employer_forward_candidate.email.value = email ;
  var name_hidden = document.getElementById( 'name'+email_id );
  var name = name_hidden.value;
  document.employer_forward_candidate.name.value = name ;
}

function selectAll(obj) { 
	var checkboxes = document.getElementsByTagName('input' ); 
	for( i = 0; i < checkboxes.length; i++) {
           if( checkboxes[i].type == 'checkbox') checkboxes[i].checked = obj.checked;
	} 
}

/*  ----- end document style changes -----  */