	
	
	
	var activediv = 'login_form';

	function show (el) {
		document.getElementById('login_form').style.display = 'none';
		document.getElementById('add_user_form').style.display = 'none';
		document.getElementById(el).style.display = 'block';
	}

	function showhide (el) {

		if (document.getElementById(el).style.display == 'block') {
	    	document.getElementById(el).style.display = 'none';
	    	}
	    else {
	    	document.getElementById(el).style.display = 'block';
	    }
	}
	


			 function showimg (id, imgw, imgh) {
			
				if( typeof( window.innerWidth ) == 'number' ) {
					//Non-IE
					myWidth = window.innerWidth;
					myHeight = window.innerHeight;
				} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
					//IE 6+ in 'standards compliant mode'
					myWidth = document.documentElement.clientWidth;
					myHeight = document.documentElement.clientHeight;
				} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
					//IE 4 compatible
					myWidth = document.body.clientWidth;
					myHeight = document.body.clientHeight;
				}
	
				var scrOfX = 0, scrOfY = 0;
		
				if( typeof( window.pageYOffset ) == 'number' ) {
					//Netscape compliant
					scrOfY = window.pageYOffset;
					scrOfX = window.pageXOffset;
				} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
					//DOM compliant
					scrOfY = document.body.scrollTop;
					scrOfX = document.body.scrollLeft;
				} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
					//IE6 standards compliant mode
					scrOfY = document.documentElement.scrollTop;
					scrOfX = document.documentElement.scrollLeft;
				}
	
				var ll= 234;
				document.getElementById(id).style.left = (myWidth - imgw)/2 + "px";
				var tt= 234;
				document.getElementById(id).style.top = (myHeight - imgh)/2 + scrOfY + "px";
				
				showhide (id);
			}


			
	function confirm_delete (url,quesion) {
		if (confirm(quesion)) {
			parent.location=url;
		} else {
		}
	}

	
	
	
	
	
	
	
	
	
	function open_registration_win() {
		window.open('add_user01.php4','registration','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=565,height=480');
	}


	function confirm_delete (url,quesion) {
		if (confirm(quesion)) {
			parent.location=url;
		}
			else {
		}
	}
	
	// при выбирании input.radio показывает-прячет соответсвующие блоки с информацией
	function reg_or_login (el) {
		
	    $('reg').style.display = 'none'; 
	    $('log').style.display = 'none'; 
	    $('ano').style.display = 'none'; 
	    $(el).style.display = 'block'; 
	    
	}
	
	function reg() {
	
       var url    = 'add_user02.php';
       var params = 'new_user=' + $F('new_user') + '&new_pass=' + $F('new_pass') + '&new_pass2=' + $F('new_pass2') + '&new_email=' + $F('new_email');      
       var ajax   = new Ajax.Updater(
                                       {success: 'div_for_errors'},
                                        url, 
                                       {method: 'get',
                                        parameters: params, 
                                        onFailure: reportError,
                                        onComplete: show_login_div}
                                     );
	
	}
	
	function show_login_div() {
	    
	    $('reg').style.display = 'block'; 
	    $('log').style.display = 'none'; 
	    $('ano').style.display = 'none'; 
	          
	}
	
	function reportError(request) {
	     $('reg').innerHTML = "<h4>Ошибка на сервере. Попробуйте еще раз.</h4>";
	          
	}
	
	
	
	
	function goToUrl(selObj, goToLocation) {
		eval("document.location.href = '" + goToLocation + "" + selObj.options[selObj.selectedIndex].value + "'");
	}
	
	
				
	
	
	
	
	
	