<!--Begin Pro js functions
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// End Pro js functions -->
<!--
var isdynamic = true;
function open_link(contenttype, object, language){
	s= window.location.href;
	page = "index.cfm?contentid=" + object;
	document.location.href = page;
}

function open_link_popup(contenttype, object, language){
	s= window.location.href;
	page = "index.cfm?contentid=" + object;
	window.open (page, 'adminConsole', 'left=300,top=10,width=1024,height=768,scrollbars=yes,resizable=0,status=yes,menubar=yes,directories=np');
}

function open_link_popup_mag(contenttype, object, language, magasinDNS){
	s= window.location.href;
	page = "/" + magasinDNS + "/" + language + "/?contentid=" + object + "&magasinIDDNS=" + magasinDNS;
	window.open (page, 'adminConsole', 'left=300,top=10,width=1024,height=768,scrollbars=yes,resizable=0,status=yes,menubar=yes,directories=np');
}

function open_popup(page){
	page = page + "&rd=" + Math.random();
	window.open (page, 'adminConsole', 'left=300,top=10,width=700,height=650,scrollbars=yes,resizable=0,status=yes,menubar=no,directories=np');
}

function open_pictman(page){
	page = page + "&rd=" + Math.random();
	window.open (page, 'adminPictures', 'left=300,top=10,width=650,height=450,scrollbars=no,resizable=0,status=yes,menubar=no,directories=np');
}

function gotoAnchor(anchorname) {
	document.location.hash = anchorname;
	void(0);
}
function confirm_action (page) {
	if (confirm("Are you sure you want to do this ?")) {
		page = page + "&rd=" + Math.random();
		open_popup (page, 'adminConsole', 'left=300,top=10,width=700,height=300,scrollbars=yes,resizable=1,status=no,menubar=no,directories=np');
		return false;}
	else {
		return false;
	}
}

function setCookie(name, value, expire) {   
    document.cookie = name + "=" + escape(value)   + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
}

function saveLanguage(name) {
    var today = new Date();
    var expires = new Date();
    expires.setFullYear(today.getFullYear() + 1);
    setCookie("pro", name, expires);
}


function getCookie(Name) {
    var search = Name + "=";
    if (document.cookie.length > 0)
    { // if there are any cookies
        offset = document.cookie.indexOf(search);
        if (offset != -1)
        { // if cookie exists
            offset += search.length;
            // set index of beginning of value
            end = document.cookie.indexOf(";", offset);
            // set index of end of cookie value
            if (end == -1)
            {
                end = document.cookie.length;
            }
	    return unescape(document.cookie.substring(offset, end));
	}
    }
}

function popUp(url) { 
    sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
    self.name = "mainWin";
}

function zoomProduit(url,racine) { 
	if (racine != null) {
		sealWin=window.open(racine,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=700,height=700');
		sealWin.document.location.href = url;
	} else {
    	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=700,height=700');
	}
    self.name = "mainWin";
}

function zoomProduitGuide(url) { 
    sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=700,height=425');
    self.name = "mainWinProduit";
}

function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
   var obj = document.layers ? document.layers[szDivID] :
   document.getElementById ?  document.getElementById(szDivID).style :
   document.all[szDivID].style;
   obj.visibility = document.layers ? (iState ? "show" : "hide") :
   (iState ? "visible" : "hidden");
}

// Removes leading whitespaces
function LTrim( value ) {
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
}

// Removes ending whitespaces
function RTrim( value ) {
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
}

// Removes leading and ending whitespaces
function trim( value ) {
	return LTrim(RTrim(value));
}


var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1);

function printThisPage() {
   	window.open("print.cfm","Print",'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=730,height=600');
}

function printThisPageHtml() {
   	window.open("/print.html","Print",'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=730,height=600');
}

function printThisInitiativePage(page){
	page = page + "&rd=" + Math.random();
	window.open (page, 'adminConsole', 'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=620,height=600');
}

