// javascript 

$(function() {
		$('#jsddm > li').bind('mouseover', jsddm_open)
		$('#jsddm > li').bind('mouseout',  jsddm_timer)
		// $('.homeSectionBox').hover(function()	{
		// 			$(this).stop().animate({ "marginLeft" : "15px" });
		// 		}, function()	{
		// 			$(this).stop().animate({ "marginLeft" : "0px" });
		// 		});
		//$('.homeSectionBox').hover(function()	{
//				//$(this).animate({ "top" : "-20px" });
//				$(this).css("background-color","#ccc");
//				// $(this).css("font-weight","bold"); 
//			}, function()	{
//				//$(this).animate({ "top" : "20px" });
//				$(this).css("background-color","#fff");
//				$(this).css("font-weight","normal");
//		 });
		$('.homeSectionBox').hover(function()	{
				$(this).css("background-image","url(http://develop.gestaltcleveland.org/images/home-button-over.jpg)");
			}, function()	{
				$(this).css("background-image","url(http://develop.gestaltcleveland.org/images/home-button-normal.jpg)");
		 });
		$('.homeSectionBox h2').hover(function()	{
				$(this).css("color","#d89410")
			}, function()	{
				$(this).css("color","#fff");
		 });
	    $('ul#topNavList li a').hover(function()	{
			//$(this).animate({ "top" : "-20px" });
			$(this).css("background-color","#ccc");
			// $(this).css("font-weight","bold"); 
		}, function()	{
			//$(this).animate({ "top" : "20px" });
			$(this).css("background-color","#333");
			$(this).css("font-weight","normal");
		});
		$('div.slider').hide();
		$('a.flippy').css("text-decoration","none").hover(function(){
			$(this).css("color","#c60");
				},function(){
					$(this).css("color","#600");
				}).click(function() {
	      var heading = $(this).html().substr(1);
	      var content = $(this).parent('p').next('div.slider');
	      if ($(content).is(':hidden')) {
	         $(this).html('&#x25BC;' + heading);
	         $(content).slideDown('fast');
	       } else {
	         $(this).html('&#x25BA;' + heading);
	         $(content).slideUp('fast');
	      } return false;
	   });
		
		// var fadeDuration = 150; //time in milliseconds

	   // $('#leftNavList li a').hover(function() { 
	   // 			
	   //     		$(this).animate({ paddingLeft: '30px' }, fadeDuration);
	   //     		$(this).children('span').show().animate({ left: -5 }, fadeDuration);
	   // 			
	   //       }, function() {
	   //         $(this).animate({ paddingLeft: '15px' }, fadeDuration);
	   //         $(this).children('span').animate({ left: -35 }, fadeDuration).fadeOut(fadeDuration);
	   //   	});
		
});

// Dropdown Menus script ////////////

var timeout    = 500;
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; 
////////////////////////////////
	
