$(document).ready(function(){

   $("input#search-input").bind(
       'focus',
       function(){
           $("input#search-input").val("")
       }
   );

   var filelinks = jQuery('.filelinks');
   if (filelinks.length > 0) {
   
	filelinks.Accordion({
		header: 'div.title',
		active: false,
		alwaysOpen: false,
		animated: false
	});

	jQuery.Accordion.setDefaults({
		showSpeed: 1000,
		hideSpeed: 150
	});

   }
   
   $(".contact-person").hover(function () {
      $(this).css({ "background-color":"#f9b700" });
         }, 
         function () {
            $(this).css({ "background-color":"white" });
   });   

   // starting the script on page load
	tooltip();
   
});



this.tooltip = function(){	
    /* CONFIG */		
    xOffset = 10;
    yOffset = 20;		
    // these 2 variable determine popup's distance from the cursor
    // you might want to adjust to get the right result		
    /* END CONFIG */		
	$("#navi-main ul ul a").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
            .css("position","absolute")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$("#navi-main ul ul a").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};
