function js_ljsend(id){x_aj_sendnewstolj(id,callback);} function js_mod(){x_aj_moderation(callback);} function js_objdel(id){if(confirm('Внимание! Операция удаления. Продолжать?....'))x_aj_obj_del(id,callback);if(window.js_n2e_page_refresh)js_n2e_page_refresh();} function js_objundel(id){if(confirm('Внимание! Восстановить объект. Продолжать?....'))x_aj_obj_undel(id,callback);} function js_objsortdown(id){x_aj_obj_sort(-1,id,callback);} function js_objsortup(id){x_aj_obj_sort(1,id,callback);} function js_comment_add(id,form){var name,cmmt,code;var frm=document.getElementById(form);if(!frm)return false;if(!(name=frm.elements['nickname']))return false;if(!(cmmt=frm.elements['cmmt']))return false;if(cmmt.value=='')return false;if(!(code=frm.elements['gcode']))return false;if(name.value==''||cmmt.value==''||code.value=='')return false;x_aj_comment_add(code.value,id,name.value,cmmt.value,callback);cmmt.value='';code.value='';} FileInput=function(frm,tabid,maxl,data,name){this.MaxLinesNumber=maxl;this.code=new String(data);this.formName=new String(frm);this.tabID=tabid;this.StopMsgAdd="Превышено допустимое количество строк загрузки!";this.StopMsgRemove="Невозможно удалить первую строку!";this.InputName=new String(name);} FileInput.prototype={add:function(){return this._tabcontrol(1,1);},remove:function(){this._tabcontrol(1,-1);},_alert:function(msg){if(msg)alert(msg);},_tabcontrol:function(n,d){var frm,num,count=0,i,tag="";if(!(frm=findElement(this.formName)))return false;for(i=0;i0){if(this.MaxLinesNumber<=count){this._alert(this.StopMsgAdd);return true;} tag=this.code;s=this.code.split(//);if(s.length>1)tag=s[0]+(count+1)+' '+s[1];insertTableRow(this.tabID,-1,tag);}else{theTable=getTable(this.tabID) if(theTable.rows.length<=0)return true;i=theTable.rows.length-1;if((i-1)>0)removeRow(this.tabID,i);else this._alert(this.StopMsgRemove);} return true;}} function DHTML_api(){if(document.images){this.isCSS=(document.body&&document.body.style)?true:false this.isW3C=(this.isCSS&&document.getElementById)?true:false this.isIE=(this.isCSS&&document.all)?true:false this.isNN=(document.layers)?true:false this.isIECSS=(document.compatMode&&document.compatMode.indexOf("CSS1")>=0)?true:false}} DHTML_api.prototype={show:function(obj){var theObj=this.get_object(obj);if(theObj)theObj.visibility="visible";},hide:function(obj){var theObj=this.get_object(obj);if(theObj)theObj.visibility="hidden";},getHeight:function getHeight(){if(this.isIE)return document.body.clientHeight;if(this.isNN)return window.innerHeight;if(this.isCSS)return document.body.offsetHeight;return 600;},getWidth:function(){if(this.isIE)return document.body.clientWidth;if(this.isNN)return window.innerWidth;if(this.isCSS)return document.body.offsetWidth;return 800;},size_to:function(obj,x,y){var theObj=this.get_object(obj);if(!theObj)return;if(this.isCSS){var units=(typeof theObj.width=="string")?"px":0;theObj.width=x+units;theObj.height=y+units;} else if(this.isNN) alert('theObj.moveTo(x,y) ');},shift_to:function(obj,x,y){var theObj=this.get_object(obj);if(!theObj)return;if(this.isCSS){var units=(typeof theObj.left=="string")?"px":0;theObj.left=x+units;theObj.top=y+units;}else if(this.isNN)theObj.moveTo(x,y)},shift_by:function(obj,deltaX,deltaY){var theObj=this.get_object(obj);if(!theObj)return;if(this.isCSS){var units=(typeof theObj.left=="string")?"px":0;theObj.left=getObjectLeft(obj)+deltaX+units;theObj.top=getObjectTop(obj)+deltaY+units;}else if(this.isNN){theObj.moveBy(deltaX,deltaY);}},set_zindex:function(obj,zOrder){var theObj=this.get_object(obj);if(!theObj)return;theObj.zIndex=zOrder;},set_bkcollor:function(obj,color){var theObj=this.get_object(obj);if(!theObj)return;if(this.isNN){theObj.bgColor=color;}else if(this.isCSS){theObj.backgroundColor=color;}},_seek_layer:function(doc,name){var theObj;for(var i=0;i0)theObj=this._seek_layer(document.layers[i].document,name);} return theObj;},get_raw_object:function(obj){if(typeof obj!="string")return obj;if(this.isW3C)return document.getElementById(obj);else if(this.isIE)return document.all(obj);else if(this.isNN)return this._seek_layer(document,obj);return null;},get_object:function(obj){var theObj=this.get_raw_object(obj);if(theObj&&this.isCSS)theObj=theObj.style;return theObj;},get_object_left:function(obj){var elem=this.get_raw_object(obj);var result=0;if(document.defaultView){var style=document.defaultView;var cssDecl=style.getComputedStyle(elem,"");result=cssDecl.getpropertyValue("left");}else if(elem.currentStyle){result=elem.currentStyle.left;}else if(elem.style){result=elem.style.left;}else if(this.isNN){result=elem.left;} return parseInt(result);},get_object_top:function(obj){var elem=this.get_raw_object(obj);var result=0;if(document.defaultView){var style=document.defaultView;var cssDecl=style.getComputedStyle(elem,"");result=cssDecl.getpropertyValue("top");}else if(elem.currentStyle){result=elem.currentStyle.top;}else if(elem.style){result=elem.style.top;}else if(this.isNN){result=elem.top;} return parseInt(result);},get_object_width:function(obj){var elem=this.get_raw_object(obj);var result=0;if(elem.offsetWidth){result=elem.offsetWidth;}else if(elem.clip&&elem.clip.width){result=elem.clip.width;}else if(elem.style&&elem.style.pixelWidth){result=elem.style.pixelWidth;} return parseInt(result);},get_object_height:function(obj){var elem=this.get_raw_object(obj);var result=0;if(elem.offsetHeight){result=elem.offsetHeight;}else if(elem.clip&&elem.clip.height){result=elem.clip.height;}else if(elem.style&&elem.style.pixelHeight){result=elem.style.pixelHeight;} return parseInt(result);},get_inside_window_width:function(){if(window.innerWidth){return window.innerWidth;}else if(this.isIECSS){return document.body.parentElement.clientWidth;}else if(document.body&&document.body.clientWidth){return document.body.clientWidth;} return 0;},get_inside_window_height:function(){if(window.innerHeight){return window.innerHeight;}else if(this.isIECSS){return document.body.parentElement.clientHeight;}else if(document.body&&document.body.clientHeight){return document.body.clientHeight;} return 0;}} function n2e_textarea_size(id,rows){var obj;if(!(obj=findElement(id)))return false;if(obj.type=='textarea')obj.rows=rows;} function cookie_write(cookie_n,value){var exp=new Date();var nowPlusOneWeek=exp.getTime()+(7*24*60*60*1000);exp.setTime(nowPlusOneWeek);document.cookie=cookie_n+"='"+escape(value)+"'; expires="+exp.toGMTString();} function GetCookieValueByName(name) {var beg=document.cookie.indexOf(name+"=");if(beg==-1)return false;var end=document.cookie.indexOf(";",beg+name.length);if(end==-1)end=document.cookie.length;var val=new String();val=unescape(document.cookie.substring(beg+name.length+1,end));val=val.replace(/\'/g,"");return val;} function n2e_before_submit(id){ var frm=findElement(id); if(!frm) return false; if(findElement('tag_contol') && n2e_linked_tags_number==0 ){ if(!confirm('Внимание! Для объекта не определено ни одного тега! Сохранить без тегов?')){ goToAnchor('tags'); return false; } } frm.submit(); } function goToAnchor(nameAnchor){ window.location.hash=nameAnchor; } function getloclist(tag,id,nw){ nw=nw||""; var frm=findElement("id"+tag+"_sec"); if(!frm) return false; var sel=findElement(tag); if(!sel) return false; x_aj_getloclist(tag,id,sel.value,nw,callback); } function getloclist_add(fl,tag,id){ var i=findElement(fl); if(!i ) return false; if(i.value=='')return false; getloclist(tag,id,i.value); i.value=''; }