
function FormValidate(theForm){

    if ((theForm.email.value == "")
		|| (theForm.email.value.indexOf ('@') == -1)
		|| (theForm.email.value.indexOf ('.') == -1)){
        
        alert("Please enter a valid email address")
        theForm.email.focus()
        return (false)
        
    }
    
    return true
 
}


function val(frm){

    if ((frm.email.value == "")
		|| (frm.email.value.indexOf ('@') == -1)
		|| (frm.email.value.indexOf ('.') == -1)){
        
        alert("Please enter a valid email address")
        frm.email.focus()
        return (false)
        
    }
    
    return true
 
}

function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}

function getCopy(lev,col){
	var ret= ""
	ret+= '<table width=100% cellpadding=0 cellspacing=0 border=0>'
	ret+= '<tr><td width=127 align=center bgcolor=black><a HREF=#top><img SRC=' + lev + 'images/buttons/fr-b-top.gif ALT=\"Retour au top\" WIDTH=108 HEIGHT=35 BORDER=0></a></td><td width=100% bgcolor=white>&nbsp;</td><td width=150 bgcolor=' + col + '><img src=' + lev + 'images/spacer.gif width=150 height=1></td></tr>'
	ret+= '<tr><td width=127 bgcolor=#cccccc><img src=' + lev + 'images/spacer.gif width=127 height=1></td><td colspan=2 bgcolor=#cccccc height=1></td></tr>'
	ret+= '</table>'
	ret+= '<span class=cr>&copy; ' + getYear() + '</span><br>'
	return ret
}

function getHomePageCopy(lev,col){
	var ret= ""
	ret+= '<span class=cr>&copy; ' + getYear() + '</span><br>'
	return ret
}

function getDate(){
	var d = new Date()
	var months = new Array()
	months[0] = "janvier"
	months[1] = "février"
	months[2] = "mars"
	months[3] = "avril"
	months[4] = "mai"
	months[5] = "juin"
	months[6] = "juillet"
	months[7] = "août"
	months[8] = "septembre"
	months[9] = "octobre"
	months[10] = "novembre"
	months[11] = "décembre"
	return d.getDate() + ' ' + months[d.getMonth()] + ' ' + d.getFullYear()
}

function getYear(){
	var d = new Date()
	return d.getFullYear()
}

function doTicker(){

	if(document.all){
	
		if(ptr == 1){
		   nextStory();
		}

		if(ptr != stories[story].length) {
			drawStory();
		}
		else{
			stopStory();
		}
          
    }
    else{
		tckr = document.getElementById("tckr")
		story =Math.round(Math.random() * (stories.length - 1))		
		tckr.innerHTML = titles[story] +  urls[story] + stories[story] + '</a>'
    }
          		
}

function nextStory(){
	story = story + 1
	if(story > stories.length - 1) story = 0
}

function drawStory(){

	if(!document.all) tckr = document.getElementById("tckr")
	
	tckr.innerHTML = titles[story] + stories[story].substring(0,ptr) + widget
	ptr ++
	
	setTimeout('doTicker()',100)
	
}

function stopStory(){

	if(!document.all) tckr = document.getElementById("tckr")
	tckr.innerHTML = titles[story] + urls[story] + stories[story] + '</a>'
	ptr = 1
	setTimeout("doTicker()", 5000);
	
}


