function SelectMenuItems(mainMenu, subMenu)
{
  if (document.getElementById)
  {
	if (document.getElementById(mainMenu))
	{
		document.getElementById(mainMenu).className = 'SelectedMenu';
	}
	if (subMenu.length > 0)
	{
		if (document.getElementById(subMenu))
		{
			document.getElementById(subMenu).className = 'SelectedSubMenu';
		}
	}
  }
}

function WriteEmailAddress (name, domain, topLevelDomain, css)
{
	document.write('<a');
	if (css.length > 0)
	{
		document.write(' class=\"' + css + '\"');
	}
	document.write(' href=\"mailto:' + name + '@' + domain + '.' + topLevelDomain + '\">');
	document.write(name + '@' + domain + '.' + topLevelDomain + '</a>');
}

function SyncTitle(Title)
{
/*	'===============================================================
	'   NAME: 					SyncTitle
	'   CREATED ON: 			2005-12-15
	'	Description:			Synchronise title from top document in a html-frame.
	'   VERSION: 				1
	'   FUNCTION: 				
	'   IN: 					all contentpages
	'===============================================================*/

	top.document.title=Title;
}


var _win=null;

function closeWin()
{
  if(_win && !_win.closed && _win.open)
  {
      _win.close();
	  _win=null;
  }
}

function openWin(theURL,winName,features)
{
  closeWin();
  _win=window.open(theURL,winName,features);
  _win.focus();
}


function openMedewerkerWin(employeeId)
{
	var winLeft = (screen.width - 450) / 2;
	var winUp = (screen.height - 270) / 2;
	openWin('PopupMedewerker.asp?CID=' + employeeId, 'medewerker', 'width=450,height=270,left='+winLeft+',top='+winUp+',scrollbars=yes');
}

function openZoom(imagepath)
{
	var winLeft = (screen.width - 200) / 2;
	var winUp = (screen.height - 200) / 2;
	openWin('/Static/PopupZoom.asp?' + imagepath, 'MyPopup', 'width=100,height=100,left='+winLeft+',top='+winUp+',scrollbars=no');
}

function dm(msgStr) {
  document.returnValue = false;
  if (document.images) { 
     window.status = msgStr;
     document.returnValue = true;
  }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
 var thewin = window.open(theURL,winName,features);
 	 thewin.focus;
}

function InitializeMenu()
{
	if (document.all && document.getElementById)
	{
		var navRoot = document.getElementById("Nav");
		for (i=0; i<navRoot.childNodes.length; i++)
		{
			node = navRoot.childNodes[i];
			if (node.nodeName == "LI")
			{
				node.onmouseover=function()
				{
					this.className+=" over";
				}
				node.onmouseout=function()
				{
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}

}

function ResizeContentAndMenu()
{
	var frameWidth = 0;
	var frameHeight = 0;
	if (self.innerWidth)
	{
		frameWidth = self.innerWidth;
		frameHeight = self.innerHeight;
		//alert(frameHeight);
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		frameWidth = document.documentElement.clientWidth;
		frameHeight = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		frameWidth = document.body.clientWidth;
		frameHeight = document.body.clientHeight;
	}

	document.getElementById('myContent').style.height = frameHeight - 128;
	document.getElementById('myContent').style.width = (frameWidth - 233);
	document.getElementById('myContent').style.overflow = 'auto';
	document.getElementById('MyMenu').style.height = frameHeight - 128;
}

function FormatZipCode (theTextBox)
  {
    try
    {
      var theValue = theTextBox.value;
      if (theValue != null)
      {
        if (theValue.length > 0)
        {
          if (theValue.indexOf(' ') == -1)
          {
            if (theValue.length == 6)
            {
              theValue = theValue.substring(0, 4) + ' ' + theValue.substring(4, 6);
            }
          }
        }
      }
      theValue = theValue.toUpperCase();
      theTextBox.value = theValue;
    }
    catch (e)
    {}
  }


function WriteFlashObject(flashURL, ancho, alto, uniqueId)
{
	var theUniqueid = '';
	if (uniqueId != null)
	{
		if (uniqueId.length > 0)
		{
			theUniqueid = ' id=\"' + uniqueId + '\"';
		}
	}
	if (navigator.userAgent.indexOf("MSIE") == -1){
   document.write('<embed src="' + flashURL + '"' + theUniqueid + ' quality="high" wmode="transparent" pluginspage="<http://www.macromedia.com/go/getflashplayer>http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + ancho +'" height="' +  alto +'"></embed>');
  }else if(navigator.userAgent.indexOf("MSIE") != -1){
   document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="<http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0>http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"  width="' + ancho +  '" height="' + alto + '"><param name="movie" value="'  +  flashURL +'" /><param name="wmode" value="transparent" /><param name="quality" value="high" /></object>')
  }
}

