jsIE = document.all;
jsNs = document.getElementById;
	
function oznacObj(meno) {
	if (jsIE) return eval('document.all.'+meno);
	else if (jsNs) return document.getElementById(meno);
	else return false;
}

function rozbalovac(pocet,cislo){
	for (i=1; i<=pocet; i++){
		if (i==cislo) continue;
		oznacObj('t_'+i).style.display= "none";
		document.images['o_'+i].src=vyp.src;
	}
	if (oznacObj('t_'+cislo).style.display== "block"){
		oznacObj('t_'+cislo).style.display= "none";
		document.images['o_'+cislo].src=vyp.src;
	}
	else{
		oznacObj('t_'+cislo).style.display= "block";
		document.images['o_'+cislo].src=zap.src;
	}
}

function popup_uk(co, ttt){
	oznacObj(co).style.visibility= 'visible';
	oznacObj(co).innerHTML= popup[ttt-1];
	oznacObj(co).style.left=event.clientX+5;
	oznacObj(co).style.top=event.clientY+8;
	
}
function popup_sk(co){
	oznacObj(co).style.visibility= 'hidden';
	
	
}
function over_prihl(menoForm){
	//alert (document.forms[menoForm].meno.value);
	if (document.forms[menoForm].meno.value=='' || document.forms[menoForm].heslo.value==''){
		return false;
	}
	else{
		return true;
	}
}
function okno(subor)
{
  window.open(subor,"nazov_okna","width=730,height=450,top=0,left=0,scrollbars=yes,resizable=yes");
}
function ukaz_pozor(){
	objPozor = oznacObj('pozor');
	objPozor.style.visibility = 'visible';
}
//otvaranie okna pri obrazkoch
function otvor_okno(obr, popis, sirka, vyska){
	window.focus();
	window.open("obr.php?obr="+obr+"&popis="+popis, "obrazok","location=yes, menubar=yes, width="+sirka+", height="+vyska+", top=20, left=0,  resizable=yes, scrollbars=yes");
	}
function otvor_txt_okno(txt, sirka, vyska){
	window.focus();
	window.open("okno_txt.php?txt="+txt, "ceny","location=yes, menubar=yes, width="+sirka+", height="+vyska+", top=20, left=0,  resizable=yes");
}
function vyplnFormZMapy(hod) {
	select_kraj = oznacObj('kraj_predaj');
	select_kraj.value = hod;
	form_krj = oznacObj('form_kraj_predaj');
	form_krj.submit();
}
function vyplnFormZMapy2(hod) {
	select_kraj = oznacObj('kraj_realiz');
	select_kraj.value = hod;
	form_krj = oznacObj('form_kraj_realiz');
	form_krj.submit();
}	

//light box 
$(function() {
	$('#galeria a').lightBox();
});

$(function() {
	$('a.obr_ramik').lightBox();
});

//harmonika pata
$(document).ready(function(){
	lastBlock = $("#a1");
	maxWidth = 386;
	minWidth = 178;	
	
	$("ul#harmonika li div").hover(
	  function(){
		//$(this).css('cursor','pointer');
		$(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
	$(this).animate({width: maxWidth+"px"}, { queue:false, duration:400});
	lastBlock = this;
	  }
	);
	$("ul#harmonika li img").hover(
		function() {
		//$(this).css('cursor','pointer');
		},
		function() {
		$(this).css('cursor','auto');
	});
});

//slide hlavicka
function slideSwitch() {
	var $active = $('#hlavicka2_pix img.active');

	if ( $active.length == 0 ) $active = $('#slideshow img:last');

	// use this to pull the images in the order they appear in the markup
	var $next =  $active.next().length ? $active.next()
		: $('#slideshow img:first');

	// uncomment the 3 lines below to pull the images in random order

	var $sibs  = $active.siblings();
	var rndNum = Math.floor(Math.random() * $sibs.length );
	var $next  = $( $sibs[ rndNum ] );


	$active.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
			$active.removeClass('active last-active');
		});
}
$(function() {
	setInterval( "slideSwitch()", 8000 );
});
//slide kampan
function slideSwitch2() {
	var $active = $('#kampan_pix a.active');

	if ( $active.length == 0 ) $active = $('#slideshow img:last');

	// use this to pull the images in the order they appear in the markup
	var $next =  $active.next().length ? $active.next()
		: $('#slideshow img:first');

	// uncomment the 3 lines below to pull the images in random order

	var $sibs  = $active.siblings();
	var rndNum = Math.floor(Math.random() * $sibs.length );
	var $next  = $( $sibs[ rndNum ] );


	$active.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
			$active.removeClass('active last-active');
		});
}
$(function() {
	setInterval( "slideSwitch2()", 8000 );
});

//slide kampan
/* function slideSwitch2() {
var $active = $('#kampan_pix .active');

if ( $active.length == 0 ) $active = $('#slideshow a:last');

// use this to pull the images in the order they appear in the markup
var $next =  $active.next().length ? $active.next()
	: $('#slideshow a:first');

// uncomment the 3 lines below to pull the images in random order

var $sibs  = $active.siblings();
var rndNum = Math.floor(Math.random() * $sibs.length );
var $next  = $( $sibs[ rndNum ] );


$active.addClass('last-active');

$next.css({opacity: 0.0})
	.addClass('active')
	.animate({opacity: 1.0}, 1000, function() {
		$active.removeClass('active last-active');
	});
}
$(function() {
	setInterval( "slideSwitch2()", 10000 );
}); */



