function js_overs() 
{
 if (document.getElementById) {
  var x = document.getElementsByTagName('tr');
 } else if (document.all) {
  var x = document.all.tags('tr');
 } else {
  return;
 }
 for (var i=0;i<x.length;i++) {
  x[i].onmouseover = function () { if (this.className == 'normal') this.className = 'over'; if (this.className == 'normal1') this.className = 'over1';}
  x[i].onmouseout = function () { if (this.className == 'over') this.className = 'normal'; if (this.className == 'over1') this.className = 'normal1';}
 } 
}

function open_img(id,type)
{
  gallery = window.open('/open_img.php?id='+id+'&type='+type,"GSailingGallery","scrollbars=yes,resizable=yes,status=no,width=650,height=600");
  gallery.focus();
}

function DatumChange(nazev)
	{
	var selectDatumMin = document.rezervacia.sat1 ;
	var selectDatumMax = document.rezervacia.sat2 ;
	var valueMin = parseInt(selectDatumMin.options[selectDatumMin.selectedIndex].value) ;
	var valueMax = parseInt(selectDatumMax.options[selectDatumMax.selectedIndex].value) ;		
	if(nazev=="sat1" && valueMax <= valueMin) selectDatumMax[selectDatumMin.selectedIndex].selected = true ;
	if(nazev=="sat2" && valueMax <= valueMin) selectDatumMin[selectDatumMax.selectedIndex].selected = true ;
	}
	
function OtvorRezervaciu(id_yacht,id_destinacia,id_charter)
	{
window.open('/rezervacia.php?id_yacht=' + id_yacht + '&id_destinacia=' + id_destinacia + '&id_charter=' + id_charter + '&od=' + document.rezervacia.sat1.value + '&do=' + document.rezervacia.sat2.value,"RezervaciaGSailing","scrollbars=yes,resizable=yes,status=no,width=650,height=600");
}

function UpdateTime(){
        
        var today = new Date();
        var day = today.getDate();
        var month = today.getMonth() + 1;
        var hour = today.getHours();
        var mins = today.getMinutes();
        var secs = today.getSeconds();

        if (secs <=9){
            secs = "0" + secs
        }

        var TotalTime = 'Dnes je ' + day + "." + month + '.  ' + hour + ":" + mins;

        $('#time').html(TotalTime);

        setTimeout("UpdateTime()", 1000);
}

$(document).ready(function() {
	$('#menu_top').css('margin-left', ((944-$('#menu_top').width())/2)+'px');
	UpdateTime();
});
