$(document).ready(function(){
	
	// external links
	$('a[rel*=external]').click( function() {
		window.open(this.href);
		return false;
	});

	
	//nav carousel
	$(function() {
		$("#header #nav").jCarouselLite({
			btnNext: ".next",
			btnPrev: ".prev",
			visible: 6,
			start: 0
		});
	});
	
	//nav button rollover
	//image rollover
	$("a.roll").livequery('mouseover focus', function(event) {
		$(this).find('img').attr("src", $(this).find('img').attr("src").split('_f1').join('_f2'))
	}).livequery('mouseout blur', function(event) {/*mouseout*/
		$(this).find('img').attr("src", $(this).find('img').attr("src").split('_f2').join('_f1'))
	});
	
	$("form").livequery('mouseover focus', function(event) {
		$(this).find('input').attr("src", $(this).find('input').attr("src").split('_f1').join('_f2'))
	}).livequery('mouseout blur', function(event) {/*mouseout*/
		$(this).find('input').attr("src", $(this).find('input').attr("src").split('_f2').join('_f1'))
	});
	
	//nav bg switches		
	$("#header #home").bind("mouseenter", function() {
		$(this).addClass("home_hover");
	});
	$("#header #home").bind("mouseleave", function() {
		$(this).removeClass("home_hover");
	});
	
	$("#header #audio").bind("mouseenter", function() {
		$(this).addClass("audio_hover");
	});
	$("#header #audio").bind("mouseleave", function() {
		$(this).removeClass("audio_hover");
	});
	
	$("#header #videos").bind("mouseenter", function() {
		$(this).addClass("videos_hover");
	});
	$("#header #videos").bind("mouseleave", function() {
		$(this).removeClass("videos_hover");
	});
	
	$("#header #literature").bind("mouseenter", function() {
		$(this).addClass("literature_hover");
	});
	$("#header #literature").bind("mouseleave", function() {
		$(this).removeClass("literature_hover");
	});
	
	$("#header #downloads").bind("mouseenter", function() {
		$(this).addClass("downloads_hover");
	});
	$("#header #downloads").bind("mouseleave", function() {
		$(this).removeClass("downloads_hover");
	});
	
	$("#header #contactus").bind("mouseenter", function() {
		$(this).addClass("contactus_hover");
	});
	$("#header #contactus").bind("mouseleave", function() {
		$(this).removeClass("contactus_hover");
	});
	
	$("#header #quran").bind("mouseenter", function() {
		$(this).addClass("quran_hover");
	});
	$("#header #quran").bind("mouseleave", function() {
		$(this).removeClass("quran_hover");
	});
	
	$("#header #events").bind("mouseenter", function() {
		$(this).addClass("events_hover");
	});
	$("#header #events").bind("mouseleave", function() {
		$(this).removeClass("events_hover");
	});

	
});