﻿// JScript File
var dvan_MenuInstance;
                    function createArray(arrlength)
                    {
                      dvan_MenuInstance=new Array(arrlength);
                      for(var i=0;i<dvan_MenuInstance.length;i++)
                      {
                       if(i<10)
                        dvan_MenuInstance[i]="MainMenu-dvan00"+i+"-subitem";
                        else
                        dvan_MenuInstance[i]="MainMenu-dvan0"+i+"-subitem";
                      }
                    }
					function mousedOverMenu_ctl00_ctl00_ctl00_ctl00_MenuInstance(elem, parent, displayedVertically)
					{
						stopTick_ctl00_ctl00_ctl00_ctl00_MenuInstance();
						// only close the subMenus if we are mousing over a top-level menu
						closeSubMenus_ctl00_ctl00_ctl00_ctl00_MenuInstance(elem);
						
						// Display child menu if needed
						var childID = elem.id + "-subitem";						
						if (document.getElementById(childID) != null)
						{
							// make the child menu visible and specify that its position is specified in absolute coordinates
							document.getElementById(childID).style.display = 'block';
							document.getElementById(childID).style.position = 'absolute';	
					
							if (displayedVertically) {
								// Set the child menu's left and top attributes according to the menu's offsets
								document.getElementById(childID).style.left = getAscendingLefts(parent) + parent.offsetWidth;//(+4)
								document.getElementById(childID).style.top = getAscendingTops(elem);
							}
							else
							{
								// Set the child menu's left and top attributes according to the menu's offsets
								document.getElementById(childID).style.left = getAscendingLefts(elem);
								document.getElementById(childID).style.top = getAscendingTops(parent) + parent.offsetHeight;

								if (document.getElementById(childID).offsetWidth < elem.offsetWidth)
									document.getElementById(childID).style.width = elem.offsetWidth;
							}
						}
					elem.className = 'TopItemHover';
					}

					function mousedOutMenu_ctl00_ctl00_ctl00_ctl00_MenuInstance(elem)
					{
						elem.style.cursor = 'default';
						doTick_ctl00_ctl00_ctl00_ctl00_MenuInstance();

					elem.className = 'TopItem';
					}

					function closeSubMenus_ctl00_ctl00_ctl00_ctl00_MenuInstance(parent)
					{
						if(dvan_MenuInstance != null)
						{
							for (var i = 0; i < dvan_MenuInstance.length; i++)
							{
								if (dvan_MenuInstance[i].length > parent.id.length)
								{
									document.getElementById(dvan_MenuInstance[i]).style.display = 'none';
								}
							}						
						}
					}


					function getAscendingLefts(elem)
					{
						if (elem == null)
							return 0;
						else
							return elem.offsetLeft + getAscendingLefts(elem.offsetParent);
					}

					function getAscendingTops(elem)
					{
						if (elem == null)
							return 0;
						else
							return elem.offsetTop + getAscendingTops(elem.offsetParent);
					}



					var clockValue = 0;
					var ticker;
					var DELAY_BOUND = 1;
					function doTick_ctl00_ctl00_ctl00_ctl00_MenuInstance()
					{
						if (clockValue > DELAY_BOUND)
						{
							stopTick_ctl00_ctl00_ctl00_ctl00_MenuInstance();
							closeSubMenus_ctl00_ctl00_ctl00_ctl00_MenuInstance(document.getElementById('MainMenu'));
						}
						else
						{
							clockValue++;
							ticker = setTimeout("doTick_ctl00_ctl00_ctl00_ctl00_MenuInstance();", 200);
						}
					}

					function stopTick_ctl00_ctl00_ctl00_ctl00_MenuInstance()
					{
						clockValue = 0;
						clearTimeout(ticker);
					}

					// -->