/* ==================================================== ##
##             COPYRIGHTS © DANNEO PHP TEAM             ##
## ==================================================== ##
## PRODUCT : CMS(CONTENT MANAGEMENT SYSTEM)             ##
## LICENSE : GNU 2(General Public License v.2)          ##
## TECHNOLOGIES : PHP & MySQL                           ##
## WWW : www.danneo.com | www.danneo.org                ##
## E-MAIL : help@danneo.com                             ##
## ==================================================== */
// CLASS : DN_System_Load
// Load
function DN_System_Load(sysini){
this.ini = sysini ? sysini : '';
this.wib = screen.width;
this.heb = screen.height;
this.XCPosit = 0;
this.YCPosit = 0;
this.wini = 0;
this.obj = '';
this.marker = '';
this.documes = (document.getElementById || document.createElement || document.getElementsByTagName) ? true : false;
this.objects = window.addEventListener || window.attachEvent ? window : document.addEventListener ? document : null;
this.types = 'load';
this.rusid = new Array('À','Á','Â','Ã','Ä','Å','¨','Æ','Ç','È','É',
                       'Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô',
                       'Õ','×','Ö','Ø','Ù','Ý','Þ','ß','Û','Ú','Ü',

                       'à','á','â','ã','ä','å','¸','æ','ç','è','é',
                       'ê','ë','ì','í','î','ï','ð','ñ','ò','ó','ô',
                       'õ','÷','ö','ø','ù','ý','þ','ÿ','û','ú','ü',

                       ' ','\'','"','(',')','[',']',':','/','.','-'
                      );
this.latid = new Array('A','B','V','G','D','E','Jo','Zh','Z','I','J',
                       'K','L','M','N','O','P','R','S','T','U','F','H',
                       'Ch','C','Sh','Csh','E','Ju','Ja','Y','','',

                       'a','b','v','g','d','e','jo','zh','z','i','j',
                       'k', 'l','m','n','o','p','r','s','t','u','f','h',
                       'ch','c','sh','csh','e','ju','ja','y','','',

                       '_','','','','','','','','_','_','_'
                       );
}
// ADDSEVENT
DN_System_Load.prototype.addsevent = function(func){
if(this.objects.addEventListener){
this.objects.addEventListener(this.types,func,false);
return true;
} else if (this.objects.attachEvent){
this.objects.attachEvent("on" + this.types,func);
} else {
return false;
}
}
// Browser
DN_System_Load.prototype.browser = function(){
 this.ver = navigator.appVersion;
 this.agent = navigator.userAgent.toLowerCase();
 this.dom = document.getElementById ? 1:0;
 this.all = document.all ? 1:0;
 this.ie5 = (this.ver.indexOf("MSIE 5")>-1 && this.dom) ? 1:0;
 this.ie6 = (this.ver.indexOf("MSIE 6")>-1 && this.dom) ? 1:0;
 this.ie7 = (this.ver.indexOf("MSIE 7")>-1 && this.dom) ? 1:0;
 this.ie4 = (document.all && !this.dom) ? 1:0;
 this.ie = this.ie4 || this.ie5 || this.ie6  || this.ie7;
 this.mac = this.agent.indexOf("Mac")>-1;
 this.opera = this.agent.indexOf("Opera")>-1;
 this.ns6 = (this.dom && parseInt(this.ver) >= 5) ? 1:0;
 this.ns4 = (document.layers && !this.dom) ? 1:0;
 this.gecko = (this.agent.indexOf('gecko')!=-1) ? 1:0;
 this.bw = (this.ie || this.ns4 || this.ns6 || this.opera || this.gecko);
 return this;
}
// ALERTS
DN_System_Load.prototype.alerts = function(err){
alert(err);
}
// CONFIRMS
DN_System_Load.prototype.confirms = function(str){
confirm(str);
}
// FIND OBJ
DN_System_Load.prototype.findobj = function(obj){
this.parent = window.document;
if(this.parent.getElementById && this.parent.getElementById(obj)){ return this.parent.getElementById(obj); }
if(this.parent[obj]){ return this.parent[obj]; }
if(this.parent.all && this.parent.all[obj]){ return this.parent.all[obj]; }
if(this.parent.layers && this.parent.layers[obj]){ return this.parent.layers[obj]; }
return null;
}
// FIND TAG
DN_System_Load.prototype.findtag = function(tag){
if(document.getElementsByTagName(tag)){ return document.getElementsByTagName(tag); }
return null;
}
// ALLSELECT
DN_System_Load.prototype.allselect = function(obj){
var formwork = this.findobj(obj);
var total = formwork.elements.length; var b = 0;
for(var i=0; i < formwork.elements.length; i++){
var element = formwork.elements[i];
if(element.type=='checkbox' && element.checked==false){ element.checked = true; } else { element.checked = false; }
if(element.type=='checkbox' && element.checked==true){ b+=1; }
}
formwork.button.value = button + ' [' + b + ']';
}
// COUTNSELECT
DN_System_Load.prototype.countselect = function(obj){
var formwork = this.findobj(obj);
var total = formwork.elements.length; var b = 0;
for(var i=0; i < formwork.elements.length; i++){
var element = formwork.elements[i];
if(element.type=='checkbox' && element.checked==true){ b+=1; }
}
formwork.button.value = button + ' [' + b + ']';
}
// ALLSELECT
DN_System_Load.prototype.openurl = function(url){
window.location = url;
}
// DELCHECK
DN_System_Load.prototype.delcheck = function(obj){
var formwork = this.findobj(obj);
var count = 0;
for(var i=0;i<formwork.elements.length;i++){
var element = formwork.elements[i];
if(element.type=='checkbox' && element.checked==true){ count++; }
}
if(count>0){
if(!confirm(alertdel)){
return false;
}
} else { this.confirms(nodelsel); return false; }
}
// PREVIMG
DN_System_Load.prototype.previmg = function(obj,paths,w,h){
this.hidevideo(); this.hideimg();
var objel = this.findobj(obj);
var move = objel;
this.wini = this.findobj('loaderout');
this.findobj('imgbar').innerHTML = '&nbsp;';
this.wini.style.display = '';

this.XCPosit = objel.offsetLeft;
this.YCPosit = objel.offsetTop + objel.offsetHeight;
while((objel = objel.offsetParent)!=null){
this.XCPosit += objel.offsetLeft;
this.YCPosit += objel.offsetTop;
}

if((this.XCPosit + this.wini.offsetWidth) >= document.documentElement.clientWidth && (this.XCPosit + move.offsetWidth - this.wini.offsetWidth) > 0){
this.XCPosit-= this.wini.offsetWidth;
} else {
this.XCPosit+= move.offsetWidth;
}
this.wini.style.left = this.XCPosit + 'px';
this.wini.style.top = this.YCPosit + 'px';
this.wini.style.opacity = '.90';
this.wini.style.filter = "alpha(opacity:90)";
this.wini.style.display = 'inline';
this.findobj('imgbar').innerHTML = '<img src="' + paths + '" border="0">';
if(w>0 && h>0){
this.findobj('imgsize').innerHTML = w + 'x' + h + 'px';
} else {
this.findobj('imgsize').innerHTML = '&nbsp;';
}
}
// PREVIDEO
DN_System_Load.prototype.prevideo = function(paths){
this.windows(paths,'FLV',408,358);
}

