var nodex=null;
function writeFlash(path,height,width){
document.write('<object type="application/x-shockwave-flash"  data="'+path+'" height="'+height+'" width="'+width+'" >'+
              '<param name="autoStart" value="-1" />'+
              '<param name="movie" value="'+path+'" />' +
              '<param name="play" value="true" />' +
              '<param name="loop" value="true" />' +
              '<param name="quality" value="high" />' +
              '<param name="scale" value="noborder" />' +
              '<param name="devicefont" value="true" />' +
              '<param name="bgcolor" value="#FFFFFF" />' +
              '</object>');}

function writeFlashh(path){
document.write('<object type="application/x-shockwave-flash"  data="'+path+'" height="398" width="580" >'+
              '<param name="autoStart" value="-1" />'+
              '<param name="movie" value="'+path+'" />' +
              '<param name="play" value="true" />' +
              '<param name="loop" value="true" />' +
              '<param name="quality" value="high" />' +
              '<param name="scale" value="noborder" />' +
              '<param name="devicefont" value="true" />' +
              '<param name="bgcolor" value="#FFFFFF" />' +
              '</object>');}
// JavaScript Document
function external() {
 if (document.getElementsByTagName) {
  var i, a;
  a = document.getElementsByTagName('a');
  for (i in a) {
  if (a[i].rel == 'external') a[i].target = '_blank';
  }
 }
}

Browser = navigator.appName
var Micro = Browser.indexOf("Microsoft")
var Netscape=false;
var IE = false;
var nodex=null;
text="";

window.onload = function() {
if(text!="")alert(text);
external();
  Netscape = true

	if(Micro >= 0) {
		IE = true
		c=0
	}

  nodex=document.getElementById('info');
  
  nodex.style.display='block';
}

wokno=null;

function show_popup(href,name,width,height){
 
  var int_windowLeft = (screen.width - width) / 2;
  var int_windowTop = (screen.height - height) / 2;
  
try{
      wokno.close();
}catch(e){}
      
wokno=null;

//wokno=window.open("http://agrio.sk/showFoto.php?href=" + href + "", "Agrio - archív","resizable=no;scrollbars=yes;titlebar=no;status=no;toolbar=no,menubar=no,height="+height+",width="+width+",top="+int_windowTop+",left="+int_windowLeft+"");
wokno=window.open( 'http://www.mpl.sk/showFoto.php?href='+href, 'obrazok', 'top='+int_windowTop+', left='+int_windowLeft+', width='+width+',height='+height+',resizable=yes,scrollbars=1')
}

function printWindow(){
  var int_windowLeft = (screen.width - 600) / 2;
  var int_windowTop = (screen.height - 800) / 2;
  
myWindow=window.open('http://www.mpl.sk/print.html', 'tlacit', 'top='+int_windowTop+', left='+int_windowLeft+', width=600,height=800,resizable=yes,scrollbars=1')
} 

function XYpos(e) {
xPos="1"
yPos="1";

	if (IE == true) {
		xPos = event.clientX+getScrollX();
		yPos = event.clientY+ getScrollY();
	}
	
	if (Netscape == true) {
	
		xPos = e.clientX + getScrollX();
		yPos = e.clientY + getScrollY();
		
	}
  
  nodex=document.getElementById('info');
  if(nodex){
    nodex.style.left=xPos+2+'px';
    nodex.style.top=yPos+2+'px';
  }
}

function getScrollY() {
        var scrollY = 0;
        if( document.documentElement && document.documentElement.scrollTop ) {
            scrollY = document.documentElement.scrollTop;
        }
        else if( document.body && document.body.scrollTop ) {
            scrollY = document.body.scrollTop;
        }
        else if( window.pageYOffset ) {
            scrollY = window.pageYOffset;
        }
        else if( window.scrollY ) {
            scrollY = window.scrollY;
        }
        return scrollY;
    }

function getScrollX() {
        var scrollX = 0;
        if( document.documentElement && document.documentElement.scrollLeft ) {
            scrollX = document.documentElement.scrollLeft;
        }
        else if( document.body && document.body.scrollLeft ) {
            scrollX = document.body.scrollLeft;
        }
        else if( window.pageXOffset ) {
            scrollX = window.pageXOffset;
        }
        else if( window.scrollX ) {
            scrollX = window.scrollX;
        }
        return scrollX;
    }

function showInfo(text){


nodex=document.getElementById('info');
//alert(nodex.className);
nodex.className='infos';
nodex.innerHTML=text;

}
function hideInfo(){
nodex=document.getElementById('info');
nodex.className='infoh';


}

