// JavaScript Document
function ShowDescr (Desc){
if (Desc.className == "Desc_off")
Desc.className = "Desc-on";
else Desc.className = "Desc_off"}
function CloseDescr (Desc){
Desc.className = "Desc_off"}

   var FontSize = 9;
   var Incr = 1;
   function ChangeSize (){
          Caption_3.style.fontSize = FontSize;
          FontSize += Incr;
          if ((FontSize > 13) || (FontSize < 9))
            Incr = -Incr;
          setTimeout('ChangeSize()',200);
   }
   
 var SpaceSize = 0;
   var Increment = 1;
   function ChangeSpacing (){
         Caption_2.style.letterSpacing = SpaceSize;
          SpaceSize+=Increment;
          if ((SpaceSize > 1) || (SpaceSize < -2))
            Increment = -Increment;
          setTimeout('ChangeSpacing()',200);
  }

      var MinVal = 1;
      var MaxVal = 4;
      var Delay = 200;
      var FColor = "#ffff33";
      var Inc = 1;
      var Val = 10;
	  function ChangeFilter(){
        if (!document.all) return;
        if (Inc > 0){
          if (Val < MaxVal) Val += Inc;
          else Inc = -Inc;
        } else {
          if (Val > MinVal) Val += Inc;
          else Inc = -Inc;
        }
        Caption_1.style.filter = "Glow(Color=" +
          FColor + ", Strength=" + Val + ")";
       	Timeout = setTimeout('ChangeFilter()',Delay);
      }

  function ShowFoto (Img, W, H){
	            var NewWin = window.open("", "Fotografie",
          "toolbar=no,location=no,width="+W+",height="+H+
          ",directories=no,status=no,menubar=no,"+
          "resizable=no,scrollbars=yes"+
          ",left=350,top=30");
			
               with (NewWin.document){
          write("<HTML><HEAD><TITLE>Kliknutím zatvor"+
                "</TITLE></HEAD>");
          write('<BODY BgColor="black" Text="white"'+
                ' TopMargin="0" LeftMargin="0">');
          write('<A Href="javascript:close();"><IMG Src="'+Img+
                '" HSpace="'+1+'" VSpace="'+1+'" Border="0"></A>');
          write("</BODY></HTML>");
          close();
        }
      }
 
 function change(o,source) {
	o.src=source;
}

NewWindow=null;
function ShowItem(src, w, h, title){
	if(NewWindow){NewWindow.close();}
	if(NewWindow==null || NewWindow.closed){
	 settings=
	 "left=10,"
	 +"top=10,"
	 +"width=" + w + ","
	 +"height=" + h + ","
	 +"toolbar=no,"
	 +"location=no,"
	 +"directories=no,"
	 +"status=no,"
	 +"menubar=no,"
	 +"scrollbars=no,"
	 +"resizable=no"
	 NewWindow = window.open("",'Klose',settings);
	}
	NewWindow.document.open();
	NewWindow.document.clear();
	NewWindow.document.write(
	"<html><head><title>"+ title +"</title></head>\n"
	+"<body topmargin=0 leftmargin=0 onclick=window.close(); onblur=\"window.close();\" bgcolor=#FFFFFF>\n"
	+"<table width=\"100%\" height=\"100%\"><tr><td align=\"center\" valign=\"middle\"><img src=" + src + " border=0></td></tr></table>\n"
	+"</body>\n"
	+"</html>"
	);
	NewWindow.document.close();
	NewWindow.focus();
}

NewWindow2=null;
function ShowWin(adreska, w, h) {
	if(NewWindow2){NewWindow2.close();}
	if(NewWindow2==null || NewWindow2.closed){
	 settings=
	 "left=10,"
	 +"top=0,"
	 +"width=" + w + ","
	 +"height=" + h + ","
	 +"toolbar=no,"
	 +"location=no,"
	 +"directories=no,"
	 +"status=no,"
	 +"menubar=no,"
	 +"scrollbars=yes,"
	 +"resizable=no"
	 NewWindow2 = window.open(adreska,'okno',settings);
	}

    NewWindow2.focus();
}

function openWindowPICTURE(pic)
{
     window.open(pic, "img", 'toolbar=0, location=0, scrollbars=0, resizable=yes, width=300, height=300');
}

/* overeni vyplneni formulara */
//varianta 1
 	function isFilled(field){
	   	var filled = false;
  		for(i=0;i<field.length;i++){
	  	    if ((field[i].type == 'checkbox')||(field[i].type == 'radio')){
   			  if (field[i].checked) filled = true
	   		}else{
		  	  if (field[i].value!="") filled=true
		  	}
          }
	  	return (filled);
  	}
	function isEmail(field) {
	    for (i=0;i<field.length;i++){
		     if (!((field[0].value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)||(field[0].value==""))){
		        return (i);
		        break;
		     }
		}
		return true;
	}
  function CheckForm(form) { var field, i;	req = new Array(2);
		  emails = new Array(1);
		  req[0]="meno";		  
		  req[1]="email";
		  emails[0]="email";
		  req[2]="text";		  
	    for (i=0;i<3;i++){
		    field = document.getElementsByName(req[i]);
       if (!isFilled(field)){
          var name = field[0].title=="" ? field[0].name : field[0].title;
		       alert("Poličko '"+name+"' požadované!");
		       field[0].focus();
		       return false;
 		     break;
		    }
     }
	    for (i=0;i<1;i++){
		    email = document.getElementsByName(emails[i]);
	   	  if (!isEmail(email)){
		       alert("'"+email[isEmail(email)].value+"' nie je platná emailová adresa!");
		       email[isEmail(email)].focus();
		       return false;
		       break;
		    }
     }
return true; }

//varianta 2
/*
function checkit (theForm) {
if (theForm.meno.value == "")
  {
    alert("Prosím vyplňte políčko:\"Meno a Priezvisko\".");
    theForm.meno.focus();
    return (false);
  }
if (theForm.email.value == "")
 {
    alert("Prosím vyplňte políčko: \"E-mail\".");
    theForm.email.focus();
    return (false);
 }
if (theForm.text.value == "")
 {
    alert("Prosím vyplňte políčko: \"dotaz/správa\".");
    theForm.telefon.focus();
    return (false);
 }

return (true);
}	
*/
function newWindow(mypage,myname,w,h,features) {
  if(screen.width){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  }else{winl = 0;wint =0;}
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}
