

jQuery.scrollToTop = function(){
	$('.toTheTop').unbind().bind('click', function(){
		  $('html, body').animate({scrollTop:0}, '4000');
		  return false;
	});
}

jQuery.newWindow = function(){
	$('.newWindow').unbind().bind('click', function(){
		  window.open(this.href);
		  return false;
	});
}


jQuery.slToolTips = function(){
	// VIDEO AVAILABLE
	slVideoContent = $('.SLVideoAvailable a').html(); // GET HTML FROM LINK 
	$('.SLVideoAvailable a').text("");
	$('.SLVideoAvailable a').append('<span>' + slVideoContent + '</span>');
	$('.SLVideoAvailable a span').fadeOut(0);
	$('.SLVideoAvailable a').hover(function() {
		$(this).children('span').fadeIn(200);
				} , function() {
		$(this).children('span').fadeOut(200);
				});
	
	// FINANCE AVAILABLE
	slFinanceContent = $('.SLFinanceAvailable a').html(); // GET HTML FROM LINK
	$('.SLFinanceAvailable a').text("");
	$('.SLFinanceAvailable a').append('<span>' + slFinanceContent + '</span>');
	$('.SLFinanceAvailable a span').fadeOut(0);
	$('.SLFinanceAvailable a').hover(function() {
		$(this).children('span').fadeIn(200);
				} , function() {
		$(this).children('span').fadeOut(200);
				});
	
	// MORE PHOTOS AVAILABLE
	slMoreImagesContent = $('.SLMoreImagesAvailable a').html(); // GET HTML FROM LINK 
	$('.SLMoreImagesAvailable a').text("");
	$('.SLMoreImagesAvailable a').append('<span>' + slMoreImagesContent + '</span>');
	$('.SLMoreImagesAvailable a span').fadeOut(0);
	$('.SLMoreImagesAvailable a').hover(function() {
		$(this).children('span').fadeIn(200);
				} , function() {
		$(this).children('span').fadeOut(200);
				});
}



jQuery.vdButtons = function(){
	// ADD CLASSES TO VD BUTTONS BASED ON THEIR TITLE ATTRIBUTE TEXT
	$('ul.vd-buttons li').each(function(idx) {
					ref = $(this).children('a').attr('title').replace(/ /g,'');
;
					$(this).children('a').addClass(ref);						
				});
}


jQuery.jTabs = function(){
		//Default Action
	$(".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 rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
}


jQuery.hoursTable = function(){
	$(document).ready(function() {	   
			$('.hourstable tbody tr:odd').addClass('odd');
			$('.hourstable tbody tr:even').addClass('even');
		});
}




