/* Project Name Global Javascript Functions

By  - ISITE Design


*/

//start the jQuery functions
$(document).ready(function() {


	/*clear search field on click - made into plugin so it can easily be used more than once.*/
	$.fn.inputClear = function() {
		return this.focus(function() {
			if( this.value == this.defaultValue ) {
				this.value = "";
			}
		}).blur(function() {
			if( !this.value.length ) {
				this.value = this.defaultValue;
			}
		});
	};

	/*apply to the header search input - add as needed*/
	$("#search").inputClear();

	/*add class to drop downs for IE <6*/
	if(document.all){
	    $("#mainNav li").hover(
	            function() {
					$(this).addClass("over");
				},
	            function() {
					$(this).removeClass("over");
				}
	    );
	}// if document.all

	$("#mainnav").hide();

	$("#comments").hide();

	$(".commentslink a").click(function () {
		$("#comments").slideToggle(300);
		return false
	});

	// make the envelop slide out.  Also, stay nerdy and rearrange the source order.
	$(".eventinfomationlink").insertBefore("#secondary h2:first");
	$(".eventinfomation").insertBefore(".eventinfomationlink").hide();

	$(".eventinfomationlink").click(function () {
		$(".eventinfomation").slideToggle(300)
		return false
	});

// tag links with class="external" to work
$("a.external").click(function(){ window.open(this.href); return false; });
	//specific event location reveals.
	$(".specificeventinfo").hide();
	$("#secondary dt").click(function () {
		//$(this).next(".specificeventinfo").slideToggle(300);
		$(this).next("dd").next("dd").slideToggle(300);
		$(this).toggleClass("openheart");

	});
});// document ready / end jquery functions

