	// swfobject setup for type page
	var flashvars = {};
	var params = {};	
	params.wmode = "transparent";
	var attributes = {};
	attributes.align = "middle";
	
	if (this.location.hash == '#spendshifter') {
		url = ("../swf/spendshifter.swf");
	}
	else if (this.location.hash == '#legitimiser') {
		url = ("../swf/legitimiser.swf");
	}
	else if (this.location.hash == '#minitreater') {
		url = ("../swf/minitreater.swf");
	}
	else if (this.location.hash == '#righter') {
		url = ("../swf/righter.swf");
	}
	else if (this.location.hash == '#haymaker') {
		url = ("../swf/haymaker.swf");
	}
	else {
		url = ("../swf/nellie.swf");
	}
	
	// function for changing banner on click
	function changeBanner(id) {
		flashvars.section = id;
		swfobject.embedSWF(url, "flash_alt", "786", "158", "8.0.0", "../swf/expressInstall.swf", flashvars, params, attributes);
	}
	
	changeBanner('');
	
	jQuery(document).ready(function(){
		$(".ui-tabs-nav li a").each(function(){
			$(this).click(function(e){
				var section = $(this).attr("href").substr(1);
				//changeBanner(section);
				location.hash = $(this).attr("href");
				e.preventDefault();
				return false;
			})
		})
	});
	
	// switch flash files on click of tabs
	function loadSWF(url, targetID){
		// check for existing flash file
		if(isObject(targetID)){
			// replace object/element with a new div
			replaceSwfWithEmptyDiv(targetID);
		}
		// embed flash file
		swfobject.embedSWF(url, targetID, "786", "158", "8.0.0", "../swf/expressInstall.swf", flashvars, params, attributes);
		params.wmode = "transparent";	
	}
	
	function isObject(targetID){
		var isFound = false;
		var el = document.getElementById(targetID);
		if(el && (el.nodeName === "OBJECT" || el.nodeName === "EMBED")){
			isFound = true;
		}
		return isFound;
	}
	
	function replaceSwfWithEmptyDiv(targetID){
		var el = document.getElementById(targetID);
		if(el){
			var div = document.createElement("div");
			el.parentNode.insertBefore(div, el);
			// remove the swf
			swfobject.removeSWF(targetID);
			// give the new div the old element's ID
			div.setAttribute("id", targetID);
		}
	}
