// NEW POP-UP CODE

	var NS4;
	var NS6;
	
	if (document.all) {
		NS4 = false;
	}
	else if (document.layers) {
  		NS4 = true;
	}
	else if (document.getElementById) {
  		NS6 = true;
		//alert("NETSCAPE 6");
	}
	else {
  		//do nothing
	} 
	
	var isMacTest = navigator.platform.toLowerCase();
	var isMac;

	if (isMacTest.indexOf("mac")!=-1) {
	isMac=true;
	}
	else {
	isMac=false;
	}
	//alert(isMac);
	
	var left_corner_x = 1; // y-coordinate of top left corner of dropdown menu
	
	 // x-coordinate of top left corner of dropdown menu
	if (NS4) {
		if (!isMac) {
		var left_corner_y = 238; //82
		}
		else {
		var left_corner_y = 238; //74
		}
	}
	else if (NS6) {
		if (!isMac) {
		var left_corner_y = 238; //82
		}
		else {
		var left_corner_y = 238; //74
		}
	}
	else {
		if (!isMac) {
		var left_corner_y = 245; //77
		}
		else {
		var left_corner_y = 245; //74
		}
	}
	
	var back_color = '#B0C0CF'; // the background color of dropdown menu
	var border_size  = '0'; // the width of dropdown menu border
	var menu_width   = '150'; // the width of dropdown menu


	//// Don't change these parameters
	var activeMenu //for select box detection
	var active_layer_id = -1;  /////
	var on_layer_id  = -1;  /////
	var buff_id  = -1;  /////
	var menu_size = 0
	
	//// modify these values for menu drop down delay
	var enter_delay  = 50;
	var exit_delay = 100;
	
