/*
 Milonic DHTML Menu
 Written by Andy Woolley
 Copyright 2002 (c) Milonic Solutions. All Rights Reserved.
 Plase vist http://www.milonic.co.uk/menu or e-mail menu3@milonic.com
 You may use this menu on your web site free of charge as long as you place prominent links to http://www.milonic.co.uk/menu and
 your inform us of your intentions with your URL AND ALL copyright notices remain in place in all files including your home page
 Comercial support contracts are available on request if you cannot comply with the above rules.

 Please note that major changes to this file have been made and is not compatible with versions 3.0 or earlier.

 You no longer need to number your menus as in previous versions. 
 The new menu structure allows you to name the menu instead, this means that you can remove menus and not break the system.
 The structure should also be much easier to modify, add & remove menus and menu items.
 
 If you are having difficulty with the menu please read the FAQ at http://www.milonic.co.uk/menu/faq.php before contacting us.

 Please note that the above text CAN be erased if you wish as long as copyright notices remain in place.
*/

//The following line is critical for menu operation, and MUST APPEAR ONLY ONCE. If you have more than one menu_array.js file rem out this line in subsequent files
menunum=0;var menus=new Array();_d=document;function addmenu(){menunum++;menus[menunum]=menu; }function dumpmenus(){mt="<script language=javascript>";for(a=1;a<menus.length;a++){mt+=" menu"+a+"=menus["+a+"];"}mt+="<\/script>";_d.write(mt);}
//Please leave the above line intact. The above also needs to be enabled if it not already enabled unless this file is part of a multi pack.

//alert(document.location.search + "\n" + document.location.pathname);

////////////////////////////////////
// Editable properties START here //
////////////////////////////////////
if(navigator.appVersion.indexOf("MSIE 6.0")>0)
{
	//effect = "Fade(duration=0.1);Alpha(style=0,opacity=90);"
	//effect = "Fade(duration=0.2);Alpha(style=0,opacity=100);Shadow(color='#ECE6E6', Direction=135, Strength=3)"
}
else
{
	//effect = "Shadow(color='#0756a5', Direction=135, Strength=5)" // Stop IE5.5 bug when using more than one filter
}


ns6=(navigator.userAgent.indexOf("Gecko")!=-1)?true:false

var offset = 0;

timegap=5;				// The time delay for menus to remain visible
followspeed=2			// Follow Scrolling speed
followrate=2			// Follow Scrolling Rate
suboffset_top=0;		// Sub menu offset Top position 
suboffset_left=0;		// Sub menu offset Left position

style1=[				// style1 is an array of properties. You can have as many property arrays as you need. This means that menus can have their own style.
"#ffffff",					// Mouse Off Font Color
"#FF9247",				// Mouse Off Background Color E0DBEB
"#ffffff",				// Mouse On Font Color
"#CB4300",				// Mouse On Background Color green = "#73c13a" purple=0B074F dark blue="#264363"
"#ffffff",				// Menu Border Color 
12,						// Font Size in pixels
"normal",				// Font Style (italic or normal)
"normal",				// Font Weight (bold or normal)
"Arial",				// Font Name
3,						// Menu Item Padding
//"/images/eq_nav_arrow_transparent2.gif",						// Sub Menu Image (Leave this blank if not needed) eg "arrow.gif"
,						// 3D Border & Separator bar
,						// 3D High Color eg "66ffff"
,						// 3D Low Color eg "000099"
,						// Current Page Item Font Color (leave this blank to disable) eg "Purple"
,						// Current Page Item Background Color (leave this blank to disable) eg "pink"
,						// Top Bar image (Leave this blank to disable) eg "arrowdn.gif"
"ffffff",				// Menu Header Font Color (Leave blank if headers are not needed)
"000099",				// Menu Header Background Color (Leave blank if headers are not needed)
];


var oMenuProperties =  null;
//oHOMEMenuProperties = null;
//oDEFAULTMenuProperties = null;

if (document.location.pathname == "/" || document.location.pathname == "/default.aspx" || document.location.pathname == "/cms/hpasset/preview.aspx") {

	oMenuProperties = oHOMEMenuProperties;
	if (ns6) offset = 6;
}else
	oMenuProperties = oDEFAULTMenuProperties;


