$(document).ready(function(){
/*************************************
	REMOVE DEFAULT INPUT VALUES
**************************************/
$('input, textarea').focus(function() {
	value=$(this).val();
	$(this).attr("value","");
});
$('input, textarea').blur(function() {
	if($(this).val()=="") {
		$(this).val(value);
	}
});
/*************************************
	HOMEPAGE GALLERY
**************************************/

if ($("#gallery_container").length) { //Check to see if element is on the page

/*If element is on the page then execute function*/
/*-------------------------------------
	GALLERY THUMBNAIL HOVER LOGIC
-------------------------------------*/
$("#item_one").show();
$("#thumb_one").addClass("selected");
$("#thumb_one").hover(
	function(){
		$(this).addClass("hover");
		$(this).removeClass("selected");
		$("#thumb_one .hover").show();
		$("#thumb_two .hover").hide();	
		$("#thumb_three .hover").hide();
		$("#thumb_three .hover").hide();
		$("#item_one").show();
		$("#item_two").hide();
		$("#item_three").hide();
		$("#item_four").hide();
	},
	function(){
		$(this).removeClass("hover");
		$(this).removeClass("selected");
		$(".hover").hide();
	});
$("#thumb_two").hover(
	function(){
		$(this).addClass("hover");
		$("#thumb_one .hover").hide();
		$("#thumb_one").removeClass("selected");
		$("#thumb_two .hover").show();	
		$("#thumb_three .hover").hide();
		$("#item_one").hide();
		$("#item_two").show();
		$("#item_three").hide();
		$("#item_four").hide();
	},
	function(){
		$(this).removeClass("hover");
		$(".hover").hide();
	});
$("#thumb_three").hover(
	function(){
		$(this).addClass("hover");
		$("#thumb_one .hover").hide();
		$("#thumb_one").removeClass("selected");
		$("#thumb_two .hover").hide();	
		$("#thumb_three .hover").show();
		$("#item_one").hide();
		$("#item_two").hide();
		$("#item_three").show();
		$("#item_four").hide();
	},
	function(){
		$(this).removeClass("hover");
		$(".hover").hide();	
	});
$("#thumb_four").hover(
	function(){
		$(this).addClass("hover");
		$("#thumb_one .hover").hide();
		$("#thumb_one").removeClass("selected");
		$("#thumb_two .hover").hide();	
		$("#thumb_three .hover").show();
		$("#item_one").hide();
		$("#item_two").hide();
		$("#item_three").hide();
		$("#item_four").show();
	},
	function(){
		$(this).removeClass("hover");
		$(".hover").hide();	
	});
/*-------------------------------------
	GALLERY ITEM HOVER LOGIC
-------------------------------------*/
$("#item_one").hover(
	function(){
		$("#thumb_one .hover").show();
		$("#thumb_two .hover").hide();	
		$("#thumb_three .hover").hide();
	},
	function(){
		$(".hover").hide();
	});
$("#item_two").hover(
	function(){
		$("#thumb_one .hover").hide();
		$("#thumb_two .hover").show();	
		$("#thumb_three .hover").hide();
	},
	function(){
		$(".hover").hide();
	});
$("#item_three").hover(
	function(){
		$("#thumb_one .hover").hide();
		$("#thumb_two .hover").hide();	
		$("#thumb_three .hover").show();
	},
	function(){
		$(".hover").hide();
	});
	
}
/*-------------------------------------
	TOOLTIP
-------------------------------------*/
$('.tooltip').tooltip({showURL: false, positionLeft: true,delay:0,showBody: " - "});	
$('.tooltip').bgiframe();	
/*-------------------------------------
	DATEPICKER
-------------------------------------*/

$("#datepicker1").datepicker({showOn: 'button', buttonImage: 'images/icon_calendar.jpg', buttonImageOnly: true});
$("#datepicker2").datepicker({showOn: 'button', buttonImage: 'images/icon_calendar.jpg', buttonImageOnly: true});	
});/*CLOSING BRACKETS*/
