$(function() {
	d = '<img src="/themes/mapitravel/images/ajax-loader.gif" class="center" alt="Cargando" />';
	$('#disponi').bind("click", function() {
		$('#resultados').empty();								 
		$('#resultados').append(d);
		m = $('#cmes').val();
		a = $('#cano').val();
		$.ajax({
			type: "GET",
			url: "/caminoinca/resultados.php",
			data: "mes="+m+"&ano="+a,
			success: function(msg){
			$('#resultados').empty();
			$('#resultados').append(msg);
		}
		});
	});
	
//Social Media	

$('.mini-social').bind('click', function() {
			relsocial = $(this).attr('rel');
			this_url = encodeURIComponent(window.location.href);
			this_title = encodeURIComponent(document.title);
			switch(relsocial) {
				case 'delicious':
					socialurl = 'http://delicious.com/save?url='+this_url+'&title='+this_title+'&v=5&noui=1&jump=doclose';
				break;
				case 'google':
					socialurl = 'http://www.google.com/bookmarks/mark?op=edit&bkmk='+this_url+'&title='+this_title;
				break;
				case 'facebook':
					socialurl = 'http://www.facebook.com/sharer.php?u='+this_url+'&t='+this_title;
				break;
				case 'twitter':
					socialurl = 'http://twitter.com/home?status='+this_url;
				break;
				case 'yahoo':
					socialurl = 'http://bookmarks.yahoo.com/myresults/bookmarklet?u='+this_url+'&t='+this_title;
				break;
			}
			open(socialurl);
			return false;
		});

//BookMarks
// add a "rel" attrib if Opera 7+
	if(window.opera) {
		if ($("a.bookmark").attr("rel") != ""){
			$("a.bookmark").attr("rel","sidebar");
		} 
	}

	$("a.bookmark").click(function(event){
		event.preventDefault();
		var url = this.href;
		var title =  encodeURIComponent(document.title);
		
		if (window.sidebar) { // Mozilla Firefox Bookmark
			window.sidebar.addPanel(title, url,"");
		} else if( window.external ) { // IE Favorite
			window.external.AddFavorite( url, title);
		} else if(window.opera) { // Opera 7+
			return false; // do nothing
		} else { 
			 alert('Unfortunately, this browser does not support the requested action,'
			 + ' please bookmark this page manually.');
		}
	
	});

});