/*<![CDATA[*/

var ff = (navigator.userAgent.indexOf("Gecko") > -1) ? true : false;
var ie = (navigator.userAgent.indexOf("MSIE") > -1) ? true : false;


function OpenPopup(Home,SizeX,SizeY)
 {
   PosX = (screen.width/2)-(SizeX/2);
   PosY = (screen.height/2)-(SizeY/2);
   Params = "height="+SizeY+",width="+SizeX+",resizable=no,scrollbars=no,left="+PosX+",top="+PosY;

   MyFocus = window.open(Home,"Popup",Params);
   MyFocus.focus();
 }


function OpenGallery(id)
 {
   OpenPopup("/galerie_show.php?show="+id,620,470)
 }


function InsertMail(owner,domain,subject,showed)
 {
   if(subject) subject="?subject="+subject; else subject="";

   var at = "@";
   document.write("<a href='mailto:"+owner+at+domain+subject+"'>"+showed+"</a>"); 
 }




function FadingText(fcontent)
 {
   var delay = 10000;
   var index = 0;

   frame = 25;
   hex = 0x1F1F47;  // Initial color value, barva podkladu

   fnc_cf = function ColorFade()
    {	         	
      if(frame>0)
        {
         	hex += 12;
          document.getElementById("fadingtext").style.color = "rgb("+hex+","+hex+","+hex+")";
          frame--;
          setTimeout("this.fnc_cf()",20);	
        }
      else
       {
         document.getElementById("fadingtext").style.color = "rgb(255,255,255)";
         frame = 25;
         hex = 0;
       }
    }

   fnc_cc = function ChangeContent()
    {
      if(index >= fcontent.length)
      index = 0;

      document.getElementById("fadingtext").style.color = "rgb(255,255,255)";
      document.getElementById("fadingtext").innerHTML = fcontent[index];
      fnc_cf();

      index++;
      setTimeout("this.fnc_cc()",delay);
    }

   fnc_cc();
 }



function init()
 {
   if(self.location!=top.location) { top.location=self.location; }
 }







              NS4 = (document.layers) ? 1 : 0;
              IE4 = (document.all) ? 1 : 0;

              function siteToFavorites()
               {
	title = document.title; 
	url = document.URL;
	
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title,url,"");
	} else if (window.external) { // IE Favorite
		window.external.AddFavorite(url,title);
	} else if(window.opera && window.print) { // Opera Hotlist
		return true;
	}


                 //if (IE4 && !NS4)
		             //  window.external.AddFavorite("http://milanc.chvalsiny.net/","MilanC Development");
	               //else
		             //  alert('Tato služba vyžaduje alespoň Internet Explorer 5.0');
               }

              function siteAsHomepage()
               {
                 if (IE4 && !NS4)
	                {
	                  document.body.style.behavior='url(#default#homepage)';
                    document.body.setHomePage('http://milanc.chvalsiny.net');
                  }
                 else
                   window.alert('Tato služba vyžaduje alespoň Internet Explorer 5.0');
               }
/*]]>*/
