	function Left(obj)
	{
		var curleft = 0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curleft += obj.offsetLeft
				obj = obj.offsetParent;
			}
		}
		else if (obj.x)
			curleft += obj.x;
		return curleft;
	}
   
	function Top(obj)
	{
		var curtop = 0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curtop += obj.offsetTop
				obj = obj.offsetParent;
			}
		}
		else if (obj.y)
			curtop += obj.y;
		return curtop;
	}
   
   function showHelpDiv() {
      document.getElementById('searchHelp').style.visibility='visible';
      document.getElementById('searchHelp').style.top=Top(document.getElementById('anchorHelp'))+20;
   }
   
   function showHelpDivXY(ox,oy) {
      document.getElementById('searchHelp').style.visibility='visible';
      document.getElementById('searchHelp').style.top=Top(document.getElementById('anchorHelp'))+oy;
      document.getElementById('searchHelp').style.left=Left(document.getElementById('anchorHelp'))+ox;
   }
   
   function hideHelpDiv() {
      document.getElementById('searchHelp').style.visibility='hidden';
   }
   
   function showDiv() {
      document.getElementById('fpl').style.visibility='visible';
      document.getElementById('fpl').style.top=Top(document.getElementById('anchorfpl'))+20;
      document.getElementById('fpl').style.left=Left(document.getElementById('anchorfpl'))-(450-document.getElementById('anchorfpl').offsetWidth)/2;
   }
   
   function hideDiv() {
      document.getElementById('fpl').style.visibility='hidden';
   }
      
   function checkMail(e)
   {
   	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
   	if (filter.test(e))
   	   return true;
   	else
   	   return false;
   }
   
   function BECheckMail(e,idout) {
         if (!checkMail(e)) {
            document.getElementById(idout).innerHTML='<br>Please enter a valid email address to continue';
            return false;
         }
         else
            return true;
   }
   
   var popupwin = null;

  function popup(loc,ww,hh)

   {

    var mywidth = (ww + 0);

    var myheight = (hh + 0);

    var myspecs = "'menubar=0,status=1,resizable=1,location=0,titlebar=1,toolbar=0,scrollbars=1,width=" + mywidth + ",height=" + myheight + "'";

      if (popupwin == null || popupwin.closed)

			{

            popupwin = window.open (loc, 'popupwin', myspecs);

           }

		 else

		   {

            popupwin.focus();

            popupwin.location.href = loc;

          }

    }
