function submitEmptySearch(){
	document.SearchForm.ecmsearchtext.value="";
	document.SearchForm.ecmstartingfolder.value="\\";
	document.SearchForm.ecmsearchtype.value="0";
	document.SearchForm.submit();
}					

function openEmailWindow(_url) {	
	window.open(_url, 'emailWindow', 'toolbar=no,scrollbars=no,resizeable=no,menubar=no,status=no,width=450,height=460');
	void(0);
}
function openRegistrationWindow(_url) {
	window.open(_url, 'registrationWindow', 'toolbar=yes,scrollbars=yes,resizeable=yes,menubar=yes,status=yes,width=900,height=600');
	void(0);
}
function openLink(_type) {
	switch (_type.toUpperCase()) {

		case "EUROPE":
		
			window.parent.location = "/id2619/index.html";
		
		break;
		
		case "MIDDLEEAST":
		
			window.parent.location = "/id2620/index.html";
		break;
		
		case "AMERICAS":
			window.parent.location = "/id2617/index.html";
		
		break;

		case "AFRICA":
			window.parent.location = "/id2616/index.html";
		
		break;
		case "ASIA":
			window.parent.location = "/id2618/index.html";
		
		break;		
		
		default:
		
		break;
	}
}

//verifie que le champ e-mail du formulaire est bien remplie
//renvoie true si le champ e-mail est bien rempli et false sinon

function checkEmail()
{
//variable contenant le champ e_mail du formulaire
var e_mail;
e_mail = document.forms.form.e_mail.value;

//variable comptant le nombre de passage sur la page
var passage;
passage=0;


//incrementation de la variable passage pour eviter l'envoi intempestif de formulaires
passage++;


if (passage > 1)
	{
	return false;
	}



//verifie que e-mail a ete rempli
if (e_mail.length == 0) 
	{
	alert('Please enter an e-mail.');
	return false;
	}
//verifie que e-mail contient un @ et un .
if ( (e_mail.indexOf('@')==-1) || (e_mail.indexOf('.')==-1) )
	{
	alert('Your e-mail is wrong, try again');
	return false;
	}

return true;	
}

function checkConfMailingList(){
	if (document.forms.form.last_name.value.length==0)
	{
		alert('Please enter your last name.');
		return false;
	}
	if (document.forms.form.first_name.value.length==0)
	{
		alert('Please enter your first name.');
		return false;
	}
	if (document.forms.form.company.value.length==0)
	{
		alert('Please enter your company\'s name.');
		return false;
	}
	if (document.forms.form.position.value.length==0)
	{
		alert('Please enter your position.');
		return false;
	}
	if (document.forms.form.country.value.length==0)
	{
		alert('Please select a country.');
		return false;
	}					
	if (!checkEmail()) {
		return false;
	}
	if (document.forms.form.conf_subject.value.length==0)
	{
		alert('Please enter a conference subject.');
		return false;
	}		
	if (document.forms.form.address.value.length==0)
	{
		alert('Please enter an address.');
		return false;
	}			
/*
	if (document.forms.form.postal_code.value.length==0)
	{
		alert('Please enter a postal code.');
		return false;
	}			
*/
	if (document.forms.form.city.value.length==0)
	{
		alert('Please enter a city.');
		return false;
	}			
}
function alpha(button){
    try{	
	    button.style.opacity=0.5;
	}
	catch(e){}
	try{
	button.style.MozOpacity=0.5;
	}
	catch(e){}
	try{
	button.filters.alpha.opacity=50;	
	}
	catch(e){}
}
function unAlpha(button){
	try{
	button.style.opacity=1;
	}
	catch(e){}
	try{
	button.style.MozOpacity=1;
	}
	catch(e){}
	try{
	button.filters.alpha.opacity=100;	
	}
	catch(e){}
}
function alphaGlobe(cell,alfa){	
	var lglobecell,rglobecell;
	//lglobecell = document.getElementById("lglobe" + cell.id);
	rglobecell = document.getElementById("rglobe" + cell.id);
	try{
	cell.style.MozOpacity=alfa-0.3;
	}
	catch(e){}
	try{
	cell.style.opacity=alfa-0.3;		
	}
	catch(e){}
	try{
	rglobecell.style.MozOpacity=alfa-0.3;
	}
	catch(e){}
	try{
	rglobecell.style.opacity=alfa-0.3;		
	}
	catch(e){}
	try{
	cell.filters.alpha.opacity=alfa*100-30;
	}
	catch(e){}
	try{
	rglobecell.filters.alpha.opacity=alfa*100-30;
	}
	catch(e){}
}	

