/* Main Java Driver for Application
---------------------------------------- */
$(document).ready(function () {

    InitMisc ();
	InitMenus ();
	InitAnimations ();
		    
});





/* *********************************************************************
 * Misc
 * *********************************************************************/
function InitMisc () {
	
	/* *********************************************************************
	 * Notifications
	 * *********************************************************************/
	function InitNotifications () {
		$('.notification .close').click(function () {
			$(this).parent().fadeOut(1000, function() {
				$(this).find('p').fixClearType ();
			});		
			return false;
		});		
	}
	
	$('.notification').delay(8000).fadeOut(1000)
    
	//CUFON - will take the css property of element to do rest
	Cufon.replace('h1, h2, h3, h4, h5', { hover: 'true' });
	
	
    // clear Value from fields with class onFocusEmpty
	$('.onFocusEmpty').focus(function () {
        $(this).val('');
    });

	// Footer Hide Show Tab
    $('#page-footer-tab').click(function () {
        $('#page-footer-wrapper').slideToggle(200);
        
		var showTxt = $('#page-footer-tab-text').attr('showText');
		var hideTxt = $('#page-footer-tab-text').attr('hideText');
		
		
        if ( $('#page-footer-wrapper').hasClass("hide") ){
        	$("#page-footer-tab-text").html(hideTxt);
        	$("#page-footer-wrapper").removeClass("hide");
        	$("span.arrow-white").addClass("down");
        }else{
        	$("#page-footer-tab-text").html(showTxt);
        	$("#page-footer-wrapper").addClass("hide");
        	$("span.arrow-white").removeClass("down");
        }
        
    });


	// facebox 
	$('a[rel*=facebox]').facebox();


	$(".close").click(
		function () {
			$(this).parent().fadeTo(400, 0, function () { // Links with the class "close" will close parent
				$(this).slideUp(600);
			});
			return false;
		}
	);
    
	$(".pricingButton").click(function() {
		document.location = "/site/pricing";
	});
	
	
	$("#stdPlanBtn").click(function() {
		document.location = "https://goodclic.com/claimApp/1";
	});
	
	
	$("#premiumPlanBtn").click(function() {
		document.location = "https://goodclic.com/claimApp/2";
	});
	
	$(".faqButton").click(function() {
		document.location = "/site/faq";
	});
	
	$(".caseStudiesButton").click(function() {
		document.location = "/site/caseStudies";
	});
	
	$(".videoBlogButton").click(function() {
		document.location = "/site/vidsandblogs";
	});
    
    

}


/* *********************************************************************
 * Menus
 * *********************************************************************/
function InitMenus () {
    
    $('.menu li').hover(function () {
       	$(this).find('ul:first').css({'visibility': 'visible', 'display': 'none'}).slideDown();
    }, function () {
        $(this).find('ul:first').css({visibility: "hidden"});

    });
    
}


/* *********************************************************************
 * Animations
 * *********************************************************************/
function InitAnimations () {
    
}