function rollin(obj, c){
	//eval("obj.style.cssText='background-color:" + c + "'")
	eval("obj.style.cssText = 'border:solid 1px #000000'")
	obj.style.cursor = 'pointer'
}
function rollout(obj, c){
	//eval("obj.style.cssText='background-color:" + c + "'")
	eval("obj.style.cssText = 'border:solid 1px #b0b0b0'")
}


        
function getNavMenu(lev){
	var menu = ""
    menu+= "<table width=127 cellpadding=0 cellspacing=0 border=0>"
    menu+= addNavMenuItem(lev, "default.asp", "fr-b-hme.gif", "#DEDEDE")
    menu+= addNavMenuItem(lev, "Actualités.asp", "fr-b-nws.gif", "#FFCCCC")
    menu+= addNavMenuItem(lev, "info.asp", "fr-b-faq.gif", "#ffe7bd")
    menu+= addNavMenuItem(lev, "opinion.asp", "fr-b-opn.gif", "#C6E7E7")
    menu+= addNavMenuItem(lev, "info/Bibilothéque_scientifique.asp", "fr-b-sci.gif", "#CCFFCC")
    menu+= addNavMenuItem(lev, "Caloritest/index.asp", "btn-cal-fr.gif", "#d6d6d6")
    menu+= addNavMenuItem(lev, "search.asp", "fr-b-sch.gif", "#B5D6EF")
    menu+= addNavMenuItem(lev, "links/liens.asp", "fr-b-lnk.gif", "#FFCCCC")
    menu+= addNavMenuItem(lev, "contact.asp", "fr-b-ctz.gif", "#ccffcc")
    menu+= addNavMenuItem(lev, "sitemap.asp", "fr-b-map.gif", "#FFCCFF")

    menu+= "</table>"
    return menu
}        

function addNavMenuItem(l, link, img, c){
	var ret = ""
	ret += "<tr><td align=center bgcolor=" + c + " height=31 width=123>" +
		"<a href=\"" + l + link + "\">" +
		"<img border=0 src=" + l + "images/buttons/" + img + "></a></td></tr>"
	return ret
}     


function getHeader(lev, hdr)
{
	var ret = ""

	ret+= '<a name=top>'
	ret+= '<table BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100% bgcolor=white>'
	ret+= '<tr VALIGN=TOP>'
	ret+= '<td width=127 bgcolor=black><A HREF=' + lev + 'default.asp><img border=0 src=' + lev + 'images/Aj-infologo.gif ALT=\"Service d&#146;Information sur l&#146;Aspartame\"></a></td>'
	ret+= '<td><img SRC=\"' + lev + 'images/spacer.gif\" width=10 height=1></td>'
	ret+= '<td colspan=3 align=center><img SRC=\"' + lev + 'images/headers/' + hdr + '\" VSPACE=3></td>'
	//ret+= '<td><img SRC=\"' + lev + 'images/spacer.gif\" width=10 height=1></td>'
	//ret+= '<td><img SRC=\"' + lev + 'images/spacer.gif\" width=150 height=1></td>'
	ret+= '</tr>'
	ret+= '<tr>'
	ret+= '<td bgcolor=#c7c7c7><img src=' + lev + 'images/pixel.gif height=1 width=127></td>'
	ret+= '<td><img src=' + lev + 'images/pixel.gif height=1 width=10></td>'
	ret+= '<td bgcolor=#c7c7c7 width=100%><img src=' + lev + 'images/pixel.gif height=1 width=1></td>'
	ret+= '<td><img src=' + lev + 'images/pixel.gif height=1 width=10></td>'
	ret+= '<td bgcolor=#c7c7c7><img src=' + lev + 'images/pixel.gif height=1 width=150></td>'
	ret+= '</tr>'
	ret+= '</table>'
	return ret
}



function openWindow( pageToLoad, winName, width, height, center, x, y) {		 
	xposition=0; yposition=0;
	if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
		xposition = (screen.width - width) / 2;
		yposition = (screen.height - height) / 2;
	}
	args = "width=" + width + "," 
	+ "height=" + height + "," 
	+ "location=0," 
	+ "menubar=0,"
	+ "resizable=0,"
	+ "scrollbars=0,"
	+ "status=0," 
	+ "titlebar=1,"
	+ "toolbar=0,"
	+ "hotkeys=0,"
	+ "screenx=" + x + ","  //NN Only
	+ "screeny=" + y + ","  //NN Only
	+ "left=0" + xposition + ","     //IE Only
	+ "top=0" + yposition;           //IE Only
	window.open( pageToLoad,winName,args );
}