$(document).ready(function() {
						   
	Cufon.replace('h1, h2, h3, h4, h5, .dropcap', {
		fontFamily: 'PT Sans'
	});
	
	Cufon.replace('footer h4', {
		fontFamily: 'PT Sans',
		textShadow: '#000 0px 1px 0px;'
	});
							
	Cufon.replace('#sidebar .widget span h3, h3.trigger', {
		fontFamily: 'PT Sans',
		textShadow: '#fff 0px 1px 0px;'
	});
	
    
	
	$('.testimonials').cycle({
		fx: 'scrollHorz', // http://jquery.malsup.com/cycle/browser.html
		prev:   '.testimonials_nav .prev', 
    	next:   '.testimonials_nav .next',
		timeout: 6000,
		speed: 500
	});
	
	//Quick Contact Form styling
	$(".quick_contact input").click(function(){
			$(this).next().fadeOut(100);
	});
	
	
	
	
	//Sidebar Menu Function
	$('#sidebar .widget ul li ul').parent().addClass('hasChildren').children('a').append("<span />");
	var children;
	$("#sidebar .widget ul li").hoverIntent(
								  function () {
									children = $(this).children("ul");
									if($(children).length > 0){
											$(children).stop(true, true).slideDown('fast');	   
									}
								  }, 
								  function () {
									  $(this).children('ul').stop(true, true).slideUp(500);
								  }
	);
	
	//Lightbox
	$("a[rel^='prettyPhoto']").prettyPhoto({show_title: false, social_tools: '<div class="pp_social"><div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&href='+location.href+'&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div></div>' });
	
	//Tabs
	$("ul.tabs").tabs("div.panes > div");
	$(".accordion").tabs(".accordion div.pane", {tabs: 'h2', effect: 'slide', initialIndex: null});
	
	//Hide (Collapse) the toggle containers on load
	$(".toggle_container").hide(); 

	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$("h3.trigger").click(function(){
		$(this).children("a").toggleClass("active").parent().next().slideToggle("slow");
		return false; //Prevent the browser jump to the link anchor
	});
	
	//Current Nav
	$(".jqueryslidemenu .current_page_item > a").addClass("current_nav");
							$(".jqueryslidemenu .current-menu-item > a").addClass("current_nav");
							
							
							if ($(".jqueryslidemenu .current_page_parent").length>0) {
								$(".jqueryslidemenu .current_page_parent > a").addClass("current_nav");
								$(".jqueryslidemenu .current_page_parent ul li").removeClass("current_page_item");
								$(".jqueryslidemenu .current_page_parent ul li a").removeClass("current_nav");
							}
							
							if ($(".jqueryslidemenu .current-menu-parent").length>0) {
								$(".jqueryslidemenu .current-menu-parent > a").addClass("current_nav");
								$(".jqueryslidemenu .current-menu-parent ul li").removeClass("current_page_item");
								$(".jqueryslidemenu .current-menu-parent ul li").removeClass("current-menu-item");
								$(".jqueryslidemenu .current-menu-parent ul li a").removeClass("current_nav");
							}


	
});
