try{Typekit.load();}catch(e){}

Cufon.replace('h2', {hover: true, hoverables: { li: true, a: true, h2:true, p:true, em:true }}

);

$(document).ready(function(){

/* Nav */

	function main_hover(){
	
		
	
		$(this).children('.parent-n').css("color", "#FF00FF");
	
		$(this).find('ul').show();
		
		$(this).find('ul li').hide();
	
		$(this).find('ul li').slideDown('fast');
		
		
	
	};
	
	function main_out(){
	
		$(this).children('.parent-n').css("color", "#000000");
		
		$(this).find('ul li').slideUp('fast');
		

		
	};
	

	
	var config = {
     sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
     interval: 100, // number = milliseconds for onMouseOver polling interval
     over: main_hover, // function = onMouseOver callback (REQUIRED)
     timeout: 500, // number = milliseconds delay before onMouseOut
     out: main_out // function = onMouseOut callback (REQUIRED)
	};
	
	$("#nav ul li").hoverIntent(config); //Trigger Hover intent with custom configurations
	
	

	/* articles */
	
	//$("#share-links").hide();
	
	$("#share-btn").click(function(e){
		e.preventDefault();
		$(this).parent().next("#share-links").slideToggle("slow");
		$(this).toggleClass("active"); return false;
	});
	
	
	
	/* Gallery */
	
	/*$("#viewGallery").click(function() {
		$.fancybox([
			'http://farm5.static.flickr.com/4044/4286199901_33844563eb.jpg',
			'http://farm3.static.flickr.com/2687/4220681515_cc4f42d6b9.jpg',
			{
				'href'	: 'http://farm5.static.flickr.com/4005/4213562882_851e92f326.jpg',
				'title'	: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit'
			}
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'changeFade'        : 0
		});
	});*/
	
	/* Mailing list */
	
	/*$("#mailinglist a.signup").click(function(e){
		
		e.preventDefault();
		
		var newEmail = $("#mailinglist #box").val();
		
		if(isValidEmailAddress(newEmail)){
		
			$.post('./site/mailing/signup',
				{ email: newEmail},
				function(data){
					$("#mailinglist #box").val('THANK YOU!');
				}
			);
			
		} else {
			$("#mailinglist #box").val('PLEASE ENTER A VALID EMAIL');
		}
		
	});
	
	$("#mailinglist #box").focus(function(){
		if($(this).val() == "EMAIL"){
			$(this).val('');
		}
	});

	$("#mailinglist #box").blur(function(){
		if($(this).val() == ""){
			$(this).val('EMAIL');
		}
	});
	
	function isValidEmailAddress(emailAddress) {
	var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
	return pattern.test(emailAddress);
	}*/
	
	
	/* Search */
	
	$("#search #box").focus(function(){
		if($(this).val() == "SEARCH"){
			$(this).val('');
		}
	});

	$("#search #box").blur(function(){
		if($(this).val() == ""){
			$(this).val('SEARCH');
		}
	});
	
	
	
	/* SearchP */
	
	$("#searchPanel #box").focus(function(){
		if($(this).val() == "SEARCH"){
			$(this).val('');
		}
	});

	$("#searchPanel #box").blur(function(){
		if($(this).val() == ""){
			$(this).val('SEARCH');
		}
	});

	
	
	
	
	

 
});


