var dbg = false;
var cookieName = 'style';
//**********************************************************************************************************************
//
// Author: GF
// www.otm.gov.hu
//
//**********************************************************************************************************************
var ns4 = (document.layers);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);
//**********************************************************************************************************************
// function open_sx()
//**********************************************************************************************************************
function open_sx()
{
window.open(getPath() + '/info.htm?OpenPage', 'info', 'width=400, height=300, statusbar=no, left=50, top=50');
}
//**********************************************************************************************************************
// function openerRefresh(loc)
//**********************************************************************************************************************
function openerRefresh(win, loc)
{
win.opener.location.href = getPath() + '/' + loc;
}
//**********************************************************************************************************************
// function idozito(loops, mess)
//**********************************************************************************************************************
function idozito(loops, mess, win)
{
if (!win) w = window;
else w = win;
for (i = 0; i < loops; i++)
w.status = mess + " ... " + String(i);
}
//**********************************************************************************************************************
// function getElement(id, win)
//**********************************************************************************************************************
function getElement(id, win)
{
var obj;
if (ns4)
{
obj = (win) ? win.document.layers[id] : document.layers[id];
}
else if (ie4)
{
obj = (win) ? win.document.all[id] : document.all[id];
}
else if (ie5 || ns6)
{
obj = (win) ? win.document.getElementById(id) : document.getElementById(id);
}
if (!obj) obj = (win) ? win.document.getElementsByName(id)[0] : document.getElementsByName(id)[0];
return(obj);
}
//**********************************************************************************************************************
// function getPath(mode)
//**********************************************************************************************************************
function getPath(mode)
{
w = window.location;
n = w.pathname.indexOf(".nsf");
n += 4;
p = w.pathname.substr(0, n);
loc = w.protocol + "//" + w.hostname + p;
if (mode == 'P')
return p;
else
return loc;
}
//**********************************************************************************************************************
// function openwin(url, name, ww, wh, scroll, status)
//**********************************************************************************************************************
function openwin(url, name, ww, wh, scroll)
{
var sh = screen.availHeight;
var sw = screen.availWidth;
var p = getPath();
var win;
var attr;
var s;
if (!ww) ww = 400;
if (!wh) wh = 200;
s = scroll ? '1' : '0';
st = status ? '1' : '0';
attr = "toolbar=1, location=1, directories=0, status=" + st + ", menuBar=1, scrollbars=" + s + ", resizable=0, width=" + String(ww) + ", height=" + String(wh) + ", left=" + String((sw - ww) / 2) + ", top=" + String((sh - wh) / 2);
if (dbg) alert('openwin...' + p + url + ', ' + name + ', ' + attr);
win = window.open(p + url, name, attr);
//win.focus();
return win;
}
//**********************************************************************************************************************
// function twistie()
//**********************************************************************************************************************
function twistie()
{
// Thanks for www.dominopower.com
var i;
var nullcount;
var expand;
var collapse;
expand=new Image(); // creates new image object instance and assign reference
expand.src = getPath() + '/expand.gif?OpenImageResource'; //place URL to your image for expand
collapse=new Image();
collapse.src = getPath() + '/collapse.gif'; //place URL to your image for collapse
nullcount=1; // initialize nullcount to non-zero so it enters the while loop.
while (nullcount ) //while loop tests if all the images are loaded by the browser
{
nullcount=0; // Reset nullcount which counts number of images remaining to download.
// document.images is collection of all images (
tags) on the document
// it has length attribute representing the image count.
for (i = 0; i < document.images.length; i++)
{
if (document.images[i].src == null) // src is property storing image url
nullcount++;
else
{
if (document.images[i].src.indexOf('expand.gif') > 0 ) // checks expand
document.images[i].src=expand.src;
else if(document.images[i].src.indexOf('collapse.gif') > 0) //checks collapse
document.images[i].src=collapse.src;
}
}
}
}
//**********************************************************************************************************************
// function datum()
//**********************************************************************************************************************
function datum()
{
var ie;
if (navigator.userAgent.indexOf('MSIE') > -1) ie = 0; else ie =1900;
var nap = new Array("vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat");
var ho = new Array("január","február","március","április","május","június","július","augusztus","szeptember","október","november","december");
var ma = new Date();
var ev = ie + ma.getYear();
document.write(ev + ". " + ho[ma.getMonth()] + " " + ma.getDate() + ". " + nap[ma.getDay()] + " ");
}
//**********************************************************************************************************************
// function submit_ff()
//**********************************************************************************************************************
function submit_ff()
{
var v = replaceSubstring(getElement('gyk').value, unescape(' '), '+');
var loc = location;
var view = getElement('ActView').value;
var query = getElement('Query_String').value;
var url;
if (view == '' && query != '')
view = 'web_search_results';
url = getPath() + '/' + view + '?OpenView&StartKey=';
if (v != '')
{
v = url + v + '&CollapseView';
loc.replace(v);
return false;
}
else
{
return false;
}
return false;
}
//**********************************************************************************************************************
// function submit_fts(vw)
//**********************************************************************************************************************
function submit_fts(vw)
{
var v1 = replaceSubstring(getElement('v_query_1').value, unescape(' '), '+');
var v2 = replaceSubstring(getElement('v_query_2').value, unescape(' '), '+');
var v = (v1 != '' ? v1 : v2);
var loc = location;
var view = vw;
var query = getElement('Query_String').value;
var url;
if (v == '') return false;
//view = 'web_search_results';
// url = getPath() + '/' + view + '?SearchView&Query=' + v + '*' + '&SearchOrder=4';
url = getPath() + '/' + view + '?SearchView&Query=' + v + '*';
loc.href = url;
return false;
}
//**********************************************************************************************************************
// function replaceSubstring(s, source, target)
//**********************************************************************************************************************
function replaceSubstring(s, source, target) {
// Replaces s substring in a String with another substring
var pos;
pos = s.indexOf(source);
do {
if (pos == -1) {
pos = -1;
}
else {
if (pos == 0 && s.length == 1) {
s = target;
pos = -1;
}
else {
s = s.substring(0, pos) + target + s.substring(pos + source.length);
pos = s.indexOf(source, pos + target.length);
}
}
} while (pos > -1);
return(s);
}
//*************************************************************************
// function clickIt(loc, dcnum, mode)
//*************************************************************************
function clickIt(loc, dcnum, mode)
{
var a;
var c;
var d;
if (mode == "F")
{
a = getPath() + "/" + loc + "?OpenView&Start=" + dcnum + "&Expand=" + dcnum;
}
else if (mode == true)
{
a = getPath() + "/" + loc + "/" + dcnum + "?OpenDocument";
}
else
{
c = StrLeft(dcnum, '.');
d = (c.length == 0) ? dcnum : c;
a = getPath() + "/" + loc + "?OpenView&Start=" + d + "&Expand=" + dcnum;
}
window.location.href = a;
}
function StrLeft(s, p) {
return(String(s).substring(0, String(s).indexOf(String(p))));
}
//*************************************************************************
// function w(docid)
//*************************************************************************
function w(docid)
{
var pw;
var path;
path = getPath() +'/wsz/' + docid + '?OpenDocument';
if(!pw) pw = window.open(path, 'pw', 'toolbar=0, resizable=1, scrollbars=1, width=795, height=595');
pw.focus();
window.location.reload();
}
//**********************************************************************************************************************
// function whichKey(e)
//**********************************************************************************************************************
function whichKey(e) {
e = (e) ? e : (window.event) ? window.event : "";
if (e)
{
var key = "";
var elem = (e.target) ? e.target : e.srcElement;
if (e.which)
key = e.which;
else
key = e.keyCode;
return key;
}
return false;
}
//**********************************************************************************************************************
// function Right(s, n)
//**********************************************************************************************************************
function Right(s, n) {
return(String(s).substring(String(s).length - n, String(s).length));
}
//**********************************************************************************************************************
// function hasab(mode)
//**********************************************************************************************************************
function hasab(mode)
{
var i;
var j;
var k;
var l;
var n = 3; // cikkek + 1
var obj;
var d = new Date();
var date = d.getFullYear() + '.' + Right('0' + (d.getMonth() + 1), 2) + '.' + Right('0' + d.getDate(), 2);
var divCollection = document.getElementsByTagName("DIV");
n = 1;
for (i=0; i < divCollection.length; i++) {
obj = divCollection[i];
if (obj.className == 'cikk') {
for (j = 0; j < obj.attributes.length; j++) {
if(obj.attributes[j].name == "prop") {
for (l = 0; l < obj.attributes.length; l++) {
if (obj.attributes[l].name == 'date') {
if (obj.attributes[l].value >= date && !mode) {
for (var z = 0; z < obj.childNodes.length; z++) {
if (obj.childNodes[z].nodeName == "IMG") obj.childNodes[z].className = 'img_leadimg';
}
n++;
} else {
k = parseInt(obj.attributes[j].value, 10);
num = k % 2;
obj.className = 'cikk' + (n + k) % 2;
for (var z = 0; z < obj.childNodes.length; z++) {
if (obj.childNodes[z].nodeName == "IMG") obj.childNodes[z].className = 'img_leadimg_kicsi';
}
}
}
}
}
}
}
else if (obj.className == 'cikk1' || obj.className == 'cikk0') {
obj.className = "cikk";
for (var z = 0; z < obj.childNodes.length; z++) {
if (obj.childNodes[z].nodeName == "IMG") obj.childNodes[z].className = 'img_leadimg';
}
}
}
}
//**********************************************************************************************************************
// function proba()
//**********************************************************************************************************************
function proba()
{
var i;
var j;
var k;
var n = 3; // cikkek + 1
var obj;
var divCollection = document.getElementsByTagName("DIV");
for (i=0; i < divCollection.length; i++) {
obj = divCollection[i];
if (obj.className == 'cikk') {
for (var j = 0; j < obj.attributes.length; j++) {
if(obj.attributes[j].name == "prop") {
k = parseInt(obj.attributes[j].value, 10);
num = k % 2;
if (k < n) {
for (var z = 0; z < obj.childNodes.length; z++) {
if (obj.childNodes[z].nodeName == "IMG") obj.childNodes[z].className = 'img_leadimg';
}
}
else {
obj.className = 'cikk' + (n + k) % 2;
}
}
}
}
else if (obj.className == 'cikk1' || obj.className == 'cikk0') {
obj.className = "cikk";
}
}
}
//**********************************************************************************************************************
// function failedSave(mess, width, height, u)
//**********************************************************************************************************************
function failedSave(mess, width, height, u) {
var vh;
if (vh) {
vh.focus();
}
else {
// window.history.back(-1);
// vh = openwin('/webMESS?OpenForm', 'vh', width, height, true);
// vh.opener.location.href = u;
}
//var m = '
' + mess + '
Az adatlap mentése nem történt meg!
Folytatás';
window.location.href = u;
// vh.focus();
//var divCollection = vh.document.getElementsByTagName("DIV");
//alert('vh=' + vh + '\n' + vh.document.getElementById('mess') + '\ndivCollection.length=' + divCollection.length);
// vh.document.writeln('
' + mess);
// vh.document.writeln('
Az adatlap mentése nem történt meg!
');
// vh.document.writeln('Folytatás');
return true;
}
//**********************************************************************************************************************
// function successSave(mess, width, height, u)
//**********************************************************************************************************************
function successSave(mess, width, height, u) {
var vh;
if (vh) {
vh.focus();
}
else {
vh = openwin('/webMESS?OpenForm', 'vh', width, height, true);
vh.opener.history.back(-2);
}
vh.document.writeln('
' + mess);
vh.document.writeln('
Az adatlap mentése megtörtént !
');
vh.document.writeln('Folytatás');
vh.document.writeln('Folytatás');
vh.opener.document.bgColor='bisque';
return true;
}
//**********************************************************************************************************************
// function openList()
//**********************************************************************************************************************
function openList() {
var vl;
if (vl)
vl.focus();
else
vl = openwin('/webPARTNER?OpenForm', 'Adatszolg', undefined, undefined, false, false);
}
//**********************************************************************************************************************
// function osszeg(obj)
//**********************************************************************************************************************
function kosszeg(obj, k) {
// var k = whichKey(window.event);
//alert(k);
if ((k >= 48) && (k <= 57) || (k >= 96) && ( k <= 105 ) || (k == 37) || (k == 39) || (k == 9) || (k == 8) || (k == 46)) {
return true;
}
else {
return false;
}
}
//**********************************************************************************************************************
// function q_ss(k)
//**********************************************************************************************************************
function q_ss(k) {
var field = getElement('q_search');
if (field.value == '' || field.value == 'Mit keres?')
{
alert('Nem adott meg kereső szót !!!');
return false;
}
location.href = getPath() + '/ftsearch?SearchView&Query=' + field.value + '*&SearchOrder=1&SearchMax=0&SearchWV=FALSE&SearchThesaurus=TRUE';
return false;
}
//**********************************************************************************************************************
// function setActiveStyleSheet(title)
//**********************************************************************************************************************
function setActiveStyleSheet(title) {
createCookie(cookieName, title, 365);
var i, a, main;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if(a.getAttribute("title") == title) a.disabled = false;
}
}
}
//**********************************************************************************************************************
// function getActiveStyleSheet()
//**********************************************************************************************************************
function getActiveStyleSheet() {
var i, a;
for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
}
return null;
}
//**********************************************************************************************************************
// function getPreferredStyleSheet()
//**********************************************************************************************************************
function getPreferredStyleSheet() {
var i, a;
for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1
&& a.getAttribute("rel").indexOf("alt") == -1
&& a.getAttribute("title")
) return a.getAttribute("title");
}
return null;
}
//**********************************************************************************************************************
// function createCookie(name,value,days)
//**********************************************************************************************************************
function createCookie(name, value, days) {
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else expires = "";
document.cookie = name + "=" + value + expires + "; path=/";
}
//**********************************************************************************************************************
// function readCookie(name)
//**********************************************************************************************************************
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return false;
}
//**********************************************************************************************************************
// Alap színséma beállítása
//**********************************************************************************************************************
if (readCookie(cookieName)) {
setActiveStyleSheet(readCookie(cookieName));
}
else {
setActiveStyleSheet('default');
}
function open_keydown(fn,e) {
try {
if (e.keyCode || e.which) { var key = (e.keyCode) ? (e.keyCode) : (e.which); if ((key==32) || (key==13)) { window.open(fn, '', 'scrollbars=no,status=no,resizable=yes,left=0,top=0'); }}
}
catch(ex) {}
}
function open_click(fn) {
window.open(fn, '', 'scrollbars=no,status=no,resizable=yes,left=0,top=0');
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i