//menu content contains all the links on each layer	
menu_content = new Array (
'<a href="mission.html" target="_top" onmouseover="window.status=\'OUR MISSION\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">OUR MISSION</a> | <a href="message.html" target="_top" onmouseover="window.status=\'MESSAGE FROM CEO\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">MESSAGE FROM CEO</a> | <a href="jobopportunities.html" target="_top" onmouseover="window.status=\'JOB OPPORTUNITIES\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">JOB OPPORTUNITIES</a>' ,
'<a href="case_studies.html" target="_top" onmouseover="window.status=\'CASE STUDIES\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">CASE STUDIES</a> | <a href="clients.html" target="_top" onmouseover="window.status=\'CLIENT LIST\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">CLIENT LIST</a> | <a href="faq.html" target="_top" onmouseover="window.status=\'FAQs\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">FAQs</a> | <a href="steps.html" target="_top" onmouseover="window.status=\'6 STEP PROCESS\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">6 STEP PROCESS</a>' ,
'<a href="products.html" target="_top" onmouseover="window.status=\'PRODUCTS OVERVIEW\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">PRODUCTS OVERVIEW</a> | <a href="bonustracking.html" target="_top" onmouseover="window.status=\'PHARMA IC PLANNER\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">PHARMA IC PLANNER</a> | <a href="eventadvantage.html" target="_top" onmouseover="window.status=\'EVENT ADVANTAGE\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">EVENT ADVANTAGE</a> | <a href="webadvantage.html" target="_top" onmouseover="window.status=\'WEB ADVANTAGE\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">WEB ADVANTAGE</a> | <a href="salesincentiveadministrator.html" target="_top" onmouseover="window.status=\'SALES INCENTIVE ADMINISTRATOR\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">SALES INCENTIVE ADMINISTRATOR</a> | <a href="physiciansegmentation.html" target="_top" onmouseover="window.status=\'PHYSICIAN SEGMENTATION\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">PHYSICIAN SEGMENTATION</a> | <a href="others.html" target="_top" onmouseover="window.status=\'All OTHER PRODUCTS\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">All OTHER PRODUCTS</a>' ,
'<a href="consulting_services.html" target="_top" onmouseover="window.status=\'SALES FORCE COMPENSATION\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">SALES FORCE COMPENSATION</a> | <a href="consulting_services.html#TSA" onmouseover="window.status=\'TACTICAL SALES ANALYSIS\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">TACTICAL SALES ANALYSIS</a> | <a href="consulting_services.html#MSM" onmouseover="window.status=\'MARKETING SCIENCE MODELING\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">MARKETING SCIENCE MODELING</a> | <a href="consulting_services.html#FP" onmouseover="window.status=\'FORECASTING AND PROJECTING\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">FORECASTING AND PROJECTING</a>' ,
'<a href="solutions.html" target="_top" onmouseover="window.status=\'AREAS OF EXPERTISE\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">AREAS OF EXPERTISE</a> | <a href="whitepapers.html" target="_top" onmouseover="window.status=\'WHITE PAPERS\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">WHITE PAPERS</a> | <a href="newsalesincentivebook.html" target="_top" onmouseover="window.status=\'SALES INCENTIVE BOOK\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">SALES INCENTIVE BOOK</a> | <a href="salesicplanningcourse.html" target="_top" onmouseover="window.status=\'SALES INCENTIVE PLANNING COURSE\'; return true" onmouseout="window.status=\'\'; return true" class="Layer">SALES INCENTIVE PLANNING COURSE</a>' 
 );


	if (NS4) {
	//netscape
		if (!isMac) {
		menu_position = new Array (70,95,110,120,154);
		}
		else {
		// MAC NS menu bar postion
		menu_position = new Array (70,95,110,120,154);
		}
	}
	else {
	//internet explorer - Windows
		if (!isMac) {
		menu_position = new Array (70,95,110,120,154);
		}
		else {
		// MAC I.E. menu bar position
		menu_position = new Array (70,95,110,120,154);
		}
	}

	function layer_enter (id){
		on_layer_id = id;
		//setTimeout ('show('+ id +')', enter_delay/5);
		//hideSelect();
	}

	function layer_exit (id){
		on_layer_id = - 1;
		setTimeout ('hide('+ id +')', exit_delay);
		//showSelect();
	}
	
	function menu_enter (id)
	{
		if (buff_id >= 0)
			hide (buff_id);
		setTimeout ('show('+ id +')', enter_delay);
		//show (id);
		active_layer_id = id;
		if(!NS4) {
			activeMenu = eval("document.all('Menu" + id + "');");
		}
		//hideSelect();
	}

	function menu_exit (id)
	{
		
		//showSelect();		
		setTimeout ('hide('+ id +')', exit_delay);
		buff_id = active_layer_id;
		active_layer_id = -1;
	}

	function show (id){
		if (!NS4){
			if (!NS6){
				document.all['Menu' + id].style.visibility = "visible";
			}
			else{
				document.getElementById('Menu' + id).style.visibility="visible";
			}
		}
		else{
			document.layers[id].visibility = "visible";
		}
	}

	function hide (id){
		if (active_layer_id != id && on_layer_id != id){
			if (!NS4){
				if (!NS6){
					document.all['Menu' + id].style.visibility = "hidden";
				}
				else{
					document.getElementById('Menu' + id).style.visibility="hidden";
				}
			}
			else{
				document.layers[id].visibility = "hide";
			}
		}
	}

	function generate_layers ()
	{
		var colCount = 0;
		var tempItem;
		var setLength;
		var tempLayerBody;
		tempLayerBody = '';
	
		for (i = 0; i < menu_content.length; i++)
		{
			menu_size = menu_size + menu_position[i]
			elements = menu_content[i].split (/\s*\|\s*/);
			layer_body = '';
			
			if (!NS4)
				layer_header = '<div id=Menu' + i +
						   	   ' onMouseOver="layer_enter (' + i + ');" onMouseOut = "layer_exit (' + i + ');"' +
					           ' style="z-index:10;visibility: hidden; position: absolute; left: ' + (left_corner_x + menu_size) +
					           '; top: ' + left_corner_y  + ';">';
			else
				layer_header = '<layer id=' + i +
							   ' onMouseOver="layer_enter (' + i + ');" onMouseOut = "layer_exit (' + i + ');"' +
							   ' visibility=hide left=' + (left_corner_x + menu_size) +
							   ' top = ' + left_corner_y  + ' z-index="10">';

			layer_header += '<table width=' + menu_width + ' cellpadding=0 cellspacing=0 border=0><tr>' +
						    '<td bgcolor=' + back_color + ' nowrap ><table width="100%" cellpadding=3 ' +
						    'cellspacing=' + border_size + ' border=0>';
			
			//split links into X number of columns - T.Lai.
			if ((screen.availHeight < 600) && (elements.length > 10)){
				setLength = 10;
				colCount = Math.ceil(elements.length / setLength);
			}
			else if ((screen.availHeight < 768) && (elements.length > 20)){
				setLength = 20;
				colCount = Math.ceil(elements.length / setLength);
			}
			else{
				setLength = elements.length;
				colCount = 1;
			}
			
			for (j = 0; j < setLength; j++){
				for (p = 0; p < colCount; p++){
					tempItem = elements[j + (p * setLength)];
					if (!tempItem){
						tempLayerBody += '<td bgcolor=' + back_color + ' nowrap>&nbsp;</td>'
					}
					else{
						tempLayerBody += '<td bgcolor=' + back_color + ' nowrap><font face=geneva,verdana,arial size=1 color=#ffffff>' + tempItem + '</font></td>';
					}
				}
				tempLayerBody = '<tr align=center>' + tempLayerBody + '</tr>';
				layer_body += tempLayerBody;
				tempLayerBody = '';
			}
			//*end* split links
			
			
			layer_footer = '</table></td></tr></table>';
			if (!NS4)
				layer_footer += '</div>';
			else
				layer_footer += '</layer>';
			document.writeln (layer_header + layer_body + layer_footer);
			
		}
	}



