function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function toggleSearchValue() {
	
    if (! document.getElementById) return;
    if (! document.getElementById('term')) return;
    var terminput = document.getElementById('term');
    terminput.onclick= function() {
	                        this.value='';
                       }
    terminput.onblur = function() {
	                        if(this.value=='') {
                                this.value='Search...';
                            }
                       }                       
}

/* print */
function printPage() { 
    if (!document.getElementsByTagName) return; 
    var anchors = document.getElementsByTagName("a"); 
    for (var i=0; i<anchors.length; i++) { 
        var anchor = anchors[i]; 
        if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "print") {
        anchor.onclick = function() {
                                    window.print();
                                    return false;
                                    }
        } 
    } 
}

function levelHeights(){
		
	if (! document.getElementById) return;
    if (! document.getElementById('extra')) return;
    if (! document.getElementById('content')) return;

	var extra = document.getElementById('extra');
	var content = document.getElementById('content');
	
	//alert(content.getHeight());
	
	if(extra.offsetHeight > content.offsetHeight){
		content.style.height = extra.offsetHeight + 'px';
	}else{
		extra.style.height = content.offsetHeight + 'px';
	}
		
}
	
addLoadEvent(levelHeights);
/* -- call all my functins -- */

addLoadEvent(toggleSearchValue);