// func (null function)
function func(){}
//----------------------------------------
// SEARCH
function verif_search_form(){
	var form = document.getElementById("form_search");
	var nbChars = form.search.value.length;
	if (nbChars > 0 && form.search.value != "Search..."){
		var vAlert = "";
		if (nbChars < 3) vAlert += "Please enter 3 characters mninimum.\n";
		if (nbChars > 25) vAlert += "Please enter less than 25 characters.\n";
		
		if (vAlert != ""){
			alert(vAlert);
		}else{
			//form.submit();
			document.location = "_search"+form.search.value+".html";
		}
		
	}
	
}

//----------------------------------------
// MENU

var ns4 = (document.layers)? true:false;
var ie4 = ((document.all) && (!document.getElementById))? true:false;
var ns6 = ((document.getElementById) && (!ie4))? true:false;

var tto;
var thisDiv;

function gety(theitem){
	var obj =eval("document.getElementById('m_" + theitem + "')");
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	//return curleft;
	// For vp_cms, we need to substract the offsetleft de main_frame because it is position:relative
	if (document.getElementById("main_frame")!=null) curleft -= document.getElementById("main_frame").offsetLeft;
	return(curleft);
}
function getx(theitem){
	var obj =eval("document.getElementById('m_" + theitem + "')");
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curtop += obj.x;
	//return curleft;
	return(curtop);
}

function showMenu(theItem){
	
	// ATTENTION : LES x ET y SONT INVERSES
   var y=gety(theItem);
   var x= getx(theItem);
  clearTimeout(tto);
   if (ns4) {
      thisDiv = document.layers['mc_'+theItem];
	   thisDiv.top=x;
      thisDiv.left=y;
      thisDiv.visibility="show";
	   }
   if (ie4) {
      if ((thisDiv) &&(thisDiv!=document.layers['mc_'+theItem])){
		   thisDiv.visibility='hidden';
	   }
      thisDiv = document.layers['mc_'+theItem];
	   thisDiv.top=x;
      thisDiv.left=y;
      thisDiv.visibility="visible";
      }
   if (ns6) {
      if ((thisDiv) &&(thisDiv!=document.getElementById('mc_'+theItem).style)){
        thisDiv.visibility='hidden';
	   }
   	thisDiv = document.getElementById('mc_'+theItem).style;
		thisDiv.top=x+"px";
      thisDiv.left=y+"px";
      thisDiv.visibility="visible";
      }
}
			
function hideMenu(theItem){
	
   var thetime=400;
   if (ns4) {
      thisDiv = document.layers['mc_'+theItem];
      tto=setTimeout("thisDiv.visibility='hide'",thetime);
      }
   if (ie4) {
      thisDiv = document.layers['mc_'+theItem];
      tto=setTimeout("thisDiv.visibility='hidden'",thetime);
      }
   if (ns6) {
      thisDiv = document.getElementById('mc_'+theItem).style;
      tto=setTimeout("thisDiv.visibility='hidden'",thetime);
      }
}		

//----------------------------------------
// ACCESSIBILITY

function change_font_size(num){
	document.body.style.fontSize = num+"em";
	
}
