var page = 1; // global for other functions

function delay_fade(el, millisecs) {
    var i = setTimeout(function(){
        $(el).fadeIn()   
        
    }, millisecs);
}

 
$(document).ready(function() {

  if($('#wrp'))
    $('#wrp').corner('5px');
  if($('.project'))
  {
    var c = 0;
    $(this).next().find('li').each(function(){              
        var t = c;
        delay_fade(this, 50*t);
        c++;
    })
  }
    
    

  $('#mainimage').corner('5px');

    try
    {
      $('#mainimage').dropShadow();
      $('#facilities').dropShadow();
      $('#location').dropShadow();
      $('#news').dropShadow();
    }
    catch(e)
    {
      // function doesn't exist
    }

  $('#facilities').corner('5px');
  $('#location').corner('5px');
  $('#news').corner('5px');
 


	$(".parent").toggle(		

        function() {
            
            $(this).addClass('more');
            var c = 0;
            $(this).next().find('li').each(function(){              
                var t = c;
                delay_fade(this, 50*t);
                c++;

            })
         
          
        },
        function() {
            $(this).removeClass('parentselected');
            $(this).next().find('li').fadeOut('fast');
        }
	);		

/*
    $('.parents a').click(
      function() {
            $(".parent").removeClass('parentselected');
            $(".parent").removeClass('more');
            $('#navigate a').removeClass('parentselected');
            $(".parent").next().find('li').fadeOut('fast');

        }
    );

*/

});
