/*===============================================*/
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;
}
