﻿// JScript File

//*****For Rotating Banner*************
var adImages = new Array("images/mainrotator1.jpg","images/mainrotator2.jpg","images/mainrotator3.jpg","images/mainrotator4.jpg");
var thisAd = 2;

function rotate() 
{
	thisAd++;
	if (thisAd == adImages.length) {
		thisAd = 0;
	}

	
	var el = document.getElementById("adBanner");
	el.src = adImages[thisAd];
	el.style.display = 'none';
    
    ShowBanner();
    
	setTimeout("rotate()", 5 * 1000);
}
//***********************************************

function OpenCurrent()
{
    window.open("./Current.aspx", '_blank','top=200, left=200, width=550, height=400, status=no, menubar=no, resizable=no, scrollbars=no, toolbar=no, location=no, directories=no');
}

function PopUpWindow()
{
    window.open("./ContactUs.aspx", '_blank','top=100, left=100, width=200, height=750, status=no, menubar=no, resizable=no, scrollbars=no, toolbar=no, location=no, directories=no');
}

function OpenPage(page)
{
    window.open("./" + page, '_parent');
}

var curDiv = null;
function ShowHideDiv(cntrlID)
{
    var el;
	if (curDiv) 
	    {
	        el = document.getElementById(curDiv);
			el.style.display = 'none';
		}
	if (cntrlID != curDiv) 
	    {
	    el = document.getElementById(cntrlID);
		curDiv = cntrlID;
		el.style.display = '';
	    } 
	 else 
	    {
		curDiv = null;
	    }
}


function CloseDivByClassName(className) 
{
  var all = document.all ? document.all :
    document.getElementsByTagName('*');
  var elements = new Array();
  for (var e = 0; e < all.length; e++)
    if (all[e].className == className)
      all[e].style.display = 'none';
  return elements;
}


// ----------------------------------------------------------------------
        // Name: InitializeMenu
        // Abstract: Add mouse over and mouse out events to every menu item.
        // ----------------------------------------------------------------------
        function InitializeMenu()
        {
            var divHeader = 0;
            var aliMenuOptions = 0;
            var intIndex = 0;
            
			
			
            // Get the division that contains the menu
            divHeader = document.getElementById( "MainMenu" );
            
            // Get all the LI elements in the menu division
            aliMenuOptions = divHeader.getElementsByTagName( "li" );
            
            // Update each LI element
            for( intIndex = 0; intIndex < aliMenuOptions.length; intIndex += 1 )
            {
                // Add a mouse over event handler
                aliMenuOptions[ intIndex ].onmouseover = function(){ ChangeClassName( this, 'clsSelected' ); };

                // Add a mouse out event handler
                aliMenuOptions[ intIndex ].onmouseout = function(){ ChangeClassName( this, '' ); };
            }
        }        

        // ----------------------------------------------------------------------
        // Name: ChangeClassName
        // Abstract: Select the menu item and show the specified sub menu
        // ----------------------------------------------------------------------
        function ChangeClassName(objTargetMenu, strNewClassName)
        {   
            objTargetMenu.className = strNewClassName;
        }        