// nav menu dropdown animation 

jQuery(function ($) {
	$(document).ready(function () {
	      $('#access .menu-header li').hover(
	           function () {
	               //show its submenu
	               $('ul', this).slideDown(250);
	           }, 
	           function () {
	               //hide its submenu
	               $('ul', this).slideUp(250).animate({ opacity: "hide" }, "fast"); ;         
	           }
	       );
	});
});	

// make homepage call-out divs clickable 
jQuery(function ($) {
	$(document).ready(function(){ 
        $(".call-out").click(function(){
             window.location=$(this).find("a").attr("href");
             return false;
        }); 
	 }); 
});

// support for html5 placeholder 

jQuery(function ($) {
	$(document).ready(function() {
		$("input[type=text]").each(function(){
			if ($(this).attr("holder") != "") {
				if ($(this).val() == "") {
					$(this).val($(this).attr("holder"));
					$(this).addClass("holder");
				}
				$(this).focus(function() {
					if ($(this).hasClass("holder")) {
						$(this).val("");
						$(this).removeClass("holder");
					}
				});
				$(this).blur(function() {
					if ($(this).val() == "") {
						$(this).val($(this).attr("holder"));
						$(this).addClass("holder");
					}
				});
			}
		});
		$("textarea").each(function(){
			if ($(this).attr("holder") != "") {
				if ($(this).val() == "") {
					$(this).val($(this).attr("holder"));
					$(this).addClass("holder");
				}
				$(this).focus(function() {
					if ($(this).hasClass("holder")) {
						$(this).val("");
						$(this).removeClass("holder");
					}
				});
				$(this).blur(function() {
					if ($(this).val() == "") {
						$(this).val($(this).attr("holder"));
						$(this).addClass("holder");
					}
				});
			}
		});
	});
});

jQuery(function ($) {
	$(document).ready(function(){
		// portfolio excerpts
		$('.portfolio-excerpt:odd').addClass('last');
		
		// portfolio excerpt hover 
		$('.portfolio-excerpt').each(function(){
			$(this).hover(
				function(){
					$(this).find('.project-desc').fadeIn('fast');
				},
				function(){
					$(this).find('.project-desc').fadeOut('fast');
				});
		});	
		
		// make whole div clickable 
		$(".project-desc").click(function(){
		     window.location=$(this).find("a").attr("href");
		     return false;
		}); 
		
		// remove last divider
		$('.module-wrapper .divider:last').css('display','none');
		$('.post-wrap .divider:last').css('display','none');
		
		
		// home featured call-outs
		$('.call-out').each(function(){
			$(this).hover(
				function(){
					$(this).find('.call-out-excerpt').fadeIn('fast');
				},
				function(){
					$(this).find('.call-out-excerpt').fadeOut('fast');
				});
		});
		
		// real estate home page
		
		$('.entry-content').find('ol').each(function(){
		    $(this).children().each(function(i) {
		        $(this).addClass("item-" + (i+1));
		    });
		});
		
		$('.entry-content').find('li').each(function(){
		    $(this).children("div").each(function(i) {
		        $(this).addClass("div-" + (i+1));
		    });
		});
		
		
		
	});
});




