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('Pridat obl�benou str�nku jako nov� panel?')) 
    { 
      window.sidebar.addPanel(addTitle,addUrl,''); 
      return false; 
    } 
  } 
  window.alert('Po potvrzen� stisknete CTRL-D,\nstr�nka bude prid�na k va�im obl�ben�m odkazum.'); 
  return false; 
}

function clearInput(input, text) {
	if (input.value == text) {
		input.value = '';
	}
}

function defaultText(input, text) {
	if (input.value == '') {
		input.value = text;
	}
}

function deselectAllFormsLine() {
	for (var i=1; i < 13; i++) {
		document.getElementById("input" + i).className = "formline";;
	}
}

function selectFormLine(line) {
	deselectAllFormsLine();
	document.getElementById("input"+line).className = "formlineselected";
}


function requiredFields() {
	//document.write('test'+document.getElementById("odberatelprodejce").checked);
	if (document.getElementById("cisloodberatele").value != '') {
		changeSpanVisibility(1,'off');
		changeSpanVisibility(3,'off');
		changeSpanVisibility(4,'off');
		changeSpanVisibility(5,'off');
		changeSpanVisibility(6,'off');
		changeSpanVisibility(7,'off');
		changeSpanVisibility(8,'off');
		changeSpanVisibility(9,'off');
		changeSpanVisibility(10,'off');
		document.getElementById("infotext").className = "on";
	} else if (document.getElementById("odberatelzakaznik").checked) {
		changeSpanVisibility(1,'on');
		changeSpanVisibility(3,'on');
		changeSpanVisibility(4,'on');
		changeSpanVisibility(5,'off');
		changeSpanVisibility(6,'off');
		changeSpanVisibility(7,'on');
		changeSpanVisibility(8,'on');
		changeSpanVisibility(9,'on');
		changeSpanVisibility(10,'on');
		document.getElementById("infotext").className = "off";
	} else if (document.getElementById("odberatelprodejce").checked) {
		changeSpanVisibility(1,'on');
		changeSpanVisibility(3,'on');
		changeSpanVisibility(4,'on');
		changeSpanVisibility(5,'on');
		changeSpanVisibility(6,'on');
		changeSpanVisibility(7,'on');
		changeSpanVisibility(8,'on');
		changeSpanVisibility(9,'on');
		changeSpanVisibility(10,'on');
		document.getElementById("infotext").className = "on";
	}
}

function changeSpanVisibility(id, c) {
	document.getElementById("span"+id).className = c;
}