$(function(){
	/* Initialize the Menu */
	freshTipsMenu.init();
})

var freshTipsMenu = {
	menuSelector:"#freshTipsMenu",
	paragraphSelector:".freshTipsItemParagraph",
	classSelected:"ttl_freshTipsSelected",	
	
	init:function(){
		this.hide();
		this.events();
		this.toggle();
	},
	
	hide:function(){
		var i=0;
		$(this.menuSelector+" li div"+this.paragraphSelector).each(function(){
		    this.position = i;
		    if(this.position!=0){
		        $(this).hide();
		    }
		    i++;
		});
	},
	
	events:function(){
		_this = this;
		$(this.menuSelector+" li a").click(function(){
			var paragraph = $(this).parent().children(_this.paragraphSelector);
			if (!this.toogle) {				
				paragraph.show();
				this.toogle = 1;				
			}else{
				paragraph.hide();
				
				this.toogle = 0;
			}
			return false;
		});		
	},
	toggle:function(){
	    var i=0;
		$(this.menuSelector+" li a").each(function(){		
		    this.position = i;
		    if(this.position!=0){
			    this.toogle = 0;
			}else{
			    this.toogle = 1;
			}
			i++;
		})
	}
}
