
function popwin(cesta, width, height) 
	{
	WinFeatures = 'toolbar=no,scrollbars=no,status=no,resizable=yes,width='+width+',height='+height;
	ShowWindow = window.open(cesta,'info',WinFeatures);
	}

function showpic(language,cesta, width, height) 
	{
	WinFeatures = 'toolbar=no,scrollbars=no,status=no,resizable=yes,width='+width+',height='+height;
	ShowWindow = window.open('showpic.php?language='+language+'&path='+cesta,'info',WinFeatures);
	}

function showpic_scrollbar(language,cesta, width, height) 
	{
	WinFeatures = 'toolbar=no,scrollbars=yes,status=no,resizable=yes,width='+width+',height='+height;
	ShowWindow = window.open('showpic.php?language='+language+'&path='+cesta,'info',WinFeatures);
	}


function targetBlank(href) {
	var newWindow = window.open(href, "print_page", "toolbar=yes,titlebar=yes,directories=yes,menubar=yes,location=yes,scrollbars=yes,status=yes,resizable=yes");

	if(!newWindow) return false;
	return true;
}


function stripHTML(oldString) {

var re= /<\S[^>]*>/g; 
oldString = oldString.replace(re,""); 
return oldString;
  
}

function isEmailAddress (string) {
  var addressPattern = 
    /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
  return addressPattern.test(string);
}
function checkEmail (field) {
  if (!isEmailAddress(field.value)) {
    alert('Prosím vložte správnu e-mailovú adresu!');
    field.focus();
    field.select();
  }
}


/*
 * Cross browser Layer visibility / Placement & Detection
 * Done by Chris Heilmann (mail@onlinetools.org) www.onlinetools.org
 * Modified by Roman Chlebec (rchlebec@studiostyle.sk) www.studiostyle.sk / added getx & gety functions
 */


function la(status,id) {

// Layer visible
if (status=="1"){
	if (document.layers) document.layers[''+id+''].visibility = "show"
	else if (document.all) document.all[''+id+''].style.visibility = "visible"
	else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"				
	}
// Layer hidden
else if (status=="0"){ 	

//	which=setxy.arguments[2];
//	clearTimeout(l[which]);

	if (document.layers) document.layers[''+id+''].visibility = "hide"
	else if (document.all) document.all[''+id+''].style.visibility = "hidden"
	else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"	
	}
		
}

// Place layer
function setxy(id,lax0,lay0) {
if (lax0){
	if (document.layers){document.layers[''+id+''].left = lax0}
	else if (document.all){document.all[''+id+''].style.left=lax0}
	else if (document.getElementById){document.getElementById(''+id+'').style.left=lax0+"px"}
	}
if (lay0){
	if (document.layers){document.layers[''+id+''].top = lay0}
	else if (document.all){document.all[''+id+''].style.top=lay0}
	else if (document.getElementById){document.getElementById(''+id+'').style.top=lay0+"px"}
	}
}


/* jazdene */
function uploadpopup(parameter) 
	{
	WinFeatures = 'scrollbars=no,status=no,resizable=yes,width=320,height=60';
	ShowWindow = window.open('inc/jazdene/upload_popup.php'+parameter,'info',WinFeatures);
	}

function setownPhoto (imgname,cislo_adresara)
	{
	foto_id=imgname.split("."); 
	document.jazdene_form.jazdene_id.value=foto_id[0];
	document.user_image.src = 'jazdene_foto/thumb'+cislo_adresara+'/'+imgname;
	pathpath= 'jazdene_foto/thumb'+cislo_adresara+'/'+imgname;
	}
