function openWindow(theURL,winName,features) { 
    child = window.open(theURL,winName,features);
	child.focus();
}

function init(){
    if (!document.getElementsByTagName) return false;
    if (!document.getElementById) return false;
    
	var searchInput = document.getElementById("searchText");
	searchInput.onfocus = function(){
		this.value = '';
		this.onfocus = null;
	}
	
    //popup links
    var links = document.getElementsByTagName("a");
    for(var i=0; i < links.length; i++){
        if(links[i].className.indexOf("imageEnlarge") >= 0){
        	initPopupLink(links[i], "height=660,width=660,resizable,scrollbars=yes");
        }
    }
}

function initPopupLink(link, f){
    var features = f;
    link.onclick = function(){
        openWindow(this.href, "newWindow", features);
        return false;  
    }     
}

window.onload=init;