// JavaScript Document

$(function(){   
		    var id;
		 var d=new Date();
mont = Number(d.getMonth());
day = Number(d.getDate());
mont++;
var nfo;

	 $.ajax({type: "GET", url: "featured.xml",  dataType: ($.browser.msie) ? "text" : "xml", success: function(data) {
var xml;
     if (typeof data == "string") {
       xml = new ActiveXObject("Microsoft.XMLDOM");
       xml.async = false;
       xml.loadXML(data);
     } else {
       xml = data;
     }

$(xml).find('node').each(function(i){
								  
								 id=  $(this).attr("id");
								  var idmonth =Number( id.substring(0,id.indexOf("/")));
									var idday = Number(id.substring(id.indexOf("/")+1));	
									
									if(mont ==idmonth){
										if(day<idday){
										
											 nfo = $(xml).find('node').eq(Number(i-1)).attr("nextMonth");
										}else{
											
											 nfo = $(this).attr("nextMonth");
											
										}
										$(".feature").html(nfo);
									}
								  
								  });
							}});
		
$("#nextMonthButton").click(function () { 
      $("#nextMonthText").slideDown().animate({ marginTop: "-75px" }, 250 );
    });
$("#nextMonthButton").hover(
		function () { 
		 $(this).css({'backgroundPosition' : '0 bottom' , 'cursor' : 'pointer'});
		}, function () { 
	 	 $(this).css({'backgroundPosition' : '0 top'});
		}
	);
$("#xBut").click(function () { 
      $("#nextMonthText").slideUp().animate({ marginTop: "0px" }, 0 );; 
    });
$("#xBut").hover(
		function () { 
		 $(this).css({'backgroundPosition' : '0 bottom' , 'cursor' : 'pointer'});
		}, function () { 
	 	 $(this).css({'backgroundPosition' : '0 top'});
		}
	);


});
