/**
 * Twitter timeline
 * 
 * */

//declare variable for on & off state
var twitswitch = 0;

function loadTwit(){
	if(twitswitch == 0){
		//show timeline div
		$("#timeline").slideDown('slow',function(){
			//start loading the tweets in
			//alert('showit');
			$('#timeline .middle.tweets').jTweetsAnywhere({
                   username: 'HotelErkelenS',
                   count: 3,
                   showFollowButton: false
               });
		});
		//set twitswitch on
		twitswitch = 1;
	} else if(twitswitch == 2) {
		//when twitswitch was closed while already loaded only show the timelinediv
		$("#timeline").slideDown('slow');
		//set twitswitch on
		twitswitch = 1;
	} else {
		//hide while loaded
		$("#timeline").slideUp('slow');
		//set twitswitch off
		twitswitch = 2;
	}
	return false;
};

$(document).ready(function(){
	$("#timeline").mouseleave(function(){ 
		$("#timeline").slideUp('slow');
		//set twitswitch off
		twitswitch = 2;
	});
	
	$('#mainMenu ul > li').mouseenter(function(){
		$(this).addClass('over');
		$(this).find('.dropdown').slideDown(200);
	}).mouseleave(function(){
		$(this).removeClass('over');
		$(this).find('.dropdown').slideUp(200);
	});
});

