/* $Id: toggle.js,v 1.1.2.2 2005/11/30 21:09:00 robinmonks Exp $ */

function toggle( targetId ) {
   if ( document.getElementById ) {
    target = document.getElementById( targetId );
    if ( target.style.display == "none" ) {
     target.style.display = "";
    } else {
     target.style.display = "none";
    }
   }
}
		
function toggleShow( targetId ) {
	if ( document.getElementById ) {
  	target = document.getElementById( targetId );
	  	if (target.style.display == "none") {
			target.style.display = "";
		} 
	}
}

function toggleHide( targetId ) {
	if ( document.getElementById ) {
  	target = document.getElementById( targetId );
	  	if (target.style.display == "") {
			target.style.display = "none";
		} 
	}
}

function toggleAll( targetTag, showHide ) {
  if ( document.getElementById ) {
    target = document.getElementsByTagName( targetTag );
    var i;
    var max = target.length;
    if ( showHide == "show" ) {
      for ( i = 0; i < max; i++ ) {
        if ( target[ i ].style.display == "none" ) {
          target[ i ].style.display = "";
        }
      }
    }
    else if ( showHide == "hide" ) {
      for ( i = 0; i < max; i++ ) {
        if ( target[ i ].style.display == "" ) {
          target[ i ].style.display = "none";
        }
      }
    }
  }      
}
//Per amagar el block d'usuaris de bon principi
function addLoadEvent(f) { 
	var old = window.onload;
    if (typeof old != 'function') window.onload = f
    else { window.onload = function() { old(); f() }}
}

addLoadEvent(userBlockInit);


function userBlockInit(){
	toggleHide('block-user-0');
}