/* flash ........................................................... */
/* START: GLOBAL VARS */
var flashDir = "flash/";
/* Default Flash version supported, 
Flash Write function can override this if passed a different version as the last argument*/
var ver = 7;
/* END: GLOBAL VARS */

function fDetect() {
	/* detect which version of Flash installed, either  */
	fPlug= (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if (fPlug) {
		fPlug = parseInt(fPlug.description.substring(fPlug.description.indexOf(".")-1));
	}
	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && navigator.userAgent.indexOf("Windows")>=0 ) {
		document.write('<script language="vbscript" type="text\\vbscript"> \n');
		document.write('on error resume next \n');
		document.write('fPlug = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+ver+'")))\n');
		document.write('<\/script> \n');
		if (fPlug>0) {fPlug=ver;}
	}
}
function fWrite(movie, w, h, fVars, minVer) {
	if ((minVer&&fPlug>=minVer)||fPlug>=ver) {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ver+',0,0,0" ');
		document.write('width="'+w+'" height="'+h+'" id="visualiser">');
		document.write('<param name="movie" value="'+flashDir+movie+'.swf?' + fVars + '">');
		document.write('<param name="allowScriptAccess" value="sameDomain" />');
		document.write('<param name="wmode" value="transparent">');
		document.write('<embed src="'+flashDir+movie+'.swf?' + fVars + '" name="visualiser" width="'+w+'" height="'+h+'" ');
		document.write('wmode="transparent" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
		document.write('<\/object>');
	}
}
function hideNoFVer() {
	document.write('<style type="text/css"><!--');
	document.write('.noFlash {visibility:hidden;position:absolute;top:0;left:-1600;z-index:1;}');
	document.write('--><\/style>');
}

function visRequest(pageURL, parmList) {
	
//	alert(pageURL);
//	alert(parmList);
	
	document.visData.method = "POST";
	
	if (pageURL == "planNow") {
		document.visData.action = '/webapp/wcs/stores/servlet/MyPlanControl?storeId=' + globalCommerceConfig.storeId + '&catalogId=' + globalCommerceConfig.catalogId + '&OP=LIST';
	}
	
	if (pageURL == "allProjects") {
		document.visData.action = '/webapp/wcs/stores/servlet/MyProjectsLibraryControllerCmd?storeId=' + globalCommerceConfig.storeId + '&catalogId=' + globalCommerceConfig.catalogId + '&OP=LIST';
	}


	var arrElements = parmList.split('::');
	
	var i
	for (i=0; i < arrElements.length; i++) {
		var arrIndivElement = arrElements[i].split('!');

		var obj = document.createElement('INPUT');

        	obj.type 	= 'HIDDEN';
        	obj.name 	= arrIndivElement[0];
        	obj.value 	= arrIndivElement[1];

		//add the object to the form
		document.visData.appendChild(obj);
	}
	
	
	document.visData.submit();

}


function visualiser_DoFSCommand(command, args) {
	
	// alert('commands=' + command + ' , args=' +args);
	if (window.opener) {
		window.opener.processVisRequest(command, args);
		window.close();
	}
}

function lhsFlash(num) {   
	if (fWrite) { 
		fWrite('insp_nav', 87, 200, 'initMenu=' + num + '&inlink1=i_ci_red.html&inlink2=i_ci_orange.html&inlink3=i_ci_gold.html&inlink4=i_ci_yellow.html&inlink5=i_ci_green.html&inlink6=i_ci_blue.html&inlink7=i_ci_violet.html&inlink8=i_ci_neutral.html'); 
		if (fPlug && fPlug >= ver) { 
			document.write('<div class="w72"><span class="tSmall">Cliquez ici pour voir d’autres couleurs&nbsp;</span></div>'); 
		} 
	} 



}