function setCookie(name, value) { var expire = "0, 01-01-2050 00:00:00 GMT" document.cookie = name + "=" + escape(value) + "; path=/; expires=" + expire; }; //func function getCookie(Name) { var search = Name + "=" if (document.cookie.length > 0) { offset = document.cookie.indexOf(search) if (offset != -1) { offset += search.length; end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(offset, end)); }; //if }; //if }; //func function getObjectByID( id, o ) { var c, el, els, f, m, n; if (!o) o = document; if (o.getElementById) el = o.getElementById(id); else if (o.layers) c = o.layers; else if (o.all) el = o.all[id]; if (el) return el; if (o.id==id || o.name==id) return o; if (o.childNodes) c = o.childNodes; if (c) for (n=0; n 0 ) { sl.remove( 0 ); }; //while }; //if }; //func function getInnerHtml(id) { obj = getObjectByID(id); if (obj!=null) return obj.innerHTML; }; //func function setInnerHtml(id, text) { obj = getObjectByID(id); if (obj!=null) obj.innerHTML = text; }; //func function copyInnerHtml(sid, did) { sobj = getObjectByID(sid); if (sobj!=null) { setInnerHtml(did, sobj.innerHTML); }; //if }; //func function exchangeInnerHtml( sid, did ) { oldHtml = getInnerHtml( sid ); copyInnerHtml(did, sid); setInnerHtml(did, oldHtml); }; //func function GetClassName( id ) { obj = getObjectByID(id); if (obj!=null) { return obj.className; }; //if }; //func function SetClassName( id, className ) { obj = getObjectByID(id); if (obj!=null) { obj.className = className; }; //if }; //func function copyValue( sid, did ) { sobj = getObjectByID( sid ); dobj = getObjectByID( did ); if ( ( sobj != null ) && ( dobj != null ) ) { dobj.value = sobj.value; }; //if }; //func function ShowHideObj(id, ret) { obj = getObjectByID(id); if (obj!=null) { setCookie( 'erimex_rubricator_groups', 'off' ); setCookie( 'erimex_rubricator_marks', 'off' ); if (obj.className=='hidden') { setCookie( 'erimex_' + id, 'on' ); obj.className = 'visible'; } else { setCookie( 'erimex_' + id, 'off' ); obj.className = 'hidden'; }; //if }; //if if (ret==true) { return obj; }; //if }; //func function cCode(f) { if ( f.c.value == '') { alert('Введите код защиты!'); } else { f.submit(); }; // }; //func function centralizeObject( id, width, height ) { obj = getObjectByID( id ); if ( ( obj ) && ( obj.style ) ) { screenWidth = document.body.clientWidth; screenHeight = document.body.clientHeight; obj.style.width = width; obj.style.height = height; obj.style.left = ( screenWidth - width ) / 2; obj.style.top = document.body.scrollTop + 200; //( ( screenHeight - height ) / 2 ) + document.body.scrollTop; }; //if }; //func function _ajax( id ) { obj = getObjectByID( id ); if ( ( obj ) && ( obj.innerHTML ) ) { obj.innerHTML = 'Загрузка данных...'; }; //if }; //func function addEvent( obj, evType, fn ) { if ( obj.addEventListener ) { obj.addEventListener(evType, fn, false); return true; } else if ( obj.attachEvent ) { var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; }; //if }; //func