<!-- Begin to hide script contents from old browsers.

// Declare global helper variables
var g_OpenDropDownMenu = null;
var g_OpenTopLevelMenuItem = null;

function OpenMenu(p_TopLevelMenuItem,pDropDownMenu)
{
	// Determine the left coordinate of the drop down menu
	pDropDownMenu.style.left = eval((1.0 * p_TopLevelMenuItem.offsetLeft) + (1.0 * (document.getElementById("TblObjectiaTopLevelMenu")).cellPadding));
	
	// Determine the top coordinate of the drop down menu
	pDropDownMenu.style.top = eval((1.0 * (document.getElementById("TblObjectiaTopLevelMenu")).offsetTop) + (1.0 * (document.getElementById("TblObjectiaTopLevelMenu")).offsetHeight));

	// Set the drop down menu visibility
	pDropDownMenu.style.visibility = "visible";

	// Store this top level menu item as the open menu
	g_OpenTopLevelMenuItem = p_TopLevelMenuItem;
	
	// Store this drop down menu as the open menu
	g_OpenDropDownMenu = pDropDownMenu;
}

function CloseMenu(pDropDownMenu)
{
	// Set the drop down menu visibility
	pDropDownMenu.style.visibility = "hidden";
	
	// Set the open drop down menu object to null
	g_OpenDropDownMenu = null;
}

function ProcessTopLevelMenuMouseOverEvent(pSrcID)
{
	var l_WhichDropDownMenuObject = null;
	var l_WhichTopLevelMenuItemObject = null;

	// Determine which drop down menu to open
	if("TdMenuBarItemProducts" == pSrcID)
	{
		l_WhichDropDownMenuObject = document.getElementById("DropDownMenuProducts");
		l_WhichTopLevelMenuItemObject = document.getElementById(pSrcID);
		l_WhichDropDownMenuObject.style.width = 130;
	}
	else if("TdMenuBarItemServices" == pSrcID)
	{
		l_WhichDropDownMenuObject = document.getElementById("DropDownMenuServices");
		l_WhichTopLevelMenuItemObject = document.getElementById(pSrcID);
		l_WhichDropDownMenuObject.style.width = 160;
	}
	else if("TdMenuBarItemResources" == pSrcID)
	{
		l_WhichDropDownMenuObject = document.getElementById("DropDownMenuResources");
		l_WhichTopLevelMenuItemObject = document.getElementById(pSrcID);
		l_WhichDropDownMenuObject.style.width = 115;
	}
	else if("TdMenuBarItemRelations" == pSrcID)
	{
		l_WhichDropDownMenuObject = document.getElementById("DropDownMenuRelations");
		l_WhichTopLevelMenuItemObject = document.getElementById(pSrcID);
		l_WhichDropDownMenuObject.style.width = 130;
	}
	else if("TdMenuBarItemCorporate" == pSrcID)
	{
		l_WhichDropDownMenuObject = document.getElementById("DropDownMenuCorporate");
		l_WhichTopLevelMenuItemObject = document.getElementById(pSrcID);
		l_WhichDropDownMenuObject.style.width = 140;
	}

	// See if there is a drop down menu already open
	if(null != g_OpenDropDownMenu)
	{
		// If a drop down menu is already open and it matches the new drop down menu - cancel the event by returning
		if(g_OpenDropDownMenu == l_WhichDropDownMenuObject)
		{
			return;
		}

		// Validate the top level menu item object
		if(null != g_OpenDropDownMenu)
		{
			// Reset the top level menu item text color
			g_OpenTopLevelMenuItem.style.color="#ffffff"; 
		}

		// Otherwise close the drop down menu already open
		CloseMenu(g_OpenDropDownMenu);
	}

	// Validate the new drop down menu and the parent object
	if((null != l_WhichDropDownMenuObject) && (null != l_WhichTopLevelMenuItemObject))
	{
		// Reset the top level menu item text color
		l_WhichTopLevelMenuItemObject.style.color="#ffc800"; 

		// Open the new drop down menu
		OpenMenu(l_WhichTopLevelMenuItemObject,l_WhichDropDownMenuObject);
	}
}

function PopupMenuFSM(pSrcID)
{
	ProcessTopLevelMenuMouseOverEvent(pSrcID);
}

function ValidateNonEmptyField(pField,pAlertMessage) 
{
	// This expression must be all on one line.
	var l_bValid = true;
	
	// Check the email address
	if(pField.value == "")
	{
		// Display message to user
		alert(pAlertMessage);

		// Set the input focus to the field
		pField.focus();

		// Select any residual text
		pField.select();

		// Set return code to false
		l_bValid = false;
	}

	// Return success code
	return l_bValid;
}

function ValidateEmailAddress(pEmailAddressField) 
{
	// This expression must be all on one line.
	var l_bValid = pEmailAddressField.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	
	// Check the email address
	if(!l_bValid)
	{
		// Display message to user
		alert('Please enter a valid e-mail address.');

		// Set the input focus to the email address field
		pEmailAddressField.focus();

		// Select any residual text
		pEmailAddressField.select();
	}

	// Return success code
	return l_bValid;
}

function EmailFeedbackForm()
{
	// Create the subject text message
	var l_SubjectText = "Objectia Feedback Form";

	// Create the body text message
	var l_BodyText = "The following details are about to be sent to Objectia. Please verify that these details are correct:%0d%0d";
	l_BodyText = l_BodyText + "Name: " + document.FeedbackForm.realname.value + "%0d";
	l_BodyText = l_BodyText + "Email: " + document.FeedbackForm.email.value + "%0d";
	l_BodyText = l_BodyText + "Address: " + document.FeedbackForm.address.value + "%0d";
	l_BodyText = l_BodyText + "Company: " + document.FeedbackForm.companyname.value + "%0d";
	l_BodyText = l_BodyText + "Position: " + document.FeedbackForm.companyposition.value + "%0d";
	l_BodyText = l_BodyText + "Phone: " + document.FeedbackForm.telephone.value + "%0d";
	l_BodyText = l_BodyText + "Facsimile: " + document.FeedbackForm.facsimile.value + "%0d";
	l_BodyText = l_BodyText + "Comments: " + document.FeedbackForm.comments.value;

	if
	(
		ValidateEmailAddress(document.FeedbackForm.email) &&
		ValidateNonEmptyField(document.FeedbackForm.realname,"Please enter a contact name.") &&
		ValidateNonEmptyField(document.FeedbackForm.telephone,"Please enter a contact telephone number.") &&
		ValidateNonEmptyField(document.FeedbackForm.comments,"Please enter a comment.")
	)
	{
		// the following expression must be all on one line.
		window.location = "mailto:"+"support@objectia.com"+"?subject="+l_SubjectText+"&body="+l_BodyText;
	}
}

// End the hiding here.-->		
