$(function(){
	proftache.init();
});




proftache = {
	init: function(){
		if( $("body#tacheprofiles").length > 0 ){
			profTools.tweakSearch("input#profileSearchBox");
		}
	}
}





profTools = {
	tweakSearch:function(wEl){
		jQuery(wEl).each(function(){
			var sVal = jQuery(this).val();
			jQuery(this).focus(function(){
				if( jQuery(this).val() == sVal ){
					jQuery(this).val("");
				}
			}).blur(function(){
				if( jQuery(this).val() == "" ){
					jQuery(this).val(sVal);
				}
			});
		});
	},
	externaliseLinks: function(thisDomain){
		if(thisDomain){
				jQuery("a[href^='http']:not(a[href*="+thisDomain+"])").addClass("extLink").attr("rel","external");
		} else {
				jQuery("a[href^='http']").addClass("extLink").attr("rel","external");
		}
	
		jQuery("a[rel*='external']").addClass("extLink");
		
		jQuery("a.extLink").unbind("click").click(function(){
			window.open(this.href, "_blank");
			return false;
		}).each(function(){
			jQuery(this).attr("title","Link to "+ jQuery(this).text() +" will open in a new window" );
		});
	}
}















