function fActivate(prvek) {
	//prvek.style.border="1px solid #333333";
	//prvek.style.backgroundColor="#FFF9F9";
	prvek.className="activeInput";
}

function fDeactivate(prvek) {
	//prvek.style.border="1px solid #CCCCCC";
	//prvek.style.backgroundColor="#FFFFFF";
	prvek.className="deactiveInput";
}

function MeSelect( strName, iFirstIndex ){
    this.strName = strName    
    this.iFirstIndex = iFirstIndex
    this.Validate = function( field ) {
        if (field.selectedIndex<this.iFirstIndex) {
            alert('Vyberte prosím položku v poli "' + this.strName + '".');
            field.focus()
            return false     
        }
        return true
    }
}  

function MeText( strName, fAllowEmpty ){
    this.strName = strName    
    this.fAllowEmpty = fAllowEmpty
    this.Validate = function( field ) {

        if ( (!this.fAllowEmpty) && (field.value=="") ) {
            alert('Vyplňte prosím pole "' + this.strName + '".')
			field.focus()
            return false     
        }
		if(this.strName=='EMAIL' && field.value.indexOf("@")==-1){	// validace emialu
			alert ("Email musíte vyplnit ve tvaru: xx@domena.yy");
			field.focus();
            return false 
		}		
        return true
    }
}  
 
function Validate(theForm,arr) {
    for( var i=0; i<theForm.length; i++ ) {
        if( arr[i] ) {
            if( !arr[i].Validate(theForm.elements[i]) )
                return false
        }
    }
    return true;
} 

function DeleteItem(a,hlaska)
      {
          if (confirm(hlaska))
	  {
		window.location=a;
		
		 }
      }
	  
function open_win(movie,sirka,vyska,name,scroll,resize){
	window.open(movie,name,'scrollbars='+scroll+',toolbar=no,resizable='+resize+',location=left,width='+sirka+',height='+vyska);
}

function open_win1(dokument,sirka,vyska,centrovat,pozice_l,pozice_h,toolbar) {
  if (centrovat == 1) {
	  so = screen.width;
		vo = screen.height;
		zleva = ((so - sirka) / 2) - 13;
		shora = (vo - vyska) / 2;
		//shora = 100;
	} else {
		zleva = pozice_l;
		shora = pozice_h;
	}
  popup_win = window.open(dokument,"popup_okno","width="+sirka+",height="+vyska+",left="+zleva+",top="+shora+",location="+toolbar+",menubar="+toolbar+",resizable=0,scrollbars=1,status=0,titlebar="+toolbar+",toolbar="+toolbar);
  popup_win.focus();
}

function new_win(url) {
	popup_win=window.open(url,"","");
	popup_win.focus();
}

function closewin(){
    parent.window.close();
}

function showInputVal(frm, hodnota){
	if(frm.value==''){
		frm.value=hodnota;
	}
}

function hideInputVal(frm, hodnota){
	if(frm.value==hodnota) {
		frm.value='';
	}
}

function tisk(){
	print();
}

function countitvp(form, pole, param) {
 var lock = false
  if (!lock) {
    lock=true;
    str= pole.value;
    strlength= str.length;
    if (strlength > slen) {
      form.zbyva.value="!!!";
      alert("Příliš dlouhý text!");
      pole.value=str.substring(0,slen);
    }else{
      form.zbyva.value = slen - strlength;
      form.napsano.value=strlength;
	}
  lock=false;
  }
}

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')){ 
      window.sidebar.addPanel(addTitle,addUrl,''); 
      return false; 
  } 
  return false; 
}

