function preload(imgName,lang) {i=new Image(); i.src="/img/"+lang+"/"+imgName;}
function imgOn(imgName,lang) {eval('document.'+imgName+'.src ="/img/"+"'+lang+'/'+imgName+'"+"_on.gif"');}
function imgOff(imgName,lang) {eval('document.'+imgName+'.src ="/img/"+"'+lang+'/'+imgName+'"+".gif"');}

preload("button_amg.gif",lang);
preload("button_amg_on.gif",lang);
preload("button_dnzqf.gif",lang);
preload("button_dnzqf_on.gif",lang);
preload("button_gdg.gif",lang);
preload("button_gdg_on.gif",lang);
preload("button_lyf.gif",lang);
preload("button_lyf_on.gif",lang);
preload("button_ztf.gif",lang);
preload("button_ztf_on.gif",lang);
preload("button_ptg.gif",lang);
preload("button_ptg_on.gif",lang);

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_openBrWindow(theUrl, winName, features) {
secondWindow=window.open(theUrl, winName, features);
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function T_gobj(x){var m;if(document.getElementById){m=document.getElementById(x)}else if(document.all){m=document.all[x]}else if(document.layers){m=document[x]}return m;}
function T_gstyle(x){var m;m=T_gobj(x);if(!(document.layers)){if(m)m=m.style;}return m;}
function T_ostyle(m){if(!(document.layers)){if(m)m=m.style;}return m;}

function bover(bunka) {T_gstyle(bunka).background='#FFFF00'}
function bout(bunka) {T_gstyle(bunka).background='#EAEAEA'}

function cover(bunka) {T_gstyle(bunka).color='#FF0000'}
function cout(bunka) {T_gstyle(bunka).color='#666666'}

function liover(bunka) {T_ostyle(bunka).color='#FF0000'}
function liout(bunka) {T_ostyle(bunka).color='#666666'}

function paste(typ) {
dest=document.formular.text
if (typ=='b') dest.value += '<b></b>';
if (typ=='i') dest.value += '<i></i>';
if (typ=='p') dest.value += '<p></p>';
if (typ=='br') dest.value += '<br />';
if (typ=='email') dest.value += '<a href="mailto:@">@</a>';
if (typ=='a') dest.value += '<a href=""></a>';
if (typ=='img') dest.value += '<img src="" width="" height="" alt="" />';
dest.focus();
}

//filtry na obrazky
var isIE=(navigator.appName=='Microsoft Internet Explorer');
var isFF=(navigator.appName=='Netscape');
function oshow(obrazek) {
  //if (isIE) obrazek.filters.item(0).enabled=true;
  //if (isIE) obrazek.style.filter='alpha(opacity=50, enabled=1)';
  //if (isFF) obrazek.style.MozOpacity=0.5;
}
function ohide(obrazek){
  //if (isIE) obrazek.filters.item(0).enabled=false;
  //if (isIE) obrazek.style.filter='alpha(enabled=0)';
  //if (isFF) obrazek.style.MozOpacity=1;
}

function oWin(pFileName, i_width, i_height, pTitle, pClose) {
  var swidth=screen.width, sheight=screen.height;
  var min_x=100, min_y=100, max_x=swidth-10, max_y=sheight-190;
  var owidth=i_width>max_x?max_x:i_width<min_x?min_x:i_width, oheight=i_height>max_y?max_y:i_height<min_y?min_y:i_height;
  if ((owidth!=i_width) || (oheight!=i_height))
    photoWin = window.open( "", "", "width="+(owidth+50)+",height="+(oheight+86)+",menubar,scrollbars,resizable,screenX=20,screenY=40,left=20,top=40");
  else
    photoWin = window.open( "", "", "width="+(owidth+50)+",height="+(oheight+86)+",screenX=20,screenY=40,left=20,top=40");
  photoWin.document.write('<html><head><title>' + pTitle + '</title>');
  photoWin.document.write('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">');
  photoWin.document.write('<style type="text/css">a.window:hover {color: #FF0000;}</style>');
  photoWin.document.write('</head>');
  photoWin.document.write('<body bgcolor="#ffffff" text="#333333" link="#333333" vlink="#333333" alink="#FF0000" style="font-family: Arial, Helvetica, sans-serif;">');
  photoWin.document.write('<div align="center"><b>' + pTitle + '</b><br />');
  photoWin.document.write('<a class="window" href="javascript:self.close()">');
  photoWin.document.write('<img style="border-color: #D8D8D8 #D8D8D8 #D8D8D8 #D8D8D8;" src="' + pFileName + '" width="' + i_width + '" height="' + i_height + '" border="1" alt="' + pClose + '" /><br />');
  photoWin.document.write('<small>' + pClose + '</small></a><br /></div>');
  photoWin.document.write('</body></html>');
  photoWin.document.close();
  photoWin.focus();
}

