// otvori nove okno pre zvacseninu nahladovej fotky
function okno(url, alt) {
	var sir, vys, x, y, alt

	sir = 560; vys = 590;

	x = (screen.width / 2) - (sir / 2);
	y = (screen.height / 2) - (vys / 2);

	alt = escape(alt);

	window.open('/image.php?url='+url+'&alt='+alt, '',
		'location=no,menubar=no,status=no,height='+
		vys+',width='+sir+'screenX='+x+'screenY='+y+'');

}


// otvori okno s vizitkou uzivatela
function vizitka(id) {
	var sir, vys, x, y

	sir = 300; vys = 180;

	x = (screen.width / 2) - (sir / 2);
	y = (screen.height / 2) - (vys / 2);

	window.open('/vizitka.php?id='+id, '',
		'location=no,menubar=no,status=no,height='+
		vys+',width='+sir+'screenX='+x+'screenY='+y+'');
}


// otvori okno s detailami kontaktu osoby
function kon_osoba(id) {

	sir = 400; vys = 400;

	x = (screen.width / 2) - (sir / 2);
	y = (screen.height / 2) - (vys / 2);

	window.open('/kon_osoba.php?id='+id, '',
		'location=no,menubar=no,status=no,height='+
		vys+',width='+sir+'screenX='+x+'screenY='+y+'');
}


// otvori okno s detailami kontaktu org jednotky/utvaru
function kon_org(id) {
	var sir, vys, x, y

	sir = 450; vys = 400;

	x = (screen.width / 2) - (sir / 2);
	y = (screen.height / 2) - (vys / 2);

	window.open('/kon_org.php?id='+id, '',
		'location=no,menubar=no,status=no,height='+
		vys+',width='+sir+'screenX='+x+'screenY='+y+'');
}

// otvori okno s popismi skratky
function kni_skratka(id) {
	var sir, vys, x, y

	sir = 450; vys = 300;

	x = (screen.width / 2) - (sir / 2);
	y = (screen.height / 2) - (vys / 2);

	window.open('/kni_skr.php?id='+id, '',
		'location=no,menubar=no,status=no,height='+
		vys+',width='+sir+'screenX='+x+'screenY='+y+'');
}

function kni_nahlad(obj, show) {
	var aaa

	aaa = document.getElementById(obj)
	if (show == 1) {
		aaa.style.visibility = 'visible'
	} else {
		aaa.style.visibility = 'hidden'
	}
}

function okno1(url, sir, vys) {
	var url, sir, vys, x, y

	if (sir == undefined) {
		sir = 600
		vys = 400
	}

	x = (screen.width / 2) - (sir / 2);
	y = (screen.height / 2) - (vys / 2);

	window.open(url, 'aaa',
		'resizable=yes,scrollbars=yes,location=no,menubar=no,status=no,height='+
		vys+',width='+sir+'screenX='+x+'screenY='+y+'');

}

// otvori nove okno
function popup(url) {

	sir = 780;
	vys = 580;

	x = (screen.width / 2) - (sir / 2);
	y = (screen.height / 2) - (vys / 2);

	open(url, '', 'resizable=yes,scrollbars=yes,location=no,menubar=no,status=no,height='+
		vys+',width='+sir+'screenX='+10+'screenY='+10+'')
}

// okontroluje form
function Kontrola(theform) {
  var a = true;
  var b = TheForm.sEMail.value;
  var c = false;
  if ((theform.sZaujem.value=="") || (theform.sMeno.value=="")) {
    alert("Políčka Meno a Oblasť záujmu musia byť vyplnené !!");
    a=false;
    }
  if (theform.sEMail.value != "") {
     for (var i = 0; i <= b.length; i++){
         if (b.substr(i-1,1) == "@"){c = true}
     }
     if (!c) {
       alert("Políčko E-Mail obsahuje neplatnú adresu !!");
       a = false;
       }
    }
  if (a) {
    theform.submit();
    }
   return a;
}

function Kontrola2(theform) {
  var a = true;
  if ((theform.sSuma.value=="") || (theform.sDarca.value=="")) {
    alert("Políčka Darca a Suma musia byť vyplnené !!");
    a=false;
    }
  if (a) {
    TheForm.submit();
    }
  return a;
}

function otestujform(TheForm) {
	var a=true;
  var b = TheForm.sEMail.value;
  var c = false;
  if ((TheForm.sZaujem.value=="") || (TheForm.sMeno.value=="")) {
    alert("Políčka Meno a Oblasť záujmu musia byť vyplnené !!");
    a=false;
    }
  if (TheForm.sEMail.value != "") {
     for (var i = 0; i <= b.length; i++){
         if (b.substr(i-1,1) == "@"){c = true}
     }
     if (!c) {
       alert("Políčko E-Mail obsahuje neplatnú adresu !!");
       a = false;
       }
    }
  if (a) {
    TheForm.reset();
    }

return a;
}


function otestujform2(theform) {
	var a=true;
  if ((TheForm.sSuma.value=="") || (TheForm.sDarca.value=="")) {
    alert("Políčka Darca a Suma musia byť vyplnené !!");
    a=false;
    }
 
  if (a) {
    TheForm.submit();
    }

return a;
}


function NewColor(obj,back)
{

obj.src=back;

}


function Delete(TheForm) {

TheForm.reset();
return false;

}


sfHover = function() {
	var sfEls = document.getElementById("nav");
	if (sfEls) {
		sfEls = sfEls.getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(48.590759, 17.834909), 15);
      }
      var mapControl = new GMapTypeControl();
      var zoomControl = new GSmallZoomControl();
			map.addControl(mapControl);
			map.addControl(zoomControl);
			map.enableScrollWheelZoom();
			
			function createMarker() {
				var marker = new GMarker(new GLatLng(48.590759, 17.834909), {draggable: false});
				GEvent.addListener(marker, "click", function() {
					marker.openInfoWindowHtml("<b>TRIXI</b><br/>stanovište taxi<br/>pred hotelom Lipa");
				});
 			return marker;
 			}
			map.addOverlay(createMarker());
			
    }

