var showHideReqValue = "toProcess";

function showActivity(act) {
  divs = document.getElementsByTagName("div");
  for (i=0;i<divs.length;i++) {
    //alert("div getAttribute(id)="+divs[i].getAttribute("id") + ", id=" + divs[i].id);
    
    //check if the DIV has the required value
  	if ( showHideReqValue != null && showHideReqValue != "" ) {
  		if ( divs[i].getAttribute("id") && divs[i].getAttribute("id").indexOf(showHideReqValue) == -1) {
  			//alert("skip div with id ="+divs[i].id);
  			continue;
  		}	
  	}

    if (divs[i].getAttribute("id")) {
        if (divs[i].getAttribute("id").indexOf(act) == -1) {
	    divs[i].style.display = "none";
        } else {
	    divs[i].style.display = "block";
        }
    }

  }
}

function showDiv(prod) {
  var reqPrefix = "resource";
  divs = document.getElementsByTagName("div");
  for (i=0;i<divs.length;i++) {
  	if ( reqPrefix != null && reqPrefix != "" ) {
  		if ( (divs[i].getAttribute("class") && divs[i].getAttribute("class").indexOf(reqPrefix) == -1) || 
  			(divs[i].getAttribute("className") && divs[i].getAttribute("className").indexOf(reqPrefix) == -1) ) {
  			continue;
  		}	
  	}
  	
    if (divs[i].getAttribute("class")) {
	    if (divs[i].getAttribute("class").indexOf(prod) == -1) {
	      divs[i].style.display = "none";
	    } else {
	      divs[i].style.display = "block";
	    }
	}  else if (divs[i].getAttribute("className")) {
	    if (divs[i].getAttribute("className").indexOf(prod) == -1) {
	      divs[i].style.display = "none";
	    } else {
	      divs[i].style.display = "block";
	    }
	}
	else {
		//alert("div id=" + divs[i].id + " has no class");
	}
  }
}
