
var VERSION = '20260326';

//var storage = localStorage;
var storage = sessionStorage;

function setVersionToAbout() {
        $("#dialog_about_version").html(VERSION);
}
function getContentWidth() {
	var en=new Object(JSON.parse(storage.getItem("_Env")));
	if(_isEmpty(storage.getItem("_TitleW"))){
		storage.setItem("_TitleW", getTitleWidth());
	}
        if(_isEmpty(storage.getItem("_BlockW"))){
                storage.setItem("_BlockW","10");
        }
        if(_isEmpty(storage.getItem("_Block"))){
                storage.setItem("_Block","100");
        }
	if(en.useSystemTree === "1" && _isEmpty(storage.getItem("_SystemTreeW"))) {
		storage.setItem("_SystemTreeW", getSystemTreeWidth());
	}
	return getSystemTreeWidth() + parseInt(storage.getItem("_TitleW")) + parseInt(storage.getItem("_BlockW")) * parseInt(storage.getItem("_Block")) + 60;
}
function getContentHeight(offset) {
	if(offset !== 0 && !offset) offset = 20;
	return window.innerHeight-$('#content').offset().top - $('#content2').height() - $('#bottom').height() - offset;
}
function getContentVisibleArea() {
	var eleCont = document.getElementById("content");
	var contTop = parseInt(eleCont.getBoundingClientRect().top);
	var eleCont2 = document.getElementById("content2");
	var cont2Top = parseInt(eleCont2.getBoundingClientRect().top);
var visible = cont2Top - contTop;
//	var visible = cont2Top-contTop+parseInt(Objects.BlockH*1.5);
	var accStr = eleCont.scrollTop;
var skipTop = Math.ceil((accStr-11)/Objects.BlockH);	// considering value=0
var visibleCont = Math.ceil(visible/Objects.BlockH);	//top +1 bottom +1
//	var skipTop = parseInt(accStr/Objects.BlockH);	// considering value=0
//	var visibleCont = parseInt(visible/Objects.BlockH);	//top +1 bottom +1
	var baseobj=new Object(_getList("db"));

	if(isNaN(skipTop)) skipTop = 1;
	if(isNaN(visibleCont)) visibleCont = baseobj.length - 1;
	if(skipTop<=0) skipTop=1;
//console.log("Test1:" + accStr + "=>" + skipTop + ", " + visibleCont);

	return {"top":skipTop, "count":visibleCont};
}
function getTitleWidth() {
	var en=new Object(JSON.parse(storage.getItem("_Env")));
	if(!_isEmpty(en.accession_cvs_width)){
		return parseInt(en.accession_cvs_width);
	} else if(storage.getItem("_Name") == "id"){
		return 180;
	} else {
		return 220;
	}
}
function getSystemTreeWidth() {
	var en=new Object(JSON.parse(storage.getItem("_Env")));
	if(storage.getItem("_SYSTREE") === "on") {
		if(!_isEmpty(storage.getItem("_SystemTreeW"))) {
			return parseInt(storage.getItem("_SystemTreeW"));
		} else {
			return 100;
		}
	} else {
		return 0;
	}
}
