function AddFavorite(linkObj,addUrl,addTitle)
{
 if (document.all && !window.opera)
  {
    window.external.AddFavorite(addUrl,addTitle);
    return false;
  }
  else if (window.opera && window.print)
  {
    linkObj.title = addTitle;
    return true;
  }
  else if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function'))
  {
    if (window.confirm('Přidat oblíbenou stránku jako nový panel?'))
    {
      window.sidebar.addPanel(addTitle,addUrl,'');
      return false;
    }
  }
  window.alert('Po potvrzení stiskněte CTRL-D,\nstránka bude přidána k vašim oblíbeným odkazům.');
  return false;
}

function adv(uri)
{
	window.open(uri, "page", "menubar=yes, location=yes, status=no, toolbar=no, scrollbars=yes, resizable=yes,left=100,top=100");
	return false; 
}


function pop_adv(uri, width, height) {
	window.open(uri, "advertising", "width=" + width + ", height=" + height + ",menubar=no, location=no, status=no, toolbar=no, scrollbars=yes, resizable=no,left=70,top=70");
	return false; 
}


function w(uri)
{
	var result = adv(uri);
	return result;
}

function ws(uri)
{
	return w(uri);
}

function wi(url, width, height)
{
	width += 50; height += 50;
	window.open(url, 'foto', 'width='+width+', height='+height+', toolbar=no, location=no, resizable=yes, scrollbars=yes, top=100, left=100');
	return false;
}


function is_int(val, string) {
	var intresult = true; var a = 1; var needle = '';
	for(a=1; a<val.length+1; a++) {
		needle = val.substring(a-1,a);
		if((needle < "0" || needle > "9") && (string.indexOf(needle) < 0 || string.length == 0)) intresult = false;
	}
	return intresult;
}


function change_js_input()
{
	var items = '';
	var i = 0;
	var error = false;
	var a;
	var report = '';
	var var_name = '';
	if (document.getElementById('required_items')) {
		items = document.getElementById('required_items');
		items = items.split(';');
	} else items = new Array('jmeno', 'prijmeni', 'firma', 'telefon', 'email');

	for (i = 0; i < items.length; i ++) {
		var_name = items[i];
		if (document.getElementById(var_name)) a = document.getElementById(var_name).value;
		else a = 'xxx';
		if (!a) {
			error = true;
			if (var_name == 'jmeno') report += 'Není zadáno jméno!\n';
			if (var_name == 'prijmeni') report += 'Není zadáno příjmení!\n';
			if (var_name == 'firma') report += 'Není zadána firma!\n';
			if (var_name == 'telefon') report += 'Není zadán telefon!\n';
			if (var_name == 'email') report += 'Není zadán e-mail!\n';
		}
	}

	if (error) {
		alert(report);
		return false;
	}

	var el = document.getElementById('js_input');
	el.value = 1;
	return true;
}
