var mylib =
{
	cycle_image :
	{
		init : function()
		{
			  //********************************************************************
			  //image cycle
			  $('#image-cycle').cycle({fx: 'fade',timeout:  3000});
		}
	},
	navigation :
	{
		init : function()
		{			  
			  //********************************************************************
			  //main navigation
			  
			        var config = {    
				         sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
				         interval: 200,  // number = milliseconds for onMouseOver polling interval    
				         over: doOpen,   // function = onMouseOver callback (REQUIRED)    
				         timeout: 200,   // number = milliseconds delay before onMouseOut    
				         out: doClose    // function = onMouseOut callback (REQUIRED)    
				    };
				    
				    function doOpen() {
				        $(this).addClass("hover");
				        $('ul:first',this).css('visibility', 'visible');
				    }
				 
				    function doClose() {
				        $(this).removeClass("hover");
				        $('ul:first',this).css('visibility', 'hidden');
				    }
				
				    $("ul.dropdown li").hoverIntent(config);
				    
				    $("ul.dropdown li ul li:has(ul)").find("a:first").append(" <span class=\"raquo\">&raquo;</span> ");
				    


		}
	},
	enhance :
	{
		init : function()
		{
			  //********************************************************************
			  //Things to enhance the page

				$('#inner-page-content a').filter(function() {
				    return this.hostname && this.hostname !== location.hostname;
				}).attr('target','_blank');
				

				var ext = "";
				$('#inner-page-content a').each(function() {
					ext = $(this).attr("href").split('.').pop().toLowerCase();
					$(this).addClass("mime-"+ext);
					if(ext=='pdf'){
						$(this).attr('target','_blank');
					}
				});


		}
	}
		
}

$(window).load(function() {	

  mylib.cycle_image.init();
  mylib.navigation.init();
  mylib.enhance.init();		

});
