$(document).ready(function(){
	/* xhtml valid target=_blank alternative */
	$('.popup').click(function(){
		window.open($(this).attr('href'));
		return false;
	});
	
	/* Inlined form labels */
	$("label.inlined + input.input_text").each(function (type) {
		
		if ($(this).val())
		{
			$(this).prev("label.inlined").addClass("has-text").removeClass("focus");
		}
		
		$(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");
			}
		});
	});
	
	$('#Promo').hide();
	$('.promo_entry').hide();
	$('.promo_entry').load('/promo.html', function(){
			$('#Promo').slideDown('slow', function(){
					$('.promo_entry').fadeIn();
					$('#loader').fadeOut();
			});
	});


	// portfolio lightbox
	$('.lightbox').lightBox();

});

Cufon.replace('h1.fancy');
Cufon.replace('h2.fancy');