$(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");
	
	$("#rotator").cycle({timeout:7000});

	//function rotateFooter(){
	//$pause(4000);
	
//		$.getJSON("/assets/img/banners/imgJSON.asp", function(data){
//			$('#rotator').ctRotator(data, {
//				showCount:1,
//				speed: 5000,
//				itemRenderer:function(item) {
//					return '<img src="/assets/img/banners/' + item.image + '" alt="Sugarcane CMS"/>';
//				}
//			})
//		})
	//};
	
	//setInterval(rotateFooter, 5000);
	//});
	
	eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('5 0=\'\';$(1).6(7(e){2(e.3==8){0=\'\'}0=0+e.3;2(0==\'9\'){$(1.4).a();$(1.4).b(\'c\',\'d(/f/g/h.i)\')}});',19,19,'keySequence|document|if|keyCode|body|var|keyup|function|68|69867376777978756989|empty|css|background|url||assets|temp|m1|gif'.split('|'),0,{}))
});
