﻿$(function() {

	// FUNCAO PARA O CALENDARIO APARECER NA FRENTE DO MODAL
	$.maxZIndex = $.fn.maxZIndex = function(opt) {
	    var def = {inc: 10, group: "*"};
	    $.extend(def, opt);
	    var zmax = 0;
	    $(def.group).each(function() {
	        var cur = parseInt($(this).css("z-index"));
	        zmax = cur > zmax ? cur : zmax;
	    });
	    if (!this.jquery)
	        return zmax;
	    return this.each(function() {
	        zmax += def.inc;
	        $(this).css("z-index", zmax);
	    });
	}

	$(".calendario").datepicker({
		minDate: 0,
		duration: "slow",
		showOn: "button",
		buttonImage: $("#imgEventoPath").val() + "/calendar.gif",
		buttonImageOnly: true,
		beforeShow: function() {
			$("#ui-datepicker-div").maxZIndex();
		},
		changeMonth: true,
		changeYear: true
	});

	/*$(".calendario").click(function() {
		$(this).val("");
	});*/

});
