function getObj(id) {
	if (typeof id != "string") {
		return id;  
	} else {
		return document.getElementById(id);
	}
}

function surfto(razeni) {
	var myindex=razeni.selectedIndex
	if (razeni.options[myindex].value != "x") location='/operation.php'+razeni.options[myindex].value+"&url-back="+document.location;
}


function CheckMail(item) {
	if (getObj(item).value.indexOf('@') > -1) return true;
	alert('Prosím, vyplňte platný email.');
	return false;
}

function OpenWnd(strURL, target){
	open(strURL,target,"scrollbars=auto,height=400,width=400,left=10,top=10");
	return false;
}

function OpenDialog(strURL){
         var objWnd = window.open(strURL,"InfoDetail","scrollbars=auto,height=400,width=400,left=10,top=10");
         objWnd.focus();
}



function bubble_basket(){
	var bubble = document.getElementById('vlozeno');

	bubble.style.display = "none";
	return false;

}
function bubble_favorit(){
	var bubble = document.getElementById('vlozeno_favorit');

	bubble.style.display = "none";
	return false;

}


function CheckLengthMin(id, minLength, message) {
	obj = getObj(id);
	if (obj.value.length < minLength) {
		if (message != '') alert(message);
		return false;
	} 
	return true;
}

function form_check_num(id)	{
	str = '0123456789';

	for(i=0; i < getObj(id).value.length; i++) {
		for (j=0; j < str.length; j++) {
			if (getObj(id).value.charAt(i) == str.charAt(j)) return true; 
		}
	}
	alert('S největší pravděpodobností jste nevyplnili číslo popisné. Opravte prosím položku.');
	return true;
}
