jQuery(document).ready(function(){
	jQuery(".jqclear").focus(function() {
		if( this.value == this.defaultValue ) this.value = "";
	}).blur(function() {
		if( !this.value.length ) this.value = this.defaultValue;
	});
	if (jQuery("#calendar").length > 0) navigate("","");
});


function mailAntiSpam(){
var u = "info";var d = "aposta.coop";
document.write('<a href="mailto:'+u+'@'+d+'">'+u+'@'+d+'</a>');
}



/*
 * AJAX CALENDAR
 */
var req;

function navigate(month,year) {
        var url = "/calendar.php?month="+month+"&year="+year;
        if(window.XMLHttpRequest) {
                req = new XMLHttpRequest();
        } else if(window.ActiveXObject) {
                req = new ActiveXObject("Microsoft.XMLHTTP");
        }
        req.open("GET", url, true);
        req.onreadystatechange = callback;
        req.send(null);
}

function callback() {
        if(req.readyState == 4) {
                if(req.status == 200) {
                        response = req.responseText;
                        document.getElementById("calendar").innerHTML = response;
                } else {
                        alert("There was a problem retrieving the data:\n" + req.statusText);
                }
        }
}