var URLAppli = '';

	function initApp(section){
		setSectionToURL(section);
		initFlash();
		checkSections();
	}


	function initFlash(){
		var urlFlash = "";
		
		var flashvars =	{
			xmlLoader:"xml/preload_v2.xml"
		};
				
		var params = {
			bgcolor : "#000000",
			scale : "noScale",
			salign : "tm",
			menu : "false",
			wmode:"window",
			allowFullScreen : "true",
			allowScriptAccess:"always"
		}
		var attributes = {
			id:"flashContainer",
			allowScriptAccess:"always"
		};
		
		swfobject.embedSWF("loader.swf", "flashContainer", "960", "600", "9.0.0","expressInstall.swf", flashvars, params, attributes);
		
	}
	
	function setSectionToURL(section){
		var currentURL = document.location.href;
		if (currentURL.indexOf("#") == -1){
			document.location.href = "#/page="+section;
		}
	}

	function checkSections(){
		setInterval(function(){
			isSectionHome();
		},1000);
	}
	
	function isSectionHome(){
	if (URLAppli == document.location.href) return;
	URLAppli = document.location.href;
	sectionAppli = URLAppli.substring(URLAppli.indexOf("#"),URLAppli.length);
	/*if((sectionAppli.indexOf('home') != -1) || (sectionAppli.indexOf('discover') != -1))document.getElementById('marie-claire').className = '';
	else document.getElementById('marie-claire').className = 'hidden';*/
	
	if((sectionAppli.indexOf('home') != -1))document.getElementById('salon-locator').className = '';
	else document.getElementById('salon-locator').className = 'hidden';
}
