$(document).ready(function() {
	
	$("#header .page_item").find('ul').css({ display: 'none' });
	


  $("#header .page_item").hover(function() {
								 

		 
	  $(this).find('ul').slideDown(300, function (){$(this).parent().find("a").filter("ul").css({color: '#a2a2a2', backgroundColor: '#eaeaea' });});

	  
	  } , function() {
  
	  $(this).find('ul').slideUp(300);

  });
  
  
  




$("#progs_table tbody tr").hover(function() {

	$(this).addClass("t_highlight");
	$(this).animate({backgroundColor:'#bde06a'}, 250);

	  
	  } , function() {
	$(this).removeClass("t_highlight");
	$(this).animate({backgroundColor:'#ffffff'}, 250);

  });



$("#progs_table tbody tr").click(function(e){ 
										  
		//  Set default url to redirect to...
		var url = 'http://aeple.pt/online-assessment/';
		
		
		// Set variable to handle the table row attribute ID
		var id = $(this).attr("id");
		
		
		
		// Check to see which school was clicked and redirect to their page.
 	if(id=="arsl") {
	var url = 'http://aeple.pt/aeple-members/royal-school-of-languages/';
	}
	if(id=="falm") {
	var url = 'http://aeple.pt/aeple-members/academia-de-linguas-da-madeira/';
	}
	if(id=="lcial") {
	var url = 'http://aeple.pt/aeple-members/cial-centro-de-linguas/';
	}
	if(id=="lox") {
	var url = 'http://aeple.pt/aeple-members/oxford-school/';
	}
	if(id=="lport") {
	var url = 'http://aeple.pt/aeple-members/inlingua-porto/';
	}
	if(id=="lsee") {
	var url = 'http://aeple.pt/aeple-members/see-learning-center/';
	}
	if(id=="pinl") {
	var url = 'http://aeple.pt/aeple-members/portlingua/';
	}
			

    		document.location.href = url;
			return false;

});




$("#arsl, #falm, #lcial, #lox, #lport, #lsee, #pinl").tooltip({ 
	track: true, 
    delay: 0, 
    fade: 250,
	extraClass: "contact_tips", 
    fixPNG: true, 
    bodyHandler: function() {
	 return $('#'+$(this).attr("id")+'-tip').html();
    }, 
    showURL: false 
});

$("#brasil_map, #ginnea_map, #port_map, #moz_map, #timor_map, #stp_map, #angola_map, #cabo_map, #port_map").css({opacity:0});

$("#PortMap > area").tooltip({ 
	track: true, 
    delay: 0, 
    fade: 250,
	extraClass: "world_tips",
	opacity: 1,
    fixPNG: true, 
    bodyHandler: function() {
	$($(this).attr("href")).animate({opacity:1}, 300);
	 return $($(this).attr("href")+'-tip').html();
    }, 
    showURL: false 
});




$("#ContactMap > area").tooltip({ 
	track: true, 
    delay: 0, 
    fade: 250,
	extraClass: "contact_tips",
	opacity: 1,
    fixPNG: true, 
    bodyHandler: function() {
	 return $($(this).attr("href")).html();
    }, 
    showURL: false
});
 

});