function confirmDelete(delUrl) {
	if (confirm("Existuje cesta spat, ak das ok tak jej niet")) {
		document.location = delUrl;
	}
}

function printme() {
	window.print();
}

function valForm() {
	valid = true;
	if ( document.user_form.lang.value == "en" ) {
		tag = "Unfilled values: ";
		if ( document.user_form.european.checked == true ) {
     	if ( document.user_form.firma_meno.value == "" ) {
				tag = tag + "Company Name, ";
				valid = false;
     	} 
     	if ( document.user_form.firma_adresa.value == "" ) {
				tag = tag + "Company Adress, ";
				valid = false;
     	} 
     	if ( document.user_form.firma_mesto.value == "" ) {
				tag = tag + "Company City, ";
				valid = false;
     	} 
     	if ( document.user_form.firma_psc.value == "" ) {
				tag = tag + "Company Postal Code, ";
				valid = false;
    	} 
     	if ( document.user_form.firma_krajina.value == "" ) {
				tag = tag + "Company Country, ";
				valid = false;
     	} 
    	if ( document.user_form.firma_ico.value == "" ) {
				tag = tag + "Company ID, ";
				valid = false;
     	} 
    	if ( document.user_form.firma_icdph.value == "" ) {
				tag = tag + "Company VAT ID, ";
				valid = false;
     	} 
    	if ( document.user_form.firma_telefon.value == "" ) {
				tag = tag + "Company Phone, ";
				valid = false;
     	} 
    	if ( document.user_form.firma_fax.value == "" ) {
				tag = tag + "Company Fax, ";
				valid = false;
     	} 
    	if ( document.user_form.osoba_meno.value == "" ) {
				tag = tag + "Personal Name, ";
				valid = false;
     	} 
    	if ( document.user_form.osoba_priezvisko.value == "" ) {
				tag = tag + "Personal Surname, ";
				valid = false;
     	} 
    	if ( document.user_form.osoba_mail.value == "" ) {
				tag = tag + "Personal Email, ";
				valid = false;
     	} 
		} 
		if ( document.user_form.european.checked == false ) {
     	if ( document.user_form.firma_meno.value == "" ) {
				tag = tag + "Company Name, ";
				valid = false;
     	} 
     	if ( document.user_form.firma_adresa.value == "" ) {
				tag = tag + "Company Address, ";
				valid = false;
     	} 
     	if ( document.user_form.firma_mesto.value == "" ) {
				tag = tag + "Company City, ";
				valid = false;
     	}
     	if ( document.user_form.firma_psc.value == "" ) {
				tag = tag + "Company Postal Code, ";
				valid = false;
    	} 
     	if ( document.user_form.firma_krajina.value == "" ) {
				tag = tag + "Company Country, ";
				valid = false;
     	} 
    	if ( document.user_form.firma_telefon.value == "" ) {
				tag = tag + "Company Phone, ";
				valid = false;
     	} 
    	if ( document.user_form.firma_fax.value == "" ) {
				tag = tag + "Company Fax, ";
				valid = false;
     	} 
    	if ( document.user_form.osoba_meno.value == "" ) {
				tag = tag + "Personal Name, ";
				valid = false;
     	} 
    	if ( document.user_form.osoba_priezvisko.value == "" ) {
				tag = tag + "Personal Surname, ";
				valid = false;
     	} 
    	if ( document.user_form.osoba_mail.value == "" ) {
				tag = tag + "Personal Mail, ";
				valid = false;
     	} 
		}
  }
  if ( document.user_form.lang.value == "sk" ) {
  		
			tag = "Nevyplnene polia: ";
     	if ( document.user_form.firma_meno.value == "" ) {
				tag = tag + "Meno Firmy, ";
				valid = false;
     	} 
     	if ( document.user_form.firma_adresa.value == "" ) {
				tag = tag + "Adresa Firmy, ";
				valid = false;
     	} 
     	if ( document.user_form.firma_mesto.value == "" ) {
				tag = tag + "Mesto, ";
				valid = false;
     	} 
     	if ( document.user_form.firma_psc.value == "" ) {
				tag = tag + "PSC, ";
				valid = false;
    	} 
    	if ( document.user_form.firma_ico.value == "" ) {
				tag = tag + "ICO, ";
				valid = false;
     	} 
    	if ( document.user_form.firma_icdph.value == "" ) {
				tag = tag + "ICDPH, ";
				valid = false;
     	} 
    	if ( document.user_form.firma_telefon.value == "" ) {
				tag = tag + "Telefon, ";
				valid = false;
     	} 
    	if ( document.user_form.firma_fax.value == "" ) {
				tag = tag + "Fax, ";
				valid = false;
     	} 
    	if ( document.user_form.osoba_meno.value == "" ) {
				tag = tag + "Meno, ";
				valid = false;
     	} 
    	if ( document.user_form.osoba_priezvisko.value == "" ) {
				tag = tag + "Priezvisko, ";
				valid = false;
     	} 
    	if ( document.user_form.osoba_mail.value == "" ) {
				tag = tag + "Email, ";
				valid = false;
     	} 
	}
	if (valid == false) {
		alert(tag);
	} 
	return valid;
}

