// determine object model

var isDom = document.getElementById ? true:false;

var isNN4 = document.layers ? true:false;

var isIE = document.all ? true:false;

 

var browserVersion = parseFloat(navigator.appVersion);

var isOpera = (navigator.userAgent.indexOf("Opera") != -1);

var isMac = (navigator.appVersion.indexOf("Mac") != -1);

var isNetscape = (navigator.appName.indexOf("Netscape") != -1);

 

// Client-side Browser Check

var agt = navigator.userAgent.toLowerCase();

var is_ie = ((agt.indexOf("msie") != -1));

var is_ie3 = (is_ie && (browserVersion < 4));

var is_ie4 = (is_ie && (browserVersion == 4) && (agt.indexOf("msie 5")==-1) );

var is_ie4up = (is_ie && (browserVersion >= 4));

var is_ie5 = (is_ie && (browserVersion == 4) && (agt.indexOf("msie 5.0")!=-1) );

var is_ie5_5 = (is_ie && (browserVersion == 4) && (agt.indexOf("msie 5.5") !=-1));

var is_ie5up = (is_ie && !is_ie3 && !is_ie4);

var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);

var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)

              && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)

              && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));

var is_mac = (agt.indexOf("mac")!=-1);

var is_nav6up = (is_nav && (browserVersion >= 5));                                  

var is_nav4_5up = (is_nav && (browserVersion >= 4.5));

var is_ie4up  = (is_ie && (browserVersion >= 4));

 

var menuIds = new Array();

 

menuIds[0] = new Array('0','menuItem1Link','menuItem2Link','menuItem3Link');

menuIds[1] = new Array('0','menuItem1');

menuIds[2] = new Array('0','menuItem2');

menuIds[3] = new Array('0','menuItem3');
 

 

//This function was casually nicked from the Play-Cricket version of the NTCC website.

 

// The following function is used on the menu to show hidden items.

// It requires 2 arrays to have been created

// menuIds[0] is an array of all the top level menu items.

//olly infact menuIds[0] is a 1 based array of all sub menu item

// menuIds[1] is an array of all the second level menu items.

 

function showHideChildren() {

// first argument to function is the parent id, then the children ids    

            var linkRef, ref;

 

            // hide all the second level menu items

            for ( i = 1 ; i < menuIds[0].length ; i++ ) {

                                    

                        getElement(menuIds[0][i]).style.display = 'none';

            }

            

            ref = getElement(arguments[0]+"Indicator");

        //ref = getElement(arguments[i]).style.display

            //if (ref == "giraffe") {

            //          adam = scuff

            //} else {

                        for ( i = 1 ; i < arguments.length ; i++ ) {

                                    ref = getElement(arguments[i]).style.display = 'block';

                                    alert(ref);

                                    //linkRef = getElement(arguments[i]+"Link");

 

                        }

//}         

}

 

// return an element on the page given the ID

// no support for netscape 4

function getElement(elementId) {

            var el;                                                    

            if (document.all) {

                        el = document.all[elementId];

            } else {

                        el = document.getElementById(elementId);

            }

            return el;

}

 

 

function Boris(menuType) {

// menuItem1.style.display = 'block';

// first argument to function is the parent id, then the children ids    

	switch (menuType) {
		case "Firsts": arrayNum = 1
		break
		case "Reserves": arrayNum = 2
		break
		case "Archive": arrayNum = 3
		break
	}


	var linkRef, ref;

// hide all the second level menu items


	for ( i = 1 ; i < menuIds[arrayNum].length ; i++ ) {

		curSet = getElement(menuIds[arrayNum][i]).style.display;

                //alert(curSet);

                if (curSet=='none') {getElement(menuIds[arrayNum][i]).style.display = 'block'} else

                                    {getElement(menuIds[arrayNum][i]).style.display = 'none'}
	}

}

 

 

function frameloader()

 

{

    if (parent.location.href==self.location.href) {

        reqPage = extract(self.location.href);

        //alert(reqPage)

        if (reqPage=='nav') {reqPage='index1';}  

        window.location.href='index.html?'+reqPage;

        }

}
