$(document).ready(function() {

	// loads the cycle or whatever on specific url in this case the home page
	//GET URL	
	var url = window.location.pathname;
	url = url.toLowerCase();
	//READ URL
	// uncomment alert to see what the url is in browser if needed
	//alert(url);
	if (url == '/' || url == "/index.php") {
	//RUN CYCLE
		$("#cycle").cycle({
			fx: "fade"
		});
	};
	
	function textReplacement(input) {
		var originalvalue = input.val();
		input.focus(function() {
			if($.trim(input.val()) == originalvalue){ input.val(""); }
		});
		input.blur(function() {
			if($.trim(input.val()) == ""){ input.val(originalvalue); }
		});
	}

	textReplacement($("#home-form #input_1_1"));
	textReplacement($("#home-form #input_1_2"));
	textReplacement($("#home-form #input_1_3"));
	textReplacement($("#home-form #input_1_4"));

	textReplacement($("#sdbr-form #input_1_1"));
	textReplacement($("#sdbr-form #input_1_2"));
	textReplacement($("#sdbr-form #input_1_3"));
	textReplacement($("#sdbr-form #input_1_4"));

	
	$('#content').equalHeights();
	
	// loads only if the cycle selector exists
	// if ($("#cycle").length > 0){	
		// $("#cycle").cycle({
			// fx: "fade"
		// });
	// };

	// $('figure.gallery-item a').attr('rel','gallery');
	// $('figure.gallery-item a[rel="gallery"]').fancybox();

});
