jQuery(document).ready(function() {
	$().loadHome();
	$().preparePrompts();
	if($("#tagAdd").get(0)) {
		$.get("custom/ajax_tagadd.php", {
			name: $("#tagAdd").html()
		}, function(data) {});
 	};
	if($("#accordion-slider").get(0)) {
		$("#accordion-slider").kwicks({
			max : 750,
			spacing : 2
		});
	}
});

$.fn.loadHome = function() {
	$("#whatsNew").load("custom/ajax_whatsnew.php", {}, function() {
  		$("#whatsNew").scrollable({
			size: 3, 
			interval: 3500,
			speed: 400, 
			loop: true
		});
	});
	$("#tagCloud").load("custom/ajax_tagcloud.php", {}, function() {
  		
	});
}

$.fn.preparePrompts = function() {
	$(".formField").focus(function() {
		if($(this).val() == $(this).attr("title")) {
			$(this).val("");
			$(this).removeClass("prompt");		
		}
	});
	$(".formField").blur(function() {
		if($(this).val() == "") {
			$(this).addClass("prompt");	
			$(this).val($(this).attr("title"));		
		}
	});
}
