jQuery.noConflict();


//ondoc ready starts
jQuery(document).ready(function(){     
	
	jQuery("#maincontent.wide H2").addClass("wide");
	
		
	//show hide containers
	jQuery(".hideMe").hide();
	
	jQuery("a#searchIcon, a#searchClose").click(function() { 
		jQuery('#searchHolderInner').slideToggle(300);
		return false; 
	}); 	
	
	
			
	
	//show hide containers ends
		
	
	//add attachemnt icons
	jQuery('#maincontent a[href$=".pdf"]').each(function(){
    	jQuery(this).wrap("<span class='pdf'></span>");
	}); 
	
	jQuery('#maincontent a[href$=".ppt"]').each(function(){
    	jQuery(this).wrap("<span class='ppt'></span>");
	}); 
	
	jQuery('#maincontent a[href$=".doc"]').each(function(){
    	jQuery(this).wrap("<span class='doc'></span>");
	}); 
	
	jQuery('#maincontent a[href$=".xls"]').each(function(){
    	jQuery(this).wrap("<span class='xls'></span>");
	}); 
	
	jQuery('#maincontent a[href$=".txt"]').each(function(){
    	jQuery(this).wrap("<span class='txt'></span>");
	}); 
	
	jQuery('#maincontent a[href$=".zip"]').each(function(){
    	jQuery(this).wrap("<span class='zip'></span>");
	}); 
	
	jQuery('#maincontent a[href$=".mp3"], #maincontent a[href$=".wav"]').each(function(){
    	jQuery(this).wrap("<span class='mp3'></span>");
	}); 
	
	
	//isolate offsite links and make blank
	jQuery("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank");
	//isolate attachment links and make blank
	jQuery("a[href$='.pdf'], a[href$='.ppt'], a[href$='.doc'], a[href$='.xls'], a[href$='.zip'], a[href$='.txt']").attr("target","_blank");

	//search box
	jQuery("#s").val("Search...").focus(function(){
		jQuery(this).addClass("activeWithFocus")
        if (jQuery(this).val() == "Search...") {
           jQuery(this).val("");
        }
    })
    .blur(function(){
		jQuery(this).removeClass("activeWithFocus")
        if (jQuery(this).val() == "") {
            jQuery(this).val("Search...");
        }
    });
	
	
	//remove margin from last P on home page to avoid scroll box on overflow
	jQuery(".homePagePod p:last-child").css("margin-bottom","0")
	
	//remove margin from last images on projetcs pages
	jQuery("#maincontent .pageImageHolder:nth-child(3n)").css("margin-right","0");
		
	jQuery("#maincontent .pageImageHolder P").css({"cursor": "pointer", "opacity": ".5"});
	
	
		
	
	jQuery("#maincontent .pageImageHolder").hover(
	  function () {
	    
				jQuery(this).children('p').animate({"padding-top": 5, "opacity": 1 },200);

	  },
	  function () {
	  		
			   jQuery(this).children('p').animate({"padding-top": 0, "opacity": .5}, 400);
	  }
	);
	
		
	jQuery("#maincontent .pageImageHolder p").click(function() { 
			findNextHref = jQuery(this).next('DIV.pageImage').children('A')
			getLink = findNextHref.attr("href");
			//findNextHref.css("border","1px solid red");
			document.location = getLink;			
			
	}); 	
	
	
	jQuery("#leftHandContent li a:not(#leftHandContent li.current_page_item a)").hover(
	  function () {
	    		initialLeftPadding = jQuery(this).css('padding-left');
				newLeftPadding = 20;
				
				jQuery(this).animate({"padding-left": newLeftPadding},300);
	  },
	  function () {
	  		
			   jQuery(this).animate({"padding-left": initialLeftPadding },400);
	  }
	);
	
	
	
	
	
	//activate lightbox
	jQuery('a[rel="lightbox"]').lightBox();
    
	
	
	
	
//on docReadyEnds	
});




