function isblank(co){
	for (var i=0; i < co.length; i++)
	{
		var c=co.charAt(i);
   		if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
	}
	return true;
}

function isnum(co){
	ok = true;
	for (var i=0; i < co.length; i++)
	{
		var c=co.charAt(i);
   		if ((c < '0') || (c > '9')) ok = false;
	}
	return ok;
} 

function isdic(co){
	ok = true;
	for (var i=0; i < co.length; i++)
	{
		var c=co.charAt(i);
   		if (((c < '0') || (c > '9')) && (c != '-')) ok = false;
	}
	return ok;
}

function istel(co){
	ok = true;
	for (var i=0; i < co.length; i++)
	{
		var c=co.charAt(i);
   		if (((c < '0') || (c > '9')) && (c != '+')) ok = false;
	}
	return ok;
}

function isemil(co){
	ok = false;
	for (var i=0; i < co.length; i++)
	{
		var c=co.charAt(i);
   		if ((c == '@')) ok = true;
	}
	return ok;
} 

function jsok(){
	window.open("jsok.php","shop","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,width=200,height=100"); 
}

function chflog(){

	if ( document.forms.lf.lname.value == "" || isblank(document.forms.lf.lname.value) ) {
		alert ("Formulář nebyl správně vyplněn, vyplňte uživatelské jméno.");
		document.forms.lf.lname.focus();
		return false;
	};

	if ( document.forms.lf.lpass.value == "" || isblank(document.forms.lf.lpass.value) ) {
		alert ("Formulář nebyl správně vyplněn, vyplňte heslo.");
		document.forms.mf.lpass.focus();
		return false;
	};

}

function lsh(el){
	if (!document.getElementById && document.all) document.getElementById = document.all;
	if (document.getElementById(el).style.display == 'block'){
		document.getElementById(el).style.display = 'none';
		document.getElementById(el).style.visibility = 'hidden';
	}else{
		document.getElementById(el).style.display = 'block';
		document.getElementById(el).style.visibility = 'visible';
	}
}

function lsho(el){
	if (!document.getElementById && document.all) document.getElementById = document.all;
	if (document.getElementById(el).style.display == 'none'){
		document.getElementById(el).style.display = 'block';
		document.getElementById(el).style.visibility = 'visible';
	}else{
		document.getElementById(el).style.display = 'none';
		document.getElementById(el).style.visibility = 'hidden';
	}
}

function imgopen(id){
	window.open("pic_small_show_img.php?id="+id,"xx","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,width=100,height=100"); 
}

function showpic(id){
	window.open("pic_small_show.php?id="+id,"x","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,width=100,height=100"); 
}

