//document ready
jQuery(document).ready( function() {

	//Append the InputFocus() and InputBlur() functions to any elements with the class "clearfocus"
	jQuery(".clearfocus").focus(function() { InputFocus(this); });
	jQuery(".clearfocus").blur(function() { InputBlur(this); });
	
	//external links
	jQuery('a.external, li.external a').attr('target', '_blank');
	
});

//Cufon
Cufon.replace('h2');
Cufon.replace('h3');
Cufon.replace('#header li a');
Cufon.replace('.time');
Cufon.replace('a.button');
Cufon.replace('#footer li a');
Cufon.replace('.gigpress-sidebar-date');
Cufon.now();


/* Functions */

function InputFocus(element) {
	if (element.value == element.defaultValue) {
		element.value = "";
		$(element).addClass('filled');
	}
}
function InputBlur(element) {
	if (element.value == "") {
		$(element).removeClass('filled');
		element.value = element.defaultValue;
	}
}

//get a querystring by name
function querySt(ji) {
	hu = window.location.search.substring(1);
	gy = hu.split("&");
	for (i=0;i<gy.length;i++) {
		ft = gy[i].split("=");
		if (ft[0] == ji) {
			return ft[1];
		}
	}
}
