// JavaScript Document
$(document).ready(function(){

	$("ul li:last-child").addClass("last-child");
	$("#item_Search a").attr("href","#");
	$("#item_ContactUs a").attr("href","#");
	$("li:has(#houseMenuCurrentItem)").addClass("activeParent");
//	$("a:contains('Leadership')").addClass("activeParent");
	
	$("#item_Search a").click(function(){
			$("#contact-wrapper").hide();	
			$("#search-wrapper").fadeIn("fast");						   
			$("#header .container").animate({ 
				height: "180px"
			}, 250 );
			$(this).addClass("active");
			$("#item_ContactUs a").removeClass("active");
		});
	
	$("#item_ContactUs a").click(function(){
			$("#search-wrapper").hide();	
			$("#contact-wrapper").fadeIn("fast");						   
			$("#header .container").animate({ 
				height: "265px"
			}, 250 );
			$(this).addClass("active");
			$("#item_Search a").removeClass("active");
		});
	$("#contact-wrapper .specific-contact-info div.new-york").show();
	$("#contact-wrapper .locations li#new-york-link").addClass("active");
	$("#contact-wrapper .locations li").hover(function(){
			$("#contact-wrapper .locations li").removeClass("active");										   
			$(this).addClass("active");
			var currentLocation = $(this).attr("rel");
			var currentLocationId = "#contact-wrapper .specific-contact-info div." + currentLocation
			$("#contact-wrapper .specific-contact-info div").hide();
			$(currentLocationId).show();
		//	alert(currentLocationId);
	});
	
	
	
	
	$(".hide-search-bar").click(function(){
			$("#search-wrapper").fadeOut("fast");	
			$("#header .container").animate({ 
				height: "108px"
			}, 250 );
			$("#item_Search a").removeClass("active");
	});
	$(".hide-contact-bar").click(function(){
			$("#contact-wrapper").fadeOut("fast");	
			$("#header .container").animate({ 
				height: "108px"
			}, 250 );
			$("#item_ContactUs a").removeClass("active");
	});
	

	// Random Footer BG
	
	bgImageTotal=3;

	randomNumber = Math.round(Math.random()*(bgImageTotal-1))+1;
 
	imgPath=('/Portals/_default/Skins/SamSchwartz/images/footer-image'+randomNumber+'.gif');
 
	$("#content .container").css('background-image', ('url("'+imgPath+'")'));
 


	
});