/* 
Name     : Javascript Functies voor de Aglaja Website  
Version  : 1.0
Date     : 09/11/2001 13:20:05
*/

var win = null;

function overNavButton(obj)
  {
  obj.className = "NavButtonOn";
  }
  
function outNavButton(obj)
  {
  obj.className = "NavButtonOff";
  }
  
function pressNavButton(obj)
  {
  obj.className = "NavButtonDown";
  }
  
function MM_displayStatusMsg(msgStr)
  {
  status=msgStr;
  document.MM_returnValue = true;
}

function NewWindow(mypage, myname)
	{
	
	settings =  'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes';
	win = window.open(mypage,myname,settings);
	if(win.window.focus)
		{
		win.window.focus();
		}
	}

function NewPopup(mypage, myname, w, h)
	{
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'width=' + w + ', height=' + h + ', top=' + TopPosition + ', left=' + LeftPosition + ', ';
	settings = settings + 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes';
	win = window.open(mypage,myname,settings);
	if(win.window.focus)
		{
		win.window.focus();
		}
	}
	
	
function ClosePage()
	{
	window.close();
	}

function PrintPage()
	{
	window.print();
	}
	
function checkEmail(e)
	{
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	for(i=0; i < e.length; i++)
		{
		if(ok.indexOf(e.charAt(i)) < 0)
			{ 
			return (false);
			}	
		} 
	if (document.images)
		{
		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
		re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
		if (!e.match(re) && e.match(re_two))
			{
			return (-1);		
			}
		}
	}
	
function isEmpty(s)
	{
	return ((s == null) || (s.length == 0))
	}

function isDigit(c)
	{
	return ((c >= "0") && (c <= "9"))
	}
	
function isFloat(s)
	{
	var i;
	var defaultEmptyOK = false;
  var seenDecimalPoint = false;
	var decimalPointDelimiter = ".";
  if (isEmpty(s)) 
    if (isFloat.arguments.length == 1) return defaultEmptyOK;
    else return (isFloat.arguments[1] == true);

  if (s == decimalPointDelimiter) return false;

  for (i = 0; i < s.length; i++)
	  {   
    var c = s.charAt(i);
    if ((c == decimalPointDelimiter) && !seenDecimalPoint) seenDecimalPoint = true;
    else if (!isDigit(c)) return false;
  	}
  return true;
	}