// HIDEGLOBMENU
DN_System_Load.prototype.hideglobmenu = function(){
this.findobj('globmenu').innerHTML = '';
document.cookie = "opendoublemenu=" + escape('close') + "; expires=Fri, 31 Dec 2099 23:59:59 GMT;";
}

// UNSETINPUT
DN_System_Load.prototype.unsetinput = function(obj){
this.findobj(obj).value = '';
}
// HIDEIMG
DN_System_Load.prototype.hideimg = function(){
this.findobj('imgbar').innerHTML = '&nbsp;';
this.findobj('loaderout').style.display = 'none';
}
// HIDEIMG
DN_System_Load.prototype.hidevideo = function(){
if(this.findobj('loadervideo')){
this.findobj('loaderout').style.display = 'none';
}
}
// STYLES ODN
DN_System_Load.prototype.odn = function(obj,styles){
var parentdiv = this.findobj('menu_' + obj);
var parentpanel = this.findobj('panel_' + obj);
if(!parentdiv){ return; }
if(parentdiv.style){ parentdiv = parentdiv.style; }
for(i=0; i < DN.menus.length; i++){
 if(DN.menus[i] != obj){
  this.findobj('menu_' + DN.menus[i]).style.display = 'none';
 }
}
if(styles=='none'){
document.cookie = "openmenu=; expires=Fri, 21 Dec 1976 04:31:24 GMT;";
} else {
document.cookie = "openmenu=" + escape(obj) + "; expires=Fri, 31 Dec 2099 23:59:59 GMT;";
}
parentdiv.display = (styles=='none') ? 'none' : (styles=='block') ? 'block' : (styles=='inline') ? 'inline' : '';
if(parentpanel){
parentpanel.className = (styles=='none') ? 'menupanel' : 'menupanelopen';
}
}
// STYLES RDN
DN_System_Load.prototype.rdn = function(obj,styles){
var parentdiv = this.findobj('menu_' + obj);
if(!parentdiv){ return; }
if(parentdiv.style){ parentdiv = parentdiv.style; }
for(i=0; i < DN.menus.length; i++){
 if(DN.menus[i] != obj){
  this.findobj('menu_' + DN.menus[i]).style.display = 'none';
  this.findobj('panel_' + DN.menus[i]).className = 'menupanel';
 }
}
switch(styles){
 case 'display':
 return (parentdiv.display ? parentdiv.display : '');
 default: return null;
}
}
// STYLES ALLODN
DN_System_Load.prototype.allodn = function(obj,styles){
var parentdiv = this.findobj(obj);
if(!parentdiv){ return; }
if(parentdiv.style){ parentdiv = parentdiv.style; }
parentdiv.display = (styles=='none') ? 'none' : (styles=='block') ? 'block' : (styles=='inline') ? 'inline' : '';
}
// STYLES ALLRDN
DN_System_Load.prototype.allrdn = function(obj,styles){
var parentdiv = this.findobj(obj);
if(!parentdiv) { return; }
if(parentdiv.style) { parentdiv = parentdiv.style; }
switch(styles){
 case 'display':
 return (parentdiv.display ? parentdiv.display : '');
 default: return null;
}
}
// IMGROL
DN_System_Load.prototype.imgrol = function(obj){
var img = this.findobj(obj);
var path = img.src.slice(0,img.src.lastIndexOf('/')+1);
var name = img.src.slice(img.src.lastIndexOf('/')+1,img.src.length);
if(name=='open.gif'){
img.src = path + 'closed.gif';
} else {
img.src = path + 'open.gif';
}
}
// IMGCOOKIE
DN_System_Load.prototype.imgcookie = function(name){
var argv = this.imgcookie.arguments;
var argc = this.imgcookie.arguments.length;
var who = this.findobj('menuface');
var expires = (argc > 2) ? argv[2] : null;
var path    = (argc > 3) ? argv[3] : null;
var domain  = (argc > 4) ? argv[4] : null;
var secure  = (argc > 5) ? argv[5] : false;
if(who.style.display=='none'){ val='closed'; } else { val='open'; }
document.cookie = name + "=" + escape (val) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
// OPACITYOUT
DN_System_Load.prototype.opacityout = function(id){
this.findobj(id).style.display = "none";
this.findobj('loadermessage').style.visibility = "hidden";
}
// CHANGEOPACITY
DN_System_Load.prototype.changeopacity = function(opacity,id){
    var object = this.findobj(id).style;
    object.opacity = ((opacity - 10) / 100);
    object.MozOpacity = ((opacity - 10) / 100);
    object.KhtmlOpacity = ((opacity - 10) / 100);
    object.opacity = '.' + opacity;
    object.filter = "alpha(opacity:" + opacity + ")";
}
// OPACITY
DN_System_Load.prototype.opacity = function(id,opacstart,opacend,millisec){
var speed = Math.round(millisec / 100);
var timer = 0;
 for(i = opacstart; i >= opacend; i--) {
   setTimeout("DN.changeopacity(" + i + ",'" + id + "')",(timer * speed));
   timer++;
 }
 if(opacend == 0){ setTimeout("DN.opacityout('"+id+"')",200); }
}
// LOADER
DN_System_Load.prototype.loader = function(){
var obj = DN.findobj('loadermessage');
var xp = 0; var yp = 0;
if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
  xp = (document.documentElement.clientWidth - 200) / 2;
  yp = (document.documentElement.clientHeight - 30) / 2;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight )){
  xp = (document.body.clientWidth - 200) / 2;
  yp = (document.body.clientHeight - 50) / 2;
}

