if (document.all)    {n=0;ie=1;}
if (document.layers) {n=1;ie=0;}

function Submitform() {
	if  (document.sub.addr.value=='') alert("Adresse Email non valide");
    else {
		if ( ((document.sub.addr.value.indexOf('@',1))==-1)||(document.sub.addr.value.indexOf('.',1))==-1 )
			alert("Adresse Email non valide");
        else {
			w = window.open('/newsletter/mladd.php?type=inscription&addr=' + document.sub.addr.value,'ami','WIDTH=350,HEIGHT=280');
            if (navigator.userAgent.indexOf('MSIE')==-1) {w.focus()}
        }
    }
}

function Ami(url)    {
		w = window.open(url,'ami','WIDTH=550,HEIGHT=280');
    if (navigator.userAgent.indexOf('MSIE')==-1) {w.focus()}
}
function Ami(url, width, height)    {
		if(!width) width = 350;
		if(!height) height = 280;
		w = window.open(url,'ami','WIDTH=' + width + ',HEIGHT=' + height);
    if (navigator.userAgent.indexOf('MSIE')==-1) {w.focus()}
}





function inactiveIllustrationId(objid) {
	inactiveIllustration(document.getElementById(objid));
}
function activeIllustrationId(objid) {
	activeIllustration(document.getElementById(objid));
}
function inactiveIllustration(obj) {
	// obj.style.opacity = .5;
	// obj.style.filter = 'alpha(opacity=50)';
	opacity(obj.id, 100, 60, 100);
}
function activeIllustration(obj) {
	// obj.style.opacity = 1;
	// obj.style.filter = 'alpha(opacity=100)';
	opacity(obj.id, 60, 100, 100);
}


function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 


