$(document).ready(function(){
	
	$("img.popup").each(function(){
		
		var href = $(this).attr("src").replace('/lores/','/hires/');
		var title = $(this).attr("alt");
		$(this).wrap("<a></a>")
			.parent("a")
				.attr("href",href)
				.attr("title",title)
				.attr("rel","inpage")
				.addClass("thickbox")	
	});
	
	//$("h2, p, a, li").each(function(){
	//	$(this).html($(this).html().replace(/&amp;/g,'<em class="amp">&amp;</em>'))
	//});
	
	$(":header, li.current, #menu li a").each(function(){
		var el = $(this);
		if(el.html()=='Our Home Page') el.html("Our <em>Home</em> Page");
		if(el.html()=='Learn About It') el.html("Learn <em>About</em> It");
		if(el.html()=='Customer Login') el.html("Customer <em>Login</em>");
	});
	
	$("ul.gallery li a, ul.sidegallery li a").each(function(){
		$tit = $("img", this).attr("alt");
		$(this)
			.prepend("<p>" + $tit + "</p>")
	})
	
	$("img[@src$=png], ul.gallery p, ul.sidegallery p,#head, #foot, #footwrapper, li.current a").pngfix();
			  
			    $('a[href*=#]').click(function() {
				if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
				&& location.hostname == this.hostname) {
				  var $target = $(this.hash);
				  $target = $target.length && $target
				  || $('[name=' + this.hash.slice(1) +']');
				  if ($target.length) {
					var targetOffset = $target.offset().top;
					$('html,body')
					.animate({scrollTop: targetOffset}, 1000);
				   return false;
				  }
				}
			  });
			  
			  $("li.photo a").addClass("thickbox").attr("rel","galleryimg");
});