var $ = jQuery.noConflict();

$(document).ready(function() {



	//When page loads...

	$(".tab_content").hide(); //Hide all content

	$("ul.tabs li:first").addClass("active").show(); //Activate first tab

	$(".tab_content:first").show(); //Show first tab content



	//On Click Event

	$("ul.tabs li").click(function() {



		$("ul.tabs li").removeClass("active"); //Remove any "active" class

		$(this).addClass("active"); //Add "active" class to selected tab

		$(".tab_content").hide(); //Hide all tab content



		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content

		$(activeTab).fadeIn(); //Fade in the active ID content

		return false;

	});



});


$(document).ready(function() {

	//Tooltips

	$(".tip_trigger").hover(function(){

		tip = $(this).find('.tip');

		tip.show(); //Show tooltip

	}, function() {

		tip.hide(); //Hide tooltip		  

	}).mousemove(function(e) {

		var mousex = e.pageX + 20; //Get X coodrinates

		var mousey = e.pageY + 20; //Get Y coordinates

		var tipWidth = tip.width(); //Find width of tooltip

		var tipHeight = tip.height(); //Find height of tooltip

		

		//Distance of element from the right edge of viewport

		var tipVisX = $(window).width() - (mousex + tipWidth);

		//Distance of element from the bottom of viewport

		var tipVisY = $(window).height() - (mousey + tipHeight);

		  

		if ( tipVisX < 20 ) { //If tooltip exceeds the X coordinate of viewport

			mousex = e.pageX - tipWidth - 20;

		} if ( tipVisY < 20 ) { //If tooltip exceeds the Y coordinate of viewport

			mousey = e.pageY - tipHeight - 20;

		} 

		tip.css({  top: mousey, left: mousex });

	});

});



 $(document).ready(function() {



 $("div.scrollable").scrollable({



		size: 3,

		items: '#thumbs',   

		hoverClass: 'hover',

		speed: 400,

		keyboard: false,

		clickable: false



	}).navigator();	

	  

  		

});


 // when the DOM is ready...        



$(document).ready(function () {      



  // load the ticker                 



	createTicker();                    



});                                  



function createTicker(){             



	// put all list elements within #ticker-area into array   



	var tickerLIs = $("#ticker-area ul").children();          



	tickerItems = new Array();                                



	tickerLIs.each(function(el) {                             



		tickerItems.push( jQuery(this).html() );                



	});                                                       



	i = 0                                                     



	rotateTicker();                                           



}                                                           



function rotateTicker(){                                    



	if( i == tickerItems.length ){                            



	  i = 0;                                                  



	}                                                         



  tickerText = tickerItems[i];                              



	c = 0;                                                    



	typetext();                                               



	setTimeout( "rotateTicker()", 5000 );                     



	i++;                                                      



}                                                           



var isInTag = false;                                        



function typetext() {	                                      



	var thisChar = tickerText.substr(c, 1);                   



	if( thisChar == '<' ){ isInTag = true; }                  



	if( thisChar == '>' ){ isInTag = false; }                 



	$('#ticker-area').html("&nbsp;" + tickerText.substr(0, c++));   



	if(c < tickerText.length+1)                                     



		if( isInTag ){                                                



			typetext();                                                 



		}else{                                                        



			setTimeout("typetext()", 28);                               



		}                                                             



	else {                                                          



		c = 1;                                                        



		tickerText = "";                                              



	}	                                                              



}                                                                 