function pictPopup(img,w,h,title) 
{
	if('undefined'.indexOf(title) == 0){
		titre="SOMFY";
	}else{
		titre="SOMFY : "+title;
	}
	if('undefined'.indexOf(w) == 0){
		tw="100";
	}else{
		tw=w;
	}
	if('undefined'.indexOf(h) == 0){
		th="100";
	}else{
		th=h;
	}
	// window.moveTo((screen.width-w)/2,(screen.height-h)/2) ;
	w=open('','image','width='+tw+',height='+th+',toolbar=no,scrollbars=no,resizable=yes');
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { var w = document.images[0].width + 12 ; var h = document.images[0].height + 30 ; if (document.images[0].complete) {  window.resizeTo(w,h) ;  window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}

function makevisible(cur,which)
{
	strength=(which==0)? 1 : 0.2;
	if (cur.style.MozOpacity)
		cur.style.MozOpacity=strength;
	else if (cur.filters)
		cur.filters.alpha.opacity=strength*100;
}

function pictPopupSB(img,w,h,title) 
{
	if('undefined'.indexOf(title) == 0){
		titre="SOMFY";
	}else{
		titre="SOMFY : "+title;
	}
	if('undefined'.indexOf(w) == 0){
		tw="100";
	}else{
		tw=w;
	}
	if('undefined'.indexOf(h) == 0){
		th="100";
	}else{
		th=h;
	}
	// window.moveTo((screen.width-w)/2,(screen.height-h)/2) ;
	w=open('','image','width='+tw+',height='+th+',toolbar=no,scrollbars=yes,resizable=yes');
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
	//w.document.write("<SCRIPT language=javascript>function checksize()  { var w = document.images[0].width + 12 ; var h = document.images[0].height + 30 ; if (document.images[0].complete) {  window.resizeTo(w,h) ;  window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY  leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}

function selectValue(selectbox) {
	var form = selectbox.form;
	form.criteria.value = selectbox.name;
	form.submit();
}

function announceEvent(form, eventname) {
	form.method.value = eventname;
	form.submit();
}

function activeSWFContent() {
	var ret = SWFGetArgs(arguments);
	SWFGenerateObject(ret.objAttrs, ret.params, ret.embedAttrs);
}

function SWFGenerateObject(objAttrs, params, embedAttrs) { 
	var str = '<object ';
	for (var i in objAttrs)
		str += i + '="' + objAttrs[i] + '" ';
	str += '>';
	for (var i in params)
		str += '<param name="' + i + '" value="' + params[i] + '" /> ';
	str += '<embed ';
	for (var i in embedAttrs)
		str += i + '="' + embedAttrs[i] + '" ';
	str += ' ></embed></object>';

	document.write(str);
}

function SWFGetArgs(args) {
	var ret = new Object();
	ret.embedAttrs = new Object();
	ret.params = new Object();
	ret.objAttrs = new Object();
	for (var i=0; i < args.length; i=i+2){
		var currArg = args[i].toLowerCase();    

		switch (currArg){	
			case "pluginspage":
			case "type":
			case "src":
				ret.embedAttrs[args[i]] = args[i+1];
				break;
			case "data":
			case "codebase":
			case "classid":
			case "id":
			case "onafterupdate":
			case "onbeforeupdate":
			case "onblur":
			case "oncellchange":
			case "onclick":
			case "ondblClick":
			case "ondrag":
			case "ondragend":
			case "ondragenter":
			case "ondragleave":
			case "ondragover":
			case "ondrop":
			case "onfinish":
			case "onfocus":
			case "onhelp":
			case "onmousedown":
			case "onmouseup":
			case "onmouseover":
			case "onmousemove":
			case "onmouseout":
			case "onkeypress":
			case "onkeydown":
			case "onkeyup":
			case "onload":
			case "onlosecapture":
			case "onpropertychange":
			case "onreadystatechange":
			case "onrowsdelete":
			case "onrowenter":
			case "onrowexit":
			case "onrowsinserted":
			case "onstart":
			case "onscroll":
			case "onbeforeeditfocus":
			case "onactivate":
			case "onbeforedeactivate":
			case "ondeactivate":
				ret.objAttrs[args[i]] = args[i+1];
				break;
			case "width":
			case "height":
			case "align":
			case "vspace": 
			case "hspace":
			case "class":
			case "title":
			case "accesskey":
			case "name":
			case "tabindex":
				ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
				break;
			default:
				ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
		}
	}
	return ret;
}
//-->
