/*********************************************************M\u00F5ned Javascripti funktsioonid, mis on kasutusel \u00FCle baasi**********************************************************/	/* hoiab serveri sessiooni \u00FCleval */function keepSessionAlive() {var now = new Date();foo = new Image();var newurl = '/icons/ecblank.gif?time='+now.toGMTString();foo.src = newurl;}	/* teeb javascripti jooksutamisse v\u00E4ikese pausi */function pause(amount) {d = new Date(); while (1) {mill=new Date(); diff = mill-d; if( diff > amount ) {break;}}}	/* leiab url-i pealt \u00FChe query v\u00E4\u00E4rtuse */function urlquery(queryString)	{var query = location.search.substring(1); var pairs = query.split("&");	for(var i = 0; i < pairs.length; i++) {		var pos = pairs[i].indexOf('='); if (pos == -1) continue;		var argname = pairs[i].substring(0,pos);var value = pairs[i].substring(pos+1);		if(argname == queryString) return value;}	return ''}	/* leiab url-i v\u00E4\u00E4rtuse kuni andmebaasini */function getDBURL(){var query = location.pathname;var pos=query.indexOf('.nsf');return query.substring(0, pos)+'.nsf'}	/*annab avatud dokumendi editeerimisURL-i*/function getEditURL(){var url = document.URL;var pos=url.indexOf('OpenDocument');return url.substring(0, pos)+'EditDocument'}	/*this function checks that the value of a date is in the dd.mm.yyyy format */	/* obj = Input whose value is to be checked */function isValidDate(obj)	{	if (obj.value.length != 10) return false;	dateBits = obj.value.split('.'); if (dateBits == null) return false;	day = dateBits[0];month = dateBits[1];year = dateBits[2];	if (isNaN(day) || isNaN(month) || isNaN(year)) return false;	if ((month < 1 || month > 12) || (day < 1 || day > 31)) {return false;	} 	if ((month==4 || month==6 || month==9 || month==11) && day==31) {return false;}	if (month == 2) {var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); if (day>29 || (day==29 && !isleap)) {return false;}} 	return true;}	/* radiobuttoni valideerimine */function isRadioFilled(FieldName){	if(FieldName == null) return true;	for (var i=0;i<FieldName.length;i++) {if(FieldName[i].checked) return true}	return false;}	/* textarea valideerimine */function isTextAreaFilled(FieldName){	if(FieldName == null) return true;	if(FieldName.value == "") return false;	return true;	}	function expandCategory(id){	if( document.getElementById(id).style.display=='none' )	{ document.getElementById(id).style.display = '';}	else{ document.getElementById(id).style.display = 'none'; }}function setContent(elementID, newContent){ document.getElementById(elementID).innerHTML=newContent; }String.prototype.trim = function() {a = this.replace(/^\s+/, '');return a.replace(/\s+$/, '');}