obj.style.left = xp + "px";
obj.style.top = yp + "px";
obj.style.visibility = 'visible';
this.opacity('loaderlayer',100,0,700);
}
// WINDOWS
DN_System_Load.prototype.windows = function(url,name,wid,hei){
if(!this.ini){ return false; }
var width = (this.wib - wid)/2;
var height = (this.heb - hei)/2;
window.open(url,name,"width="+wid+",height="+hei+",top="+height+",left="+width+",dependent=yes,titlebar=no,scrollbars=no");
}
// WINDOWS
DN_System_Load.prototype.scrollwindows = function(url,name){
if(!this.ini){ return false; }
var wid = (this.wib - 100);
var hei = (this.heb - 100);
var width = (this.wib - wid)/2;
var height = (this.heb - hei)/4;
window.open(url,name,"width="+wid+",height="+hei+",top="+height+",left="+width+",dependent=yes,titlebar=no,scrollbars=yes");
}
// FIX WINDOW
DN_System_Load.prototype.filebrowser = function(url,input){
if(!this.ini){ return false; }
var FBheight = (this.heb - 100);
var FBwidth = (this.wib - 100);
var height = (this.heb - 215);
var left = ((this.wib - FBwidth) / 2);
var top = ((this.heb - FBheight) / 4);
window.open(url + "&input=" + input + "&height=" + height,"FileBrowser","width="+FBwidth+",height="+FBheight+",top="+top+",left="+left+",dependent=yes,titlebar=no,scrollbars=no");
}
// FIX WINDOW
DN_System_Load.prototype.langbrowser = function(url){
if(!this.ini){ return false; }
var LBwidth = (this.wib - 150);
var LBheight = 610;
var width = ((this.wib - LBwidth) / 2);
var height = ((this.heb - LBheight) / 4);
window.open(url,"LangBrowser","width="+LBwidth+",height="+LBheight+",top="+height+",left="+width+",dependent=yes,titlebar=no,scrollbars=yes");
}
// FIX WINDOW
DN_System_Load.prototype.langdelid = function(url,name){
if(!this.ini){ return false; }
if(confirm(confirmdel + ' ' + name + ' ?')){
parent.window.location.href = url;
}
}
// DELFILES
DN_System_Load.prototype.delfiles = function(url){
if(window.confirm(confidel + ' ?')){ parent.frames['files'].location.href = url; }
}
// OBJDIRS
DN_System_Load.prototype.objdirs = function(url,name,w,h){
var newurl = url + "&objdir=" + document.folder_form.link.value;
this.windows(newurl,name,w,h);
}
// TEXTAREA
DN_System_Load.prototype.textarea = function(gui,obj){
var retextarea = this.findobj(obj);
  if(gui<0){ var rows=-5; var cols=-10; } else { var rows=5; var cols=10; }
   var rerows = retextarea.rows + rows;
   var recols = retextarea.cols + cols;
 if(rerows >= 5 && recols >= 45 && recols < 96){
  retextarea.rows = rerows;
  retextarea.cols = recols;
 }
return false;
}
// TRANSLIT
DN_System_Load.prototype.translit = function(gui,obj){
 var str = this.findobj(gui).value;
 if(str){

 var chars;
 var re = '';

 for(i=0; i < str.length; i++){
  chars = str.charAt(i,1);
  var me = false;

  for(a=0; a<this.rusid.length; a++){
   if(chars == this.rusid[a]){
    me = true;
    break;
   }
  }
   re += (me) ? this.latid[a] : chars;
 }
 this.findobj(obj).value = re;
 }
}
//
DN_System_Load.prototype.insertinfo = function(obj,tag){
var newobj = DN.findobj(obj), tag = '{' + tag + '}';
 if(newobj){
   if(DN.browser().ie){
     newobj.focus();
     document.selection.createRange().duplicate().text = tag;
   } else if(DN.browser().gecko){
     var selEnd = newobj.selectionEnd, txtLen = newobj.value.length;
     var txtbefore = newobj.value.substring(0,selEnd), txtafter =  newobj.value.substring(selEnd,txtLen);
     newobj.value = txtbefore +  tag + txtafter;
   } else {
     newobj.text.value += tag;
   }
 }
}
// CLASS : DN_System_Load


