var isDHTML = 0;
var isID = 0;
var isAll = 0;
var isLayers = 0;

if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
if (document.all) {isAll = 1; isDHTML = 1;}
else {
browserVersion = parseInt(navigator.appVersion);
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
}
}

function findDOM(objectID,withStyle) {
	if (withStyle == 1) {
		if (isID) { return (document.getElementById(objectID).style) ; }
		else { 
			if (isAll) { return (document.all[objectID].style); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		}
		}
	}
	else {
		if (isID) { return (document.getElementById(objectID)) ; }
		else { 
			if (isAll) { return (document.all[objectID]); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		}
		}
	}
}



var menuTop = 10;
var menuLeft = 500;

var domSMenu = null;
var oldDomSMenu = null;
var oldDomON = null;
var t = 0;
var lDelay = 20;
var lCount = 0;
var pause = 500;

function popMenu(menuNum,menuName){
	if (isDHTML) {
///// Sets the previous menu's visibility to hidden

		if (oldDomSMenu) {
			newON = menuName;
			oldDomSMenu.visibility = 'hidden'; 
			oldDomSMenu.zIndex = '0'; 
		    //eval('document.' + oldDomON + '.src="/home/images/nav_' + oldDomON + '.gif";');

			lCount = 0;
		}

		var idSMenu = 'menu' + menuNum;
		var domSMenu = findDOM(idSMenu,1);


///// Positions and shows the menu
		if (oldDomSMenu != domSMenu) {	
			//eval('document.' + menuName + '.src="/home/images/nav_' + menuName + 'ON.gif";');
			domSMenu.visibility = 'visible';
			domSMenu.zIndex = '100';
			oldDomSMenu = domSMenu;
			oldDomON = menuName;
		}

///// Resets oldDom if it is the same as the current DOM
		else { oldDomSMenu = null; }
	}

////// Returns a 'null' value for non-DHTML Browsers 
	else { return null; }
}

function delayHide() {
///// Checks to see if there is a menu showing and whether 
///// the global variable 't' has been set to 0

    if ((oldDomSMenu) && (t == 0)) {

///// Hides the old menu, resets menu conditions, 
///// and stops the function running
		
		//eval('document.' + oldDomON + '.src="/home/images/nav_' + oldDomON + '.gif";');
        oldDomSMenu.visibility = 'hidden'; 
        oldDomSMenu.zIndex = '0';
        oldDomSMenu = null;
        lCount = 0; 
        return false;
    }

///// Interupts the function if another menu is opened
    if (t == 2) { lCount = 0; return false; }

///// Repeats the function adding 1 to lCount each time until 
///// lCount is equal to lDelay and then sets 't' to 0 so that 
///// the menu will hide when it runs again

    if (t == 1) { 
        lCount = lCount + 1;
        if (lDelay <= lCount) { t = 0; }
        if (lDelay >= lCount) { setTimeout('delayHide(' + .5 + ')',pause); }
    }
}

	
	
	var two = '<div id="menu2">';
	two += '<table cellpadding="0" cellspacing="0">';
	two += '		<tr>';
	two += '			<td>&nbsp;</td>';
	two += '			<td><a href="../services.html"><img src="images/nav_services_on.jpg" border="0" /></a></td>';
	two += '			<td>&nbsp;</td>';
	two += '		</tr>';
	two += '	<tr bgcolor="#FFFFFF">';
	two += '		<td><img src="images/spacer.gif" width="4" height="1"/></td>';
	two += '		<td width="76" background="images/drop_bg2.jpg" height="20">';
	two += 		constructMenuItem('../valuation.html','Valuation');
	two += '		</td>';
	two += '		<td><img src="images/spacer.gif" width="4" height="1"/></td>';
	two += '	</tr>';
	two += '	<tr>';
	two += '		<td></td>';
	two += '		<td background="images/drop_bg2.jpg" height="20">';
	two += 		constructMenuItem('../businesscase.html','Management<br>&nbsp;&nbsp;&nbsp;Consulting<br>');
	two += '		</td>';
	two += '		<td></td>';
	two += '	</tr>';
	two += '<tr>';
	two += '		<td></td>';
	two += '		<td><img src="images/drop_btm2.gif" width="76" height="18" /></td>';
	two += '		<td></td>';
	two += '</tr>';
	two += '</table>';
	two += '</div>';
	
	var three = '<div id="menu3">';
	three += '<table cellpadding="0" cellspacing="0">';
	three += '		<tr>';
	three += '			<td>&nbsp;</td>';
	three += '			<td><a href="../resources.html"><img src="images/nav_resources_on.jpg" border="0" /></a></td>';
	three += '			<td>&nbsp;</td>';
	three += '		</tr>';
	three += '	<tr bgcolor="#FFFFFF">';
	three += '		<td><img src="images/spacer.gif" width="4" height="1"/></td>';
	three += '		<td width="76" background="images/drop_bg2.jpg" height="20">';
	three += 			constructMenuItem('../clientlogin.html','Client Login');
	three += '		</td>';
	three += '		<td><img src="images/spacer.gif" width="4" height="1"/></td>';
	three += '	</tr>';
	three += '	<tr>';
	three += '		<td></td>';
	three += '		<td background="images/drop_bg2.jpg" height="20">';
	three += 			constructMenuItem('../samples.html','Samples');
	three += '		</td>';
	three += '		<td></td>';
	three += '	</tr>';
	three += '<tr>';
	three += '		<td></td>';
	three += '		<td><img src="images/drop_btm2.gif" width="76" height="18" /></td>';
	three += '		<td></td>';
	three += '</tr>';
	three += '</table>';
	three += '</div>';
	
	var four = '<div id="menu4">';
	four += '<table cellpadding="0" cellspacing="0">';
	four += '		<tr>';
	four += '			<td>&nbsp;</td>';
	four += '			<td><a href="../aboutus.html"><img src="images/nav_about_on.jpg" border="0" /></td>';
	four += '			<td>&nbsp;</td>';
	four += '		</tr>';
	four += '	<tr>';
	four += '		<td></td>';
	four += '		<td background="images/drop_bg2.jpg" height="20">';
	four += 		constructMenuItem('../contactus.html','Contact Us');
	four += '		</td>';
	four += '		<td></td>';
	four += '	</tr>';
	four += '	<tr>';
	four += '		<td></td>';
	four += '		<td background="images/drop_bg2.jpg" height="20">';
	four += 		constructMenuItem('../careers_home.html','Careers');
	four += '		</td>';
	four += '		<td></td>';
	four += '	</tr>';		
	four += '	<tr>';
	four += '		<td></td>';
	four += '		<td background="images/drop_bg2.jpg" height="20">';
	four += 		constructMenuItem('../partners.html','Partners');
	four += '		</td>';
	four += '		<td></td>';
	four += '	</tr>';
	four += '<tr>';
	four += '		<td></td>';
	four += '		<td><img src="images/drop_btm2.gif" width="76" height="18" /></td>';
	four += '		<td></td>';
	four += '</tr>';
	four += '</table>';
	four += '</div>';
	
	
