$(document).ready(function() {
	
/* add textshadow to main menu for IE */
  var myShadow = {
    x:      1, 
    y:      2, 
    radius: 3,
    color:  "#40536f"
  }
  $("div#mainMenuBar ul li a").textShadow(myShadow);

/* animate back to top */
  $('a.top').click(function(){
         $('html, body').animate({scrollTop: '0px'}, 'slow', 'swing');
         return false;
    });  
    
  /* News Summary */
  $('div#centerColumn .NewsSummary').mouseover(function(){
		$(this).css("background-color","#f7f9fd");
  });
  $("div#centerColumn .NewsSummary").mouseout(function(){
		$(this).css("background-color","white");
	});  
  /* Events Summary */
  $('div#centerColumn .calendar-event-page').mouseover(function(){
		$(this).css("background-color","#f7f9fd");
  });
  $("div#centerColumn .calendar-event-page").mouseout(function(){
		$(this).css("background-color","white");
	});  
    
});

/* main menu */

var timeout    = 800;
var closetimer = 0;
var ddmenuitem = 0;

function jsddm_open()
{  jsddm_canceltimer();
   jsddm_close();
   ddmenuitem = $(this).find('ul').css('visibility', 'visible');}

function jsddm_close()
{  if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

function jsddm_timer()
{  closetimer = window.setTimeout(jsddm_close, timeout);}

function jsddm_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
      closetimer = null;}}

$(document).ready(function()
{  $('#jsddm > li').bind('mouseover', jsddm_open)
   $('#jsddm > li').bind('mouseout',  jsddm_timer)});

document.onclick = jsddm_close;

/* FIX FORMS FOR IE */
/*$(function(){
    $('input').keydown(function(e){
        if (e.keyCode == 13) {
            return false;
        }
    });
});*/

