//	jQuery Compatibility Method
var $j = jQuery.noConflict();





$j("document").ready(function(){





	//	hash to tag based on 'id' attribute (creates scrolling animation)
	
	$j('[href^=#]').click(function(event){
		if($j(this).attr('href').slice(1))
		{
			$j('html,body').animate({scrollTop: $j('[id=' + this.hash.slice(1) +']').offset().top}, 1000);
		}
		else
		{
			$j('html,body').animate({scrollTop: 0}, 1000);
		}
	});
	
	
	
	
	// Dynamic call to action based on hover of menu titles
	
	var current_html = '';
	var dynamic_html = '';
	var added_html = ' <a href="contact.html">book now</a>';
	
	$j('.menu h3').hover(function(){
		current_html = false;
		current_html = $j(this).children('.description').html();
		dynamic_html = current_html + added_html;
		$j(this).children('.description').html(dynamic_html);
	});
	
	$j('.menu h3').mouseleave(function(){

		$j(this).children('.description').html(current_html);
		current_html = false;
	});
	
	$j('.menu h4').hover(function(){
		current_html = false;
		current_html = $j(this).children('.description').html();
		dynamic_html = current_html + added_html;
		$j(this).children('.description').html(dynamic_html);
	});
	
	$j('.menu h4').mouseleave(function(){

		$j(this).children('.description').html(current_html);
		current_html = false;
	});
	
	
	
	
	// Wufoo form
	
	/*
	var wufoo_html = '<iframe id="wufoo" height="600" allowTransparency="true" frameborder="0" scrolling="no" style="width:100%;border:none"  src="http://clinicalesthetics.wufoo.com/embed/z7x4z5/"></iframe>';
	
	try
	{
		$j('.wufoo').html(wufoo_html);
	}
	catch(e)
	{
		// nothing
	}
	
	// Wufoo contact form
	
	var wufoo_contact_html = '<iframe height="720" allowTransparency="true" frameborder="0" scrolling="no" style="width:100%;border:none"  src="https://clinicalesthetics.wufoo.com/embed/m7x4a3/">';
	
	try
	{
		$j('.wufoo_contact').html(wufoo_contact_html);
	}
	catch(e)
	{
		// nothing
	}
	*/

	// Google map
	
	var google_map_html = '<iframe width="379" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?hl=en&amp;ie=UTF8&amp;q=clinical+esthetics+palm+beach+gardens&amp;fb=1&amp;split=1&amp;gl=us&amp;ei=49g3SpmnG6eijQP92vzlAw&amp;sig2=MNPt0AXUIEblifejhwUI2w&amp;cd=1&amp;cid=26842845,-80090113,4318081677992078779&amp;li=lmd&amp;ll=26.842845,-80.090113&amp;spn=0.006295,0.006295&amp;output=embed"></iframe>';
	
	try
	{
		$j('.google_map').html(google_map_html);
	}
	catch(e)
	{
		// nothing
	}




}); // document.ready