// INIT CLASS
if(sysini){
var DN = new DN_System_Load(sysini);
// BRAUSER SUPPORT ?
if(DN.browser().bw==0){
//DN.confirms('Your browser is not supported !\nÂàø áðàóçåð ÿâëÿåòñÿ íå ïîääåðæèâàåìûì !\nYou are fastest cannot to work normally with the panel.\nÑêîðåé âñåãî âû íå ñìîæåòå íîðìàëüíî ðàáîòàòü ñ ïàíåëüþ.');
}
}
// INIT CLASS

// OLD
function FileBrows(sess,input){
FBheight = (screen.height)-100;
FBwidth = (screen.width)-100;
height = (screen.height)-215;
window.open("filebrowser.php?ops=" + sess + "&input=" + input + "&height=" + height,"Popup","width="+FBwidth+",height="+FBheight+",top=25,left=50,dependent=yes,titlebar=no,scrollbars=no");
}
// CLASS : DN_AJAX_Initialize
// Init
function DN_AJAX_Initialize(works){
this.works = works ? true : false;
this.reqxml = '';
this.data = '';
this.doc = '';
}
// Create
DN_AJAX_Initialize.prototype.create = function(){
this.reqxml = '';
if(!this.works){ return false; }
var msxmllist = new Array('Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.5.0',
                          'Msxml2.XMLHTTP','Microsoft.XMLHTTP');
for(var i=0; i<msxmllist.length; i++){
 try {
  this.reqxml = new ActiveXObject(msxmllist[i]);
  if(this.reqxml){ return true; }
 } catch(e){}
}

if(!this.reqxml && typeof XMLHttpRequest!="undefined"){
 this.reqxml = new XMLHttpRequest();
 if(this.reqxml){ return true; }
}
return false;
}
// findelm
DN_AJAX_Initialize.prototype.findelm = function(obj){
this.environment = '';
for(i = 0; i < obj.elements.length; i++){
var elm = obj.elements[i];
 if(elm.name && !elm.disabled){
  switch(elm.type){
   case 'text':
   case 'textarea':
   case 'hidden':
   case 'select-one':
    this.environment += elm.value ? '&' + elm.name + '=' + encodeURIComponent(elm.value) : '';
   break;
   case 'checkbox':
   case 'radio':
    this.environment += elm.checked ? '&' + elm.name + '=' + elm.value : '';
   break;
  }
 }
}
return this.environment;
}
// onreadystatechange
DN_AJAX_Initialize.prototype.onreadystatechange = function(build){
if(!this.reqxml && !this.create()){ return false; }
if(typeof build=='function'){ this.reqxml.onreadystatechange = build; } else { alert(build + ' is not function !'); }
}
// SEND
DN_AJAX_Initialize.prototype.send = function(url,data,metod){
if(!this.reqxml && !this.create()){ return false; }
if(!this.reqxml.readyState && (this.reqxml.readyState < 4)){
 if(metod == 'post'){
  this.reqxml.open('POST',url,true);
  this.reqxml.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
  this.reqxml.setRequestHeader("Content-Length",data.length);
  this.reqxml.send(data);
 } else {
  this.reqxml.open('GET',url,true);
  this.reqxml.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");
  this.reqxml.send(null);
 }

  if(this.reqxml.readyState == 4 && this.reqxml.status == 200){ return true; }
}
return false;
}
// emulateurl
DN_AJAX_Initialize.prototype.emulateurl = function(){
if(AJAX.reqxml.readyState == 4 && AJAX.reqxml.status == 200 && AJAX.reqxml.responseText){
DN.findobj('ajaxbox').innerHTML = AJAX.reqxml.responseText;
DN.findobj('ajaxmessage').style.visibility = 'hidden';
// Bugs Dom
if(DN.browser().ie){
AJAX.reqxml.abort();
} else {
AJAX.reqxml = ''; // CLEAR reqxml NO SUPPORT IE
}
// Bugs Dom
}
}
// emulategeteditor
DN_AJAX_Initialize.prototype.emulategeteditor = function(){
if(AJAX.reqxml.readyState == 4 && AJAX.reqxml.status == 200 && AJAX.reqxml.responseText){
if(DN.findobj(DN.obj + 'new')){
 DN.findobj(DN.obj).removeChild(DN.findobj(DN.obj + 'new'));
}
DN.findobj('ajaxpanel').innerHTML = '';
newdiv = document.createElement("div");
newdiv.setAttribute('id',DN.obj + 'new');
newdiv.innerHTML = AJAX.reqxml.responseText;
DN.findobj('ajaxpanel').appendChild(newdiv);
// Bugs Dom
if(DN.browser().ie){
AJAX.reqxml.abort();
} else {
AJAX.reqxml = ''; // CLEAR reqxml NO SUPPORT IE
}
// Bugs Dom
}
}
// openurl
DN_AJAX_Initialize.prototype.openurl = function(url){
 if(AJAX.create()){
 vc = document.getElementsByTagName((document.compatMode && document.compatMode=="CSS1Compat") ? "HTML":"BODY")[0];
 xp = vc.clientWidth ? (((vc.clientWidth + vc.scrollLeft)) / 2) : 0;
 yp = vc.clientHeight ? (((vc.clientHeight + vc.scrollTop) - 30) / 2) : 0;
 DN.findobj('ajaxmessage').style.left = xp + 'px';
 DN.findobj('ajaxmessage').style.top = yp + 'px';
 DN.findobj('ajaxmessage').style.visibility = 'visible';
 if(DN.findobj('ajaxpanel')){
  DN.findobj('ajaxpanel').style.display = 'none';
 }
 AJAX.onreadystatechange(AJAX.emulateurl);
 AJAX.send(url + '&ajax=1',null,'get');
 }
}
// panel
DN_AJAX_Initialize.prototype.panel = function(id){
if(!DN.findobj('ajaxpanel')){
  panel = document.createElement("DIV");
  panel.setAttribute('id','ajaxpanel');
  document.getElementsByTagName('body')[0].appendChild(panel);
} else {
  panel = DN.findobj('ajaxpanel');
}
var objel = DN.findobj(id);
var move = objel;
DN.XCPosit = objel.offsetLeft;
DN.YCPosit = objel.offsetTop + objel.offsetHeight;
while((objel = objel.offsetParent)!=null){
DN.XCPosit += objel.offsetLeft;
DN.YCPosit += objel.offsetTop;
}
if(id.match(/^de([0-9]+)/)){
DN.XCPosit+= (move.offsetWidth / 2) - 24;
}
panel.style.left = (DN.XCPosit - 5) + 'px';
panel.style.top = (DN.YCPosit) + 'px';
//panel.style.position = 'absolute';
panel.className = 'ajaxpanel';
panel.innerHTML = '<font class="loads">Çàãðóæàþ ...</font>';
panel.style.display = 'inline';
}
// geteditor
DN_AJAX_Initialize.prototype.geteditor = function(url,id){
 if(AJAX.create()){
 AJAX.panel(id);
 AJAX.onreadystatechange(AJAX.emulategeteditor);
 AJAX.send(url,null,'get');
 }
}

