// JavaScript Document

function flOuvrePoduit(sId,sLargeur,sHauteur){
	//if(sId=="1" || sId=="3" || sId=='2'){
		layer({id:'popprod',url:'aja/index.php',param:'page=clindoeil&id='+sId,width:parseInt(sLargeur),height:parseInt(sHauteur)})
	//}else{
		//alertdiv('img/null.gif',"Cette partie du site est actuellement en construction ...","");
	//}
}

function flCloseDecouvrir(){
	document.location.href='index.php';
}

function flRelanceAnime(){			
			thisMovie('decouvrir').relanceAnime();	
}

function clickFlashShw(){
	layer({id:'popprodSec',url:'aja/index.php',param:'page=clindoeil&id=3',width:836,height:837})
}
var objGLOB;
function setWMode(mode,id){

/*	var embeds = getElementsByName_iefix("param","wmode");
	for (i = 0; i < embeds.length; i++)	{embeds[i].value='window';}*/
	
	
	
}

function getElementsByName_iefix(tag, name) {
	
	var elem=document.getElementsByTagName(tag);
	var arr=new Array();
	for(i=0,iarr=0; i < elem.length; i++) {
		
		att=elem[i].getAttribute("name");
		if(att == name) {
			arr[iarr]=elem[i];
			iarr++;
		}
	}
	return arr;
}
	
	
	

function flashToBackground(){
	if(document.getElementById('3dblocPrise')){
		$('3dblocPrise').style.visibility='hidden';
	}
}
function flashToForeground(){
	if(document.getElementById('3dblocPrise')){
		$('3dblocPrise').style.visibility='visible';
	}
}

function hideFlash(){
	
	if(document.getElementById('decouvrir')){
		$('decouvrir').style.height='1px';
	}
	if(document.getElementById('pano-home')){
		$('pano-home').style.height='1px';
		$('pano-home').style.visibility='hidden';
	}
	
/*	if(document.getElementById('pub')){
		
		$('pub').style.visibility='hidden';
		
	}	

	if(document.getElementById('module-slide-pub')){
	
		$('module-slide-pub').style.visibility='hidden';
	}
	if(document.getElementById('moyen-services')){
		
		$('moyen-services').style.visibility='hidden';
	}*/
		/*if(document.getElementById('btFlashCatalogue')){
		$('btFlashCatalogue').style.height='1px';
		$('btFlashCatalogue').style.visibility='hidden';
	}
	if(document.getElementById('btFlashCommande')){
		$('btFlashCommande').style.height='1px';
		$('btFlashCommande').style.visibility='hidden';
	}
	if(document.getElementById('EnteteCommande')){
		$('EnteteCommande').style.height='1px';
		$('EnteteCommande').style.visibility='hidden';
	}*/
	
	
}

function showFlash(){
	
	if(document.getElementById('decouvrir')){
		$('decouvrir').style.height='493px';
		flRelanceAnime();
	}
	if(document.getElementById('pano-home')){
		$('pano-home').style.height='335px';
		$('pano-home').style.visibility='visible';
		
	}
	/*if(document.getElementById('pub')){
		
		$('pub').style.visibility='visible';
		
	}	

	if(document.getElementById('module-slide-pub')){
	
		$('module-slide-pub').style.visibility='visible';
	}
	if(document.getElementById('moyen-services')){
		
		$('moyen-services').style.visibility='visible';
	}*/
}

