
$(document).ready(function(){
    $('ul#nav').NavDropDown({
            duration:100,
            hoverElement:'li',
            hoverClass:'hover',
            dropHolder:'div',
            showEffect:'slide' // slide, fade, slide&fade
        });   
        
        
    $("tr.bussiness").bind("mouseover", false, function() {
        $(this).css("background", "#8CD0E2");
        alert(1);
    });
    $("tr.bussiness").bind("mouseout", false, function() {
        $(this).css("background", "transparent");
    });
    
    $("tr.citizen").bind("mouseover", false, function() {
        $(this).css("background", "#8CD0E2");
    });
    $("tr.citizen").bind("mouseout", false, function() {
        $(this).css("background", "transparent");
    });
    
  // --------------  
  $("#enter").livequery("click", function () {
    	var LLL = $('#login').attr('value');
    	var PPP = $('#passs').attr('value');
      $.ajax({  
        type: "POST",
        dataType: "html",
        data: "oidkas="+LLL+"&viAdoPX="+PPP,  
        url: "../inc3/conf_reg.php",
        error: function() {
        	$("#reg_mess").html("Ошибка связи");
        },
        beforeSend: function() {
			$("#reg_mess").html("Авторзация...");
        },
        success: function(responseText, textStatus){
			$("#conf_auth").html(responseText);
		}
  		});  
	});	
	
	$("#exit").livequery("click", function () {
      $.ajax({  
        type: "POST",
        dataType: "html",
        data: "exit=ok",  
        url: "../inc3/conf_reg.php",
        error: function() {
        	$("#reg_mess").html("Ошибка связи");
        },
        beforeSend: function() {
        	$("#reg_mess").html("Выходим...");
        },
        success: function(responseText, textStatus){
			$("#conf_auth").html(responseText);
		}
  		});  
	});	
		
		// --------------  
		$("#loading").ajaxStart(function(){ 
			$("#loading").show();  
			});  
		$("#loading").ajaxStop(function() { 
			$(this).hide(2000);
			//$("#reg_mess").empty();  
			});  
		$("#conf_auth").ajaxComplete(function(){  
			});	  
			
	/*		
	$("#enter").hover(
	function(){
		$(this).addClass("hover_enter");
	},
	function(){
		$(this).removeClass("hover_enter");
	});
	
	$("#reg_conf").hover(
	function(){
		$(this).addClass("hover_reg");
	},
	function(){
		$(this).removeClass("hover_reg");
	});
	*/
	$("#exit").hover(
	function(){
		$(this).addClass("hover_exit");
	},
	function(){
		$(this).removeClass("hover_exit");
	});
    
    
    $(".anketa1").bind("mouseover", false, function(){
        $(this).css("border", "1px dashed gray");
    });
    $(".anketa1").bind("mouseout", false, function(){
        $(this).css("border", "1px dashed white");
    });
    
    $(".anketa2").bind("mouseover", false, function(){
        $(this).css("border", "1px dotted gray");
    });
    $(".anketa2").bind("mouseout", false, function(){
        $(this).css("border", "1px dotted white");
    });
    
    $(".send").bind("mouseover", false, function(){
        $(this).css("background", "#BCD2FC");
    });
    $(".send").bind("mouseout", false, function(){
        $(this).css("background", "white");
    });
    
    $("input[name='all']").bind("click", false, function(){
        if (!$(this).attr('checked')) {
            $("input.v").attr('checked', false);
            $(".all").html('Отметить все');
        } else {
            $("input.v").attr('checked', true);
            $(".all").html('Снять все');
        }
    });    
    
});
 

function forms1() 
{
	var n = document.getElementById("form1");
	if (n.style.display == "block") 
		{
			n.style.display='none';
		} 
		else 
		{
			n.style.display='block';
		}	
}

function see(id) 
{
	var n = document.getElementById("see_"+id);
	if (n.style.display == "block") 
		{
			n.style.display='none';
		} 
		else 
		{
			n.style.display='block';
		}	
}

function reload_code(value)
{
    var rndval = new Date().getTime(); 
    document.getElementById('reload_id').src='/inc3/kcaptcha/index.php?'+value+'='+rndval;
}

function letters() 
{
	var n = document.getElementById("let");
	if (n.style.display == "block") 
		{
			n.style.display='none';
		} 
		else 
		{
			n.style.display='block';
		}	
}

function conf_open(id)
{
	var n = document.getElementById("conf_id_"+id);
	if (n.style.display == "block") 
		{
			n.style.display='none';
			//$("#conf_id_"+id).show(1000);
		} 
		else 
		{
			n.style.display='block';
			//$("#conf_id_"+id).hide(1000);
		}	
}

function reply_view(id)
{
	var n = document.getElementById("reply_id_"+id);
	if (n.style.display == "block") 
		{
			n.style.display='none';
			//$("#conf_id_"+id).show(1000);
		} 
		else 
		{
			n.style.display='block';
			//$("#conf_id_"+id).hide(1000);
		}	
}
