/*
	===========================================================
	Custom Wordpress Theme - UI Effects - "Crunch.js"
	Author: Foxtie Internet
	===========================================================
	Description: jQuery function initialization.
	===========================================================
*/

jQuery(function( $ ){		
	// Put your jQuery here.

	
// Cufon Script Obviously.	
	Cufon.replace('h1',{ fontFamily: 'PMN Caecilia' });
	Cufon.replace('h2',{ fontFamily: 'VAGRounded' });
	Cufon.replace('h3',{ fontFamily: 'VAGRounded' });
	Cufon.replace('.page-template-our-coffee-php #post-sidebar li a',{ fontFamily: 'VAGRounded' });
	Cufon.replace('.page-template-eventspage-php #post-sidebar ul li.calendar span.month',{ fontFamily: 'VAGRounded' });
	Cufon.replace('.page-template-eventspage-php #post-sidebar ul li.calendar span.day',{ fontFamily: 'PMN Caecilia' });
	Cufon.replace('.page-template-eventspage-php #post-sidebar ul li.listing',{ fontFamily: 'PMN Caecilia' });
	Cufon.replace('.page-template-eventspage-php #post-sidebar .eventlink',{ fontFamily: 'VAGRounded' });
	Cufon.replace('.page-template-eventspage-php .event-date',{ fontFamily: 'VAGRounded' });
	Cufon.replace('.classestext .eventlink a',{ fontFamily: 'VAGRounded' });

	// Fancybox
	$("a.fancybox").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300 }); 
		
// Slider Ish
$('.anythingSlider').anythingSlider({
        easing: "linear",                // Anything other than "linear" or "swing" requires the easing plugin
        autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not
        startStopped: false,            // If autoPlay is on, this can force it to start stopped
        delay: 6000,                    // How long between slide transitions in AutoPlay mode
        animationTime: 600,             // How long the slide transition takes
        hashTags: true,                 // Should links change the hashtag in the URL?
        buildNavigation:true,          // If true, builds and list of anchor links to link to each slide
        pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        startText: "Start",             // Start text
        stopText: "Stop"	            // Stop text
});

// AJAX on Click - Coffees page
	$('.coffee-list li a').live('click',function(){
		$('.coffee-yum #post').fadeTo(300, 0.3);
		$('.coffee-yum').load($(this).attr("href")+" .coffee-yum", function(){ Cufon.refresh(); $('.coffee-yum #post').fadeTo(300, 1); });
		return false;
	});
	
	
	// Coffee Map 
	$('.tooltip').hide();
	$('.coffee-hover').stop().fadeTo(1, 0.5);
	$('.coffee-hover').hover(
		function(){
			$(this).stop().fadeTo(250, 1);
			
		}, function(){
			$('.tooltip, .tooltip-alt').hide();
			$(this).stop().fadeTo(200, 0.5);
	});
		
	// Mouse Movement
	$('.coffee-hover').mousemove(function(e) {
   	 thisId = $(this).attr('id');
     var position = $(this).position();
     var offset = $('.banner').offset();
     var x = e.pageX - (offset.left);
     var y = e.pageY - (offset.top);
   
    $('.banner div#'+thisId+'-tip')
      .show()
      .css({'left': x+16, 'top': y+16});
    
    $('#DivPosition')
      .show()
      .html(offset.left+','+offset.top);
    
  });


// Header Slider for Form
 	// hides the cformheader as soon as the DOM is ready
 	// (a little sooner than page load)
	$('#cformheader').hide();  	
  
	// slides down, up, and toggle the slickbox on click    
	$('#show-savaya').click(function() {
  		$('#cformheader').slideToggle(500);
  		return false;
  	});

$('.close').click(function() {
  		$('#cformheader').slideToggle(500);
  		return false;
  	});

		

// Form script for Home Page Sidebar 
	$('input#name').example('Name');
	$('input#ikltuj-ikltuj').example('E-mail Address');
	
	
	
// Events Thingy
$('#eventsform').hide();  
$('.show-eventsform').click(function() {
  	$('#eventsform').toggle(500);
   	return false;
});
  
  
  
});






