/*
$ID: fs.js
14:04 12.11.2006
*/

function goToUrl(goToLocation) {
    eval("document.location.href = '" + goToLocation + "'");
}


function ShowInf(name)
{
	tab = document.getElementById(name);

	if (tab.style.display == 'none')
		tab.style.display = "";
	else
		tab.style.display = "none";
}

function KinnitaValikCB(message, el, onCheck, onUncheck) {
  if(arguments.length > 0) {
    var message = arguments[0];
  } else {
    return;
  }

  if((el.checked == true && onCheck == true) || (el.checked == false && onUncheck == true)) {
    if(window.confirm(message)) {
      el.checked=true
    } else {
      el.checked=false;
    }
  }
}



function taust(asi1, col1) {
  asi1.bgColor = col1;
}

function m2rgik6ikread() {  for (var i=0;i<lookataloog.elements.length;i++) {    var e=lookataloog.elements[i];
  	if ((e.name != 'allbox') && (e.type=='checkbox')) {  	  if (lookataloog.allbox.checked) {  	  	e.checked=true;  	  }
  	  else {  	  	e.checked=false;
  	  }
    }
  }
}



function m2rgirida(name) {
  if (lookataloog.name.checked) {
    lookataloog.name.checked=true;
  }
  else {
    lookataloog.name.checked=false;
  }
}

function Opener(e, url, width, height, scroll)	{

	var x=y=0;
    y = e.clientY;
	x = e.clientX;

	var sc_X = sc_Y = 0;

	scX = screen.Width;
	scY = screen.Height;

	var OS_top = 0;
	OS_top = Number(height) + Number(y) + 40;

	var OS_right = 0;
	OS_right = Number(width) + Number(x) + 40;


	if(OS_top > scY) {

		new_y = Number(scY) - Number(height);
		y = new_y - 70;
	}

	if(OS_right > scX) {

		new_x = Number(scX) - Number(width);
		x = new_x - 70;
	}

	newwin=window.open(url, "", "left=" + x + ", top=" + y + ", toolbar=no,menubar=no,location=no,scrollbars=" + scroll + ",resize=no,width=" + width + ",height=" + height);

}

PositionX = 100;
PositionY = 100;
defaultWidth  = 620;
defaultHeight = 1040;
var AutoClose = true;
var closeTime =10000;
var closeCode = ";setTimeout('self.close()',"+closeTime+")";
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=600,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Laen pilti...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width-20);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');
writeln('window.innerWidth=document.images["George"].width+200;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()'+closeCode+'">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()'+closeCode+'" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();
}}

