$(document).ready(function() {
$('.datepicker').datepicker({ dateFormat: 'yy-mm-dd' });

var goTo = $("ul#gallery li:first").clone();
$("#big_photo ul").html(goTo);

$('a.removeFile').click(function() {

	var file_ID = $(this).attr('href');
	var handle = $(this);

	$.ajax({
        type: "POST",
        url: BASE_URL+"/file/remove",
        data: "file_ID=" + file_ID,
        success: function(msg){
        	
			$(handle).parent().remove();
        }
    });
    return false;
});

$("ul#menu li a").mouseover(function()
		{
			var title = $(this).attr("id")
			$("div#info-box").html(title);
			
		}
)


$("a.unactive").click(function(){
	
	var go = $(this);
	
	$("<div style='display:none;padding:20px;' title='komunikat'><br /><br /><br />Opcja zostanie uruchomiona wkrótce<br /><br /><br /></div>").insertAfter(go);
	var inside = $(this).next();

	$(inside).dialog({
		bgiframe: true,
		modal: true,
		resizable: false
	});

	return false;
});

$("a.nots").click(function(){
	var that = $(this);
	var go = $(this).attr("title");
	
	$("<div style='display:none;padding:20px;' title='Notatki'>"+ go + "</div>").insertAfter(that);
	var inside = $(this).next();

	$(inside).dialog({
		bgiframe: true,
		modal: true,
		resizable: false
	});

	return false;
});

$("#ads-menu li a").click(function(){
	
	var active = $(this).parent();
	var id = $(this).attr("id");
	
	if (id =='jeansowy'){
		$(".row").hide();
		$(".jeansowy").show();
		$('input.typ_pl').val(id);
		$('input.typ_en').val(id);
}	
	
	
	else if (id =='klasyczny'){
		$(".row").hide();
		$(".klasyczny").show();
		$('input.typ_pl').val(id);
		$('input.typ_en').val(id);
	}
		else if (id =='media'){
			$(".row").hide();
			$(".media").show();
			$('input.typ_pl').val(id);
			$('input.typ_en').val(id);		
}	
	

	$("#ads-menu li").removeClass("active");
	active.addClass("active");
	
	return false;
});


});

