/*

File: custom.js

For: Landed!
Author: Luke Smith - HisHandiwork.biz
Created: 01/21/11

*/



//Defining the elements that will be replaced with the Cufon font
$(document).ready(function(){
	Cufon.replace('h1', { fontFamily: 'eurostile' });
	Cufon.replace('h2', { fontFamily: 'eurostile' });
	Cufon.replace('h3', { fontFamily: 'eurostile' });
	Cufon.replace('h4', { fontFamily: 'eurostile' });
	Cufon.replace('label', { fontFamily: 'eurostile' });
	Cufon.replace('.btn', { fontFamily: 'eurostile' });
});

// Nivo Slider
jQuery(window).load(function() {
	$('.slider').nivoSlider({
		effect:             'random',
		startSlide:         0, //Set starting Slide (0 index)
		animSpeed:          500, //Slide transition speed
		pauseTime:          5000,
		captionOpacity:     0.6, //Caption Opacity
		directionNavHide:   true, //Only show on hover
		pauseOnHover:       false //Stop animation while hovering
	});
});

// JCarousel
jQuery(document).ready(function() {

	jQuery('#mycarousel').jcarousel({
		auto:               4.5,
		vertical:           true,
		wrap:               'last',
		animation:          500,
		scroll:             1
	});
	
});

/* Text hide for the subscribe text box */							
$(document).ready(function(){
	$('.default-value').each(function() {
	    var default_value = this.value;
	    $(this).css('color', '#cccccc');
	    $(this).focus(function() {
	        if(this.value == default_value) {
	            this.value = '';
	            $(this).css('color', '#555555');
	        }
	    });
	    $(this).blur(function() {
	        if(this.value == '') {
	            this.value = default_value;
	            $(this).css('color', '#cccccc');
	        }
	    });
	});
});

/* Fancybox */
jQuery(document).ready(function() {

	//display image
	$("a.fancy").fancybox({
		'opacity'		: true,
		'overlayShow'	       : true,
		'overlayOpacity'     : 0.5,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic'
	});
	
	//display text
	$(".text").fancybox({
		'titlePosition'     : 'inside',
		'transitionIn'      : 'elastic',
		'transitionOut'     : 'elastic'
	});
	
	//display Flash
	$(".flash").fancybox({
		'padding'           : 0,
		'autoScale'         : false,
		'transitionIn'      : 'elastic',
		'transitionOut'     : 'elastic'
	});


});

/* Image Zoom */
$(document).ready(function() {
	$("a.fancy img").mouseover(function(){
		$(this).stop(true,true);
		$(this).fadeTo(300, 0.6);
	});
	
	$("a.fancy img").mouseout(function(){
		$(this).fadeTo(400, 1.0);
	});
 
});

/* Tipsy For Replacing The "Title" Attribute Values */
jQuery(document).ready(function(){
	
	$('a.tipsy').tipsy({
	
		delayIn: 0,      // delay before showing tooltip (ms)
		delayOut: 0,     // delay before hiding tooltip (ms)
		fade: true,     // fade tooltips in/out?
		fallback: '',    // fallback text to use when no tooltip text
		gravity: 's',    // gravity
		html: false,     // is tooltip content HTML?
		live: false,     // use live event support?
		offset: 15,       // pixel offset of tooltip from element
		opacity: 0.8,    // opacity of tooltip
		title: 'title',  // attribute/callback containing tooltip text
		trigger: 'hover' // how tooltip is triggered - hover | focus | manual
	
	});
	
});


