/*
Javascript Functions - Global functions
					- Local funcitons described on individual tpl.html pages within <script></script> tags
*/

function openImageWindow(imgName, w, h){
	if (w == '') {
		w = '600';
	}
	if (h == '') {
		h = '400';
	}
	return window.open(imgName,'window','width='+w+',height='+h+',scrollbars=1,alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=1,status=0,titlebar=0,toolbar=0,z-lock=0,screenX=0,screeny=0,left=20,top=20');

}

function open_win(page,wid,hei,name) { // otevre nove okno s obrazkem
	if (wid == '') {
		wid = '600';
	}
	if (hei == '') {
		hei = '400';
	}
	if (name == '') {
		name = 'image';
	}
	new_window = window.open(page,name,'width='+wid+',height='+hei+',alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=1,status=0,titlebar=0,toolbar=0,z-lock=0,screenX=0,screeny=0,left=20,top=20');
}

function confirmSubmit(text) {
	var agree = confirm(text);
	if (agree) {
		return true;
	} else {
		return false;
	}
}

function isNumeric(sText){
	   var ValidChars = "0123456789.";
	   var IsNumber=true;
	   var Char;
	 
	   for (i = 0; i < sText.length && IsNumber == true; i++){ 
	      Char = sText.charAt(i); 
	      if (ValidChars.indexOf(Char) == -1){
	         IsNumber = false;
	      }
	   }
	   return IsNumber;
	}
	
	function showElement(e){
		var d = document.getElementById(e);
		if(d.style.display == 'block'){
			d.style.display = 'none';
		} else {
			d.style.display = 'block';
		}
	}
	