$(document).ready(function(){
$(function(){
		// Dialog			
				$('#dialog').dialog({
					autoOpen: false,
					width: 600,
					buttons: {
						"Ok": function() { 
							$(this).dialog("close"); 
						}
					}
				});
				
				// Dialog Link
				$('#dialog_link').click(function(){
					$('#dialog').dialog('open');
					return false;
				});
				
				//hover states on the static widgets
				$('#dialog_link').hover(
					function() { $(this).addClass('ui-state-hover'); }, 
					function() { $(this).removeClass('ui-state-hover'); }
				);
				
});

$('#nav li').hover(function(){ 
    // Mouse over function
	  $(this).stop(true).animate(		 
					  {marginTop: '6px'},{duration: '1000', easing:'easeOutBounce', queue: false}
					);}
	  , function(){
	// Mouse out function
		$(this).animate(
								  {marginTop: '2px'} ,{duration: '500', easing: 'easeOutBounce', queue: false}	
								  );	 
});
$('#nav li').click(function(){
							  $(this).css({marginTop: '2px'}) ;
							  return true;
});
$('.telno').hover(function() {
	$(this).animate({color:'white',backgroundColor:'#0033ff'}, 500);
	}, function() {
	$(this).animate({color:'black',backgroundColor:'white'}, 500, function(){$(this).css({'background-color': null})
	 });				
});
						   
//////////////////////////
//$('#sidebar1 li').hover(function() {
//	$(this).animate({fontSize: '+=3px'}, 150);
//	}, function() {
//	$(this).animate({fontSize: '-=3px'}, 150);
//});
//////////////////////////
var originalBG = "#EBEBEB";
  var fadeColor = "#ddd";

$("#sidebar1 ul li").hover( function () {
    $(this).animate( { backgroundColor:'#fff'}, 350 ).animate({fontSize: '+=3px'}, 150).animate( {backgroundColor: fadeColor}, 850 );

  },
  function () { $(this).animate({fontSize: '-=3px'}, 150).animate( {backgroundColor: originalBG}, 350 ); }
  );
//////////////////////
		
$('#CollapsiblePanel  > p').hide();	
$('#CollapsiblePanel h4').click(function() {
	$('#CollapsiblePanel  > p').animate(
	{'height':'toggle'}, '800', 'easeOutElastic'
	);
	$('html').animate({scrollTop: $('html').height()}, 800);
});
});
