// JavaScript Document
$(document).ready(function() {

//SEARCH HOVER
$("input#search_button").hover(function(e) {
		$(e.target).addClass("hover");		
	}, function(e){
		$(e.target).removeClass("hover");		
});//END SEARCH HOVER

//Drop Down Menu
var dropDownTimeOut;
$("ul#top_nav li a.drop_down_active").hover(function(e) {
	clearTimeout(dropDownTimeOut);
	$(".drop_down").css("display", "none");
	var activeLink = $(e.target).attr("href");
	var activeLinkPos = $(e.target).position();
	$(".drop_down"+activeLink).css("display", "block");
	$(".drop_down"+activeLink).addClass("active");
	$(".drop_down_arrow").css("left", activeLinkPos.left+3);
	
}, function(e) {
	dropDownTimeOut = setTimeout(function() {
		$(".drop_down").css("display", "none");
	}, 300);
});

$(".drop_down").hover(function(e) {
	clearTimeout(dropDownTimeOut);
}, function(e) {
	$(".drop_down").css("display", "none");
});

//Seach Box
$('#search').blur(function(e) {
	if(this.value == "") {
		$(this).val("SEARCH");
	}
});

$('#search').focus(function(e) {
	if(this.value == "SEARCH") {
		$(this).val("");
	}
});

var zIndexNumber = 1000;
	$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
});
	

});//END JS