// looks for block div with id=tabpre-xxx and tabs with id=tabpr-xxx-tab
// hide all blocks with id=tabpre-xxx and unstyle it's tab
function tabblocksClearAll(blockpre)
{
    var divs = document.getElementsByTagName("div");
    for (i=0; i<divs.length; i++) {
    	var div = divs[i];
    	var id = div.id;
    	if (id.indexOf(blockpre) != -1) {
    	    div.style.display = 'none';	
    	    
			elem = document.getElementById(id + '-tab');

	    	elem.setAttribute("class","");
	    	elem.setAttribute("className","");
    	}
    }
    return false;
}
// display block named id (id=blocpre-id) and active style its tab
function tabblocksDisplay(blockpre, id)
{
    tabblocksClearAll(blockpre);
    elem = document.getElementById(blockpre + '-' + id);
    elem.style.display = 'block';
    elem = document.getElementById(blockpre + '-' + id + '-tab');
    elem.setAttribute("class","active");
    elem.setAttribute("className","active");
    return false;
}

