
$(document).ready(function(){




//make nav arrow fade when you mouseover

$("#navarrow").hover(function() {
$("#navarrow").animate({ opacity:0.2 }, 400);
},function() {
$("#navarrow").animate({ opacity:1.0 }, 400);
});


$("#container").css({"height":"auto"});



//make nav panels expanded by default
elem = $("#panels");

$("#panels").show();
$("#panels").addClass("panelshow");



// when you click on the arrow, determine whether the panels are showing or hiding, and then collapse/expand accordingly

$("#navarrow").click(function(){


	if (elem.is (".panelshow")) {
	
			if ($.browser.safari) {
				$("#panels").css("height","0px"); 
			} else {
			 $("#panels").hide(600);
			 }
			 
  	  $("#panels").removeClass('panelshow');
  	    $("#panels").addClass('panelhide');
  	  $("#navarrow").css("background-image", "url(/images/ARROWup.png)");
    
	}
	
	
	else if (elem.is (".panelhide")) {
		if ($.browser.safari) {
				$("#panels").css("height","290px"); 
			} else {
			 $("#panels").show(600);
			 }
	  $("#panels").removeClass('panelhide');
  	  $("#panels").addClass('panelshow');
  	  $("#navarrow").css("background-image", "url(/images/ARROW.png)");
    
	}
	
});




// when you click on the tabs while the panels are collapsed, expand them

$(".ui-tabs-nav a").click(function(){



  	 if (elem.is (".panelhide")) {
				if ($.browser.safari) {
					$("#panels").css("height","290px"); 
				} else {
					 $("#panels").show(600);
				 }
	    $("#panels").removeClass('panelhide');
  	  $("#panels").addClass('panelshow');
  	
  	  $("#navarrow").css("background-image", "url(/images/ARROW.png)");
    
	}    
	
	
});





// make carousel item increase in opacity and change color when hover




$(".jcarousel-skin-tango li:not(li.menu-selected), .retail-project-item:not(.menu-selected)").hover(function() {
$(this).animate({ opacity:1.0 }, 200);
$(".cond_overline", this).animate({ color: "#ec3488", borderTopColor: "#ec3488" },200);

},function() {
$(this).animate({ opacity:.45 }, 200);
$(".cond_overline", this).animate({ color: "#ffffff", borderTopColor: "#fff" },200);
});




// remove carousel arrows if current projects list total is less than 5


var n = $("#current-projects-carousel").size();
 if (n<=5) {
 $("#current-projects .jcarousel-prev-horizontal, #current-projects .jcarousel-next-horizontal").css("background-image", "../images/next-horizontal.png");
 }


});