function hablalablabla(event)
	{
		keyPressed = event.keyCode;
		if (keyPressed == 13)
			{
				source = document.getElementById('sub_cat_id_text').value;
				source = source + "<br>";
				document.getElementById('sub_cat_id_text').value = source;
				document.getElementById('diaplay_sub_cat_id_text').innerHTML = source;
			}
		source = document.getElementById('sub_cat_id_text').value;
		document.getElementById('diaplay_sub_cat_id_text').innerHTML = source;	
	}

function editovat_poznamku()
	{
		
		var holder = document.getElementById('Editovat_poznamku');
		// set holder properties // 
		holder.style.position = "absolute";
		holder.style.top = "80px";
		holder.style.width = "600px";
		holder.style.borderWidth = "5px";
		holder.style.padding  = "10px";
		var LeftAlign = window.innerWidth/2-300;
		holder.style.left = LeftAlign +"px";
		var displayContent = document.getElementById("Editovat_poznamku_hide");
		displayContent.style.display = "block";
		var TextArea = document.getElementById("Editovat_poznamku_textarea");
		TextArea.style.display = "block";
		editovatPoznamkuHandleClosseButton();
		HandleOpacityLayer();
		
	}
function editovatPoznamkuHandleClosseButton()
	{
		var button = document.getElementById("EditovatPoznamkuCloseButton");
		var HideShow = document.getElementById("Editovat_poznamku_hide");
		status = HideShow.style.display;
		button.style.display = status;
	}

function HandleOpacityLayer()
	{
		var Layer = document.getElementById("opacityLayer");
		var HideShow = document.getElementById("Editovat_poznamku_hide");
		status = HideShow.style.display;
			if (status == "block")
				{
					 if( typeof( window.innerWidth ) == 'number' ) {
					    //Non-IE
					    myWidth = window.innerWidth;
					    myHeight = window.innerHeight;
					  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
					    //IE 6+ in 'standards compliant mode'
					    myWidth = document.documentElement.clientWidth;
					    myHeight = document.documentElement.clientHeight;
					  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
					    //IE 4 compatible
					    myWidth = document.body.clientWidth;
					    myHeight = document.body.clientHeight;
					  }
								Layer.style.width = myWidth+"px";
								Layer.style.height = myHeight+"px";
								Layer.style.position = "absolute";
					Layer.style.display = status;
				}
			else
				{
					Layer.style.display = status;
				}
	}

function editovatPoznamkuPreview()
	{
		getContent = document.getElementById("Editovat_poznamku_textarea").value;
		document.getElementById("poznamka_msg").innerHTML = getContent;
		document.getElementById("EditovatPoznamkuChase").innerHTML = getContent;
		editovatPoznamkuHide()	
	}
	
function editovatPoznamkuHide()
	{
		var holder = document.getElementById('Editovat_poznamku');
		// set holder properties // 
		holder.style.position = "static";
		holder.style.top = "auto";
		holder.style.width = "auto";
		holder.style.borderWidth = "0px";
		holder.style.padding  = "0px";
		var displayContent = document.getElementById("Editovat_poznamku_hide");
		displayContent.style.display = "none";
		editovatPoznamkuHandleClosseButton();
		HandleOpacityLayer();
	}

function editovatPoznamkuClose()
	{
		editovatPoznamkuHide()
		var PrevContent = document.getElementById("EditovatPoznamkuChase").innerHTML;
		document.getElementById("Editovat_poznamku_textarea").value = PrevContent;
	}

function editovatPoznamkuBack()
	{
		var FirstContent = document.getElementById("poznamka_msg_hidden").innerHTML;
		document.getElementById("Editovat_poznamku_textarea").value = FirstContent;
	}
