function popUpImage(id, width, height, title){
    var content = "<html><head><title>" + title + "</title><style type=\"text/css\">body{margin: 0; padding: 0;}</style></head><body><img style=\"cursor: pointer\" onclick=\"window.close()\" src=\"image.do?id=" + id + "\" width=\"" + width + "\" height=\"" + height + "\" border=\"0\"></body></html>";
    var popupimage = window.open("", "popupimage", "width=" + width + ",height=" + height + ",status=no,resizable=yes,scrollbars=0,top=200,left=400");
    popupimage.focus();
    popupimage.opener = self;
    var popupDoc = popupimage.document;
    popupDoc.innerHTML = "";
    popupDoc.write (content);
    popupimage.resizeTo(width,height+2);
    var pWidth = popupDoc.documentElement.offsetWidth;
    var pHeight = popupDoc.documentElement.offsetHeight;
    popupDoc.close();
    if ( width > pWidth || height > pHeight ){
	popupimage.resizeTo(2*width-pWidth+4,2*height-pHeight+5);
    }
}

function clearSearchBox(el){
	if(el.oldValue){
		if(el.value == el.oldValue){
			el.value = "";
		}
	} else {
		el.oldValue = el.value;
		el.value = "";
		el.onblur = function(){
			if(this.value == "" && this.oldValue){
				this.value = this.oldValue;
			}
		}		
	}
}

function validateSearch(form) {
	return form.query.value != "" && form.query.value != form.query.oldValue;
}