// emulategeteditor
DN_AJAX_Initialize.prototype.emulateposteditor = function(){
if(AJAX.reqxml.readyState == 4 && AJAX.reqxml.status == 200 && AJAX.reqxml.responseText){
DN.findobj(DN.obj).innerHTML = AJAX.reqxml.responseText;
DN.findobj('ajaxpanel').style.display = 'none';
// Bugs Dom
if(DN.browser().ie){
AJAX.reqxml.abort();
} else {
AJAX.reqxml = ''; // CLEAR reqxml NO SUPPORT IE
}
// Bugs Dom
}
}
// posteditor
DN_AJAX_Initialize.prototype.posteditor = function(obj,id,url){
 if(AJAX.create()){
 DN.obj = id;
 AJAX.data = AJAX.findelm(obj);
 DN.findobj('ajaxpanel').innerHTML = '<font class="loads">Ñîõðàíÿþ ...</font>';
 AJAX.onreadystatechange(AJAX.emulateposteditor);
 AJAX.send(url,AJAX.data,'post');
 }
 return false;
}
// posteditor
DN_AJAX_Initialize.prototype.hide = function(){
 if(DN.findobj('ajaxpanel')){
  DN.findobj('ajaxpanel').style.display = 'none';
 }
 return false;
}
// INIT CLASS
if(DN.browser().bw==1){
var AJAX = new DN_AJAX_Initialize(true);
} else {
var AJAX = new DN_AJAX_Initialize(false);
}
// INIT CLASS
// CLASS : DN_System_Hint
// Init
function DN_System_Hint(){}
// SHOW
DN_System_Hint.prototype.show = function(obj,str){
var hint = DN.findobj('hint');
if(!obj){ return; }
if(!DN.documes){ return; }
if(!hint){ return; }
hint.className = 'hint';
hint.style.display = '';
hint.style.left = 12;
hint.style.top = 19;

obj.onmouseout = function(advance){
hint.style.visibility = 'hidden';
if(hint.firstChild) hint.removeChild(hint.firstChild);
hint.appendChild(document.createTextNode(str));
};

obj.onmousemove = function(advance){
hint.innerHTML = str;
var vc = document.getElementsByTagName((document.compatMode && document.compatMode=="CSS1Compat") ? "HTML":"BODY")[0];
if(vc){
x = window.event ? event.clientX + vc.scrollLeft : advance.pageX;
y = window.event ? event.clientY + vc.scrollTop : advance.pageY;
vcwidth = vc.clientWidth ? vc.clientWidth + vc.scrollLeft : window.innerWidth + window.pageXOffset;
vcheight = vc.innerHeight ? window.innerHeight + window.pageYOffset : vc.clientHeight + vc.scrollTop;
 hint.style.visibility = 'visible';
 hint.style.opacity = '.90';
 hint.style.filter = "alpha(opacity:90)";
 if(hint.offsetWidth>200){ hint.style.width = '200'; }
  if((x + hint.offsetWidth + 12) > vcwidth){
   hint.style.left = x - hint.offsetWidth - 4;
  } else {
   hint.style.left = x + 12;
  }
  if((y + hint.offsetHeight + 19) > vcheight){
   hint.style.top = y - hint.offsetHeight;
  } else {
   hint.style.top = y + 19;
  }
}
}
}