//--------------------------------------------------------------
//show dropdown when menu is hidden
function showSelect(){
	if(document.all){
		var obj;
		
		for(var i = 0; i < document.all.tags("select").length; i++){
			obj = document.all.tags("select")[i];
			//alert(obj.id);
			//if(!obj || !obj.offsetParent)
			//	continue;
			obj.style.visibility = 'visible';
			//	}
		}
	}
	else{
		if(document.layers['containsFrm1']!= undefined && NS4){
			document.layers['containsFrm1'].visibility = 'visible';
		}
	}
}


 
//hide dropdown so menu can cover it when menu is visible
function hideSelect()
{
	if(document.all) {
	var obj;
	var currentEle;
	var top = 0;
	var left = 0;
	var menuHeight;
	var timeout;
		
		for(var i = 0; i < document.all.tags("select").length; i++)
		{
			obj = document.all.tags("select")[i];
			currentEle = obj;
		
			while(currentEle.tagName.toLowerCase() != 'body')
			{
				top += currentEle.offsetTop;
				left += currentEle.offsetLeft;
				currentEle = currentEle.offsetParent;
			}
			if(activeMenu != null)
			{
				menuHeight = (activeMenu.offsetTop + activeMenu.offsetHeight + 20);
				
				if(top < menuHeight)
				{			
					if((left < (activeMenu.offsetLeft + activeMenu.offsetWidth)) && (left + obj.offsetWidth > activeMenu.offsetLeft)) 
					obj.style.visibility = 'hidden';
				}
			}
			top = 0;
			left = 0;
		}
	}
	else {
//alert(document.layers['containsFrm1']);
		if(document.layers['containsFrm1']!= undefined && NS4) {
			if(document.layers['containsFrm1'].visibility == 'visible') {document.layers['containsFrm1'].visibility = 'hidden';}
		}
	}
}



	generate_layers ();
	
	function checkFocus(entry){  //Both product search and e-mail list call this function.
	entry.value="";
	}
	
	//alert(screen.availHeight);

