function onMenuOver(td)
{
	for (i = 1; i <= 5; i++)
		document.getElementById('tdMenu' + i).className='menuTopOut';

	td.className = 'menuTopOver';
	document.getElementById('tdMenu').bgColor='#DFCAE9';
}

function onMenuOut(td)
{
	for (i = 1; i <= 5; i++)
		document.getElementById('tdMenu' + i).className='menuTop';

	document.getElementById('tdMenu').bgColor='#6B4D80';
}

function checkMail(email)
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

	if (filter.test(email)) 
		return true;

	return false;
}

function checkPassword (l)
{
	ok = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_()[]{}.:;,!=+";

	for(i = 0; i < l.length; i++)
	{
		if (ok.indexOf(l.charAt(i)) < 0)
			return (-1);
	}
	return (1);
}

function ap_getObj(name)
{ 
	if (document.getElementById)
		return document.getElementById(name).style;
	else
	{
		if (document.all)
			return document.all[name].style;
		else
		{ 
			if (document.layers) 
				return document.layers[name];
		}
	}
} 

function showWaitMessage(flag)
{ 
	if (!DHTML) 
		return false; 

	var div	= 'waitDiv';
	var x	= ap_getObj(div); x.visibility = (flag) ? 'visible':'hidden'
	
	if (!document.getElementById)
	{
		if (document.layers)
		{ 
			x.left=280/2;
		}
	}
	return true; 
}

function pop_close(host)
{
	window.open("http://"+host+"/candidats/jobs_alertes.php?ac=off", "", "toolbar=no,menubar=no,location=no,scrollbars=yes,height=600,width=750");
}

var newWin = null;
function closeWin()
{
	if (newWin != null)
	{
		if(!newWin.closed)
			newWin.close();
	}
}

function popUp(strURL, strType, strWidth, strHeight)
{
	closeWin();
	var strOptions="";
	if (strType=="console")
		strOptions="resizable,height="+strHeight+",width="+strWidth;
	if (strType=="fixed")
		strOptions="status,height="+strHeight+",width="+strWidth;
	if (strType=="clean")
		strOptions="height="+strHeight+",width="+strWidth;
	if (strType=="scroll")
		strOptions="scrollbars,height="+strHeight+",width="+strWidth;
	if (strType=="elastic")
		strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
	newWin	= window.open(strURL, 'newWin', strOptions);
	newWin.focus();
} 