$(document).ready(function(){
    //fecha
    $('#datepicker').datepicker({
        changeMonth: true,
    	changeYear: true,
        yearRange: '1950:2020',
        dateFormat: 'dd/mm/yy'
    });
	$('#datepicker2').datepicker({
        changeMonth: true,
    	changeYear: true,
        yearRange: '1950:2020',
        dateFormat: 'dd/mm/yy'
    });

    ///limpia text box
    $('input.borra-vacio').blur(function(){ if(this.value=='')this.value=this.title; })
                        .focus(function(){ this.value=''});


    ///dialog
    
    ///SLIDE
    // Expand Panel
	$("#open").click(function(){
		$("div#panel").slideDown("slow");
	});

	// Collapse Panel
	$("#close").click(function(){
		$("div#panel").slideUp("slow");
	});

	// Switch buttons from "Log In | Register" to "Close Panel" on click
	$("#toggle a").click(function () {
		$("#toggle a").toggle();
	});
      ///FIN SLIDE

      $('.publicchangelanguage').click(function(){
                var src=this.href;
		$.get(src, function(data){
                    location.reload(true)
                 });
                 return false;
	 });

});

$(window).ready(function(){
    //corrige PNG
	$.ifixpng('scripts/jquery.ifixpng/blank.gif');
  	$("img").ifixpng();
	$(".img_png").ifixpng();
	$("input[type='image']").ifixpng().css('cursor','pointer');
});

function messagealert(texto) {
           $("#messages").remove();
                var img='<div id="messages" title="Information" >'+
                       texto +
                        '</div>';
                $(img).dialog({
                height: 100,
                width: 200,
                resizable: false,
                modal: true,
                dialogClass: 'alert'

              });
              setTimeout(function() {
             $("#messages").remove();
             }, 2000);
             
}


