// JavaScript Document
// Permalinks option
	function flashPutHref(href) { location.href = href; }

	/*Pour pogner la variable GET*/	
  function getVar (nomVariable)
    {
    	var infos = location.href.substring(location.href.indexOf("?")+1, location.href.length)+"&"
    	if (infos.indexOf("#")!=-1)
    		infos = infos.substring(0,infos.indexOf("#"))+"&"
    	var variable=0
    	{
    		nomVariable = nomVariable + "="
    		var taille = nomVariable.length
    		if (infos.indexOf(nomVariable)!=-1)
    			variable = infos.substring(infos.indexOf(nomVariable)+taille,infos.length).substring(0,infos.substring(infos.indexOf(nomVariable)+taille,infos.length).indexOf("&"))
    	}
    	return variable
    }

	/*Pour pogner la variable GET*/	
  function getPath ()
    {
    	return  location.href.substring( 25 , location.href.length)
    }
    
	function loadAlbum(inAlbum){
  	var flashvars = {
  		paramXMLPath: "param_" + inAlbum + ".xml",
  		initialURL: escape(document.location)
  	}
  	var params = {
  	  width: "854",
      height: "527",
  		bgcolor: "#000000",
  		allowfullscreen: "true",
  		base: "http://www.cuisinesac.com/fileadmin/templates_cac/flash/"
  	}                
  	var attributes = {}

  	swfobject.embedSWF("fileadmin/templates_cac/flash/loader.swf", "flashcontent", "854", "527", "7.0.0", "fileadmin/templates_cac/flash/expressInstall.swf", flashvars, params, attributes);  
    
  }
  
  function loadSSAlbum(inAlbum){
    loadAlbum(inAlbum);
    document.getElementById('ss_urb').className = '';
    document.getElementById('ss_cla').className = '';
    document.getElementById('ss_co').className = '';
    document.getElementById('ss_ch').className = '';
    document.getElementById('menu_cui').className = 'act';
    document.getElementById('menu_sb').className = '';
    document.getElementById('menu_mi').className = '';
    
    document.getElementById('ss_'+inAlbum).className = 'act';
  }
  
  function initAlbum(){

    switch(getPath()){
      case '/fr/produits/cuisines/index.html':
      case '/en/products/kitchens/index.html':
        loadAlbum('co');
        document.getElementById('menu_cui').className = 'act';
        document.getElementById('ss_co').className = 'act';
      break;
      case '/fr/produits/salles_de_bain/index.html':
      case '/en/products/bathrooms/index.html':
        loadAlbum('sb');
        document.getElementById('menu_sb').className = 'act';        
      break;
      case '/fr/produits/meubles_integres/index.html':
      case '/en/products/built_in_furniture/index.html':
        loadAlbum('mi'); 
        document.getElementById('menu_mi').className = 'act';        
      break;  
      case '/fr/cuisine_ac_du_marche/index.html':
      case '/en/cuisine_ac_du_marche/index.html':
        loadAlbum('mar');     
        break;           
      default: 
        loadAlbum('co');
        document.getElementById('menu_cui').className = 'act';
        document.getElementById('ss_co').className = 'act';
      break; 
  	}
  }

