// LEFT MENU
function Tlacitko (zapnuty, vypnuty, sirka, vyska) 
  { this.zapniObr     = new Image (sirka, vyska);
    this.zapniObr.src = zapnuty;
    this.vypniObr     = new Image (sirka, vyska);
    this.vypniObr.src = vypnuty; }

function Zmena (zapnuto, obrazek) 
  { if ( zapnuto )
      this.document[obrazek].src = Tlacitko[obrazek].zapniObr.src;
    else
      this.document[obrazek].src = Tlacitko[obrazek].vypniObr.src; }

Tlacitko["projekty"] = new Tlacitko ( "images/left-projekty-.gif", "images/left-projekty.gif", 175, 27 );
Tlacitko["inzenyring"] = new Tlacitko ( "images/left-inzenyring-.gif", "images/left-inzenyring.gif", 175, 27 );
Tlacitko["instalace"] = new Tlacitko ( "images/left-instalace-.gif", "images/left-instalace.gif", 175, 27 );
Tlacitko["dodavky"] = new Tlacitko ( "images/left-dodavky-.gif", "images/left-dodavky.gif", 175, 27 );

Tlacitko["projekty-en"] = new Tlacitko ( "images/left-projekty-en-.gif", "images/left-projekty-en.gif", 175, 27 );
Tlacitko["inzenyring-en"] = new Tlacitko ( "images/left-inzenyring-en-.gif", "images/left-inzenyring-en.gif", 175, 27 );
Tlacitko["instalace-en"] = new Tlacitko ( "images/left-instalace-en-.gif", "images/left-instalace-en.gif", 175, 27 );
Tlacitko["dodavky-en"] = new Tlacitko ( "images/left-dodavky-en-.gif", "images/left-dodavky-en.gif", 175, 27 );

// overeni kontakt formulare 
function ValidatorKontakt(theForm)
{

	  if (theForm.jmeno.value == "")
	  {
		alert("Vyplňte prosím Vaše jméno.");
		theForm.jmeno.focus();
		return (false);
	  }
	  if (theForm.kontakt.value == "")
	  {
		alert("Vyplňtě prosím kontakt na Vaši osobu.");
		theForm.kontakt.focus();
		return (false);
	  }

	  if (theForm.dotaz.value == "")
	  {
		alert("Napiště prosím dotaz, který nám chcete položit.");
		theForm.dotaz.focus();
		return (false);
	  }
}

// overeni dotazniku
function ValidatorDotaznik(theForm)
{
	  if (theForm.firma.value == "")
	  {
		alert("Vyplňte prosím název Vaší firmy.");
		theForm.firma.focus();
		return (false);
	  }

	  if (theForm.jmeno.value == "")
	  {
		alert("Vyplňte prosím Vaše jméno.");
		theForm.jmeno.focus();
		return (false);
	  }
	  if (theForm.telefon.value == "")
	  {
		alert("Vyplňtě prosím telefonní kontakt na Vaši osobu.");
		theForm.telefon.focus();
		return (false);
	  }

	  if (theForm.email.value == "")
	  {
		alert("Vyplňtě prosím Váš email.");
		theForm.email.focus();
		return (false);
	  }

     if ((theForm.email.value.indexOf("@")<1) || (theForm.email.value.indexOf(".")<1))
	  {
		alert("Vyplňtě prosím řádně Váš email.");
		theForm.email.focus();
		return (false);
	  }

	  if (theForm.kod.value == "")
	  {
		alert("Vyplňtě prosím kontrolní kód.");
		theForm.telefon.focus();
		return (false);
	  }
	  
}

function ValidatorDotaznikEnglish(theForm)
{
	  if (theForm.firma.value == "")
	  {
		alert("Please fill in Your company.");
		theForm.firma.focus();
		return (false);
	  }

	  if (theForm.jmeno.value == "")
	  {
		alert("Please fill in Your Name.");
		theForm.jmeno.focus();
		return (false);
	  }
	  if (theForm.telefon.value == "")
	  {
		alert("Please fill in Your telephone.");
		theForm.telefon.focus();
		return (false);
	  }

	  if (theForm.email.value == "")
	  {
		alert("Please fill in Your e-mail.");
		theForm.email.focus();
		return (false);
	  }

     if ((theForm.email.value.indexOf("@")<1) || (theForm.email.value.indexOf(".")<1))
	  {
		alert("Please fill in Your e-mail.");
		theForm.email.focus();
		return (false);
	  }

	  if (theForm.kod.value == "")
	  {
		alert("Plese fill in Check code.");
		theForm.telefon.focus();
		return (false);
	  }
	  
}


function obrazek(imgsrc,xx,yy){
  xxw=xx+40; yyh=yy+40;
  NewWin= new Array()
  
  if (yyh > 600) { yyh = 600; } 

  /*  
  if ((xxw <=620)&&(yyh<=460)) {wx=",width="+xxw+",height="+yyh}
  else {if (xxw<=620) {wx=",width="+xxw+",height=470"} 
  else { if (yyh<=460) {wx=",width=630,height="+yyh} 
  else {wx=",width=630,height=470"}
           }
    }
  */
 
  
  NewWin[i] = 
   window.open("","galery"+i,"scrollbars,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes,top=20,left=20,width="+xxw+",height="+yyh+"")
  NewWin[i].document.open()
  imgsrc='"'+imgsrc+'"'
    NewWin[i].document.writeln(
  "<title>Sorke s.r.o. - " +imgsrc+ " ("+xx+","+yy+")</title><body style=\"background-color: #F0F4F9; margin:15px; 0 0 0; padding:0\"><div align=center><a href='javascript: self.close()'><img src="+imgsrc+" width="+xx+" height="+yy+" border=0></a></div>")
  NewWin[i].document.close() 
  i++
}

i=0


function FixFlashInIE()
{
    // (c) David Grudl aka -dgx-
    //
    // more info: http://www.dgx.cz/knowhow/eolas-workaround/
    
    
    var objects = document.getElementsByTagName("object");
    
    for (var i=0; i<objects.length; i++)
        objects[i].outerHTML = objects[i].outerHTML;  
} 
