/* менюшка для админа, десу! =^_^= */ function adm_menu() { //------ методы -------------------------------------------------------------- this.echolink=function(ldata, container) // создать пункт меню { var data=ldata.split('|'); var newlink=document.createElement('A'); addEvent( newlink, 'click', function () { eval(data[1]); }); newlink.href="javascript:"; newlink.innerHTML=data[0]; container.appendChild(newlink); } //-- this.echolinklist=function(ldata, container) // создать уровень меню { var i; for (i=1; i0) {top=0;} } if (direction=="up") { top=parseInt(this.tdiv.style.top)-step; if (top<(0-this.tdiv.offsetHeight)) {top=0-this.tdiv.offsetHeight;} } this.tdiv.style.top=top+'px'; if ( (top<0) && (top>0-this.tdiv.offsetHeight)) { setTimeout('document.getElementById("'+this.container.id+'").adm_menu.move("'+direction+'");'); } else { if (direction=="up") { this.destroy(); } } } //-- this.destroy=function() // самоуничтожение { if (!$.browser.msie) { delete this.container.adm_menu; this.tdiv.parentNode.removeChild(this.tdiv); delete this; } else { this.container.adm_menu=false; this.tdiv.parentNode.removeChild(this.tdiv); } } //----- инициализация -------------------------------------------------------- this.container=document.getElementById('map'); if (this.container.adm_menu) { this.container.adm_menu.move('up'); } else { this.container.adm_menu=this; this.links=new Array( '', 'Редактирование прав|window.open("./incs/super.php");', 'ГОиЧС|open_goics();', 'Избирательная комиссия города Красноярск|open_admin_izbirkom();', 'Служба 005|open_admin_005();', Array( 'Департамент транспорта', 'Новый маршрут|empty_bus();', 'Редактировать маршруты|editm();' ), 'Очистить кэш карты|del_cache();', 'Перезапустить графический движок|reset_engine();', '|' ); if(!in_array(13,user_status) && !in_array('sa',user_status)) { delete this.links[1]; }//Редактирование прав // if (!user_status || user_status=='') { delete this.links[1]; } if(!in_array(1,user_status) && !in_array('sa',user_status)) { delete this.links[4]; }//Служба 005 if(!in_array(2,user_status) && !in_array('sa',user_status)) { delete this.links[5]; }//Депортамент транспорта if(!in_array(14,user_status) && !in_array('sa',user_status)) { delete this.links[6]; }//Кэш if(!in_array(15,user_status) && !in_array('sa',user_status)) { delete this.links[7]; }//Рефреш if( !in_array(3,user_status) && !in_array(4,user_status) && !in_array(5,user_status) && !in_array(6,user_status) && !in_array(7,user_status) && !in_array(8,user_status) && !in_array(9,user_status) && !in_array(10,user_status) && !in_array('sa',user_status) ) { delete this.links[3]; }//Избирком if(!in_array(11,user_status) && !in_array('sa',user_status)) { delete this.links[2]; }//ГО и ЧС this.tdiv=document.createElement('DIV'); this.tdiv.style.visibility='hidden'; this.tdiv.control=this; this.tdiv.id='adm_menu'; this.container.appendChild(this.tdiv); //---------------------------------------------------------------------------- this.echolinklist(this.links, this.tdiv); this.tdiv.style.top=0-this.tdiv.offsetHeight+'px'; this.tdiv.style.visibility=''; this.move('down'); } } //setTimeout("var ttt = new adm_menu();", 2000); function open_admin_005(){ var tmp=window.open("./admin_005"); } function open_admin_izbirkom(){ var tmp=window.open("./adm_izbirkom"); } function goics_keys(){ $.ajax({ url:'./admin_goics/key.php', type:'GET', error:function(){ top.location.href='./'; }, success:function(data){ //alert(data); } } ); } function open_goics(){ var tmp=window.open("./admin_goics/"); } function del_cache(){ $.ajax({ url:'./incs/del_cache.php', type:'GET', error:function(){ top.location.href='./'; }, success:function(data){ alert('Кэш карты очищен'); document.location.href='./'; } } ); } function reset_engine(){ $.ajax({ url:'./incs/reset_engine.php', type:'GET', error:function(){ top.location.href='./'; }, success:function(data){ alert(data); } } ); }