

// Equal Height

function fixH(one,two) {
    if (document.getElementById(one)) {
    var lh=document.getElementById(one).offsetHeight;
    var rh=document.getElementById(two).offsetHeight;
    var nh = Math.max(lh, rh);
    document.getElementById(one).style.height=nh+"px";
    document.getElementById(two).style.height=nh+"px";
    }
}


// Adjust width of the Buttonlinks

function adjust_buttonlink (id) {
    var content = document.getElementById(id);   
    if (!content) return;
    
    var button = document.getElementById('box_' + id);
    if (!button) return;
    
    var pixel = 20;
  
    /* If the element is currently invisible, we have to make the
     * element that has the display css property set to "none"
     * visible for a short time, so that we can calculate the clientWidth.
     */
    var parent = content.parentNode;
    while (parent) {        
    	if (parent.style && parent.style.display) {
		if ('none' == parent.style.display) {
			parent_elem = parent;
			parent.style.display = 'block';
		} else {
			parent = null;
		}
		break;
	}
	parent = parent.parentNode;
    }

    var width = content.offsetWidth + pixel;
    if (parent) {
        parent.style.display = 'none';
    }
       
    button.style.width = width + 'px';

}

// Switch linguas

function switch_lingua (lingua, filename, de, en) {
    //check for existing linguas and generate filename
    if (filename == '/cgi-bin/fts_search.pl')
        filename = '/index.html.' + lingua; 
    else if ((lingua == "de" && de) || (lingua == "en" && en)) 
        filename = filename + "." + lingua;
    else 
        filename = "/index.html."+lingua;
    window.location.href = filename;
}






