// JavaScript Document
function MM_preloadImages() { //v3.0
 	
	var d=document; 
	if(d.images)
	{ 
		if(!d.MM_p) d.MM_p=new Array();
    	var i, j=d.MM_p.length, a=MM_preloadImages.arguments;
    
    	for(i=0; i<a.length; i++)
    	if (a[i].indexOf("#")!=0)
    	{
    		d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
    	}
	}
}


window.onload = (function(){
	try{
		$("#lgt").click(function () {
			$("#registr").hide("slow", function(){$("#logout").fadeIn("slow"); }); 
		});	
		$("#regst").click(function () {
			$("#logout").hide("slow", function(){$("#registr").fadeIn("slow");}); 
			 
		});	
		$("#regst_").click(function () {
			$("#logout").hide("slow", function(){$("#registr").fadeIn("slow");}); 		 
		});	
		$("#close_registr").click(function () {
			$("#registr").hide("slow"); 
		});	
		$("#close_logout").click(function () {
			$("#logout").hide("slow"); 
		});	
		$("#exitauth").click(function () {
			document.getElementById("f_exitauth").submit();
		});
		MM_preloadImages(template_path+"images/registr.png", template_path+"images/forma_logout.png", template_path+'images/but_menu_up.jpg');
	}
	catch(e){}
});


jQuery(function($) { 
	$(document).ready( function() { 
		var currentOpen; 
		$("#menu-top .item").each( function (index){
			$(this).bind("mouseenter", function(){                        

				if(this.id != "select")
				{
					this.style.backgroundImage="url('" + template_path + "images/but_menu_up.jpg')";
					$(this).animate({"top": "-=4"}, 20);
				}
			});
			
			$(this).bind("mouseleave", function(){ 
				if(this.id != "select")
				{
					$(this).animate({"top": "+=4"}, 10);
					this.style.backgroundImage="url('" + template_path + "images/but_menu.jpg')";
				}
			});	
		});					
	}); 
});