function changeShowroom(id){
	$('sommaire-shw').style.display='block';
	$('sommaire-shw').style.position='absolute';
	

	if(id=='shw001'){
		swfobject.embedSWF("img/sous-titre-popup.swf", "titre2SHWLED", "400", "36", "10.0.0","", {texte:'BARRETTES ET SPOTS LED',width:397,couleur:'a3bc1a'}, {wmode:'transparent'});
		swfobject.embedSWF("img/092008/projet1/cuisine-led-rigide.swf", "shw", "800", "650", "10.0.0","", {}, {wmode:'transparent'});trace({evnt:'chargement',param1:'showroom led 1',param4:'msa',version_site:'2'})
		majGabarits('libelle','LED rigide','libelle','LED 24 V DC');
}

	if(id=='shw002'){
		swfobject.embedSWF("img/sous-titre-popup.swf", "titre2SHWLED", "400", "36", "10.0.0","", {texte:'INTERRUPTEURS INFRAROUGE',width:397,couleur:'a3bc1a'}, {wmode:'transparent'});
		swfobject.embedSWF("img/092008/projet2/cuisine-video-4.swf", "shw", "800", "650", "10.0.0","", {}, {wmode:'transparent'});trace({evnt:'chargement',param1:'showroom led 2',param4:'msa',version_site:'2'})
		majGabarits('libelle','LED rigide','libelle','LED 24 V DC');
}
	if(id=='shw003'){
				swfobject.embedSWF("img/sous-titre-popup.swf", "titre2SHWLED", "400", "36", "10.0.0","", {texte:'BARRETTES LED FLEXIBLES',width:397,couleur:'a3bc1a'}, {wmode:'transparent'});
		swfobject.embedSWF("img/092008/projet3/cuisine-flexible-2.swf", "shw", "800", "650", "10.0.0","", {}, {wmode:'transparent'});trace({evnt:'chargement',param1:'showroom led 3',param4:'msa',version_site:'2'})
		majGabarits('libelle','LED souple','libelle','LED 24 V DC');
}
	if(id=='shw004'){
		
		swfobject.embedSWF("img/sous-titre-popup.swf", "titre2SHWLED", "400", "36", "10.0.0","", {texte:'BARRETTES LED FLEXIBLES RGB',width:397,couleur:'a3bc1a'}, {wmode:'transparent'});
		swfobject.embedSWF("img/092008/projet4/cuisine-rgb-2.swf", "shw", "800", "650", "10.0.0","", {}, {wmode:'transparent'});trace({evnt:'chargement',param1:'showroom led 4',param4:'msa',version_site:'2'})
		majGabarits('libelle','LED souple','libelle','LED 24 V DC');
}
	if(id=='shw005'){
		swfobject.embedSWF("img/sous-titre-popup.swf", "titre2SHWLED", "400", "36", "10.0.0","", {texte:'KIT CREDENCE LUMINEUSE',width:397,couleur:'a3bc1a'}, {wmode:'transparent'});
		swfobject.embedSWF("img/092008/projet5/cuisine-credence-led.swf", "shw", "800", "650", "10.0.0","", {}, {wmode:'transparent'});trace({evnt:'chargement',param1:'showroom led 5',param4:'msa',version_site:'2'})
		majGabarits('id_clindoeil','4');
}
}

function majGabarits(champs,value,champs2,value2){
	if($('zone-gabarits').style.display=='block'){
		new Ajax.Request(
	  		'aja/index.php', {
	   		method: 'post', 
	    	parameters: 'page=zone-gabarits&champs='+champs+'&value='+value+'&champs2='+champs2+'&value2='+value2, 
	   		onComplete: function (t){
					$('zone-gabarits').innerHTML=t.responseText;
				
			}
   		} );
	}
}

function sommaireShowroom(){
	$('sommaire-shw').style.display='none';
	swfobject.embedSWF("img/092008/showroom.swf", "shw", "800", "650", "10.0.0","", {}, {wmode:'transparent'});
	swfobject.embedSWF("img/sous-titre-popup.swf", "titre2", "400", "36", "10.0.0","", {texte:'SHOWROOM INTERACTIF LED',width:397,couleur:'a3bc1a'}, {wmode:'transparent'});
	majGabarits('id_theme','6');
	
}

function _flOpenShowroomLed(){
	 flOuvrePoduit(sIdShowRoom,sWidthShowRoom,sHeightShowRoom);	
}

