var ids=new Array();

function switchid(id){		
	if (!checkdiv(id)){
		hideallids();
		showdiv(id);
		hidden = getobject("nsoftwareCollapsiblePanel");
		hidden.value = id;
	} else {
		hideallids();
	}
}

function hideallids(){
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function getobject(id){

    if (document.getElementById) {
        return document.getElementById(id);
	} else {
		if (document.layers) { // Netscape 4
			if (document.id != null) return document.id;
		} else { // IE 4
			if (document.all.id != null) return document.all.id;
		}
	}
	return null;
}

function checkdiv(id) {
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id) != null) {
			if (document.getElementById(id).style.display != 'none'){
				return true;
			}
		}
	} else {
		if (document.layers) { // Netscape 4
			if (document.id != null) {
				if (document.id.display != 'none'){
					return true;
				}
			}
		}
		else { // IE 4
			if (document.all.id != null) {
				if (document.all.id.style.display != 'none'){
					return true;
				}
			}
		}
	}
	return false;
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id) != null) {
			document.getElementById(id).style.display = 'none';
		}
	}
	else {
		if (document.layers) { // Netscape 4
			if (document.id != null) {
				document.id.display = 'none';
			}
		}
		else { // IE 4
			if (document.all.id != null) {
				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
		if (document.getElementById(id) != null) {
			document.getElementById(id).style.display = 'block';
		}
	}
	else {
		if (document.layers) { // Netscape 4
			if (document.id != null) {
				document.id.display = 'block';
			}
		}
		else { // IE 4
			if (document.all.id != null) {
				document.all.id.style.display = 'block';
			}
		}
	}
}