DN_System_Hint.prototype.buttonshow = function(obj){
obj.onmouseout = function(){
obj.className = 'button';
}
obj.onmousemove = function(){
obj.className = 'rebutton';
}
}

DN_System_Hint.prototype.inputshow = function(obj){
obj.onfocus = function(){
obj.className = 'reinput';
}
obj.onblur = function(){
obj.className = '';
}
}
// INITIALIZE
DN_System_Hint.prototype.initialize = function(){
var hint = document.createElement("DIV");
hint.setAttribute('id','hint');
document.getElementsByTagName('body')[0].appendChild(hint);
for(var i=0; i<arguments.length; i++){
 atr = document.getElementsByTagName(arguments[i]);
 for(var j=0; j<atr.length; j++){
  if((viewhint = atr[j].getAttribute("title")) || (viewhint = atr[j].getAttribute("alt"))){
  atr[j].removeAttribute('title');
  atr[j].removeAttribute('alt');
  this.show(atr[j],viewhint);
  }
  if((atr[j].getAttribute("type")=='submit') || (atr[j].getAttribute("type")=='button')){
  if(atr[j].getAttribute("name")!='p' && atr[j].getAttribute("name")!='prev' && atr[j].getAttribute("name")!='next'){
   this.buttonshow(atr[j]);
  }
  }
  if((atr[j].getAttribute("type")=='text') || (atr[j].getAttribute("type")=='password')){
   this.inputshow(atr[j]);
  }
  if(atr[j].getAttribute("rows")){
   this.inputshow(atr[j]);
  }

 }
}
}
// CLASS : DN_System_Hint
// INIT CLASS
var HINT = new DN_System_Hint();
// INIT CLASS

