function Add_ajax(query){req.open("post","red.php",true);req.onreadystatechange=Refresh;req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=windows-1251");req.send(query)};function zamload(a){var zamsite=document.getElementById("zamsite"+a).value;var query="id="+a+"&text="+zamsite;Add_ajax(query)};function check_all(count){if(document.getElementById('checkAll').checked){for(i=1;i<=count;i++){if(document.getElementById('id_'+i+'')){document.getElementById('id_'+i+'').checked=true}}}else{for(i=1;i<=count;i++){if(document.getElementById('id_'+i+'')){document.getElementById('id_'+i+'').checked=false}}}};function quit1(url_quit){if(confirm("Вы действительно хотите удалить сайт?")){window.location=url_quit}};function name_function(id_table){var s1='.style.display=""  ';var s2='.style.display="none"  ';if(document.getElementById(id_table)!=null){s="stat = "+id_table+".style.display";eval(s);if(stat=="none")s=id_table+s1;else s=id_table+s2}eval(s)};function checkAll(oForm,cbName,checked){for(var i=0;i<oForm[cbName].length;i++)oForm[cbName][i].checked=checked};function refreshParam(id,stat,dmoz,yak,top100,expire,ip,update,note,sort,order){$("#"+id+"_loading").css("visibility","visible");var group=document.getElementById("group").value;$.post("red_ajax.php",{act:"refresh_domen",id:""+id+"",view_stat:""+stat+"",view_dmoz:""+dmoz+"",view_yak:""+yak+"",view_top100:""+top100+"",view_expire:""+expire+"",view_ip:""+ip+"",view_update:""+update+"",view_note:""+note+"",sort:""+sort+"",order:""+order+"",group:""+group+""},function(data){$("#cont_"+id).html(data)});$("body").ajaxStop(function(){$("#"+id+"_loading").css("visibility","hidden")})};function refreshPage(stat,dmoz,yak,top100,expire,ip,update,note,sort,order){$("#loading").css("visibility","visible");var group=document.getElementById("group").value;$.post("red_ajax.php",{act:"refresh_page",view_stat:""+stat+"",view_dmoz:""+dmoz+"",view_yak:""+yak+"",view_top100:""+top100+"",view_expire:""+expire+"",view_ip:""+ip+"",view_update:""+update+"",view_note:""+note+"",sort:""+sort+"",order:""+order+"",group:""+group+""},function(data){$("#cont").html(data)});$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")})};function refreshOrderPage(sort,order){$("#loading").css("visibility","visible");$.post("order_r.php",{act:"refresh_page",sort:""+sort+"",order:""+order+""},function(data){$("#cont").html(data)});$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")})};function addDomen(stat,dmoz,yak,top100,expire,ip,update,note,sort,order){$("#loading").css("visibility","visible");var url=document.getElementById("url").value;var d2=document.getElementById("d2").value;var group=document.getElementById("group").value;$.post("red_ajax.php",{act:"add_domen",url:""+url+"",view_stat:""+stat+"",view_dmoz:""+dmoz+"",view_yak:""+yak+"",view_top100:""+top100+"",view_expire:""+expire+"",view_ip:""+ip+"",view_update:""+update+"",view_note:""+note+"",sort:""+sort+"",order:""+order+"",group:""+group+"",d2:""+d2+""},function(data){$("#cont").html(data)});$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")});document.getElementById("url").value=""};function addOrderDomen(sort,order){$("#loading").css("visibility","visible");var url=document.getElementById("url").value;var version=document.getElementById("version").value;$.post("order_r.php",{act:"add_domen",url:""+url+"",sort:""+sort+"",order:""+order+"",version:""+version+""},function(data){$("#cont").html(data)});$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")});document.getElementById("url").value=""};function List(count,stat,dmoz,yak,top100,expire,ip,update,note,sort,order){$("#loading").css("visibility","visible");var checkbox="";for(i=1;i<=count;i++){if(document.getElementById('id_'+i+'')){if(document.getElementById('id_'+i+'').checked==true){checkbox+=i+","}}}var group=document.getElementById("group").value;var act=document.getElementById("act").value;if(isNaN(act)){var arr=checkbox.split(',');for(var i in arr){var id=arr[i];if(id>0){switch(act){case'refresh_list':refreshParam(id,stat,dmoz,yak,top100,expire,ip,update,note,sort,order);break;case'delete_list':delDomen(id,stat,dmoz,yak,top100,expire,ip,update,note,sort,order);break}}}}else{$.post("red_ajax.php",{act:"move_list",new_group:""+act+"",checkbox:""+checkbox+"",view_stat:""+stat+"",view_dmoz:""+dmoz+"",view_yak:""+yak+"",view_top100:""+top100+"",view_expire:""+expire+"",view_ip:""+ip+"",view_update:""+update+"",view_note:""+note+"",sort:""+sort+"",order:""+order+"",group:""+group+""},function(data){$("#cont").html(data)})}$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")})};function Cancel(id){$('#'+id+'').fadeOut(300,function(){$('#overlay').fadeOut('slow')})};function addDomenList(stat,dmoz,yak,top100,expire,ip,update,note,sort,order){$("#loading").css("visibility","visible");var group=document.getElementById("group").value;var domenList=document.getElementById("domenList").value;var d1=document.getElementById("d1").value;var addGroup=document.getElementById("addGroup").value;$.post("red_ajax.php",{act:"add_domen_list",domenList:""+domenList+"",d1:""+d1+"",addGroup:""+addGroup+"",view_stat:""+stat+"",view_dmoz:""+dmoz+"",view_yak:""+yak+"",view_top100:""+top100+"",view_expire:""+expire+"",view_ip:""+ip+"",view_update:""+update+"",view_note:""+note+"",sort:""+sort+"",order:""+order+"",group:""+group+""},function(data){$("#cont").html(data)});$('#popup').fadeOut(300,function(){$('#overlay').fadeOut('slow')});document.getElementById("domenList").value="";$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")})};function delApprove(id,stat,dmoz,yak,top100,expire,ip,update,note,sort,order){str="Вы действительно хотите удалить домен?";str+="<table align=\"center\"><tr><td><div class=\"reg\" onClick=\"delDomen('"+id+"', '"+stat+"', '"+dmoz+"', '"+yak+"', '"+top100+"', '"+expire+"', '"+ip+"', '"+update+"', '"+note+"', '"+sort+"', '"+order+"')\"></div></td><td><div class=\"break\" onClick=\"Cancel('error');\"></div></td></tr></table>";$("#error_cont").html(str);var yScroll=$.browser.msie?document.documentElement.scrollTop:self.pageYOffset;var windowHeight=$.browser.msie?document.body.clientHeight:window.innerHeight;var posTop=Math.round((windowHeight/2)+yScroll)-Math.round($("#error").innerHeight()/2);var windowWidth=$.browser.msie?document.body.clientWidth:window.innerWidth;var posLeft=Math.round(windowWidth/2)-Math.round($("#error").innerWidth()/2);$('#error').css({top:posTop+'px',left:posLeft+'px'});$('#error').fadeIn('slow').css('display','block');$('#error').css({zIndex:300})};function delOrderApprove(id,sort,order){str="Вы действительно хотите удалить домен?";str+="<table align=\"center\"><tr><td><div class=\"reg\" onClick=\"delOrderDomen('"+id+"', '"+sort+"', '"+order+"')\"></div></td><td><div class=\"break\" onClick=\"Cancel('error');\"></div></td></tr></table>";$("#error_cont").html(str);var yScroll=$.browser.msie?document.documentElement.scrollTop:self.pageYOffset;var windowHeight=$.browser.msie?document.body.clientHeight:window.innerHeight;var posTop=Math.round((windowHeight/2)+yScroll)-Math.round($("#error").innerHeight()/2);var windowWidth=$.browser.msie?document.body.clientWidth:window.innerWidth;var posLeft=Math.round(windowWidth/2)-Math.round($("#error").innerWidth()/2);$('#error').css({top:posTop+'px',left:posLeft+'px'});$('#error').fadeIn('slow').css('display','block');$('#error').css({zIndex:300})};function delOrderDomen(id,sort,order){$("#loading").css("visibility","visible");$.post("order_r.php",{act:"del_domen",id:""+id+"",sort:""+sort+"",order:""+order+""},function(data){$("#cont").html(data)});$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")});$('#error').fadeOut(300,function(){$('#overlay').fadeOut('slow')})};function delDomen(id,stat,dmoz,yak,top100,expire,ip,update,note,sort,order){$("#loading").css("visibility","visible");var group=document.getElementById("group").value;$.post("red_ajax.php",{act:"del_domen",id:""+id+"",view_stat:""+stat+"",view_dmoz:""+dmoz+"",view_yak:""+yak+"",view_top100:""+top100+"",view_expire:""+expire+"",view_ip:""+ip+"",view_update:""+update+"",view_note:""+note+"",sort:""+sort+"",order:""+order+"",group:""+group+""},function(data){$("#cont_"+id).html(data)});$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")});$('#error').fadeOut(300,function(){$('#overlay').fadeOut('slow')})};function saveNote(id,stat,dmoz,yak,top100,expire,ip,update,note,sort,order){$("#loading").css("visibility","visible");var notetext=document.getElementById(id+"_note").value;var group=document.getElementById("group").value;$.post("red_ajax.php",{act:"save_note",notetext:""+notetext+"",id:""+id+"",view_stat:""+stat+"",view_dmoz:""+dmoz+"",view_yak:""+yak+"",view_top100:""+top100+"",view_expire:""+expire+"",view_ip:""+ip+"",view_update:""+update+"",view_note:""+note+"",sort:""+sort+"",order:""+order+"",group:""+group+""},function(data){$("#cont").html(data)});$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")})};function regUser(){$("#loading").css("visibility","visible");var email=document.getElementById("email").value;var password=document.getElementById("password").value;var name=document.getElementById("name").value;$.post("red_ajax.php",{act:"check_email",email:""+email+""},function(data){if(data==1){$.post("red_ajax.php",{act:"reg_user",email:""+email+"",password:""+password+"",name:""+name+""},function(data){$("#error").html(data)})}else show_error("Такой email уже есть в базе")});$('#reg').fadeOut(300,function(){$('#overlay').fadeOut('slow')});$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")})};function check(id){$("#sub").attr('disabled','disabled');if(id=="email"){var template=/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,3})$/;if(template.test(document.getElementById(""+id+"").value)){$("#"+id+"_pic").attr('src','images/yes.png')}else{$("#"+id+"_pic").attr('src','images/del.png')}}if(id=="password"){if(document.getElementById(""+id+"").value.length>4){$("#"+id+"_pic").attr('src','images/yes.png')}else{$("#"+id+"_pic").attr('src','images/del.png')}}if(id=="name"){if(document.getElementById(""+id+"").value.length>3){$("#"+id+"_pic").attr('src','images/yes.png')}else{$("#"+id+"_pic").attr('src','images/del.png')}}if($("#email_pic").attr('src')=='images/yes.png')if($("#password_pic").attr('src')=='images/yes.png')if($("#name_pic").attr('src')=='images/yes.png')$("#sub").removeAttr("disabled")};function authUser(){$("#loading").css("visibility","visible");var email=document.getElementById("userEmail").value;var password=document.getElementById("userPass").value;$.post("red_ajax.php",{act:"auth_user",email:""+email+"",password:""+password+""},function(data){$("#message").html(data)});$('#reg').fadeOut(300,function(){$('#overlay').fadeOut('slow')});$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")})};function orderAuth(){$("#loading").css("visibility","visible");var email=document.getElementById("userEmail").value;var password=document.getElementById("userPass").value;$.post("order_r.php",{act:"auth_user",email:""+email+"",password:""+password+""},function(data){$("#message").html(data)});$('#reg').fadeOut(300,function(){$('#overlay').fadeOut('slow')});$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")})};function logoutUser(){$("#loading").css("visibility","visible");$.post("red_ajax.php",{act:"logout_user",user:"quit"},function(data){$("#cont").html(data)});$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")})};function logoutOrderUser(){$("#loading").css("visibility","visible");$.post("order_r.php",{act:"logout_user",user:"quit"},function(data){$("#cont").html(data)});$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")})};function show_form(){var yScroll=$.browser.msie?document.documentElement.scrollTop:self.pageYOffset;var windowHeight=$.browser.msie?document.body.clientHeight:window.innerHeight;var posTop=Math.round((windowHeight/2)+yScroll)-Math.round($("#popup").innerHeight()/2);var windowWidth=$.browser.msie?document.body.clientWidth:window.innerWidth;var posLeft=Math.round(windowWidth/2)-Math.round($("#popup").innerWidth()/2);$('#popup').css({top:posTop+'px',left:posLeft+'px'});$('#popup').fadeIn('slow').css('display','block');$('#popup').css({zIndex:100})};function show_config(){var yScroll=$.browser.msie?document.documentElement.scrollTop:self.pageYOffset;var windowHeight=$.browser.msie?document.body.clientHeight:window.innerHeight;var posTop=Math.round((windowHeight/2)+yScroll)-Math.round($("#config").innerHeight()/2);var windowWidth=$.browser.msie?document.body.clientWidth:window.innerWidth;var posLeft=Math.round(windowWidth/2)-Math.round($("#config").innerWidth()/2);$('#config').css({top:posTop+'px',left:posLeft+'px'});$('#config').fadeIn('slow').css('display','block');$('#config').css({zIndex:100})};function show_error(str){$("#error_cont").html(str);var yScroll=$.browser.msie?document.documentElement.scrollTop:self.pageYOffset;var windowHeight=$.browser.msie?document.body.clientHeight:window.innerHeight;var posTop=Math.round((windowHeight/2)+yScroll)-Math.round($("#error").innerHeight()/2);var windowWidth=$.browser.msie?document.body.clientWidth:window.innerWidth;var posLeft=Math.round(windowWidth/2)-Math.round($("#error").innerWidth()/2);$('#error').css({top:posTop+'px',left:posLeft+'px'});$('#error').fadeIn('slow').css('display','block');$('#error').css({zIndex:300});$('#error').click(function(){$('#error').fadeOut(300,function(){$('#overlay').fadeOut('slow')})})};function show_reg(){var yScroll=$.browser.msie?document.documentElement.scrollTop:self.pageYOffset;var windowHeight=$.browser.msie?document.body.clientHeight:window.innerHeight;var posTop=150;var windowWidth=$.browser.msie?document.body.clientWidth:window.innerWidth;var posLeft=Math.round(windowWidth/2)-Math.round($("#reg").innerWidth()/2);$('#reg').fadeIn('slow').css('display','block');$('#reg').css({zIndex:100})};function overlayFit(){$('#overlay').css({width:$(window).width(),height:$(document).height()})};function popupFit(){var yScroll=$.browser.msie?document.documentElement.scrollTop:self.pageYOffset;var windowHeight=$.browser.msie?document.body.clientHeight:window.innerHeight;var posTop=Math.round((windowHeight/2)+yScroll);$('#popup').stop().animate({top:posTop+'px'},500)};function remind_password(){var yScroll=$.browser.msie?document.documentElement.scrollTop:self.pageYOffset;var windowHeight=$.browser.msie?document.body.clientHeight:window.innerHeight;var windowWidth=$.browser.msie?document.body.clientWidth:window.innerWidth;var posLeft=Math.round(windowWidth/2)-Math.round($("#remind").innerWidth()/2);$('#remind').fadeIn('slow').css('display','block');$('#remind').css({zIndex:100})};function do_remind_password(){$("#loading").css("visibility","visible");var email=document.getElementById("email_remind").value;$.post("red_ajax.php",{act:"remind_password",email:""+email+""},function(data){show_error(data)});$('#remind').fadeOut(300,function(){$('#overlay').fadeOut('slow')});$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")})};function check_email(){$("#sub_remind").attr('disabled','disabled');var template=/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,3})$/;if(template.test(document.getElementById("email_remind").value)){$("#email_remind_pic").attr('src','images/yes.png');$("#sub_remind").removeAttr("disabled")}else{$("#email_remind_pic").attr('src','images/del.png')}};function check_password(){$("#sub_remind").attr('disabled','disabled');if(document.getElementById("password").value.length>4){$("#password_pic").attr('src','images/yes.png');$("#sub_remind").removeAttr("disabled")}else{$("#password_pic").attr('src','images/del.png')}};function change_password(){$("#loading").css("visibility","visible");var key=document.getElementById("key").value;var password=document.getElementById("password").value;$.post("red_ajax.php",{act:"change_password",key:key,password:password},function(data){show_error(data)});$('#remind').fadeOut(300,function(){$('#overlay').fadeOut('slow')});$("body").ajaxStop(function(){$("#loading").css("visibility","hidden")})};