//dom ready
$(function(){
	
	$.extend($.fn, {
		callToolTip: function(cssClass){
			if(!cssClass)
				cssClass = 'tooltip';
			$(this).each(function(){
				var  this_rel = $(this).attr('alt');
				$(this).tooltip({ 
					delay: 200, 
					extraClass: cssClass,
					showURL: false, 
					track: true,
					bodyHandler: function() { 
						return this_rel;
					} 
				});
			});
		}
	});	

});


jQuery(document).ready(function($){
	// Hover Class for menu

	$('#navbar li').hover(function() {
		$(this).addClass('side-hover');
			}, function() {
		$(this).removeClass('side-hover');
	});
	
	
	$('.this_hover').hover(function() {
		$(this).addClass('hoverit');
			}, function() {
		$(this).removeClass('hoverit');
	});
	
	// Superfish menu dropdown
	$('ul.nav').superfish({ 
		delay:       1000,
		animation:   {height:'show', opacity: 'show'}, 
		speed:       'fast',
		autoArrows:  false,
		dropShadows: false
	});
	
	// Medua Plugin
	$('.media').media();
	
	// MP3 Plugin
	$('.mp3').media({ height: 20, autoplay: true}); 
	
	// Gallery Widget
	$('div.latestGallery div.thumbImg').hover(function() {
		$(this).addClass('thumbImg_Hover');
			}, function() {
		$(this).removeClass('thumbImg_Hover');
	});
	$('div.latestGallery div.thumbImg').css('opacity', '0.6');
		
	$('div.latestGallery div.thumbImg').mouseover(function(){
		$(this).stop().animate({opacity: 1}, {duration:600})
	})
	.mouseout(function(){
		$(this).stop().animate({opacity: 0.6}, {duration:800})
	});
	
	$('.CallToolTip').callToolTip();
	$('.CallToolTip_red').callToolTip('tooltip_red');
	$('.CallToolTip_orange').callToolTip('tooltip_orange');
	$('.CallToolTip_green').callToolTip('tooltip_green');
	
	
});