// CLASS : DN_Color_Picker
function DN_Color_Picker(){
this.colors = new Array(
"000000","003300","006600","009900","00CC00","00FF00","330000","333300","336600","339900","33CC00","33FF00","660000",
"663300","666600","669900","66CC00","66FF00","000033","003333","006633","009933","00CC33","00FF33","330033","333333",
"336633","339933","33CC33","33FF33","660033","663333","666633","669933","66CC33","66FF33","000066","003366","006666",
"009966","00CC66","00FF66","330066","333366","336666","339966","33CC66","33FF66","660066","663366","666666","669966",
"66CC66","66FF66","000099","003399","006699","009999","00CC99","00FF99","330099","333399","336699","339999","33CC99",
"33FF99","660099","663399","666699","669999","66CC99","66FF99","0000CC","0033CC","0066CC","0099CC","00CCCC","00FFCC",
"3300CC","3333CC","3366CC","3399CC","33CCCC","33FFCC","6600CC","6633CC","6666CC","6699CC","66CCCC","66FFCC","0000FF",
"0033FF","0066FF","0099FF","00CCFF","00FFFF","3300FF","3333FF","3366FF","3399FF","33CCFF","33FFFF","6600FF","6633FF",
"6666FF","6699FF","66CCFF","66FFFF","990000","993300","996600","999900","99CC00","99FF00","CC0000","CC3300","CC6600",
"CC9900","CCCC00","CCFF00","FF0000","FF3300","FF6600","FF9900","FFCC00","FFFF00","990033","993333","996633","999933",
"99CC33","99FF33","CC0033","CC3333","CC6633","CC9933","CCCC33","CCFF33","FF0033","FF3333","FF6633","FF9933","FFCC33",
"FFFF33","990066","993366","996666","999966","99CC66","99FF66","CC0066","CC3366","CC6666","CC9966","CCCC66","CCFF66",
"FF0066","FF3366","FF6666","FF9966","FFCC66","FFFF66","990099","993399","996699","999999","99CC99","99FF99","CC0099",
"CC3399","CC6699","CC9999","CCCC99","CCFF99","FF0099","FF3399","FF6699","FF9999","FFCC99","FFFF99","9900CC","9933CC",
"9966CC","9999CC","99CCCC","99FFCC","CC00CC","CC33CC","CC66CC","CC99CC","CCCCCC","CCFFCC","FF00CC","FF33CC","FF66CC",
"FF99CC","FFCCCC","FFFFCC","9900FF","9933FF","9966FF","9999FF","99CCFF","99FFFF","CC00FF","CC33FF","CC66FF","CC99FF",
"CCCCFF","CCFFFF","FF00FF","FF33FF","FF66FF","FF99FF","FFCCFF","FFFFFF"
);
this.XCPosit = 0;
this.YCPosit = 0;
this.width = 18;
this.colspan = Math.floor(this.width / 2);
this.total = this.colors.length;
}
// UPDATE
DN_Color_Picker.prototype.update = function(hex){
var colorviev = DN.findobj('colorviev');
colorviev.style.backgroundColor = hex;
var colorhex = DN.findobj('colorhex');
colorhex.innerHTML = '#' + hex;
}
// INSERT
DN_Color_Picker.prototype.insert = function(hex,obj){
DN.findobj('v_' + obj).value = hex;
DN.findobj('pv_' + obj).style.backgroundColor = hex;
var picker = DN.findobj('picker');
picker.style.visibility = 'hidden';
}
// HIDE
DN_Color_Picker.prototype.hide = function(){
var picker = DN.findobj('picker');
picker.style.visibility = 'hidden';
}
// VIEW
DN_Color_Picker.prototype.view = function(obj){
var picker = DN.findobj('picker');
picker.style.visibility = 'hidden';
var objel = DN.findobj('click_' + obj);
this.XCPosit = objel.offsetLeft;
this.YCPosit = objel.offsetTop + objel.offsetHeight;
while((objel = objel.offsetParent)!=null){
this.XCPosit += objel.offsetLeft;
this.YCPosit += objel.offsetTop;
}

this.cp_contents = '<table border="0" cellspacing="1" cellpadding="1" class="pickers">';
this.cp_contents += '<tr><td colspan="'+Math.floor(this.width)+'" class="pickerits"><a class="win" href="javascript:javascript:PICKER.hide();">X</a></td></tr>';


for(var i=0; i<this.total; i++){
if((i % this.width) == 0){ this.cp_contents += "<tr>"; }
this.cp_contents += '<td bgcolor="#'+this.colors[i]+'" onMouseOver="javascript:PICKER.update(\''+this.colors[i]+'\');"><a href="javascript:PICKER.insert(\''+this.colors[i]+'\',\''+obj+'\');">&nbsp;&nbsp;&nbsp;</a></td>';
if(((i+1)>=this.total) ||(((i+1) % this.width) == 0)){ this.cp_contents += "</tr>";}
}

this.cp_contents += '<tr><td colspan="'+this.colspan+'" bgcolor="#ffffff" id="colorviev">&nbsp;</td><td colspan="'+this.colspan+'" align="center" bgcolor="#fffff" id="colorhex">&nbsp;</td></tr>';
this.cp_contents += "</table>";

picker.innerHTML = this.cp_contents;
this.XCPosit = this.XCPosit - picker.offsetWidth;
picker.style.left = this.XCPosit + 'px';
picker.style.top = this.YCPosit + 'px';
picker.style.visibility = 'visible';
}
// INITIALIZE
DN_Color_Picker.prototype.initialize = function(){
var picker = document.createElement("DIV");
picker.setAttribute('id','picker');
picker.className = 'picker';
document.getElementsByTagName('body')[0].appendChild(picker);
}
// CLASS : DN_Color_Picker
// INIT CLASS
var PICKER = new DN_Color_Picker();
// INIT CLASS

