function Load_newses_menu(sub_url){
    $('#newses_menu').html('Loadging...');
     $.ajax({
          url: '/dinamic/newses_menu.php',
          data: sub_url,
          type: 'get',
          success: function (response) {
                  $('#newses_menu').html(response);
          }
     });
}
function Load_comments_menu(sub_url){
    $('#comments_menu').html('Loadging...');
     $.ajax({
          url: '/dinamic/comments_menu.php',
          data: sub_url,
          type: 'get',
          success: function (response) {
                  $('#comments_menu').html(response);
          }
     });
}

function Test_visitor(table_prefix, newsid, try1){
//	alert(sub_url);
	if(try1 == 1)
		var sub_url = "action=test_visitor&table_prefix="+table_prefix+"&newsid="+newsid+"&email=" + document.getElementById('mail_log').value + '&passwd1=' + document.getElementById('pass_log').value;
	else
		var sub_url = "action=test_visitor2&table_prefix="+table_prefix+"&newsid="+newsid+"&email=" + document.getElementById('mail_log').value + '&passwd1=' + document.getElementById('pass_log').value;	 
    $('#add_comment').html('Loadging...');
     $.ajax({
          url: '/dinamic/visitors',
          data: sub_url,
          type: 'get',
          success: function (response) {
                  $('#add_comment').html(response);
          }
     });
}

function Test_Name(table_prefix, newsid){
	//alert(document.getElementById('new_name').value); 
	var sub_url = "action=test_name&table_prefix="+table_prefix+"&newsid="+newsid+"&name=" + document.getElementById('new_name').value;	 
    $('#add_comment').html('Loadging...');
     $.ajax({
          url: '/dinamic/visitors',
          data: sub_url,
          type: 'get',
          success: function (response) {
                  $('#add_comment').html(response);
          }
     });
}

function Test_email(table_prefix){
	//alert(document.getElementById('new_name').value); 
	var sub_url = "action=send_email&table_prefix="+table_prefix+"&email=" + document.getElementById('email_subscr').value;	 
    $('#subscr').html('Loadging...');
     $.ajax({
          url: '/dinamic/subscription',
          data: sub_url,
          type: 'get',
          success: function (response) {
                  $('#subscr').html(response);
          }
     });
}

function Auto_subscr(table_prefix){
//	alert(document.getElementById('pass_subscr').value); 
	var sub_url = "action=test_email&table_prefix="+table_prefix+"&email=" + document.getElementById('email_subscr').value+ '&passwd1=' + document.getElementById('pass_subscr').value;	 	 
    $('#subscr').html('Loadging...');
     $.ajax({
          url: '/dinamic/subscription',
          data: sub_url,
          type: 'get',
          success: function (response) {
				if(response == 'OK'){
					$('#href_subscr').html('<a href="/site/subscription"  onfocus="this.blur()"><img src="/images/site/r_podpis_but.png" width="128" height="28" border="0" alt=""></a>');
				    $('#subscr').html('Вы авторизированы, теперь можете заказать подписку');
					window.open('/site/subscription','self');
				}
				else
                  $('#subscr').html(response);
          }
     });
}

function Not_Autorize(){
	//alert(document.getElementById('new_name').value); 
	var sub_url = "action=not_autorize";	 	 
    $('#subscr').html('Loadging...');
     $.ajax({
          url: '/dinamic/subscription',
          data: sub_url,
          type: 'get',
          success: function (response) {
                  $('#subscr').html(response);
          }
     });
}

