addLoadEvent(init);

function init() {
//look for text input, to perform the clean on focus
    var formInputs = document.getElementsByTagName('input');
	
    for (var i = 0; i < formInputs.length; i++) {
        var theInput = formInputs[i];
        
        if (theInput.type == 'text' && theInput.className.match(/\bwpsb_form_txt\b/g)) {  
            /* Add event handlers */
			/*if (navigator.appName != "Microsoft Internet Explorer") */
            theInput.addEventListener('focus', clearDefaultText, false);/*IE doesn't like it*/
            theInput.addEventListener('blur', replaceDefaultText, false);
			            /* Save the current value */
            if (theInput.value != '') {
                theInput.defaultText = theInput.value;
            }
        }
    }
	
	//look for links to disable
	/*
	jQuery(".verticalMenu ul:first").children("li").find("a").each(function(){
		alert(this.href);
		this.removeAttribute("href");
	});*/
}
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}			
			
function clearDefaultText(e) {
    var target = window.event ? window.event.srcElement : e ? e.target : null;
    if (!target) return;
    
    if (target.value == target.defaultText) {
        target.value = '';
    }
}

function replaceDefaultText(e) {
    var target = window.event ? window.event.srcElement : e ? e.target : null;
    if (!target) return;
    
    if (target.value == '' && target.defaultText) {
        target.value = target.defaultText;
    }
}