function pmLink(dr,fl,ph,str) {
    if (str=="") {
        document.getElementById("alaosastot").innerHTML="";
        return;
    }
    if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }
    else {// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4 && xmlhttp.status==200) {
            document.getElementById("alaosastot").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET",dr+"/"+fl+".php?"+ph+"="+str,true); 
    xmlhttp.send();
}

function pmSmall(dr,fl,ph,pt,str,str2) {
    if (str=="") {
        document.getElementById("alimmatosastot").innerHTML="";
        return;
    }
    if (window.XMLHttpRequest) {
        xmlhttp=new XMLHttpRequest();
    }
    else {
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4 && xmlhttp.status==200) {
            document.getElementById("alimmatosastot").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET",dr+"/"+fl+".php?"+ph+"="+str+"&"+pt+"="+str2,true);
    xmlhttp.send();
}
function linkinMuutos(pmid,lomake,nimi,esc) {
   var str;
   var string;
   if(nimi == 'muutaUrl'){
   string = 'Kirjoita uusi url-osoite: <input type="text" name="uUrl" size="35"/> (Peru:Paina Esc)';   
   }
    if(nimi == 'muutaOtsikko'){
    string = 'Kirjoita uusi otsikko: <input type="text" name="uTitle" size="35"/> (Peru:Paina Esc)';
   }
    if(nimi == 'muutaKuvaus'){
    string = 'Kirjoita uusi kuvaus: <textarea name="uKuvaus" cols="75" rows="4"></textarea><br/> (Peru:Paina Esc)';
   }
   
    if(nimi == 'muutaHakusanat'){
      string = 'Kirjoita hakusanat: <input type="text" name="uKeywords" size="35"/> (Peru:Paina Esc)';
   }
   
   if(esc !=''){
     string = "";
     document.getElementById(esc).checked=false;
   }
   if (str=="") {
        document.getElementById(pmid).innerHTML="";
        return;
   }

     document.getElementById(pmid).innerHTML= string;  
}
