/* JavaScript */
SITE_URI = "http://www.xvitresteintees.com/";
//SITE_URI = "http://www.bmgmultimedia.com/zoneclient/cil/limskzlrnf/";
//SITE_URI = "http://192.168.1.6/895_xvitres/www/";

function genererLienActif() {
	if ( document.getElementById && document.getElementsByTagName ) {
		sPage = (window.location.href).substring((window.location.href).lastIndexOf("/") + 1, (window.location.href).lastIndexOf("."));
		
		aIdentifiants = new Array;
		
		switch ( sPage ) {
			case "apropos":       aIdentifiants = ["mnpropos"]; break;
			case "archives":      aIdentifiants = ["mnnouvelles"]; break;
			case "contact":       aIdentifiants = ["mncontact"]; break;
			case "franchise":       aIdentifiants = ["mncontact"]; break;
			case "decoratif":     aIdentifiants = ["mnsecurite"]; break;
			case "videos":     		aIdentifiants = ["mnsecurite"]; break;
			case "equipe":        aIdentifiants = ["mnpropos"]; break;
			case "gal_decoratif": aIdentifiants = ["mnsecurite"]; break;
			case "gal_securite":  aIdentifiants = ["mnsecurite"]; break;
			case "gal_solaire":   aIdentifiants = ["mnsecurite"]; break;
			case "garantie":      aIdentifiants = ["mngarantie"]; break;
			case "mission":       aIdentifiants = ["mnpropos"]; break;
			case "nouvelles":     aIdentifiants = ["mnnouvelles"]; break;
			case "securite":      aIdentifiants = ["mnsecurite"]; break;
			case "solaire":       aIdentifiants = ["mnsecurite"]; break;
			case "soumission":    aIdentifiants = ["mnsoumission"]; break;
			case "evenements":    aIdentifiants = ["mnevenements"]; break;
			case "galerie":    aIdentifiants = ["mnevenements"]; break;
			case "installation":    aIdentifiants = ["mninstallation"]; break;
			case "installationpelli":    aIdentifiants = ["mninstallation"]; break;
			case "exemples":    aIdentifiants = ["mnexemples"]; break;
			case "soumission":    aIdentifiants = ["mnsoumission"]; break;
			default:              aIdentifiants = ["mnaccueil"]; break;
		}
		
		for ( compteur = 0; compteur < aIdentifiants.length; compteur++ ) {
			if ( oLien = document.getElementById(aIdentifiants[compteur]) ) {
				/* Dsactive les fonctions possibles sur le lien */
				oLien.onmouseover = function () {  };
				oLien.onmouseout = function () {  };
				
				/* Change la source de l'image pour l'image de survol */
				aImages = oLien.getElementsByTagName("IMG");
				for ( compteurIMG = 0; compteurIMG < aImages.length; compteurIMG++ ) {
					oIMG = aImages[compteurIMG];
					if (oIMG.src.indexOf("_on.gif")==-1){
						sSourceImage = oIMG.src.substring( 0, oIMG.src.lastIndexOf(".") ) + "_on" + oIMG.src.substring( oIMG.src.lastIndexOf(".") );
						oIMG.src = sSourceImage;
					}
				}
			}
		}
	}
}





/* Ouvre une photographie dans une nouvelle fenetre */
function ouvrirPhoto( eAncre, largeur, hauteur ) {
	oFenetre = window.open(
		SITE_URI + "galerie_afficher.html?i=" + eAncre.href, 
		"Galerie", 
		"width=" + largeur +
		",height=" + hauteur + 
		",top=" + Math.ceil((screen.availHeight/2)-(hauteur/2)) +
		",left=" + Math.ceil((screen.availWidth/2)-(largeur/2)) + 
		",location=0,toolbar=0,menubar=0,resizable=0,scrollbars=0"
	)
	
	oFenetre.focus();
}

/* Ouvre une photographie dans une nouvelle fenetre */
function ouvrirVideo( eAncre ) {
	iLargeur = 410;
	iHauteur = 325;
	var oFenetre = window.open(
		SITE_URI + "videos_afficher.html?i=" + eAncre.href, 
		"Video", 
		"width=" + iLargeur +
		",height=" + iHauteur + 
		",top=" + Math.ceil((screen.availHeight/2)-(iHauteur/2)) +
		",left=" + Math.ceil((screen.availWidth/2)-(iLargeur/2)) + 
		",location=0,toolbar=0,menubar=0,resizable=0,scrollbars=0"
	)
	
	oFenetre.focus();
}

