// JavaScript Document

function set_lang(data) {

document.cookie = "_lang =" +data;

}

window.onload = function () {

//fastmenu
var id='sideBarTab';
var x=0;
x += getLeft(id);

//alert(x);

var leftEl = document.getElementById("sideBarLeft");
leftEl.style.left = x - 200 + "px";

}


function getLeft(elemID){
var offsetTrail = document.getElementById(elemID);
var offsetLeft = 0;

while (offsetTrail){
offsetLeft += offsetTrail.offsetLeft;

offsetTrail = offsetTrail.offsetParent;
}
if (navigator.userAgent.indexOf('Mac') != -1 && typeof document.body.leftMargin != 'undefined'){
offsetLeft += document.body.leftMargin;

}
return offsetLeft;
}


function getTop(elemID){
var offsetTrail = document.getElementById(elemID);

var offsetTop = 0;
while (offsetTrail){

offsetTop += offsetTrail.offsetTop;
offsetTrail = offsetTrail.offsetParent;
}
if (navigator.userAgent.indexOf('Mac') != -1 && typeof document.body.leftMargin != 'undefined'){

offsetTop += document.body.topMargin;
}
return offsetTop;
}




window.onscroll = function () {
var topEL = 250;
var moveEL = document.getElementById("sideBar");
var moveEL1 = document.getElementById("sideBarLeft");


if  ( document.documentElement.scrollTop <= 250 ) {
moveEL.style.top = topEL + "px";
moveEL1.style.top = topEL + "px";

}
else {
moveEL.style.top = document.documentElement.scrollTop + 10 + "px";
moveEL1.style.top = document.documentElement.scrollTop + 10 + "px";
}
}

function hideElement(i) {
document.getElementById(i).style.display = "none";
}

function showElement(i) {
document.getElementById(i).style.display = "block";
} 



function changeElement(elem) {

//alert(elem);

 
if (elem==1) 	{ showElement('text1'); hideElement('text2'); hideElement('text3'); hideElement('text4'); hideElement('text5'); }
	
if (elem==2)	{ showElement('text2'); hideElement('text1'); hideElement('text3'); hideElement('text4'); hideElement('text5'); }
	
if (elem==3)	{ showElement('text3'); hideElement('text2'); hideElement('text1'); hideElement('text4'); hideElement('text5'); }
	
if (elem==4)	{ showElement('text4'); hideElement('text2'); hideElement('text3'); hideElement('text1'); hideElement('text5'); }
	
if (elem==5)	{ showElement('text5'); hideElement('text2'); hideElement('text3'); hideElement('text4'); hideElement('text1'); }
	
}


function hish(elem) {

  var stat = document.getElementById(elem).style.display;
    
  if ( stat != 'block' ) {  
  
  showElement(elem);
  
  }
  
  else { 
  
    hideElement(elem); 
  
  }
}

function show_counter(elem) {

//counter footer_counter

var idx='footer_c';
var xtd=0;
var ytd=0;



xtd += getLeft(idx);
ytd += getTop(idx);



var Fot = document.getElementById(elem);

Fot.style.left = xtd - 195 + "px";
Fot.style.top = ytd - 160  + "px";

hish(elem);

}

/*

function Check(tento)
{
        if (! IsSet(tento.nosnost) ) {
                alert('Vyplňte prosím nosnosť!');
                return false; }
        if (! IsSet(tento.rozpatie) ) {
                alert('Vyplňte prosím rozpätie!');
                return false; }
        if (! IsSet(tento.vyska_zdvihu) ) {
                alert('Vyplňte prosím výšku zdvihu!');
                return false; }
								
				if (! IsSet(tento.celkova_dlzka_zd) ) {
                alert('Vyplňte prosím celkovú dĺžku ŽD!');
                return false; }
				if (! IsSet(tento.rozstup_stlpcov) ) {
                alert('Vyplňte prosím rozstup stĺpcov!');
                return false; }
				if (! IsSet(tento.vyska_drahy2) ) {
                alert('Vyplňte prosím výšku dráhy!');
                return false; }
								
        if (! IsSet(tento.firma) ) {
                alert('Vyplňte prosím názov firmy!');
                return false; }
        if (! IsSet(tento.telefon) ) {
                alert('Vyplňte prosím číslo telefónu!');
                return false; }
				if (! IsSet(tento.email) ) {
                alert('Vyplňte prosím emailovú adresu!');
                return false; }
        if (! IsSet(tento.informacie_doda) ) {
                alert('Vyplňte prosím osobu, ktorá dodá informácie!');
                return false; }
        return true;
} 

onSubmit="return Check(this)

*/