for (var i = 0; i < 6; i++) {
	addmenu(menu=[		// This is the array that contains your menu properties and details
	"navigation" + (i+1) ,			// Menu Name - This is needed in order for the menu to be called
	parseInt(oMenuProperties[i][0], 10) + offset,					// Menu Top - The Top position of the menu in pixels
	oMenuProperties[i][1],				    // Menu Left - The Left position of the menu in pixels
	oMenuProperties[i][2],			    // Menu Width - Menus width in pixels
	0,					// Menu Border Width 
	,					// Screen Position - here you can use "center;left;right;middle;top;bottom" or a combination of "center:middle"
	style1,				// Properties Array - this is set higher up, as above
	0,					// Always Visible - allows the menu item to be visible at all time (1=on/0=off)
	"left",				// Alignment - sets the menu elements text alignment, values valid here are: left, right or center
	,				// Filter - Text variable for setting transitional effects on menu activation - see above for more info
	,					// Follow Scrolling - Tells the menu item to follow the user down the screen (visible at all times) (1=on/0=off)
	0, 					// Horizontal Menu - Tells the menu to become horizontal instead of top to bottom style (1=on/0=off)
	,					// Keep Alive - Keeps the menu visible until the user moves over another menu or clicks elsewhere on the page (1=on/0=off)
	,					// Position of TOP sub image left:center:right
	,					// Set the Overall Width of Horizontal Menu to 100% and height to the specified amount (Leave blank to disable)
	,					// Right To Left - Used in Hebrew for example. (1=on/0=off)
	,					// Open the Menus OnClick - leave blank for OnMouseover (1=on/0=off)
	,					// ID of the div you want to hide on MouseOver (useful for hiding form elements)
	,					// Reserved for future use
	,					// Reserved for future use
	,					// Reserved for future use
	""
	]);

}




/*
==================================================================
LTrim(string) : Returns a copy of a string without leading spaces.
==================================================================
*/
function LTrim(str)
/*
   PURPOSE: Remove leading blanks from our string.
   IN: str - the string we want to LTrim
*/
{
   var whitespace = new String(" \t\n\r");

   var s = new String(str);

   if (whitespace.indexOf(s.charAt(0)) != -1) {
      // We have a string with leading blank(s)...

      var j=0, i = s.length;

      // Iterate from the far left of string until we
      // don't have any more whitespace...
      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
         j++;

      // Get the substring from the first non-whitespace
      // character to the end of the string...
      s = s.substring(j, i);
   }
   return s;
}

/*
==================================================================
RTrim(string) : Returns a copy of a string without trailing spaces.
==================================================================
*/
function RTrim(str)
/*
   PURPOSE: Remove trailing blanks from our string.
   IN: str - the string we want to RTrim

*/
{
   // We don't want to trip JUST spaces, but also tabs,
   // line feeds, etc.  Add anything else you want to
   // "trim" here in Whitespace
   var whitespace = new String(" \t\n\r");

   var s = new String(str);

   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
      // We have a string with trailing blank(s)...

      var i = s.length - 1;       // Get length of string

      // Iterate from the far right of string until we
      // don't have any more whitespace...
      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
         i--;


      // Get the substring from the front of the string to
      // where the last non-whitespace character is...
      s = s.substring(0, i+1);
   }

   return s;
}

/*
=============================================================
Trim(string) : Returns a copy of a string without leading or trailing spaces
=============================================================
*/
function Trim(str)
/*
   PURPOSE: Remove trailing and leading blanks from our string.
   IN: str - the string we want to Trim

   RETVAL: A Trimmed string!
*/
{
   return RTrim(LTrim(str));
}

var gb_hideMenu = true;
var gs_popCmd = "";
var gs_NavName = "navigation51";


function getSalesConferenceData (sType) {

	var sImage = "";
	var sRolloverImg = "";
	var sURL   = "";


	// Set up on/off state

	// Check if the page loaded is Sales Conferences
	sImage = "<img src=/images/nav/rollover_sales_conf.gif border=0 >"; 
	sRolloverImg = "<img src=/images/nav/rollover_sales_conf.gif border=0 >"; 
	sURL   = "/sales_conferences.htm";  

	if (sURL.toLowerCase() == document.location.pathname.toLowerCase()) {

		gs_popCmd = "popup('" + gs_NavName + "');";
	
		if (sType == 1) {
		
			// Highlight menu item 
			return  sRolloverImg;
		}
		
		if (sType == 2) {

			return "#";
	
		}

	} else {
	
		// Menu item not selected
		if (sType == 1) {
		
			return sImage;
		}

		if (sType == 2) {
	
			return sURL;
		
		}

	}

}




var b_runonce = false;

	
//dumpmenus();

function CDIGLoadMenu (pintMenuIndex, pstrTitle, pstrURL) {

	if (menus[pintMenuIndex]) {
		
		menus[pintMenuIndex][menus[pintMenuIndex].length] = "&nbsp;" + pstrTitle;
		menus[pintMenuIndex][menus[pintMenuIndex].length] = pstrURL;
		menus[pintMenuIndex][menus[pintMenuIndex].length] = "";
		menus[pintMenuIndex][menus[pintMenuIndex].length] = pstrTitle;
		menus[pintMenuIndex][menus[pintMenuIndex].length] = 1;
		
	}

}

