   var tekstiaken;
   var h;
   var nim0;
   var nim1;
   var nimi;
   var j;
function ResizeNN(){
   nim0=self.location.href+'?';
   nim0 = nim0.substring(0,nim0.indexOf('?'));
   nim1=parent.abitekst.location.href+'?';
   nim1 = nim1.substring(0,nim1.indexOf('?'));
//   curpos=self.pageYOffset;
   curpos=0;
   parent.location.replace('index_sif_1.html?' + escape(nim1)  + '&' + escape(nim0) + '&' + curpos + '&0');
   return;
}
function loadleftbar(){
   var stat = 0;
   if (!(top.riba0.pilt) || !(top.riba0.pilt.document)){
		if (top.riba0){
		  top.riba0.location.replace('index_rif.html');
		  stat = 1;
		}
   }
   else {
	  stat = 1;
   }
   return stat;
}
function resize1() {
	loadleftbar();
	/*alert(parent.document.body.rows);*/
	/*alert(" abitekst: "+parent.abitekst.location.href);*/
	if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(22,23)>=4){
		h=parent.abitekst.document.body.clientHeight;
		if (h<50){
			parent.document.body.rows='70%,*';
		}
	}
	else if (window.navigator.userAgent.toLowerCase().indexOf('netscape') != -1) {
		if (parent.abitekst.innerHeight) {
			h=parent.abitekst.innerHeight;
		}
		if (h<50){
			timeout=window.setTimeout("ResizeNN();", 0050);
		}
		MM_reloadPage(true);
	}
	else {
		if (parent.abitekst.innerHeight) {
			h=parent.abitekst.innerHeight;
		}
		if (h<50){
			parent.document.body.rows='70%,*';
		}
	}
	return;
}

function pilt(nim,x,y) {
   nimi = nim;
   if (loadleftbar()){
	   if ((top.riba0.pilt)&&(top.riba0.pilt.document)&&(top.riba0.pilt.document.kaas)) {
	     top.riba0.pilt.document.kaas.src = nimi;
      } else {
           j=0;
           timeout=window.setTimeout("laepilt();", 00050);
       }
    }
	return;
}
function laepilt() {
	if ((top.riba0.pilt)&&(top.riba0.pilt.document)&&(top.riba0.pilt.document.kaas)) {
		 top.riba0.pilt.document.kaas.src = nimi;
	} else {
		 if (j<10) {
		   j++;
		   timeout=window.setTimeout("laepilt();", 0050);
		 }
	}
	return;
}
function mark(nim) {
	if (screen.width==640&&screen.height==480){
	xxx = "menubar=0,status=0,location=0,toolbar=0,resizable=yes,scrollbars=1,width=500,height=120,left=114,top=268";
	}
	if (screen.width==800&&screen.height==600){
	xxx = "menubar=0,status=0,location=0,toolbar=0,resizable=yes,scrollbars=1,width=500,height=130,left=0,top=142";
	}
	if (screen.width>=1024&&screen.height>=768){
	xxx = "menubar=no,status=no,location=no,toolbar=no,resizable=yes,scrollbars=yes,width=600,height=180,left=0,top=160";
	}
	tekstiaken=window.open(nim, '3',xxx);
	window.blur();
}
var asend=0;
function keri(){
  if (location.search){
  	asend = eval(unescape(location.search.substring(1)));
  	scroll(0,asend);
  	return;
  }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized 
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { 
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} 
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); 
} 
/*MM_reloadPage(true);*/

