$("document").onload( function() {
	if ($(".menu-primary")) {
		$(".menu-primary").find("li").list();
	}
	slider();
	if ($(".form-caption")) {
		$(".form-caption").find("input").focus(function (e) {
			var objet = $(e);
			var input = objet.prototype;
			
			objet.addClass("selected");
			objet.removeClass("default");
			//if ((isdeprecated() == -1) && input.name == "MotPasse") input.type = "password";
			if (input.name.substr(0,6) == "clone_") {
				input.style.display = "none";
				alert(input.nextSibling);
				//input.previousSibling.style.display = "inline";
			}
			
			if (input.value == input.title) input.value = "";
		});
		$(".form-caption").blur(function (e) {
			$(e).removeClass("selected");
			$(e).removeClass("default");
			var input = $(e).prototype;
			if (input.value.length == 0) {
				if ((isdeprecated() == -1) && input.name == "MotPasse") input.type = "text";
				input.value = input.title;
				$(e).addClass("default");
			}
		});
/*
		$(".form-caption").find("input").each(function (input) {
			if (input.value.length == 0 || input.value == input.title) {
				//if (input.name == "MotPasse" && (isdeprecated() != -1)) {
				if (input.name == "MotPasse") {

					var newnode = document.createElement("input");
					newnode.type = "text";
					newnode.value = input.title;
					newnode.style.position = "absolute";
					newnode.style.top = input.offsetTop + "px";
					newnode.style.left = input.offsetLeft + "px";
					newnode.className = "default";
					if (isdeprecated(7) != -1) input.parentNode.parentNode.style.position = "relative";
					input.parentNode.insertBefore(newnode, input.nextSibling);
					//input.style.display = "none";

					newnode.onclick = function(event) {
						newnode.style.display = "none";
						//input.style.display = "inline";
						input.focus();
					};
					input.onblur = function(event) {
						if (input.value.length == 0 || input.value == input.title) {
							//input.style.display = "none";
							newnode.style.display = "inline";
							newnode.className = "default";
						}
					};

				} else {
					if (input.name == "MotPasse") {
						input.type = "text";
					}
					input.value = input.title;
					$(input).addClass("default");
				}
			}
		});
*/
	}
} );


function slider() {
	if ($("#nouvelles")) {
		$("#nouvelles").slideShow( { delay: 6000 } );
	}
}
