var ns4 = (document.layers)? true:false;	  //NS 4
var ie4 = (document.all)? true:false;	  //IE 4
var dom = (document.getElementById)? true:false;	  //DOM

function RollOverMenu(status)
{
	document.getElementById("menuitem").style.backgroundImage = "url(imgs/bg_tab_menu_"+status+".gif)";
}

function RollOutMenu()
{
	document.getElementById("menuitem").style.backgroundImage = "url(imgs/bg_tab_menu.gif)";
}

function ClearDiv ()
{
	document.getElementById('company').style.visibility = "hidden";
	document.getElementById('labs').style.visibility = "hidden";
	document.getElementById('products').style.visibility = "hidden";
	document.getElementById('cases').style.visibility = "hidden";
	document.getElementById('news').style.visibility = "hidden";
}

function SetHideTimer()
{
	t = setTimeout("ClearDiv()", 850);
}

function setToAnchor(ID_Anchor,Name_Anchor,ID_Div)
//Fonction permettant de positionner un DIV à une position occupée par une ancre
    {
ClearDiv ();
var DivLeft = 0;	  //Position du Div par rapport au côté gauche de la page
    if (dom)
        {
		pos = document.getElementById(ID_Anchor);
        DivLeft = getLeft(pos) - 12;
        document.getElementById(ID_Div).style.left = DivLeft+"px";
		document.getElementById(ID_Div).style.visibility = 'visible';
        }
    else if (ie4)
        {
        pos = document.all[ID_Anchor];
        DivLeft = getLeft(pos) - 12;
		document.all[ID_Div].style.posLeft = DivLeft;
		document.all[ID_Div].style.visibility = 'visible';
        }
    else if (ns4)
        {
        pos = document.anchors[Name_Anchor];
        DivLeft = pos.x - 12;
        document.layers[ID_Div].pageX = DivLeft;
		document.layers[ID_Div].style.visibility = 'show';
        }
    }

function getLeft(MyObject)
    {
    if (MyObject.offsetParent)
        return (MyObject.offsetLeft + getLeft(MyObject.offsetParent));
    else
        return (MyObject.offsetLeft);
    }
	
function getTop(MyObject)
    {
    if (MyObject.offsetParent)
        return (MyObject.offsetTop + getTop(MyObject.offsetParent));
    else
        return (MyObject.offsetTop);
    }
	
function AttachAnc(ID_Anchor,Name_Anchor)
//Fonction permettant de positionner un DIV à une position occupée par une ancre
    {
var DivLeft = 0;	  //Position du Div par rapport au côté gauche de la page
var DivTop = 0;	  //Position du Div par rapport au haut de la page

    if (dom)
        {
		pos = document.getElementById(ID_Anchor);
		DivLeft = getLeft(pos);
		DivTop = getTop(pos);
        document.getElementById('spotwarn').style.left = DivLeft+"px";
		document.getElementById('spotwarn').style.top = DivTop+"px";
		document.getElementById('spotwarn').style.visibility = 'visible';
        }
    else if (ie4)
        {
        pos = document.all[ID_Anchor];
		DivLeft = getLeft(pos)-52;
		DivTop = getTop(pos);
        document.all['spotwarn'].style.posLeft = DivLeft;
		document.all['spotwarn'].style.posTop = DivTop;
		document.all['spotwarn'].style.visibility = 'visible';
        }
    else if (ns4)
        {
        pos = document.anchors[Name_Anchor];
        DivLeft = pos.x - 52;
		DivTop = pos.y;
        document.layers['spotwarn'].pageX = DivLeft;
		document.layers['spotwarn'].pageY = DivTop;
		document.layers['spotwarn'].style.visibility = 'show';
        }
    }
	
function CloseDiv(idDiv)
{
	document.getElementById(idDiv).style.visibility = 'hidden';
}

function MailCode(nom, domaine)
{
  document.write('<a href=\"mailto:' + nom + '@' + domaine + '\">');
  document.write(nom + '@' + domaine + '</a>');
}

function MailCodeJobs(nom, domaine)
{
  document.write('<a href=\"mailto:' + nom + '@' + domaine + '\">');
  document.write('Apply</a>');
}

function checkform(arg)
{
	if (arg == 2)
	{
	window.location.replace ("tech_form.php");
	}
}