function _flOpenFromSlideThumbs(sFile,sPathImages,sDim){

	var aDim=sDim.split("x");
	layer({id:'slideshow',url:sPathImages+'zoom/slideshow.php',param:'url='+sPathImages+'zoom/slideshow.php&image='+sFile+'&width='+aDim[0]+'&height='+aDim[1],width:parseInt(aDim[0]),height:parseInt(aDim[1])});
}

function _flOpenFichePrise(){
	//slideShow('modules/decouvrir/fiche-produits/img/repose-casserole/test.php','image=visu1.jpg',578,385);
//	layer({id:'slideshow',url:'modules/decouvrir/fiche-produits/img/repose-casserole/slideshow.php',param:'url=modules/decouvrir/fiche-produits/img/repose-casserole/slideshow.php&image=visu1.jpg'+'&width='+578+'&height='+385,width:(578),height:385});

layer({id:'popprod',url:'aja/index.php',param:'page=clindoeil&id=2',width:664,height:1036})//1036 ou 2000 pour le test 3d temps réel
	//alertdiv('img/null.gif',"Cette partie du site est actuellement en construction ...","");
}
function _flOpenFicheReposeCasserole(){
		if(sTypeUser=='client'){
			layer({id:'popReposeCasserole',url:'aja/index.php',param:'page=clindoeil&id=1',width:608,height:595})
		}else{
			layer({id:'popReposeCasserole',url:'aja/index.php',param:'page=clindoeil&id=1',width:608,height:490})	
		}
}

function _flOpenFichePiedSoftTouch(){
		if(sTypeUser=='client'){
			layer({id:'popReposeCasserole',url:'aja/index.php',param:'page=clindoeil&id=11',width:664,height:630})
		}else{
			layer({id:'popReposeCasserole',url:'aja/index.php',param:'page=clindoeil&id=11',width:664,height:630})	
		}
}

function _flOpenVenteSofive(){
	//window.open('http://www.k-mikaze.info/sofive/');
}

function  _flOpenCrealigne(){
	window.open('http://www.crealigne.fr/crealigne/site');
}

function  _flOpenPXI(){
	window.open('http://www.pxi-robinetterie.com/pxi/site/index.php'); 
}
function _flOpenFromMoyenServiceNonLog(){
	//alertdiv('img/null.gif',"Cette partie du site est actuellement en construction ...","");
	layer({id:'popContact',url:'aja/index.php',param:'page=contact',width:510,height:600});
}


function flOuvreCommandeCatalogue(str){
	
	layer({id:'popCmdBon',url:'aja/index.php',param:'page=bon_cmd&open=&action=new',width:700,height:200,autosize:'oui'}); 
	
}
function flOuvreCommandeBoncmd(str){
	
	openCatalogue();
}

function flSearchSuivi(str){
	$('nb_pages').value='1';
	$('str_search').value=str;
	navigueListe();
	/*
	new Ajax.Request('aja/index.php',
		{
			method:'post',
			parameters:'page=suivre-navigue&nb_pages='+$('nb_pages').value+'&search='+str,
			onComplete:function(t){
				$('liste-dossier').innerHTML=t.responseText;
			}
		}
	);*/
	
}
function flVideSearchSuivi(){
	$('nb_pages').value='1';
	$('str_search').value='';
	navigueListe();
	/*new Ajax.Request('aja/index.php',
		{
			method:'post',
			parameters:'page=suivre-navigue&nb_pages='+$('nb_pages').value,
			onComplete:function(t){
				$('liste-dossier').innerHTML=t.responseText;
			}
		}
	);*/
}


function _flOpenBrochure2009(){
	if(sTypeUser=='client'){
		document.location.href='index.php?page=commander&action=open-cat&id_brochure=brochure-2009';
	}else{
		openBrochure('brochure-2009');
	}
}

function diapoHomePlayVideo(){
	trace({evnt:'lecture',param1:'video euroforum',param4:'msa',version_site:'2'})
}
/*function clickOnFlash(){
}*/

