//DROPDOWN MENU
$(function(){

    $("ul.dropdown li").hover(function(){
    
        $(this).addClass("hold");
        $('ul:first',this).css('visibility', 'visible');
    
    }, function(){
    
        $(this).removeClass("hold");
        $('ul:first',this).css('visibility', 'hidden');
    
    });
    
    $("ul.dropdown li ul li:has(ul)").find("a:first").append(" &raquo; ");

});


//COLORBOX
$(document).ready(function(){
	//Examples of how to assign the ColorBox event to elements
	$("a[rel='lightbox']").colorbox();
	$(".mLogin").colorbox();
	$(".mSignup").colorbox();
});


//IMAGE ROTATE
$(document).ready(function(){
	$('ul#FBA').innerfade({
		speed: 1000,
		timeout: 5000,
		type: 'sequence',
		containerheight: '120px'
	});
	$('ul#FBB').innerfade({
		speed: 1000,
		timeout: 9999,
		type: 'sequence',
		containerheight: '120px'
	});
	$('ul#FBC').innerfade({
		speed: 1000,
		timeout: 7500,
		type: 'sequence',
		containerheight: '120px'
	});
	$('ul#quoteRotate').innerfade({
		speed: 1000,
		timeout: 7500,
		type: 'sequence',
		containerheight: '40px'
	});
});

//CHECK/UNCHECK ALL
$(document).ready(function() {
	$("#checkALL").click(function(e) {
		e.preventDefault;
		return false;
	});
	$("#checkALL").click(function() {
		$("input[type='checkbox']:not([disabled='disabled'])").attr('checked', true);
	});

	$("#uncheckALL").click(function(e) {
		e.preventDefault;
		return false;
	});
	$("#uncheckALL").click(function() {
		$("input[type='checkbox']").attr('checked', false);
	});
});

//FORM SUBMIT LOADER
$(document).ready(function() {
	$('#loaderForm').bind('submit', function() {
		$('#ajax-button').hide()
		$('#ajax-loading').show()
	});
});

//SIMPLE BOOKMARK CODE
$(document).ready(function(){
	$("a.jQueryBookmark").click(function(e){
		e.preventDefault(); // this will prevent the anchor tag from going the user off to the link
		var bookmarkUrl = this.href;
		var bookmarkTitle = this.title;
	 
		if (window.sidebar) { // For Mozilla Firefox Bookmark
			window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,"");
		} else if( window.external || document.all) { // For IE Favorite
			window.external.AddFavorite( bookmarkUrl, bookmarkTitle);
		} else if(window.opera) { // For Opera Browsers
			$("a.jQueryBookmark").attr("href",bookmarkUrl);
			$("a.jQueryBookmark").attr("title",bookmarkTitle);
			$("a.jQueryBookmark").attr("rel","sidebar");
		} else { // for other browsers which does not support
			 alert('Your browser does not support this bookmark action');
			 return false;
		}
	});
});

//EASY SLIDER
$(document).ready(function(){	
	$("#slider").easySlider({
		auto: true, 
		continuous: true,
		numeric: true
	});
	$('.quotebtn').click(function(){
		$('#quoteform').fadeIn(2000);
		$('.overlay').fadeIn(1000);
	});
	$('#closebtn').click(function(){
		$('#quoteform').fadeOut(1000);
		$('.overlay').fadeOut(1000);
	});
});


