function hideimage(imgid){
    document.getElementById('image'+imgid).innerHTML = "";
    document.getElementById('imagesmall'+imgid).style.display = "block";
    return false;
}


function showimage(imgid){
    var req = null;
    try{
        req = new XMLHttpRequest();
    }
    catch (ms){
        try{
            req = new ActiveXObject("Msxml2.XMLHTTP");
        } 
        catch (nonms){
            try{
                req = new ActiveXObject("Microsoft.XMLHTTP");
            } 
            catch (failed){
                req = null;
            }
        }  
    }

    if (req == null) alert("Error creating request object!");

    req.open("GET", 'index.php?id=3&do=showimage&iid='+imgid, true);

    req.onreadystatechange = function(){            
        switch(req.readyState) {
                case 4:
                if(req.status!=200) {
                    if (req.status == 500) alert("Bitte warten, Bild wird gesucht ...");
                    else alert("Fehler:"+req.status); 
                }else{    
                    document.getElementById('image'+imgid).innerHTML = req.responseText;
		    document.getElementById('image'+imgid).focus();
                    document.getElementById('imagesmall'+imgid).style.display = "none";
                }
                break;
                default:
                    return false;
                break;     
            }
        };
    req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    req.send(null);
}

