<!-- activate tabs with JavaScript -->
$(function() {
	// select #flowplanes and make it scrollable. use circular and navigator plugins
	$("#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
		
	});
	// select #flowsubplanes and make it scrollable. use circular and navigator plugins
	$("#flowsubpanes").scrollable({ circular: true, mousewheel: true }).navigator({
		// select #flowsubtabs to be used as navigator
		navi: "#flowsubtabs",
		// 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
	});
	// select #flowmenupanes and make it scrollable. use circular and navigator plugins
	$("#flowmenupanes").scrollable({ circular: true, mousewheel: true, prev: ".menuprev", next: ".menunext" }).navigator({
		// select #flowmenutabs to be used as navigator
		navi: "#flowmenutabs",
		// 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
	});
	
	// select .flowmenupanes and make it scrollable. use circular and navigator plugins
	$(".flowmenupanes").scrollable({ circular: true, mousewheel: true, prev: ".menuprev", next: ".menunext" }).navigator({
		// select #flowmenutabs to be used as navigator
		navi: ".flowmenutabs",
		// 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
	});
	// select #flowwinnerspanes and make it scrollable. use circular and navigator plugins
	$(".flowwinnerspanes").scrollable({ circular: true, mousewheel: true }).navigator({
		// select #flowwinnerstabs to be used as navigator
		navi: ".flowwinnerstabs",
		// 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
	});
});
<!--// activate tabs with JavaScript -->

<!-- functions -->
// get URL variable
function getUrlVars()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}
<!--// functions -->

<!-- jQuery -->
jQuery(document).ready(function() {
	$("a[name=iFrame]").fancybox({
		'titlePosition'		: 'inside',
		'overlayColor'		: '#000',
		'overlayOpacity'	: 0.75,
		'width'				: '75%',
		'height'			: '75%',
		'autoScale'			: false,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'type'				: 'iframe'
	});
	$("a[name=lightbox]").fancybox({
		'titlePosition'		: 'inside',
		'overlayColor'		: '#000',
		'overlayOpacity'	: 0.75,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic'
	});
	$("a[rel=example_group]").fancybox({
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'overlayColor'		: '#000',
		'padding'			: 0,
		'titlePosition' 	: 'over'
	});
	$("a#example_group").fancybox({
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'overlayColor'		: '#000',
		'padding'			: 0,
		'titlePosition' 	: 'over'
	});
	$(".inlinebox").fancybox({
		'titlePosition'		: 'inside',
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'overlayColor'		: '#000',
		'padding'			: 0
	});
	
	// get URL variable
	var pVars = getUrlVars()["p"];
	if(pVars == "BonusPointsCalculator#pane4"){
		//alert(pVars);
		$("#subtab4").click();
		$("#menutab2").click();
	}
});
<!--// jQuery -->
