jQuery.noConflict();


function gotoPage(page,size) { 
	var curheight = jQuery('.entry').filter(':visible').outerHeight();
	var newheight = jQuery('#'+page).outerHeight();
//check if same page?
	jQuery('.entry').filter(':visible').fadeOut(500,function(){} );
	jQuery("#content-area").animate({ height:newheight }, 500, "linear", function(){ jQuery('#'+page).eq(0).fadeIn(500) } );
/* 	jQuery("#services").animate({ height:newheight }, 500, "linear" */
};
	/*
	jQuery('.entry').filter(':visible').fadeOut(500,function(){} );
	jQuery("#services").animate({ height:newheight }, 500, "linear", function(){jQuery('#'+page).eq(0).fadeIn(500);} );
	window.location.hash = "";
	*/
	
	/* jQuery("#services").css({height:newheight}); */

	/*
	jQuery("#services").filter(':visible')
		.animate( {opacity: 'hide'},500, function(){
			jQuery(this).parent().find('>div').eq(jQuery('#'+page)).animate( {opacity: 'show'},500 );
		} )
	*/

	/*
	$service_tabs.css({height:next_tab_height});
	$service_div.filter(':visible')
		.animate( {opacity: 'hide'},500, function(){
			jQuery(this).parent().find('>div').eq(next_tab).animate( {opacity: 'show'},500 );
		} )
	*/

	
function init () {
	var anchorText = window.location.hash.replace( /#/, "");
	if(anchorText) {
        gotoPage(anchorText);
        window.location.hash = "";
	} else {
		jQuery("#services .entry").filter(':first').show(); 
	};
};




window.onload = init;

jQuery(document).ready(function() {
	/*
var anchorText = window.location.hash.replace( /#/, "");
	if(anchorText) {
		gotoPage(anchorText);
        window.location.hash = "";
	} else {

	jQuery("#main-container").css("display", "none");
    jQuery("#main-container").fadeIn(1000);
	jQuery("a").click(function(event){
        event.preventDefault();
        linkLocation = this.href;
        jQuery("#main-container").fadeOut(1000, redirectPage);
    });
    };
    
    function redirectPage() {
        window.location = linkLocation;
    }
*/

/* load slider */
	jQuery('#slider').s3Slider({
		timeOut: 8000
	});


/* 	search box actions */
	jQuery("#searchinput").focus(function() {
		if(jQuery(this).val()=="search this site..." ){ 
			jQuery(this).val(''); 
		} else {
			jQuery(this).select();
		} 
	});
	
});





/* <![CDATA[ */
jQuery(document).ready(function() {     
 /*
   jQuery("a[class^='fancybox']").fancybox({
        'overlayOpacity'    :   0.7,
        'overlayColor'      :   '#000000',
        'zoomSpeedIn'       :   500,
        'zoomSpeedOut'      :   500
    });
*/
    
    var $portfolioItem = jQuery('.custom_gallery_entry ');
/*     $portfolioItem.find('.custom_gallery_image').css('background-color','#000000'); */
    jQuery('.zoom-icon, .more-icon').css({'opacity':'0','visibility':'visible'});
    
    $portfolioItem.hover(function(){
        jQuery(this).find('.custom_gallery_image').stop(true, true).animate({top: -10}, 500).find('img.portfolio').stop(true, true).animate({opacity: 0.7},500);
        jQuery(this).find('.zoom-icon').stop(true, true).animate({opacity: 1, left: 80},400);
        jQuery(this).find('.more-icon').stop(true, true).animate({opacity: 1, left: 110},400);
    }, function(){
        jQuery(this).find('.zoom-icon').stop(true, true).animate({opacity: 0, left: 75},400);
        jQuery(this).find('.more-icon').stop(true, true).animate({opacity: 0, left: 128},400);
        jQuery(this).find('.custom_gallery_image').stop(true, true).animate({top: 0}, 500).find('img.portfolio').stop(true, true).animate({opacity: 1},500);
    });
        
            
});
/* ]]> */




jQuery(window).load(function(){
    jQuery('#testimonial1').append('<iframe src="http://player.vimeo.com/video/19204043?byline=0&amp;portrait=0" width="560" height="420" frameborder="0"></iframe>');
    jQuery('#testimonial2').append('<iframe src="http://player.vimeo.com/video/19204096?byline=0&amp;portrait=0" width="560" height="420" frameborder="0"></iframe>');
    jQuery('#testimonial3').append('<iframe src="http://player.vimeo.com/video/19204107?byline=0&amp;portrait=0" width="560" height="420" frameborder="0"></iframe>');
});


	/* page transitions ***
	jQuery("body").css("display", "none");
 
    jQuery("body").fadeIn(500);
 
    jQuery("a").click(function(event){
        event.preventDefault();
        linkLocation = this.href;
        jQuery("body").fadeOut(500, redirectPage);
    });
 
    function redirectPage() {
        window.location = linkLocation;
    }
	*/

/*
jQuery('.entry').height(curheight)
				.css({cursor:"auto", backgroundColor:"green"});
    });
*/

/* 	#searchinput:focus */
/*
.page-item-30 ul.children

http://www.yourjourneyforhealth.com/services/
*/



/* 	window.location.hash = stateData; */
	

/*
	var $featured_content = jQuery('#featured_content'),
		$service_tabs = jQuery('#services'),
		$home_tabs = jQuery("ul#main-tabs");
*/




/*




function et_service_tabs($service_tabs){
			var active_tabstate = 'ui-state-active',
			active_tab = 0,
			$service_div = $service_tabs.find('>div').hide(),
			$service_li = $service_tabs.find('>ul>li');
		
			$service_div.filter(':first').show();
			$service_li.filter(':first').addClass(active_tabstate);
					
			$service_li.find('a').click(function(){
				var $a = jQuery(this),
					next_tab = $a.parent('li').prevAll().length,
					next_tab_height = $service_tabs.find('>div').eq(next_tab).outerHeight();
				
				if ( next_tab != active_tab ) {
					$service_tabs.css({height:next_tab_height});
					$service_div.filter(':visible')
						.animate( {opacity: 'hide'},500, function(){
							jQuery(this).parent().find('>div').eq(next_tab).animate( {opacity: 'show'},500 );
						} )
						//.end()
						//.eq(next_tab)
						//.animate( {opacity: 'show'},500 )
						;
					$service_li.removeClass(active_tabstate).filter(':eq('+next_tab+')').addClass(active_tabstate);
					active_tab = next_tab;
				}
				
				return false;
			}).hover(function(){
				if ( !jQuery(this).parent('li').hasClass(active_tabstate) && !is_ie ) jQuery(this).fadeTo('slow',.7);
			}, function(){
				if (!is_ie) jQuery(this).fadeTo('slow',1);
			});
		}




jQuery('#service_allergy_elimination').outerHeight();


*/


/*
#menu-item-248 hover
load subnav


subnav.click
	.entry load page




*/
