/*
 * all the code for the
 */
var Sidebar ={
	
	container: null,
	
	init: function(){
		this.container = $('div.NavPanel');

		this.container.find('.howToTradeTabs li').bind('click',{},this.changeTab);
		//this.container.find('.liveChatClick').bind('click',General.onclickLiveChat);
        //this.container.find('div.videoTour').click(Sidebar.onClickGuidedTour);
                
	},
	
	changeTab: function(event){
		var currentTab = $(this);
		var contentContainer = currentTab.parents(".how_to_trade:first");
		var tabsContainer = currentTab.parents("ul:first");

		tabsContainer.find("li").removeClass("selected");
                                          tabsContainer.find("div").removeClass("selectedIcon");
		contentContainer.find(".steps").hide();
		contentContainer.find("." + currentTab.attr('class') + "Tab").show();
		currentTab.addClass("selected"); 
                                          currentTab.find(".iconTab").addClass("selectedIcon");
	},
	
    onClickGuidedTour: function(){
//        get current tabbed category and play its video
//        var category=$('div.how_to_trade li[class$="On"]').attr('id').split("_",2)[1];
//        if( AppData.pageId == 'home' )
//            PlatformNav.onPlayDemoVideo(category);
//        else{
//            
//             if( category ==  'oneTouch'){
                    //General.redirect('home/fast', null, "autoPlayDemo=oneTouch")
//                    return; //dont continue function
//                }else if(category ==  'binaryOptions'){
//                    General.redirect("home/pro", null, "autoPlayDemo=binaryOptions");
//                    return; //dont continue function
//                }else if(category ==  'optionsBuilder'){
//                    alert('not implemented');
//                }            
//	}
    }
}
$(document).ready(function() { 
	Sidebar.init();
}); 
