var $ = jQuery.noConflict();

//Cufon
jQuery(document).ready(function($){Cufon.replace('#content h2, #content h3, #menu_roll a, .section.midtier h4');});

//Gallery fancy box
$(document).ready(function() { 
	 $("#gallery a").fancybox(); 
	 $("a#inline").fancybox({ 'hideOnContentClick': true }); 
	 $("a.fbg").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': false }); 
}); 


//Open in external windows
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

//Scroll
jQuery(document).ready(function($) {
	$('#menu_roll a[href*="#"]').click(function() {
	   var elementClicked = $(this).attr("href");
	   var destination = $(elementClicked).offset().top;
	   $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-250}, 800 );
	   return false;
	});
});

jQuery(document).ready(function($) {
	$('.scroll a[href*="#"]').click(function() {
	   var elementClicked = $(this).attr("href");
	   var destination = $(elementClicked).offset().top;
	   $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-250}, 800 );
	   return false;
	});
});

//JQuery Plugin: "EqualHeights" by:	Scott Jehl, Todd Parker, Maggie Costello Wachs (http://www.filamentgroup.com) 
jQuery(document).ready(function($){ 	
	function equalHeight(group) {
		tallest = 0;
		group.each(function() {
			thisHeight = $(this).height();
			if(thisHeight > tallest) {
				tallest = thisHeight;
			}
		});
		group.height(tallest);
	}

	equalHeight($ ( ".midtier .split" ) );
	
});

//Slider

$(document).ready(function(){	
	$("#slider").easySlider();
});



/*
//Pre and ap ends
jQuery(document).ready(function($){$(".addclass").prepend('add stuff');});

//JQuery Plugin: "EqualHeights" by:	Scott Jehl, Todd Parker, Maggie Costello Wachs (http://www.filamentgroup.com) 
jQuery(document).ready(function($){ 	
	function equalHeight(group) {
		tallest = 0;
		group.each(function() {
			thisHeight = $(this).height();
			if(thisHeight > tallest) {
				tallest = thisHeight;
			}
		});
		group.height(tallest);
	}

	equalHeight($ ( "add stuff" ) );
	
});

*/
