// -------------------------------------------------------------------------//
// TATRANOVA
// WIT Studio - 2008
// -------------------------------------------------------------------------//


//window.onload   = Preload;
var current_index=0;

//----------------------------------------------------------------- FSC - uvod
function uvod_DoFSCommand(command, args) {
	if (command == "FSC_change_web_bkg") {
 		//var index_bkg=Math.round(Math.random()*4);
		var index_bkg=Number(args)-1;
   	if ( (obj = myGetElementById('web_bkg_02')) ) {
    		obj.src = i_BKG[index_bkg][0];
		}
   	if ( (obj = myGetElementById('web_bkg_01')) ) {
    		obj.src = i_BKG[index_bkg][1];
		}
   	//if ( (obj = myGetElementById('web_bkg_04')) ) {
		//		obj.style.width = '20px';
		//}
		//uvod_texty_off();
	}
}

//------------------------------------------------------------- FSC - num12345
function num12345_DoFSCommand(command, args) {

	if (command == "FSC_change_web_bkg") {
		var index_bkg=Number(args)-1;
   	if ( (obj = myGetElementById('web_bkg_02')) ) {
    		obj.src = i_BKG[index_bkg][0];
		}
   	if ( (obj = myGetElementById('web_bkg_01')) ) {
    		obj.src = i_BKG[index_bkg][1];
		}
   	//if ( (obj = myGetElementById('web_bkg_04')) ) {
		//		obj.style.width = '20px';
		//}
		//uvod_texty_off();
	}
	if (command == "FSC_init_web_bkg") {
   	if ( (obj = myGetElementById('web_bkg_10')) ) {
	 		 obj.style.top = (getWindowHeight()-20)+'px';
			 obj.style.width = '100%';
		}
   	if ( (obj = myGetElementById('web_bkg_09')) ) {
	 		 obj.style.top = (getWindowHeight()-20-100)+'px';
			 obj.style.width = '100%';
		}
	}
}

//----------------------------------------------------------------------------
function uvod_texty_off() {
   	if ( obj = myGetElementById('web_bkg_07') ) {	obj.style.height = '0px';	}
   	if ( obj = myGetElementById('web_bkg_08') ) {	obj.style.height = '0px';	}
   	if ( obj = myGetElementById('web_bkg_09') ) {	obj.style.height = '0px';	}
}

//----------------------------------------------------------------------------
var isIE  = (document.getElementById && document.all)?true:false;
var isNS4 = (document.layers)?true:false;
var isNS6 = (document.getElementById && !document.all)?true:false;

//----------------------------------------------------------------------------
function myGetElementById(id) {
	if ( isIE ) {
		var str = "document.all('" + id + "')";
		var retval = eval(str);
		return retval;
	}
	return document.getElementById(id);
}

//----------------------------------------------------------------------------
i_max = 0;
i_BKG = new Array();
i_BKG[i_max++] = new Array ("js/img/k_01b_bkg.jpg","js/img/k_01b_bkg_botoom.jpg");
i_BKG[i_max++] = new Array ("js/img/k_02b_bkg.jpg","js/img/k_02b_bkg_botoom.jpg");
i_BKG[i_max++] = new Array ("js/img/k_03b_bkg.jpg","js/img/k_03b_bkg_botoom.jpg");
i_BKG[i_max++] = new Array ("js/img/k_04b_bkg.jpg","js/img/k_04b_bkg_botoom.jpg");
i_BKG[i_max++] = new Array ("js/img/k_05b_bkg.jpg","js/img/k_05b_bkg_botoom.jpg");

i_tmax = 0;
i_BKG_text = new Array();
i_BKG_text[i_tmax++] = new Array ("js/img/bkg_kvalita.gif"		  ,"kvalita"		);
i_BKG_text[i_tmax++] = new Array ("js/img/bkg_tradicia.gif"		,"tradícia"	  );
i_BKG_text[i_tmax++] = new Array ("js/img/bkg_spolupraca.gif"	,"spolupráca" );

//----------------------------------------------------------------------------
function Preload() { // Images Preload

  try{
    if (document.images) { // Preload Images Background
      preload_image_object = new Array();

	    for(i=0; i<i_BKG.length; i++) {
        preload_image_object[i] = new Image();
        preload_image_object[i].src = i_BKG[i][0];
		  }
	    for(; i<i_BKG.length; i++) {
        preload_image_object[i] = new Image();
        preload_image_object[i].src = i_BKG[i][1];
		  }
	 }

  } catch(err){
	    var text= document.createTextNode('<!--    Error WIT 01 '+err+'  -->');
	    document.body.appendChild(text);
  }
}


// --- WindowHeight
function getWindowHeight(){
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number')
		windowHeight = window.innerHeight;
	else
		if (document.documentElement && document.documentElement.clientHeight)
			windowHeight = document.documentElement.clientHeight;
		else
			if (document.body && document.body.clientHeight)
				windowHeight = document.body.clientHeight;

	return windowHeight;
}