var footer = '	<tr>';
	footer+= ' <td>&nbsp;</td>';
	footer+= '	     <td height="40" colspan="6" align="center" class="logoworks">';
	footer+= 'Copyright 2005 &copy; VALUE PRISM CONSULTING, LLC. All rights reserved.</td>';
    footer+= ' </tr>';

var menusource = '	<table cellpadding="0" cellspacing="0">';
	menusource += '		<tr bgcolor="#FFFFFF">';
	menusource += '				<td width="4">&nbsp;</td>';
	menusource += '				<td width="76"><a href="http://www.valueprism.com/index.html"><img name="home" src="images/nav_home_off.jpg" width="76" height="34" border="0" /></a></td>';
	menusource += '				<td width="4">&nbsp;</td>';
	menusource += '				<td width="76"><a href="#" onMouseOver="popMenu(\'2\'); t=1; delayHide();"><img src="images/nav_services_off.jpg" width="76" height="34" border="0" /></a></td>';
	menusource += '				<td width="4">&nbsp;</td>';
	menusource += '				<td width="76"><a href="#" onMouseOver="popMenu(\'3\'); t=1; delayHide();"><img src="images/nav_resources_off.jpg" width="76" height="34" border="0" /></a></td>';
	menusource += '				<td width="4">&nbsp;</td>';
	menusource += '				<td width="76"><a href="#" onMouseOver="popMenu(\'4\'); t=1; delayHide();"><img src="images/nav_about_off.jpg" width="76" height="34" border="0" /></a></td>';
	menusource += '				<td width="4">&nbsp;</td>';
	menusource += '			</tr>';
	menusource += '		</table>';



function constructMenuItem(url,linktext,targetwindow)
{
  var str = '';
  if(!(document.getElementsByTagName) || 
  	 !(basehrefs = document.getElementsByTagName('base')) ||
	 !(basehrefs.length) || !(basehrefs.length > 0) ||
	 !(basehrefs[0].getAttribute) ||
	 !(basehref = basehrefs[0].getAttribute('href')) )
	basehref = '';


  

	str += '&nbsp;&nbsp;<a class="navtext" href="';
	str += basehref + url;
	str += '" onMouseOver="t=1; delayHide();"';
	if(targetwindow) str += ' target="' + targetwindow + '" ';
	str += ' onMouseOver="t=1; delayHide();" onClick="t=0; delayHide();" >';
	str += linktext;
	str += '</a>';
  

  return str;
}



