$(document).ready(function() {
$("#topMenu ul li:first-child").addClass("last-child");
$("#topMenu ul li:first-child a").addClass("home");
$("#topMenu ul ul li:first-child").removeClass("last-child");
$("#topMenu ul ul li:first-child a").removeClass("home");
$("#topMenu ul li a").hover( 
      function () {
		if($(this).hasClass("home")){ 
		 $("#topMenu ul").addClass("green");
		}},  
      function () { 
       $("#topMenu ul").removeClass("green");} 
    ); 
	$("#overLap").pngfix();
	 $("#jsddm li ul").hover(
      function () {
        $(this).parent().find("a:nth(0)").addClass("active");
      }, 
      function () {
       $(this).parent().find("a:nth(0)").removeClass("active");
      }
    );

});
	$(function(){
				$('#datepicker').datepicker({
					inline: true,
					showOtherMonths: true, selectOtherMonths: true
				});
				$("a.ui-state-default").each(function(){
				 $(this).bind("click", function(event){
				   event.stopPropagation();
					});
				var d = new Date();
				var currMonth = d.getMonth() + 1; 
				var currYear = d.getFullYear(); 
				var setTitle = $(this).html();
				var finalVal= currMonth + setTitle + currYear;
				$(this).addClass(finalVal);
				
				var setDate1 = 2142010;
				if($(this).hasClass(setDate1)){
				$(this).addClass("selected");
				$(this).bind("click", function(){
  					window.location.href='http://www.google.com';
					return true;
				});
				}
				
				var setDate2 = 2252010;
				if($(this).hasClass(setDate2)){
				$(this).addClass("selected");
				$(this).bind("click", function(){
  					window.location.href='http://www.yahoo.com';
					return true;
				});
				}
				var setDate3 = 2112010;
				if($(this).hasClass(setDate3)){
				$(this).addClass("selected");
				$(this).bind("click", function(){
  					window.location.href='http://www.yahoo.com';
					return true;
				});
				}
				
				});
			});
function slideSwitch() {
    var active = $('#slideShow IMG.active');
    if ( active.length == 0 ) active = jQuery('#slideShow IMG:last');
    var next =  active.next().length ? active.next()
        : jQuery('#slideShow IMG:first');
    active.addClass('last-active');
    next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            active.removeClass('active last-active');
        });
}
jQuery(function() {
    setInterval( "slideSwitch()", 5000 );
});

