//	PLACEHOLDER PLUGIN v1.1
(function($){var phClass="placeholder",pluginName="html5Forms",fieldsToCheck="input[type='text'], input[type='email'], input[type='search'], input[type='tel'], input[type='url'], input[type='password'], textarea",methods={init:function(o,callback){return this.each(function(){var $this=$(this),data=$this.data(pluginName);if(!data){var fieldTypes=$this.find(fieldsToCheck),settings={placeholderClass:phClass,alertText:"test this mutha"};if(o){$.extend(settings,o);};$.each(fieldTypes,function(i,f){var ph=$(f).attr("placeholder"),parent=$(f).parents("form:first");if(ph==$(f).val()||$.trim($(f).val())==""){$(f).val(ph).addClass(phClass);};$(f).bind("focus",function(){methods.fieldFocus.call($(this),ph);});$(f).bind("blur",function(){methods.fieldBlur.call($(this),ph);});$(f).bind("submit",function(){methods.clearValue.call($(this),ph);});});var instanceObj={settings:settings};$this.data(pluginName,instanceObj);};if(typeof callback!="undefined"){callback();};});},fieldFocus:function(ph){return this.each(function(){var $this=$(this);$this.removeClass(phClass);methods.clearValue.call($this,ph);});},fieldBlur:function(ph){return this.each(function(){var $this=$(this);if($.trim($this.val())==""){$this.addClass(phClass).val(ph);};});},clearValue:function(ph){return this.each(function(){var $this=$(this);if($this.val()==ph){$this.val("");};});}};$.fn.html5Forms=function(m){var fakeInput=document.createElement("input"),isNative=!!("placeholder"in fakeInput);if(!isNative){if(methods[m]){return methods[m].apply(this,Array.prototype.slice.call(arguments,1));}else if(!m||typeof m=="object"){return methods.init.apply(this,arguments);}else{$.error("Invalid method passed");};};}})(jQuery);

$(function() {
	//PLACEHOLDER 
	$("form").html5Forms();
	
	//BANNER
	$("#callouts a").hover(function(){
		var currentBan = $("#topPhotos li:visible");
		var banID = $(this).attr("class").split("_")[1];
		var theBan = $("#topPhotos li:nth-child(" + banID + ")");
		if(!$(theBan).is(":visible")){
		$(currentBan).fadeOut(1,function(){
		$(theBan).fadeIn(500);								   							
		});}
	}, function(){return false;});
	
	//SIMPLEMODAL
	$(".open_modal").click( function(){
	$("#appointmentForm").modal(//content
	{
		onOpen: function(dialog) { //opening animation
		dialog.overlay.fadeIn("fast", function() {
		dialog.container.show();
		dialog.data.show();								
		});
		},
		persist:true,	
		opacity:70, //alpha css
		overlayCss: {backgroundColor:"#000"}						
		});
	});
	
	//NAV
	$('#nav li').bind("mouseenter mouseleave", function(){
		$(this).find('a:first').toggleClass("nav_over");
		$(this).has('ul').toggleClass("list_over");
	});			   
});

