$(document).ready(function () {
	
	/*
	if ($('div#sidead').length > 0)
	{
		$('div#sidead').css('left', Math.max(889, ($(window).width() - 889) / 2 + 889));
	}
	*/
	function add_file_input() {

		if (($(".main input:file[value='']").val() != "" && $(".main input:file:last").val() != "") || $(".main input:file:last").val() == "")  {
			var input = document.createElement("input");
			input.type = "file";
			input.name = "test";
			input.size = "51";
			
			$(input).addClass("dp-input-file");
			$(".main input:file:last").after(input);
		}
		
	}
	
	$("textarea").growfield();
	$("li:first-child").addClass("dp-first-child");
	$("input:file").addClass("dp-input-file");
	$("input:text").addClass("dp-input-text");
	$("input:submit").addClass("dp-input-submit");
	$("input + p").addClass("dp-siblingto-input");
	$("input:submit + p").addClass("dp-siblingto-submit");
	
	$(".main input:file").live("change", function(){
		//add_file_input();
	});

	$("#more_files").click(function() {
		//add_file_input();
		return false;
	});
	
	$(".head li.drop").hover(
		function() {
			$(this).children("a").addClass("dropped");
			$(this).find("ul").show();
		},
		function() {
			$(this).find("ul").hide();
			$(this).children("a").removeClass("dropped");
		});
	
});
