function aken(url) {
window.open(url,'sisesta andmed','toolbar=no,directories=no,status=no,location=no,resizable=yes,scrollbars=yes,menubar=no,width=400,height=250');
}

function openWin(winName, winURL){
	win = window.open("",winName);
	win.location.href=winURL;
}

function disp_text(){
   var w = document.ab.ablist.selectedIndex;
   var selected_text = document.ab.ablist.options[w].text;
   alert(selected_text);
}


function asukoht2(targ,id,selObj,restore){ //v3.0
	eval(targ+".location='kys_m.php?id="+id+"&valdkond="+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}


function jsvalminud(targ, id, b, c, selObj, restore){ //v3.0
eval(targ+".location='kys3_m.php?id="+id+"&a="+selObj.options[selObj.selectedIndex].value+"&b="+b+"&c="+c+"'");
	if (restore) selObj.selectedIndex=0;
}

function jsteoksil(targ, id, a, c, selObj, restore){ //v3.0
eval(targ+".location='kys3_m.php?id="+id+"&a="+a+"&b="+selObj.options[selObj.selectedIndex].value+"&c="+c+"'");
	if (restore) selObj.selectedIndex=0;
}

function jsplaanis(targ, id, a, b, selObj, restore){ //v3.0
eval(targ+".location='kys3_m.php?id="+id+"&a="+a+"&b="+b+"&c="+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

function liik(targ, order, liik, limit){ //v3.0
eval(targ+".location='allikas.php?do=allikad&order="+order+"&limit=0&liik="+document.myForm.liik.options[selectedIndex].value+"'");
	if (restore) liik.selectedIndex=0;
}

function populate(){
var keeled=new Array("aa Afar","ab Abkhazian","af Afrikaans","ar Arabic","az Azerbaijani","ba Bashkir","be Byelorussian","bg Bulgarian","bn Bengali","bo Tibetan",
"br Breton","ca Catalan","cs Czech","cy Welsh","da Danish","de German","el Greek","en English","eo Esperanto","es Spanish","et Estonian",
"eu Basque","fa Persian","fi Finnish","fr French","fy Frisian","ga Irish","he Hebrew","hi Hindi","hr Croatian","hu Hungarian","hy Armenian",
"is Icelandic","it Italian","ja Japanese","ka Georgian","kk Kazakh","ko Korean","ku Kurdish","ky Kirghiz","la Latin","lt Lithuanian",
"lv Latvian","mn Mongolian","mo Moldavian","my Burmese","ne Nepali","nl Dutch","no Norwegian","pl Polish","ps Pushto","pt Portuguese",
"ro Romanian","ru Russian","sa Sanskrit","sh Serbo-Croatian","sk Slovak","sl Slovenian","sq Albanian","sr Serbian","sv Swedish","sw Swahili",
"ta Tamil","tg Tajik","th Thai","tk Turkmen","tr Turkish","tt Tatar","uk Ukrainian","ur Urdu","uz Uzbek","vi Vietnamese","yi Yiddish",
"zh Chinese","zu Zulu","");
var koodid=new Array("aa","ab","af","ar","az","ba","be","bg",
"bn","bo","br","ca","cs","cy","da","de","el","en","eo","es","et","eu","fa","fi","fr",
"fy","ga","he","hi","hr","hu","hy","is","it","ja","ka","kk","ko","ku","ky","la","lt","lv","mn","mo","my","ne","nl","no","pl","ps",
"pt","ro","ru","sa","sh","sk","sl","sq","sr","sv","sw","ta","tg","th","tk","tr","tt","uk","ur","uz","vi","yi","zh","zu","");

var vali=document.forms.myForm.selgituste_olem;
val=vali.value;
if (val=="Ei"){
document.getElementById("seletused_1").style.visibility="hidden";
document.getElementById("seletused_2").style.visibility="hidden";
document.getElementById("seletused_3").style.visibility="hidden";
}else{
document.getElementById("seletused_1").style.visibility="visible";
document.getElementById("seletused_2").style.visibility="visible";
document.getElementById("seletused_3").style.visibility="visible";
}
var regi=document.forms.myForm.registrite_olem;
var reg=regi[regi.selectedIndex].value;
if (reg=="Ei"){
document.getElementById("registrid_1").style.visibility="hidden";
document.getElementById("registrid_2").style.visibility="hidden";
document.getElementById("registrid_3").style.visibility="hidden";
document.getElementById("registrid_4").style.visibility="hidden";
document.getElementById("registrid_5").style.visibility="hidden";
document.getElementById("registrid_6").style.visibility="hidden";
}else{
document.getElementById("registrid_1").style.visibility="visible";
document.getElementById("registrid_2").style.visibility="visible";
document.getElementById("registrid_3").style.visibility="visible";
document.getElementById("registrid_4").style.visibility="visible";
document.getElementById("registrid_5").style.visibility="visible";
document.getElementById("registrid_6").style.visibility="visible";
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById("dok_keeled_1").appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById("dok_keeled_2").appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById('dok_keeled_3').appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById('dok_keeled_4').appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById('dok_keeled_5').appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById('dok_keeled_6').appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}

for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById('marksonad_1').appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}

for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById('marksonad_2').appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}

for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById('marksonad_3').appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}

for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById('marksonad_4').appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById('marksonad_5').appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById('marksonad_6').appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}

for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById('vasted_1').appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById('vasted_2').appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById('vasted_3').appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById('vasted_4').appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById('vasted_5').appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById("vasted_6").appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById("seletused_1").appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}

for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById("seletused_2").appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}

for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById("seletused_3").appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById("registrid_1").appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}

for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById("registrid_2").appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById("registrid_3").appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById("registrid_4").appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}

for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById("registrid_5").appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}
for (i=0;i<keeled.length;i++){
  myOption=document.createElement('option');
  myOption.setAttribute('value',koodid[i]);
  document.getElementById("registrid_6").appendChild(myOption);
  theText=document.createTextNode(keeled[i]);
  myOption.appendChild(theText);
}

}
function showSel(){
var vali=document.forms.myForm.selgituste_olem;
var val=vali[vali.selectedIndex].value;

if (val=="Ei"){
document.getElementById("seletused_1").style.visibility="hidden";
document.getElementById("seletused_2").style.visibility="hidden";
document.getElementById("seletused_3").style.visibility="hidden";
}else{
document.getElementById("seletused_1").style.visibility="visible";
document.getElementById("seletused_2").style.visibility="visible";
document.getElementById("seletused_3").style.visibility="visible";
}
}

function showReg(){
var regi=document.forms.myForm.registrite_olem;
var reg=regi[regi.selectedIndex].value;
if (reg=="Ei"){
document.getElementById("registrid_1").style.visibility="hidden";
document.getElementById("registrid_2").style.visibility="hidden";
document.getElementById("registrid_3").style.visibility="hidden";
document.getElementById("registrid_4").style.visibility="hidden";
document.getElementById("registrid_5").style.visibility="hidden";
document.getElementById("registrid_6").style.visibility="hidden";
}else{
document.getElementById("registrid_1").style.visibility="visible";
document.getElementById("registrid_2").style.visibility="visible";
document.getElementById("registrid_3").style.visibility="visible";
document.getElementById("registrid_4").style.visibility="visible";
document.getElementById("registrid_5").style.visibility="visible";
document.getElementById("registrid_6").style.visibility="visible";
}
}

