var tee='/';

function valistiil(title) {
    var i, a, main;
          for(i=0; (a = document.getElementsByTagName("link")[i]); i++) 
          {
           if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) 
           {
                  a.disabled= true;
           if(a.getAttribute("title") == title)
          a.disabled = false;
         }
        }
}

function avaaken(mis)
{
var win=window.open(mis,'vaata','top=0,left=0,height=350,width=350,scrollbars=yes, resizable=yes, status=1, dependent=1');
win.focus();
}           

function avawindow(koht,nimi,servast,laius,pikkus)
{
// win.window.close();
var winl = (screen.width*servast)/100;
var wint = (screen.height-650);
winprops = 'height='+pikkus+',width='+laius+',top='+wint+',left='+winl+',dependent=1,scrollbars=yes,resizable';

win = window.open(koht, nimi, winprops);
win.window.focus(); 
// alert (win.name.value);
}

function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}

function leiaidx(millest , mida)
{
 mida=','+mida+',';
 abi=millest.slice(0,millest.indexOf(mida));
 var lahti = new Array();
 lahti =abi.split(',');
 return lahti.length;
}

