//Timewade 2010

$(document).ready(function() {

	//Homepage Tabs
	$('#lcontent .tab:first').show();	
	$('#llist li').click(function() {
        
		var thisTop = $(this).position().top;
        $('.pointer').animate( {'top': thisTop} );
		
		$('#llist li').removeClass('current');
		$(this).addClass('current');
		var id = $("li.current a").attr('href');
	    $("#lcontent div").fadeOut(500).hide();
		$(id).fadeIn();
		return false;
    });
	
	var intervalID = null;
	
	$('#llist li').click(function(event) {
	   if('originalEvent' in event) {
		  clearInterval(intervalID);
	   }
	});
	
	intervalID = setInterval((function(){
	  var count = 0;
	  var ul = $('#llist li');
	
	  return function(){
		ul.eq(++count % ul.length).click();
	  };
	})(), 3000);
	
	$("#offering li").click(function() {                             
        $(this).find("ul").animate({height: "toggle"}, 500);
        $(this).toggleClass('current')
               .children('img.offeringselected').toggle(); // show/hide the img
	});
	
});
 
 
//Initiate Menu
ddsmoothmenu.init({
 mainmenuid: "menu",
 orientation: 'h',
 classname: 'dropdown',
 contentsource: "markup"
})
