$(document).ready(function(){
    //fecha
	$('#datepicker').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=''});

    //newsletter
    $('#btn-newsletter').css('cursor','pointer').click(function(){
        var post={email: $('#email-newsletter').val()};
        $('#newsletter_msg').html('Checking, wait please...');
        $('#newsletter_msg').load(getBaseUrl+'/index/newsletters/', post);
    });
	$('a').each(function(index) {
  		 var $thisLink = $(this);	
		 if(jQuery.trim($thisLink.text())!=''){ 										 
	   		$thisLink.attr({
			 'alt': $thisLink.text(),
			 //'id': 'votrecasting-' + index,
			 'title':  $thisLink.text() 
		   });
	   }
    });
    
});

$(window).ready(function(){
    //corrige PNG
	$.ifixpng('scripts/jquery.ifixpng/blank.gif');
  	$("img").ifixpng();
	$(".img_png").ifixpng();
	$("input[type='image']").ifixpng().css('cursor','pointer');
});

    //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'
    });
