// JavaScript Document
function clearField(id,defaultValue) {
	var fieldValue = document.getElementById(id).value;
	if (fieldValue == defaultValue) {
			document.getElementById(id).value = '';
	}
}


	function validateForm(check)
	{
		var pass = true;
		var fields = new Array();
		fields = check.split(',');

		for (i=0; i<fields.length; i++)
		{
			document.getElementById(fields[i]).parentNode.className = document.getElementById(fields[i]).parentNode.className.replace('error', '');
			var els = document.getElementById(fields[i]).parentNode.getElementsByTagName('strong');
			for (j=0; j<els.length; j++)
			{
				document.getElementById(fields[i]).parentNode.removeChild(els[j]);
			}

			//var errTag = document.createElement('strong');
			//var errTxt = document.createTextNode(' Required');

			if (document.getElementById(fields[i]).value == '')
			{
				//document.getElementById(fields[i]).className = document.getElementById(fields[i]).className + ' error';
				document.getElementById(fields[i]).parentNode.className = document.getElementById(fields[i]).parentNode.className + ' error';

				//document.getElementById(fields[i]).parentNode.appendChild(errTag);
				//errTag.appendChild(errTxt);

				pass = false;
			}
		}

		return pass;
	}


/**
*
*/
function toggle(id)
{
	if ('agenda'==document.getElementById(id).className)
	{
		document.getElementById(id).className = document.getElementById(id).className + ' HideItems';
	}
	else
	{
		document.getElementById(id).className = 'agenda';
	}
}

function openMenu (id) {
  o = document.getElementById("nav_list_" + id);
  if (o != null) o.className = (o.className == '') ? 'closed' : '';
  positionFooter();
}

function insertOfficesMap() {
  document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="450" height="280" id="map-offices" align="middle">\n<param name="allowScriptAccess" value="sameDomain" />\n<param name="movie" value="/swf/map-offices.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="/swf/map-offices.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="450" height="280" name="map-offices" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n</object>\n');
}

positionFooter = function() {
  dh = document.documentElement.clientHeight;
  wh = document.documentElement.scrollHeight;
  f = document.getElementById('footer').style;
  if (dh >= wh) {
    f.position = 'absolute';
    f.left = '50%';
    f.width = '752px';
    f.marginLeft = '-377px';
    f.top = dh - 32 + 'px';
  } else {
    f.position = 'static';
    f.left = null;
    f.marginLeft = null;
  }
}

window.onload = function() {
  positionFooter();
}