// =========== Kleinigkeiten for TACTO
// =========== created by JaryK
// =========== STUDIO SYNAPSE


//=============================================================
//=====   PRELOAD OBRAZKU
//=============================================================

	//-------------------------------------------------------------
	BUTTONS = new Array('logo_tacto','button_ok','button_x');
	preload_buttons();


//=============================================================
//=====   NASTAVAVENI VRSTEV PRO RUZNE PORHLIZECE
//=============================================================

	VRSTVA="document.getElementById(\"";
	VIDITELNOST="\").style.display";
	VIDET="=\"block\"";
	NEVIDET="=\"none\"";


//=============================================================
//=====   FUNKCE PRO PRELOAD OBRAZKU
//=============================================================

	//-------------------------------------------------------------
	function preload_buttons(){
		for(i=0;i<BUTTONS.length;i++){
			eval("BUTT_" + BUTTONS[i] + "_out=new Image()");
			eval("BUTT_" + BUTTONS[i] + "_out.src=\"obrazky/" + BUTTONS[i] + ".gif\"");
			eval("BUTT_" + BUTTONS[i] + "_over=new Image()");
			eval("BUTT_" + BUTTONS[i] + "_over.src=\"obrazky/" + BUTTONS[i] + "_over.gif\"");
		}
	}


//=============================================================
//=====   INTERAKCE V NAVIGACI
//=============================================================

	//-------------------------------------------------------------
	function butt_over(jmeno,obj){
		obj.src=eval("BUTT_" + jmeno + "_over.src");
	}
	function butt_out(jmeno,obj){
		obj.src=eval("BUTT_" + jmeno + "_out.src");
	}


//=============================================================
//=====   OTEVIRANI EXTERNICH OKEN
//=============================================================

	//-------------------------------------------------------------
	function ext_window(adresa){
		window.open(adresa);
	}


//=============================================================
//=====   GALERIE NEJBRUTALNEJSI
//=============================================================

	//-------------------------------------------------------------
	function gogo_gallery_picture(picname,xwidth,yheight){

		GalleryBackground=document.getElementById('gallerybcg');
		GalleryPictureContainer=document.getElementById('gallerypicturecontainer');
		GalleryPicture=document.getElementById('gallerypicture');

		GalleryBackground.style.visibility='visible';
		GalleryPictureContainer.style.visibility='visible';
		GalleryPicture.style.visibility='visible';

		GalleryPicture.src=picname;

		VyskaDokumentu=document.all ? document.body.offsetHeight : document.height;

		if( typeof( window.innerWidth ) == 'number' ) {
			SirkaProhlizece = window.innerWidth;
			VyskaProhlizece = window.innerHeight;
		}
		else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			SirkaProhlizece = document.documentElement.clientWidth;
			VyskaProhlizece = document.documentElement.clientHeight;
		}
		else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			SirkaProhlizece = document.body.clientWidth;
			VyskaProhlizece = document.body.clientHeight;
		}

		PosunY=document.body.scrollTop;
		if(PosunY == 0){
		    if (window.pageYOffset) PosunY = window.pageYOffset;
		    else PosunY = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
		}

		GalleryBackground.style.width='100%';
		GalleryBackground.style.height=VyskaDokumentu + 'px';
		
		PictureXPosition=(SirkaProhlizece-xwidth)/2;
		PictureYPosition=(VyskaProhlizece-yheight)/2+PosunY;
		
		GalleryPictureContainer.style.left=PictureXPosition-15+'px';
		GalleryPictureContainer.style.top=PictureYPosition-15+'px';
	}

	//-------------------------------------------------------------
	function gogo_gallery_close(picname,xwidth,yheight){

		GalleryBackground=document.getElementById('gallerybcg');
		GalleryPictureContainer=document.getElementById('gallerypicturecontainer');
		GalleryPicture=document.getElementById('gallerypicture');

		GalleryBackground.style.visibility='hidden';
		GalleryPictureContainer.style.visibility='hidden';
		GalleryPicture.style.visibility='hidden';

		GalleryBackground.style.width='100%';
		GalleryBackground.style.height='0px';

		GalleryPicture.src='';
	}


//=============================================================
//=====   FORMULARE
//=============================================================

	//-------------------------------------------------------------
	function form_toggle_regform(){
		if (document.getElementById('PouzivatKontakt').checked){
			DisabledStatus=false;
			document.getElementById('KontaktObec').className='formular-2 fblur';
			document.getElementById('KontaktUlice').className='formular-2 fblur';
			document.getElementById('KontaktCP').className='formular-2 ultranarrow fblur';
			document.getElementById('KontaktCOr').className='formular-2 xultranarrow fblur';
			document.getElementById('KontaktPSC').className='formular-2 ultranarrow fblur';
		}
		else {
			DisabledStatus=true;
			document.getElementById('KontaktObec').className='formular-2 disabled';
			document.getElementById('KontaktUlice').className='formular-2 disabled';
			document.getElementById('KontaktCP').className='formular-2 ultranarrow disabled';
			document.getElementById('KontaktCOr').className='formular-2 xultranarrow disabled';
			document.getElementById('KontaktPSC').className='formular-2 ultranarrow disabled';
		}
		document.getElementById('KontaktObec').disabled = DisabledStatus;
		document.getElementById('KontaktUlice').disabled = DisabledStatus;
		document.getElementById('KontaktCP').disabled = DisabledStatus;
		document.getElementById('KontaktCOr').disabled = DisabledStatus;
		document.getElementById('KontaktPSC').disabled = DisabledStatus;
	}			



//=============================================================
//=====   VYCHYTAVKY
//=============================================================


// =========== Kleinigkeiten for TACTO === END
