
// JavaScript Document

function _(o) {
            return document.getElementById?document.getElementById(o):null
}

// Envoyer à un ami
function popUp(url){
	window.open(url,"envoyer","width=385,height=320,left=100,top=100,scrollbars=no")
}

var winpop="";
function opennamedwin(URL, Nom, WW, HH, LL, TT) {
	var h=300;
	var w = 300;
	var t=0;
	var l = 0;

	self.window.name="Waaps";
	var Aide="";
	if (Nom=="") {Nom="Aide";}
	if (WW) {w=WW;}
	if (HH) {h=HH;}
	if (LL) {l=LL;}
	if (TT) {t=TT;}

	winpop=window.open("", Nom,"resizable=yes,scrollbars=no,toolbar=no,status=no,width=" + w + ",height=" + h + ",top=" + t + ",left=" + l);
	winpop.window.moveTo(l,t);
	winpop.focus();
	setTimeout('winpop.location="'+URL+'";',100);

}

function printdoc() {
	opennamedwin('about:blank','imprime',600,400,0,0);
	document.forms.print.doc.value=document.body.innerHTML;
	setTimeout("document.forms.print.submit();",150);
}



picto="";
function zoom(picture,legende){
	picto = picture;
	wi=100;
	hi=100;
	titre="Zoom";
	legendetex=legende;
	stats="toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no," ;
	stats += "resizable=yes,width=" + wi + ",height="+hi ;
	imgwin = window.open ("",titre,stats);
	window.setTimeout("makepage(picto,legendetex)",100) ;
	if (window.focus) {imgwin.focus()}
	return false;
}

function makepage(pic,legendetexx)
{
	legendetexxx=legendetexx;
	if (legendetexxx=="") espace=0;
	else espace=85;

	imgwin.document.clear();
	imgwin.document.write("<head><title>ZOOM</title>");
	imgwin.document.write("<s"+"cript language='Java"+"Script'>function resizeme(){picheight=document.images['posterpic'].height;picwidth=document.images['posterpic'].width;this.window.resizeTo(picwidth+40,picheight+60+"+espace+");}<"+"/s"+"cript>");
	imgwin.document.write("</head><body style='margin:0' onload='window.setTimeout(\"resizeme();\",100);' ondblclick='window.close();'><center><table><tr><td>");
	imgwin.document.write("<img name='posterpic' align='absmiddle' src='"+pic+"' border='0' alt=''>");
	imgwin.document.write("</td></tr>");

	if (espace>0)
	{
		imgwin.document.write("<tr><td><center><font face='Verdana,sans-serif' size=2>"+legendetexxx+"<font size=1><br />Double clic sur la fenêtre pour fermer</font></font></center></td></tr></table></center></body>");
	}

	imgwin.document.close();
	imgwin.focus();
}

var crtMenuRejoindre = 0;

function affMenuRejoindre(i)
{
	if (i>0 && i<30)
	{
		if (document.getElementById)
		{
			crt_menu = document.getElementById("menu" + i)
			if (crt_menu)
			{
				//alert("crt_menu.className = " + crt_menu.className)
				crt_menu.className = "links3"
			}
		}
	}
}


function newsletter() {
window.open("/abonnement_nl_pop_up.php", "newsletter", "width=390,height=240,left=100,top=100,scrollbars=no");
document.form1.action = ("/abonnement_nl_pop_up.php");
document.form1.target = ("newsletter");
document.form1.submit();
}
var crtMenu = 0;
function showMenu(crt)
{	
	if (crt>0 && crt<=9) {
		if (_) {
			crt_menu = _("menu"+crt)
			if (crt_menu) {
				crt_menu.src = "/images/menu_header/menu"+crt+"_over.png"
			}
		}
	}
	if (crt>9 && crt<=13) {
		if(_) {
			crt_menu = _("menu"+crt)
			if (crt_menu) {
				crt_menu.style.color='#E11A22'
			}
		}
	}
}

function hideMenu(crt)
{	
	if (crt>0 && crt<=9 && crt != crtMenu) {
		if (_) {
			crt_menu = _("menu"+crt)
			if (crt_menu) {
				crt_menu.src = "/images/menu_header/menu"+crt+".png"
			}
		}
	}
}



function showMenu2(crt,crt1)
{	
	a = _("link"+crt);
	a1 = _("link"+crt1);
	a.style.color='#D1321C';
	a1.style.color='#D1321C';
}

function menugrdprix (crt1,crt2)
{
	a1 = _("grdprix"+crt1);
	a2 = _("men"+crt2);
	a1.style.display='block';
	a2.style.color='#D1321C';
}

/* CAMPAGNES */

function getElementsByClassName(needle) {
			var my_array = document.getElementsByTagName("*");
			var retvalue = new Array();
			var i;
			var j;
			for (i=0,j=0;i<my_array.length;i++) {
					var c = " " + my_array[i].className + " ";
					if (c.indexOf(" " + needle + " ") != -1) retvalue[j++] = my_array[i];
			}
			return retvalue;
}

function classRepl(whatReplace,style) {
			for(var i=0;i<whatReplace.length;i++) {  
						whatReplace[i].style.display=style;
	}
}

var test_slide=false;

function campagne(n) { 
	count=1;
	while(_('camp'+count)) {
		_('camp'+count).style.display = "none";
		count++;
	}
	id=_('camp'+n);
	if (id) 
	id.style.display = "block";
}

/* APPARITION IMAGE AU SURVOL */

function survol_on(n) {
	count=1;
	while(_('vign_camp'+count)) {
		_('vign_camp'+count).style.display = "none";
		count++;
	}
	id=_('vign_camp'+n);
	if (id) 
	id.style.display = "block";
}

function survol_off(n) {
	count=1;
	while(_('vign_camp'+count)) {
		_('vign_camp'+count).style.display = "none";
		count++;
	}
	id=_('vign_camp'+n);
	if (id) 
	id.style.display = "none";
}





