﻿//Script de gestion des details
var curopt=0;

function showoption(n) {
	var temp=new String;
	var i;
	curopt=n;
	if (document.images)	{
		temp=document.images['visu'].src;
		i=temp.indexOf('_det')+4;
		temp=temp.substring(0,i)+n+temp.substring(i+1,temp.length);
		document.images['visu'].src=temp;
	}
	return;
}

function showpopup(theURL,winName,features) {
	window.open(theURL,winName,features);
}

function zoomoption(winName,features){
	//showpopup('http://www.vente-privee.com/vp2/ik/vp_z2.asp?sec=-' + curopt + '&id=238051',winName,features);
	showpopup('zoom.html',winName,features);
}
  
var zoom=0;


//Highlight form

var highlightcolor="#E4D8DA"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}


function majBugIE()
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="740" height="153">\n');
document.write('<param name="movie" value="../weblog/2006/v01/flash_jour_2esp.swf" />\n');
document.write('<param name="quality" value="high" />\n');
document.write('<embed src="../weblog/2006/v01/flash_jour_2esp.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="740" height="153"></embed>\n');
document.write('</object>\n');
}


var sound2Embed = null;

//// Play sound in the mobile page
function playSound(filePath, id)
{ 
    xt_med('C','16','ecoute_'+id,'N');
    if ( sound2Embed != null) 
    {
        document.body.removeChild(sound2Embed);
		sound2Embed = null;
    }
	sound2Embed = document.createElement("embed");
	sound2Embed.setAttribute("src", filePath);
	sound2Embed.setAttribute("hidden", true);
	sound2Embed.setAttribute("autostart", true);
	sound2Embed.setAttribute("id", "embed_"+id);
    document.body.appendChild(sound2Embed);
} 


function buildGoodiesPlayer(goodieSwfurl,playerId,nbObj,lang,xmlPath,audioPath,imagePath,popupLink,divId)
{	
	var ignoredParams = {src: 1, bgcolor: 1};
	
	var swf = new SWFObject(goodieSwfurl, "goodies", "107", "101", "8.0.0.0", "#F6E9EC");
	swf.addVariable("playerId",playerId);
	swf.addVariable("lang",lang);
	swf.addVariable("xmlPath",xmlPath);
	swf.addVariable("audioPath",audioPath);
	swf.addVariable("imagePath",imagePath);
	swf.addVariable("popupLink",popupLink);
	
	swf.addVariable("nbObj",nbObj);
	
	var players = new Array();
    for(var i = 0; i<nbObj; i++){
        players.push(i+1);                     
    }
    var k=1;
    for(var j in players){                                
        if(j!= playerId-1){                                    
           swf.addVariable("sender"+k,"LC_M" + playerId + "_M" + players[j]);
           swf.addVariable("receiver"+k,"LC_M" + players[j] + "_M" + playerId);                      
           k++;
        }                       
    }
	
	swf.addParam("wmode", "transparent");
	swf.addParam("align", "middle");
	
	swf.write(divId);
}