function unAlphaGlobe(cell,alfa){
	var lglobecell,rglobecell;
	//lglobecell = document.getElementById("lglobe" + cell.id);
	rglobecell = document.getElementById("rglobe" + cell.id);
	try{
	cell.style.MozOpacity=alfa;
	}
	catch(e){}
	try{
	cell.style.opacity=alfa;		
	}
	catch(e){}
	try{
	rglobecell.style.MozOpacity=alfa;
	}
	catch(e){}
	try{
	rglobecell.style.opacity=alfa;		
	}
	catch(e){}
	try{
	cell.filters.alpha.opacity=alfa*100;
	}
	catch(e){}
	try{
	rglobecell.filters.alpha.opacity=alfa*100;
	}
	catch(e){}
}																									

function alphaRightMenu(index){	
	var img,txt;
	img = document.getElementById("rightimg" + index);
	txt = document.getElementById("righttxt" + index);		
	try{
	img.style.opacity=0.5;
	txt.style.opacity=0.5;
	}
	catch(e){}
	try{
	img.style.MozOpacity=0.5;	
	txt.style.MozOpacity=0.5;
	}
	catch(e){}
	try{		
	img.filters.alpha.opacity=50;
	txt.filters.alpha.opacity=50;	
	}
	catch(e){}
}
function unAlphaRightMenu(index){	
	var img,txt;
	img = document.getElementById("rightimg" + index);
	txt = document.getElementById("righttxt" + index);
	try{			
	img.style.opacity=1;
	txt.style.opacity=1;
	}
	catch(e){}
	try{			
	img.style.MozOpacity=1;	
	txt.style.MozOpacity=1;
	}
	catch(e){}
	try{			
	img.filters.alpha.opacity=100;
	txt.filters.alpha.opacity=100;	
	}
	catch(e){}
}
function affectElmPos(){
	page.elmPos=function(e,p)
	{
			var tmpX, tmpY;
			var x=0,y=0,w=p?p:this.win;
			e=e?(e.substr?(isNS4?w.document.anchors[e]:getRef(e,w)):e):p;
			if(isNS4){if(e&&(e!=p)){x=e.x;y=e.y};if(p){x+=p.pageX;y+=p.pageY}}
			if (e && this.MS && navigator.platform.indexOf('Mac')>-1 && e.tagName=='A')  
			{
				e.onfocus = new Function('with(event){self.tmpX=clientLeft-offsetLeft;' +
					'self.tmpY=clientTop-offsetTop}');
				e.focus();x=tmpX;y=tmpY;e.blur()
			}
			else while(e){x+=e.offsetLeft;y+=e.offsetTop;e=e.offsetParent}
			if (is_opera){
				y+=25;x-=0;
			}
			if ((is_ie)&&(is_win)&&(!is_ie7up)){
			    y+=6;x-=1;
			}
			if (is_gecko){
			    y-=0;
			}
			if (!this.MS){				
				if(navigator.platform.indexOf('Mac')>-1)
				{
				y-=0;x-=0;
				}
			}else {
				if(navigator.platform.indexOf('Mac')>-1){
					y+=0;x+=0;
				}
			}
			return{x:x,y:y};
	};
}
var courtMenuOffset=15;
function affectElmPosCourt(){
	page.elmPos=function(e,p)
	{			
			if (e=="span_globemenu1")
			    courtMenuOffset=-1;
			if (e=="span_Dhtmlmenu1")
			    courtMenuOffset=3;
			if (e=="span_Dhtmlmenu2")
			    courtMenuOffset=0;
			if (e=="span_Dhtmlmenu3")
			    courtMenuOffset=0;
			if (e=="span_Dhtmlmenu4")
			    courtMenuOffset=-3;
			if (e=="span_Dhtmlmenu5")
			    courtMenuOffset=-5;
			    
			var tmpX, tmpY;
			var x=0,y=0,w=p?p:this.win;
			e=e?(e.substr?(isNS4?w.document.anchors[e]:getRef(e,w)):e):p;
			if(isNS4){if(e&&(e!=p)){x=e.x;y=e.y};if(p){x+=p.pageX;y+=p.pageY}}
			if (e && this.MS && navigator.platform.indexOf('Mac')>-1 && e.tagName=='A')  
			{
				e.onfocus = new Function('with(event){self.tmpX=clientLeft-offsetLeft;' +
					'self.tmpY=clientTop-offsetTop}');
				e.focus();x=tmpX;y=tmpY;e.blur()
			}
			else while(e){x+=e.offsetLeft;y+=e.offsetTop;e=e.offsetParent}
			if (is_opera){
				y+=10;x-=0;
			}
			if (is_khtml){
                y+=4;x+=4;
			}			
			if ((is_ie)&&(is_win)){
                y+=courtMenuOffset;x+=1;
			}
			if (!this.MS){				
				if(navigator.platform.indexOf('Mac')>-1)
				{
				y-=0;x-=0;
				}
			}else {
				if(navigator.platform.indexOf('Mac')>-1){
					y+=0;x+=0;
				}
			}			
			return{x:x,y:y};
	};
}
function toggleCourtHomeMenu(divId,mousein){
    div = document.getElementById(divId+'div');
    desc = document.getElementById(divId+'desc');
    image = document.getElementById(divId+'img');    
    if (mousein){        
        div.style.visibility="visible";
        div.style.display="inline";
        desc.style.visibility="hidden";
        desc.style.display="none";        
        alpha(image);
    }
    else{        
        div.style.visibility="hidden";
        div.style.display="none";
        desc.style.visibility="visible";
        desc.style.display="inline";        
        unAlpha(image);
    }
}
function setCookie(c_name,value,expiredays)
{
    var exdate=new Date()
    exdate.setDate(exdate.getDate()+expiredays)
    document.cookie=c_name+ "=" +escape(value)+
    ((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}
function getCookie(c_name)
{
    if (document.cookie.length>0)
      {
      c_start=document.cookie.indexOf(c_name + "=")
      if (c_start!=-1)
        { 
        c_start=c_start + c_name.length+1 
        c_end=document.cookie.indexOf(";",c_start)
        if (c_end==-1) c_end=document.cookie.length
        return unescape(document.cookie.substring(c_start,c_end))
        } 
      }
    return ""
}
function toggleDescription(Id){
    if (document.getElementById("Description" + Id).style.visibility=="visible"){
        document.getElementById("Description" + Id).style.visibility="hidden";
        document.getElementById("Description" + Id).style.display="none";
        document.getElementById("DescriptionLink" + Id).setAttribute("src","/uploadedImages/ICC/Conferences/More.gif");
        document.getElementById("DescriptionLink" + Id).setAttribute("alt","More");
        document.getElementById("DescriptionLink" + Id).setAttribute("title","More");
        document.getElementById("DescriptionLinkText" + Id).childNodes[0].nodeValue="More";
    }
    else{
        document.getElementById("Description" + Id).style.visibility="visible";
        document.getElementById("Description" + Id).style.display="inline";
        document.getElementById("DescriptionLink" + Id).setAttribute("src","/uploadedImages/ICC/Conferences/Less.gif");
        document.getElementById("DescriptionLink" + Id).setAttribute("alt","Hide");
        document.getElementById("DescriptionLink" + Id).setAttribute("title","Hide");        
        document.getElementById("DescriptionLinkText" + Id).childNodes[0].nodeValue="Hide";
    }
}