
//here you place the ids of every element you want.
var ids=new Array('front_page_main','politics_over','outdoors_over','environment_over','economy_over','law_over','culture_over');
function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}


//SuckerTree Horizontal Menu (Sept 14th, 06)
//By Dynamic Drive: http://www.dynamicdrive.com/style/

var menuids = ["treemenu1"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus_horizontal() {
    for (var i = 0; i < menuids.length; i++) {
        var ultags = document.getElementById(menuids[i]).getElementsByTagName("ul")
        for (var t = 0; t < ultags.length; t++) {
            if (ultags[t].parentNode.parentNode.id == menuids[i]) { //if this is a first level submenu
                ultags[t].style.top = ultags[t].parentNode.offsetHeight + "px" //dynamically position first level submenus to be height of main menu item
                ultags[t].parentNode.getElementsByTagName("a")[0].className = "mainfoldericon"
            }
            else { //else if this is a sub level menu (ul)
                ultags[t].style.left = ultags[t - 1].getElementsByTagName("a")[0].offsetWidth + "px" //position menu to the right of menu item that activated it
                ultags[t].parentNode.getElementsByTagName("a")[0].className = "subfoldericon"
            }
            ultags[t].parentNode.onmouseover = function() {
                this.getElementsByTagName("ul")[0].style.visibility = "visible"
            }
            ultags[t].parentNode.onmouseout = function() {
                this.getElementsByTagName("ul")[0].style.visibility = "hidden"
            }
        }
    }
}

if (window.addEventListener)
    window.addEventListener("load", buildsubmenus_horizontal, false)
else if (window.attachEvent)
    window.attachEvent("onload", buildsubmenus_horizontal)

var banArray = new Array(4); //for banners, increase size as necessary
var counter = 1;


if (document.images) //pre-load all banner images
{
    for (i = 0; i < 5; i++) {
        banArray[i] = new Image(302, 226);
        banArray[i].src = "images/skin" + (i + 1) + ".jpg";
    }
}

function verifyRequired() {
    if (document.icpsignup["fields_email"].value == "") {
        document.icpsignup["fields_email"].focus();
        alert("The Email field is required.");
        return false;
    }


    return true;
}