// CLASS : DN_System_Resizer
function DN_System_Resizer(){}
//
DN_System_Resizer.dragings = false;
DN_System_Resizer.labels = new Array;
DN_System_Resizer.smallheight = 60;
DN_System_Resizer.compat = null;
// RETURNOBJ
DN_System_Resizer.returnobj = function(obj){
 var currenttop = 0;
 if(obj.offsetParent){
  while(obj.offsetParent){ currenttop += obj.offsetTop, obj = obj.offsetParent; }
 } else if(obj.y){
  currenttop += obj.y;
 }
 return currenttop;
}
// MOUSEPOSIT
DN_System_Resizer.returnheight = function(element){
 if(element.style.height){
  element.height = parseInt(element.style.height);
 } else {
  element.style.height = element.clientHeight + 'px', element.height = parseInt(element.style.height);
 }
return element.height;
}
// MOUSEPOSIT
DN_System_Resizer.mouseposit = function(advance){
//var vc = document.getElementsByTagName((document.compatMode && document.compatMode=="CSS1Compat") ? "HTML":"BODY")[0];
if(DN_System_Resizer.compat){ return window.event ? event.clientY + DN_System_Resizer.compat.scrollTop : advance.pageY; }
}
// STARTDRAG
DN_System_Resizer.prototype.startdrag = function(advance){
 if(DN.browser().ie==1){ if(document.selection){ document.selection.clear(); } }
 if(DN_System_Resizer.dragings){
  var textarea = this.textarea, resizable = this.resizable, smallheight = DN_System_Resizer.smallheight;
  resizable.className = 'resizableact';
  var currentheight = DN_System_Resizer.returnheight(textarea) + DN_System_Resizer.mouseposit(advance) - DN_System_Resizer.returnobj(resizable);
  if(currentheight < smallheight){ currentheight = smallheight; }
  textarea.style.height = currentheight + 'px';
 }
}
// STOP
DN_System_Resizer.prototype.stopdrag = function(advance){
 var resizable = this.resizable, count = this.count;
 DN_System_Resizer.dragings = false, resizable.onmouseup = null;
 resizable.className = 'resizable';
 resizable.onmousedown = function(advance){ DN_System_Resizer.labels[count].actions(advance); }
}
// ACTION
DN_System_Resizer.prototype.actions = function(advance){
 var resizable = this.resizable, count = this.count;
 DN_System_Resizer.dragings = true, resizable.onmousedown = null;
 resizable.onmouseup = function(advance){  DN_System_Resizer.labels[count].stopdrag(advance); }
 window.document.onmouseup = function(advance){ DN_System_Resizer.labels[count].stopdrag(advance); }
 window.document.onmousemove = function(advance){ DN_System_Resizer.labels[count].startdrag(advance); }
}
// ACTION
DN_System_Resizer.prototype.marklist = function(textarea){
  var count = DN_System_Resizer.labels.length, resizable = document.createElement('div');
  if(DN_System_Resizer.compat == null) DN_System_Resizer.compat = document.getElementsByTagName((document.compatMode && document.compatMode=="CSS1Compat") ? "HTML":"BODY")[0];
  DN_System_Resizer.labels[count] = this, resizable.className = 'resizable';
  resizable.onmousedown = function(advance){ DN_System_Resizer.labels[count].actions(advance); }
  resizable = textarea.parentNode.insertBefore(resizable,textarea.nextSibling);
  this.resizable = resizable, this.count = count, this.textarea = textarea;
}
// INITIALIZE
DN_System_Resizer.prototype.initialize = function(){
  for(var i = 0,textarea; textarea = document.getElementsByTagName('textarea')[i]; i++){
  new DN_System_Resizer().marklist(textarea); textarea = null;
  }
}
// CLASS : DN_System_Resizer
// ADDEVENT
function loadsevent(){ HINT.initialize('A','IMG','INPUT','TEXTAREA'); PICKER.initialize(); DN_System_Resizer.prototype.initialize(); }
// LOAD || ONLOAD
if(DN.objects){ DN.addsevent(loadsevent); }