// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

// script to set up lightbox
$(document).ready(function(){
	$("a[rel='lightbox']").colorbox({transition:"fade"});
});

function manage_video_add_category() {
  var ajax_url = 	'/admin/videos/add_category?title=' + escape($F('new_video_category_name'));
  new Ajax.Updater('video_category_select',ajax_url,{asynchronous:true, evalScripts:true}); 
  $('category_busy').show();
  $('category_form').hide();
  return false;
}

$(document).ready(function(){
  // $("#slider").imAnimTabber({
  //  mode: 'manual',
  //  attribute: 'fade',
  //  tabs: [ {"content_id": "media_tab", "class_name": "media_tab", "active_tab_class": "media_sel"},
  //      {"content_id": "services_tab", "class_name": "services_tab", "active_tab_class": "services_sel"},
  //      {"content_id": "news_tab", "class_name": "news_tab", "active_tab_class": "news_sel"},
  //      {"content_id": "about_tab", "class_name": "about_tab", "active_tab_class": "about_sel", "selected": true} ]
  // });
});

$(function(){
	$("div.home_about").carousel({ loop: true, autoSlide: true, slideSpeed: "slow", effect: "fade", autoSlideInterval: 3750
	});
});

$(function(){
	$("div.client_bar").carousel({ loop: true, autoSlide: false, slideSpeed: "slow", autoSlideInterval: 2500,
		nextBtn: '<img src="images/btn_right_clients.gif" alt="next" />',
		prevBtn: '<img src="images/btn_left_clients.gif" alt="prev" />'
	});
});

$(function(){
	$("div.home_images").carousel({ loop: true, autoSlide: true, slideSpeed: "slow", effect: "fade", pagination: true, autoSlideInterval: 7500
	});
});

// not the best way to do it, but meh
function change_tab(tab) {
  $('.about_tab').removeClass('about_sel');
  $('#about_tab').hide();
  
  $('.news_tab').removeClass('news_sel');
  $('#news_tab').hide();
  
  $('.services_tab').removeClass('services_sel');
  $('#services_tab').hide();
  
  $('.media_tab').removeClass('media_sel');
  $('#media_tab').hide();
  
  $('.' + tab + '_tab').addClass(tab + '_sel');
  $('#' + tab + '_tab').show();
}

$(document).ready(function(){
	$('.client').hover(function(){  
	         $(".cover", this).stop().animate({top:'164px'},{queue:false,duration:400});  
	     }, function() {  
	         $(".cover", this).stop().animate({top:'208px'},{queue:false,duration:400});  
	});
});



