function updatePuce(selectElt)
{
	nbr = selectElt.options[selectElt.options.selectedIndex].value ;
	nbr = (nbr) ? nbr : 0 ;
	
	document.images['puce'].src = '/0-img/couleur'+nbr+'/puce_xl.gif' ;	
} 



function rollImg(imgId, Mode) {
	document.images[imgId].src = '/0-img/nav_'+imgId+'_'+Mode+'.gif' ;
}

function popRegister() {
	var popForm = window.open('http://secure.leserveur.com/ecf2003/us/fmpro?-db=ges_catia&-lay=web&-format=index.htm&-view','pop800','location=0,status=0,menubar=0,resizable=1,scrollbars=1,width=800,height=400') ;
}

function popAccess() {
	var popForm = window.open('/0-pdf/ECF2003_AccessPlan.pdf','pop800','location=0,status=0,menubar=0,resizable=1,scrollbars=1,width=800,height=400') ;
}

function printAccess() {
	var popForm = window.open('/information_warning.php','pop800','location=0,status=0,menubar=0,resizable=1,scrollbars=1,width=800,height=400') ;
}

function popDoc() {
	var popForm = window.open('/0-pdf/ECF2003_Brochure.pdf','pop800','location=0,status=0,menubar=0,width=800,height=400') ;
}

function popBanner() {
	var popForm = window.open('/pop_banner.php','pop300','location=0,status=0,menubar=0,width=300,height=400') ;
}

function openTechForm() {
	if (confirm('Only IBM - DASSAULT SYSTEMES partners can request our exhibitors and sponsors package\n\nDo you want to continue ?')) location='/technifair_form.php' ;
}

function emailCheck (emailStr) {
	var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	var validChars="\[^\\s" + specialChars + "\]"
	var quotedUser="(\"[^\"]*\")"
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+'
	var word="(" + atom + "|" + quotedUser + ")"
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
	var matchArray=emailStr.match(emailPat)
	if (matchArray==null) {
		return("Email address seems incorrect (check @ and .'s)")
	}
	var user=matchArray[1]
	var domain=matchArray[2]
	if (user.match(userPat)==null) {
	    return("The username doesn't seem to be valid.")
	}
	var IPArray=domain.match(ipDomainPat)
	if (IPArray!=null) {
		  for (var i=1;i<=4;i++) {
		    if (IPArray[i]>255) {
		        return("Destination IP address is invalid!")
		    }
	    }
	    return false
	}
	var domainArray=domain.match(domainPat)
	if (domainArray==null) {
		return("The domain name doesn't seem to be valid.")
	}
	var atomPat=new RegExp(atom,"g")
	var domArr=domain.match(atomPat)
	var len=domArr.length
	if (domArr[domArr.length-1].length<2 || 
	    domArr[domArr.length-1].length>3) {
	   return("The address must end in a three-letter domain, or two letter country.")
	}
	if (len<2) {
	   var errStr="This address is missing a hostname!"
	   return(errStr)
	}
	return false;
}

function validateAndSubmit(myForm) {
	msg = '' ;
	
	if (myForm.firstname.value=='') msg+= '- First Name\n' ;
	if (myForm.lastname.value=='') msg+= '- Last Name\n' ;
	if (myForm.email.value=='') msg+= '- Email address\n' ;
	if (myForm.company.value=='') msg+= '- First Company\n' ;
	if (myForm.address.value=='') msg+= '- Address\n' ;
	if (myForm.address.value=='') msg+= '- City\n' ;
	if (myForm.zipcode.value=='') msg+= '- Zip/Postal code\n' ;
	if (myForm.country.value=='') msg+= '- Country\n' ;
	
	if (msg) msg = 'Please fill the following required fields :\n\n' + msg
	
	if(myForm.email.value!=""&&emailCheck(myForm.email.value)) {
		if(msg) msg += '\nIn addition '+emailCheck(myForm.email.value) ;
		else msg += emailCheck(myForm.email.value) ;
	}

	if(msg) {
		alert(msg) ;
		return 0 ;
	}
	else return 1 ;
	 
	return 0 ;
}

//   ___________________________________________
//   >)))¡> Shouting Fish Script
//   Laurent FABRE - lfabre@shoutingfish.com
//   ___________________________________________


// ------------------ NAV DETECT ---------------------

agt = navigator.userAgent.toLowerCase()
isIE = (agt.indexOf('msie') != -1)? 1:0
isMAC = (navigator.userAgent.indexOf('Mac') != -1)?  1:0
isNS4 = (navigator.appName=="Netscape" && agt.indexOf('mozilla/4') != -1)? 1:0
isW3C = (document.getElementById && !document.all)? 1:0
function gob(n,cn) {
	if (isIE) { ob=eval('document.all.'+n) }
	if (isNS4) {
		ob= (cn)? eval("document."+cn+".document."+n) : eval("document."+n);
	}
	if (isW3C) ob = document.getElementById(n);
	return ob;
}

//window.onload = center
//window.onresize = center

// ------------------ AFFICHE PROFIL ---------------------

function show(q) {
	s='<table width="150" cellspacing="0" cellpadding="0" border="0"><tr><td class="prof'+q+'" align="right">'
	s+=profil[q]
	s+='</td></tr></table>'
	d=gob('about')
	d.innerHTML=s
	if (isNS4) {
	   	d.document.write(s)
    	d.document.close()
    }
}

function center() {
	w=(isNS4)? window.innerWidth : document.body.clientWidth
	if (w>775) {
		//x=(w-389)/2+82
		x=(w/2)-388+82
		put(x)
	} else {
		put(82)
	}
}

function put(x) {
	ds = (isNS4)? gob('psn') : gob('psn').style
	ds.left=x;
}

// end lfabre script

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

sLayers = new Array() ;

function openTop(layerId) {
	sLayers[layerId] = 1 ;
	MM_showHideLayers(layerId,'','show'); 
}

function openSub(layerId,fatherId) {
	sLayers[layerId] = 1 ;
	sLayers[fatherId] = 1 ;
	MM_showHideLayers(layerId,'','show'); 
}

function doHide(layerId) {
	if(! sLayers[layerId]) {
		//alert('close '+layerId) ;
		MM_showHideLayers(layerId,'','hide'); 
	}
	
}

function waitAndClose(layerId,fatherId) {
	sLayers[layerId] = 0 ;
	setTimeout("doHide('"+layerId+"')",250) ; 
	if (fatherId) {
		sLayers[fatherId] = 0 ;
		setTimeout("doHide('"+fatherId+"')",250) ; 
	}
}