/*===============================================*/
function ProfileRTypeChS(Id) {
	if (Id.className=='ExtractTO') {
				Id.className='ExtractTC'; 
				document.getElementById(Id.id+'_content').style.display="none";
				saveCookie (Id.id, 0, 7);
	}	else {
				Id.className='ExtractTO';
				document.getElementById(Id.id+'_content').style.display="block";
				saveCookie (Id.id, true, 7);
		}		
}
/*===============================================*/
function SetOpenRType(Id) {
		Id.className='ExtractTO';
		Str=Id.id+'_content.style.display=""';
		saveCookie (Id.id, true, 7);
		eval(Str);	
	}
/*===============================================*/
function ConfirmGet(aMessage, aURL, aFrame) {
var result; 

 result= confirm(aMessage);
 if (result) {
  window.open(aURL, aFrame ,'');
 } 
}

/*===============================================*/
function saveCookie (jmeno, hodnota, dny) {
	var denExp = new Date();
	denExp.setTime (denExp.getTime() + (86400 * 1000 * dny));
  document.cookie = jmeno + "=" + escape(hodnota) + "; expires=" + denExp.toGMTString() +  "; path=/";
}

/*===============================================*/
function OpenWindow(aURL, aWidth, aHeight){
 var v_Top = (screen.height - aHeight) / 2;
 var v_Left = (screen.width - aWidth) / 2;
 var v_Features='Height=' + aHeight
   + ',Width=' + aWidth
   + ',Top=' + v_Top
	 + ',Left=' + v_Left
	 + 'toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=1';
	 window.open(aURL,'',v_Features);
}

/*===============================================*/
function Trim (a_String) {
var buff = a_String.toString();
 while (buff.substr(0,1) == ' ')  buff = buff.substr(1);
 return buff;
}
//**********************************************************
//*                 Odstraní počáteční mezery              *
//**********************************************************
function Trim (pString) {
var buff = pString.toString();
 
 while (buff.substr(0,1) == ' ') 
  buff = buff.substr(1);
 return buff;	
} 
//**********************************************************
function ShowError(pId, pErrorMessage) {
	pId.focus();
	alert(pErrorMessage);
}
//**********************************************************
function CheckInputBox(pId, pMinChars, pErrorMessage) {
	var pString=new String('');

	pString = Trim(pId.value);
	if ((pMinChars>0) && (pString.length<pMinChars)) {
				ShowError(pId, pErrorMessage);	
				return false;
			}
	if (pId.value=='') {
				ShowError(pId, pErrorMessage);	
				return false;
			}
			
	return true;
}
//**********************************************************
function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function CheckNumberRange(pId, pFlag, pMin, pMax, pErrorMessage){
//**********************************************************
	pId.value = Trim(pId.value);
	if ((pId.value=='') && (pFlag!='!')) return true;
	if ((pId.value=='') && (pFlag=='!')) {
				ShowError(pId, pErrorMessage);
				return false;
			}	
	if (isInteger(pId.value)) {
				cislo = parseInt(pId.value);
				if ((cislo<pMin) || (cislo>pMax)) {
					ShowError(pId, pErrorMessage);
					return false;
				}
				
			} else {
				ShowError(pId, pErrorMessage);
				return false;
			}
	return true;
}

function showAllJobs() {
//**********************************************************
	id1=document.getElementById('jobsSelect');
	id1.style.display='none';
	id2=document.getElementById('jobsAll');
	id2.style.display='';
}

function showNoteForm() {
//**********************************************************
	id1=document.getElementById('noteFormO');
	id1.style.display='';
}

function hideNoteForm() {
//**********************************************************
	id1=document.getElementById('noteFormO');
	id1.style.display='none';
}

function noteBigWindow() {
//**********************************************************
	idnote1=document.getElementById('note1');
	idnote2=document.getElementById('note2');
	idnoteBigWind=document.getElementById('noteBigWind');
	idnote1.value=idnote2.value;
	idnoteBigWind.style.display='';
}

function noteHideWindow() {
//**********************************************************
	idnote1=document.getElementById('note1');
	idnote2=document.getElementById('note2');
	idnoteBigWind=document.getElementById('noteBigWind');
	idnote2.value=idnote1.value;
	idnoteBigWind.style.display='none';
}	

function CoMenu(menu, stav) {
//**********************************************************
	idmenu=document.getElementById(menu);
	idmenu.style.display=stav;
}	
