// Java Document

function fullwidedisplayTab(tab)
    {
        // set all the tabs to not display
		var ctrl = document.getElementById('full-wide-tab1')
        ctrl.style.display = "none";
        var ctrl = document.getElementById('full-wide-tab2')
        ctrl.style.display = "none";
        ctrl.style.display = "none";        // set the selected tab to display
        var ctrl = document.getElementById(tab)
        ctrl.style.display = "block";
}

function homedisplayTab(tab)
    {
        // set all the tabs to not display
		var ctrl = document.getElementById('home-tab1')
        ctrl.style.display = "none";
        var ctrl = document.getElementById('home-tab2')
        ctrl.style.display = "none";
		var ctrl = document.getElementById('home-tab3')
        ctrl.style.display = "none";
        // set the selected tab to display
        var ctrl = document.getElementById(tab)
        ctrl.style.display = "block";
}

function twodisplayTab(tab) {
    // set all the tabs to not display
    var ctrl = document.getElementById('two-tab1')
    ctrl.style.display = "none";
    var ctrl = document.getElementById('two-tab2')
    ctrl.style.display = "none";
    var ctrl = document.getElementById(tab)
    ctrl.style.display = "block";
}

function threedisplayTab(tab) {
    // set all the tabs to not display
    var ctrl = document.getElementById('three-tab1')
    ctrl.style.display = "none";
    var ctrl = document.getElementById('three-tab2')
    ctrl.style.display = "none";
    var ctrl = document.getElementById('three-tab3')
    ctrl.style.display = "none";
    var ctrl = document.getElementById(tab)
    ctrl.style.display = "block";
}

function openPopup(mode, strURL, intWidth, intHeight, blnNewWindow) {
    //zubin
    //alert('z');
    var intScreenHeight = 0;
    //	get screen height
    if (parseInt(navigator.appVersion) > 3) {
        intScreenHeight = screen.availHeight;
        if (!intScreenHeight) {
            intScreenHeight = screen.height;
        }
    } else if (
			navigator.appName == "Netscape" &&
			parseInt(navigator.appVersion) == 3 &&
			navigator.javaEnabled()
		) {
        var jToolkit = java.awt.Toolkit.getDefaultToolkit();
        var jScreenSize = jToolkit.getScreenSize();
        intScreenHeight = jScreenSize.height;
    } else {
        alert('Can\'t detect screen resolution');
        return;
    }
    //	adjust dimensions if necessary
    if (intHeight > intScreenHeight) {
        intHeight = intScreenHeight - 10;
    }
    if (blnNewWindow) {
        //	new window
        if (mode == 'map') {
            var openPopup = window.open(strURL, 'popup', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,left=210, top=150, width=' + intWidth + ',height=' + intHeight);
        } else {
            var openPopup = window.open(strURL, 'popup', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,left=0, top=0, width=' + intWidth + ',height=' + intHeight);
        }
        openPopup.focus();
    } else {
        //	same window
        window.resizeTo(intWidth, intHeight);
    }
    return;
}

function UseImg(img,file) 
	{
  		document.images(img).src = file;
	}

function MM_showCounty() { //v3.0
  document.images("subdivn").src = "Assets/images/county_division_overlay.gif";
}

function MM_showDistrict() { //v3.0
  document.images("subdivn").src = "Assets/images/district_ward_overlay.gif";
}

function MM_showMap() { //v3.0
  document.images("subdivn").src = "Assets/images/district_map.gif";
}

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("naxx");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

window.onload=startList; 