Cufon.replace('h1');
Cufon.replace('h8');
Cufon.replace('h20');
Cufon.replace('h60');

Cufon.replace('span');
Cufon.replace('h2');
Cufon.replace('h3');
Cufon.replace('h4');
Cufon.replace('h18');
Cufon.replace('#nav', {hover: true});
Cufon.replace('.button', {hover: true}); 
Cufon.replace('#slider-nav span', {hover: true});
Cufon.replace('#tabs li span', {hover: true});

current=1;
timeout=setTimeout("changeSlide(2)", 9000);
function changeSlide(cur){
	clearInterval(timeout);
	current=cur;
	$("#slideIt").animate({marginLeft:'-'+((cur-1)*948)+'px'}, 1000, function(){$("#slideIt ul:nth-child("+cur+") .featured").fadeIn();});
	$("#slideIt .featured").hide();
	$("#tabs li").removeClass('active');
	$("#tabs li:nth-child("+cur+")").addClass('active');
	if(current>=$("#tabs li").length)
		timeout=setTimeout("changeSlide(1)", 8000);
	else
		timeout=setTimeout("changeSlide("+(current+1)+")", 8000);
	return false;
}
$(document).ready(function(){
	$("#tabs li").click(function(){changeSlide($(this).attr('rel'))});
	if($("#tabs li").length<2) clearInterval(timeout); // only 1? disable timeout
	$("#slideIt .featured").hide();
	$("#slideIt ul:nth-child(1) .featured").fadeIn();
});

$(document).ready(function(){
	$("label.inlined + input.input-text").each(function (type) {
	
		$(this).focus(function () {
			$(this).prev("label.inlined").addClass("focus");

			$(this).keypress(function () {
				$(this).prev("label.inlined").addClass("has-text").removeClass("focus");
			});

			$(this).blur(function () {
				if($(this).val() == "") {
				$(this).prev("label.inlined").removeClass("has-text").removeClass("focus");
				}
			});
		});
	});
});
