
var vers = swfobject.getFlashPlayerVersion();    
if (vers.major >= 9) {
	var flashvars = {};
	flashvars.swfAddressEnabled = "true";
	flashvars.templatePath = '../../..'+mcDataPath+'_templates/';
	   
	var params = {};
	    params.scale = "noscale";
	    params.salign = "mc";
	    params.bgcolor = "#FFFFFF"
	    params.allowscriptaccess = "always";
	    params.menu = "false";
	       
	var attributes = {};
	    attributes.align = "center";
	    attributes.id = "container";
	       
	swfobject.embedSWF('../../..'+mcDataPath+'Main.swf', "container", "100%", "100%", "8", null, flashvars, params, attributes);  
	swfobject.createCSS("#container", "height:100%;width:100%;"); 
	swfobject.createCSS("body", "overflow:hidden;padding:0;margin:0;"); 
	swfobject.createCSS("#container_outerbanner_microsite", "display:none;"); 
} else if (SWFAddress.getValue() != "" && SWFAddress.getValue() != "/") {      
	window.location.href = pathcleaner(window.location.href);
}                  

function pathcleaner(path) {
	//wipe index-elements
	var newpath = path.replace("index.jsp#/","");
	newpath = newpath.replace("index.html#/","");    
	newpath = newpath.replace("debug.html#/","");    
	newpath = newpath.replace("#/","");
	
	//wipe virtualPaths
	var pathparts = newpath.split("/");
	var virtualPath;
	for (i=0;i<pathparts.length;i++) {
		virtualPath = pathparts[i].split("+");
		pathparts[i] = virtualPath[0];
	}
	newpath = pathparts.join("/");
	
	//return cleaned path
	return newpath;
}



