// JavaScript Document
jQuery(document).ready(function(){
	jQuery('#menu-header').find('li:first').addClass('menuleft');
	jQuery('#menu-header').find('li:last').addClass('menuright');
	
	// select #flowplanes and make it scrollable. use circular and navigator plugins
	jQuery("#flowpanes").scrollable({ circular: true, mousewheel: true }).navigator({
		// select #flowtabs to be used as navigator
		navi: "#flowtabs",
		// select A tags inside the navigator to work as items (not direct children)
		naviItem: 'a',
		// assign "current" class name for the active A tag inside navigator
		// activeClass: 'current',
		// make browser's back button work
		// history: true
	}).autoscroll({ autoplay: true,interval: 15000 });
	
	//
	jQuery('a.ajax').live("click", function(){
		var contentwrapper = jQuery(this).attr('target');
		var toLoad = jQuery(this).attr('href')+' #'+contentwrapper;
		// window.location.replace = $(this).attr('href');
		//window.location.replace ( $(this).attr('href') );
		jQuery('#'+contentwrapper+'').append('<div class="loader" style="display:block !important;"></div>');
		jQuery('#'+contentwrapper+'').load(toLoad,function () {
			jQuery('#'+contentwrapper+' .loader').remove();
		});
		return false;
	});
	
	jQuery('.video_lists a').click(function () { 
		jQuery('#list-video-posts ul li').removeClass('active_video');
		jQuery(this).parent().addClass('active_video');
	});
	
});

