/*
Retour à la dispatch
*/
//----
function dispatch() {
	//----
	var mere = this.creator;
	var dispatchURL = 'index.html';
	//----
	// Détecte si popup ou dispatch (site minimisé)
	if (mere) {
		// Redirection de la dispatch et Fermeture de la popup
		mere.location = dispatchURL;
		mere.focus();
		//
		this.close();
	} else {
		// Popup
		this.location = dispatchURL;
	}
	//-----
}
//----
/*
Execute la fonction showMe
*/
//----
function showMeJS () {
	if (thisMovie("JMWeston")) {
	     thisMovie("JMWeston").showMe();
	 }
}

function thisMovie (movieName) {
     if (navigator.appName.indexOf("Microsoft") != -1) {
          return window[movieName]
     } else {
          return document[movieName]
     }
}
//----
/*
Récupération des param de l'url
*/
//----
function recupFlashVars(so) {
	//----
	var url = location.href;
	var start = url.lastIndexOf('#') + 1;
	//----
	if (start > 5) {
		var nReq = url.substring(start, url.length);
		nReqT = nReq.split("/");
		var nb = nReqT.length;
		//----
		switch (true) {
			case (nb > 0 && nReqT[0].length > 1):
				so.addVariable('lang', nReqT[0]);
			case (nb > 1):
				//so.addVariable('directLink', nReq.splice(1, nb));
				so.addVariable('directLink', nReq);
				break;
		}
	}
	//----
}
//----
/*
Indique si fullscreen ou non
*/
//----
function isFullScreen() {
	var mere = this.creator;
	if (mere) {
		thisMovie("JMWeston").isFullScreen(true);
	} else {
		thisMovie("JMWeston").isFullScreen(false);
	}
}
//----
/*
Lance le site en popup
ou
Ferme le site en popup et change la dispatch
*/
//----
function fullScreen(url) {
	//----
	var mere = this.creator;
	var homeURL = 'home.html';
	var homeParam = 'width='+ self.screen.width + ', height='+ self.screen.height +', type=fullWindow, fullscreen, scrollbars=yes, resizable=yes';
	//----
	// réécriture de l'url
	if (url != 'null' && url) {
		homeURL += '#' + url;
	}
	//----
	// Détecte si popup ou dispatch (site minimisé)
	if (mere) {
		// Redirection de la dispatch et Fermeture de la popup
		mere.location = homeURL;
		mere.focus();
		//
		this.close();
	} else {
		// Popup
		var fille = window.open(homeURL, 'HOME', homeParam);
		fille.creator = this;
		fille.focus();
		// Retour à la dispatch
		location.href = 'index.html'
	}
	//-----
}
//----

