var tempX = 0;
var tempY = 0;
var pozadovanaVrstva = '';
var aktualniCast = '';
var winW = 630;
var IE = false; 

if ( navigator.appName.substr(0,9) ==  'Microsoft' ) {
	IE = true;
}
if ( !IE ){
	document.captureEvents(Event.MOUSEMOVE); 	
	winW = window.innerWidth - 200;	
}else{
	winW = winW -200;
}
function zobrazeni(vrstva,akce){ 
	if ( akce == 'v') {
		//document.onmousemove=getMouseXY;
		pozadovanaVrstva = vrstva;
		string="ukaz(\""+vrstva+"\");";
		setTimeout(string,100);
	}
	if ( akce == 'h' ){
		document.onmousemove = '';
		pozadovanaVrstva = vrstva;
		string = "schovej(\""+vrstva+"\");";
		setTimeout(string,100);
	}
}
function ukaz(vrstva){
		//document.getElementById(vrstva).style.visibility="visible";
		document.getElementById(vrstva).style.display="block";
}
function schovej(vrstva){
		//document.getElementById(vrstva).style.visibility="hidden";
		document.getElementById(vrstva).style.display="none";
}
function getMouseXY(e) {
		if (IE) {
				tempX = event.clientX + document.body.scrollLeft;
				tempY = event.clientY + document.body.scrollTop;
		} else {
				tempX = e.pageX;
				tempY = e.pageY;
		}  
		if (tempX < 0 ) {tempX = 0;}
		if (tempY < 0 ) {tempY = 0;}  
		if (tempX > winW ) { tempX = winW; }
		document.getElementById(pozadovanaVrstva).style.top=tempY + 10;
		document.getElementById(pozadovanaVrstva).style.left=tempX + 10;
		document.onmousemove = '';
		return true;
}

function FormSendData( id , send){
	var o = id;
	if( o ){ 
		jQuery.blockUI({ //
			message:  '<h2>Moment prosím...</h2><img src="'+zacatekUrl+'images/loading_animation.gif" alt="upload dat in progress" />',
			css: { //
				border: 'none',
				width: '250px', 
				padding: '15px',
				left: ($("body").width()/2-140)+'px' ,
				backgroundColor: '#000', 
				'-webkit-border-radius': '10px', 
				'-moz-border-radius': '10px', 
				opacity: '.5', 
				color: '#fff' 
			} 
		});
		if( send ) {
			o.submit();
		}
	}
}

/**
* create date: 2008-10-22, megac@abcool.cz
*/
function SessionRefresh(casReloadu){ //
	if( casReloadu > 0 ){ //
		$('#SessionRefresh').load(zacatekUrl+'session_refresh.php');
		var reload = casReloadu*1000; // prevod ze sekund
		setTimeout('SessionRefresh('+casReloadu+')',reload);
	} 
}
/**
 * Source: http://krijnhoetmer.nl/stuff/javascript/include-javascript/
 * @param string file
 * @return void
 */
function include(file) {
	if (document.createElement && document.getElementsByTagName) {
		var head = document.getElementsByTagName('head')[0];
		var script = document.createElement('script');
		script.setAttribute('type', 'text/javascript');
		script.setAttribute('src', file);
		head.appendChild(script);
	} else {
		alert('Your browser can\'t deal with the DOM standard. That means it\'s old. Go fix it!');
	}
}





// jquery LightBox
/*
 * $(document).ready(function(){ // $(function() {
 * $('a[@rel*=lightbox]').lightBox({ // overlayBgColor: '#AAF', overlayOpacity:
 * 0.6, imageLoading: zacatekUrl+'images/_loading.gif', imageBtnClose:
 * zacatekUrl+'images/_closelabel.gif', imageBtnPrev:
 * zacatekUrl+'images/prev.gif', imageBtnNext: zacatekUrl+'images/next.gif',
 * containerResizeSpeed: 350, txtImage: 'Obrázek', txtOf: 'cs' }); }); });
 */

