/*
	Project: cermam org
	Date: 2005-08-22
	Version: 1
	Revision: 0
*/
/*
	::: toggleItem :::::::::::::::::::::::::::::::::::::::::::::
	:::	fct: toggles the display property
	:::	ori: dr
*/
function toggleItem(box) {
    if (document.getElementById('info_'+box).style.display == 'none') {
        document.getElementById('info_'+box).style.display = 'block';
    } else {
        document.getElementById('info_'+box).style.display = 'none';
    }
}
/*
	::: doPopups :::::::::::::::::::::::::::::::::::::::::::::
	:::	fct: opens a link in a new browser window
	:::	ori: http://adactio.com/atmedia2005/
*/
function doPopups() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("popup")) {
      links[i].onclick = function() {
        window.open(this.href);
        return false;
      }
    }
  }
}

/*
	::: doClearInput :::::::::::::::::::::::::::::::::::::::::::::
	:::	fct: clears input box
*/
function doClearInput() {
  if (!document.getElementsByTagName) return false;
  var txt_input = document.getElementsByTagName("input");
  for (var i=0; i < txt_input.length; i++) {
    if (txt_input[i].className.match("clear")) {
      txt_input[i].onfocus = function() {
		if (this.defaultValue==this.value) { 
		 this.value = "";
		}
        return false;
      }
    }
  }
}

function initAll() {
	doPopups();
	doClearInput();
}

window.onload=initAll;
