var flashvars = {};
var params = {};
params.play = "true";
params.menu = "true";
params.scale = "noscale";
params.salign = "tl";
params.bgcolor = "#FFFFFF";
params.allowfullscreen = "true";
params.allowscriptaccess = "always";
params.allownetworking = "all";
var attributes = {id: "bea"};
attributes.align = "left";
swfobject.embedSWF("Philippeschmit.swf", "main-wrapper", "100%", "100%", "9.0.124", "", flashvars, params, attributes);

function convertStringUrl(string) {
			
	string = replaceSpecialCharacters(string);		
	
	string = string.toLowerCase();
	string = string.split(" ").join("-");	
	
	return string;
	
}

function replaceSpecialCharacters(string){
	
	var string = string.toLowerCase();
	string = string.replace(new RegExp(/[àáâãäå]/g), 'a');
	string = string.replace(new RegExp(/æ/g), 'ae');
	string = string.replace(new RegExp(/ç/g), 'c');
	string = string.replace(new RegExp(/[èéêë]/g), 'e');
	string = string.replace(new RegExp(/[ìíîï]/g), 'i');
	string = string.replace(new RegExp(/ñ/g), 'n');				
	string = string.replace(new RegExp(/[òóôõö]/g), 'o');
	string = string.replace(new RegExp(/œ/g), 'oe');
	string = string.replace(new RegExp(/[ùúûü]/g), 'u');
	string = string.replace(new RegExp(/[ýÿ]/g), 'y');
	
	// remove all other
	string = string.replace(new RegExp(/[^A-Za-z 0-9 -]/g), '');
	
	return string;
	
	return string;
}

//swfobject.addLoadEvent(customRedirect);

if (swfobject.hasFlashPlayerVersion('9.0.124')) {
	
	if (document.location.pathname != '/' && document.location.pathname != '/index.php') {
	
		var pathParts = document.location.pathname.split('\/');
		var newPath;
		/*
		if (pathParts[1] == 'projects') {
			newPath = 'http://' + document.location.host + '/#/projects/' + convertStringUrl(pageTitle);
			document.location = newPath;
		} else if (pathParts[1] == 'pages') {
			newPath = 'http://' + document.location.host + '/#/blog/' + convertStringUrl(pageTitle);
			document.location = newPath;
		} else {
			newPath = 'http://' + document.location.host + '/';
			document.location = newPath;
		}
		*/
		
	} else {
		
		//swfobject.createCSS('html', 'height:100%;');
		//swfobject.createCSS('body', 'margin:0; padding:0; overflow:hidden; height:100%; background-color:#FFFFFF;');
		//swfobject.createCSS('#main-wrapper', 'height:100%;');
		
		swfobject.createCSS('html', 'height:100%; max-height:100%; overflow:hidden;');
		swfobject.createCSS('body', 'height:100%; max-height:100%; margin:0; padding:0; overflow:hidden; background-color:#FFFFFF;');
		swfobject.createCSS('#main-wrapper', 'height:100%; min-height:100%;');

		
	}
	
}



