// JavaScript Document
$(document).ready(function(){
						   						   
	//Courtesy of jQuery Tools Scrollable (http://flowplayer.org/tools/scrollable.html)
	// select one or more elements to be scrollable-enabled 
	$("div.scrollable").scrollable({ 
		// one configuration property 
		size: 2,
		speed: 1000,
		interval: 3000,
		loop: true,
		onBeforeSeek: function() {
			this.getItems().fadeTo(0, 0.2);		
		},
		// when seek ends resume items to full transparency
		onSeek: function() {
			this.getItems().fadeTo(0, 1);
		}
		// ... the rest of the configuration properties 
	});
	
	//Adding target="_blank" to anchor tags.
	$("div.items div a").attr({ target: "_blank" });
	
	
	
	//Courtesy of http://www.kriesi.at/archives/create-simple-tooltips-with-css-and-jquery
	simple_tooltip("div.items div a","tooltip");
});	

	
//Courtesy of http://www.kriesi.at/archives/create-simple-tooltips-with-css-and-jquery
function simple_tooltip(target_items, name){
 $(target_items).each(function(i){
		$("body").append("<div class='"+name+"' id='"+name+i+"'><p>"+$(this).attr('title')+"</p></div>");
		var my_tooltip = $("#"+name+i);

		if($(this).attr("title") != ""){ // checks if there is a title

		$(this).removeAttr("title").mouseover(function(){
				my_tooltip.css({opacity:0.8, display:"none"}).fadeIn(500);
		}).mousemove(function(kmouse){
				my_tooltip.css({left:kmouse.pageX+15, top:kmouse.pageY+15});
		}).mouseout(function(){
				my_tooltip.fadeOut(500);
		});

		}
	});
}

$().ready(function() {  
    $('.kwicks').kwicks({  
        max: 450,  
        spacing: 0,  
        duration: 700,  
        easing: 'easeOutCubic'   
    });  
});  
