	function nvErrorHandler(){return false}window.onerror=nvErrorHandler;
	var	NVAuthorizeFormCounter=0;
	function NVAuthorizeForm( sURI, sTarget, sDisplayMode ){
		
		NVAuthorizeFormCounter++;
		this.ID='AuthorizeFormContainer'+NVAuthorizeFormCounter;
		this.authID='ssAuthPart'+NVAuthorizeFormCounter;
		this.rememberID='ssRememberPart'+NVAuthorizeFormCounter;
		this.rememberFormName='rememberForm'+NVAuthorizeFormCounter;
		this.returnURI=top.location.pathname + top.location.search;
		this.target='_self';
		this.displayMode='block';
		this.mode='auth';
		
		this.authAction='/cgi-bin/auth/login';
		this.forgetAction='/cgi-bin/auth/sendInfo';
		
		this.userLabel='Пользователь';
		this.userComment='Введите имя пользователя, под которым Вы были зарегистрированы';
		this.passwordLabel='Пароль';
		this.passwordComment='Введите Ваш пароль';
		this.loginLabel='Войти';
		this.loginComment='Авторизоваться';
		this.cancelLabel='Отменить';
		this.cancelComment='Возвратиться к вводу имени пользователя и пароля';
		this.sendLabel='Отправить';
		this.sendComment='Отправить Вашу регистрационную информацию на введенный Вами почтовый адрес';
		this.forgetLabel='Забыл пароль';
		this.forgetComment='Если Вы забыли Ваш логин или пароль, нажмите на эту ссылку';
		this.rememberMessage='Введите Ваш почтовый адрес, который Вы указывали при регистрации. На него будут отправлены Ваши регистрационные данные';
		this.registerLabel='Новый пользователь';
		this.registerComment='Если Вы еще не являетесь зарегистрированным пользователем, то нажмите на эту ссылку';
		this.emailLabel='E-mail';
		this.emailComment='Введите почтовый адрес, который Вы указывали при регистрации';
		
		this.htmlSource="		<table id='<!-- AuthorizeFormContainerID -->' class=ss-authorize-form cellpadding=0 cellspacing=0 style='display: <!-- DISPLAY_MODE -->'>\n"+
		"<tbody id='<!-- ssAuthPart -->' style=\"display: <!-- ssAuthPartDisplay -->\"><form name=\"authorizeForm\" action=\"<!-- AUTH_ACTION -->\" method=\"POST\" target=\"<!-- TARGET -->\" onsubmit='return ((this.id.value!=\"\")&&(this.pwd.value!=\"\"));'>\n"+
		" <tr>\n"+
		"  <td class=ss-authorize-form-user><!-- USER_LABEL --></td>\n"+
		"  <td class=ss-authorize-form-user-field><input name=id class=\"ss-authorize-form-user-field\" type=text value=\"\" onfocus=\"select(); return true;\" title='<!-- USER_COMMENT -->'></td>\n"+
		" </tr><tr>\n"+
		"  <td class=ss-authorize-form-password><!-- PASSWORD_LABEL --></td>\n"+
		"  <td class=ss-authorize-form-password-field><input name=pwd type=password value=\"\" onfocus=\"select()\" title='<!-- PASSWORD_COMMENT -->'></td>\n"+
		" </tr><tr>\n"+
		"  <td class=ss-authorize-form-login>&nbsp;</td>\n"+
		"  <td class=ss-authorize-form-login><input type=submit value=\"<!-- LOGIN_LABEL -->\" onfocus=\"blur()\" title='<!-- LOGIN_COMMENT -->'></td>\n"+
		" </tr><tr>\n"+
		"  <td class=ss-authorize-form-login-remember><a href=\"javascript:void(0)\" onclick=\"document.getElementById('<!-- ssAuthPart -->').style.display='none'; document.getElementById('<!-- ssRememberPart -->').style.display='block'; document.forms['<!-- rememberForm -->'].email.focus(); return false;\" title='<!-- FORGET_COMMENT -->'><!-- FORGET_LABEL --></a></td>\n"+
		"  <td class=ss-authorize-form-register><a href=\"/registrar/index.html?page=<!-- RETURN_PAGE -->\" title='<!-- REGISTER_COMMENT -->'><!-- REGISTER_LABEL --></a></td>\n"+
		" </tr><input type=hidden name=uri value=\"<!-- RETURN_PAGE -->\"><input type=hidden name=href value=\"<!-- RETURN_PAGE -->\"></form>\n"+
		" </tbody>\n"+
		" <tbody id='<!-- ssRememberPart -->' style=\"display: <!-- ssRememberPartDisplay -->\"><form name=\"<!-- rememberForm -->\" action=\"<!-- FORGET_ACTION -->\" method=\"POST\" target=\"<!-- TARGET -->\" onsubmit='return (this.email.value!=\"\");'>\n"+
		" <tr>\n"+
		"  <td class=ss-authorize-form-remember-message colspan=2><!-- REMEMBER_MESSAGE --></td>\n"+
		" </tr><tr>\n"+
		"  <td class=ss-authorize-form-e-mail><!-- EMAIL_LABEL --></td>\n"+
		"  <td class=ss-authorize-form-e-mail-field><input name=email class=\"ss-authorize-form-user-field\" type=text value=\"\" onfocus=\"select(); return true;\" title='<!-- EMAIL_COMMENT -->'></td>\n"+
		" </tr><tr>\n"+
		"  <td class=ss-authorize-form-cancel><input type=button value=\"<!-- CANCEL_LABEL -->\" onfocus=\"blur()\" onclick=\"document.getElementById('<!-- ssRememberPart -->').style.display='none'; document.getElementById('<!-- ssAuthPart -->').style.display='block'; return false;\"\" title='<!-- CANCEL_COMMENT -->'></td>\n"+
		"  <td class=ss-authorize-form-send><input type=submit value=\"<!-- SEND_LABEL -->\" onfocus=\"blur()\" title='<!-- SEND_COMMENT -->'></td>\n"+
		" </tr><input type=hidden name=uri value=\"<!-- RETURN_PAGE -->\"><input type=hidden name=href value=\"<!-- RETURN_PAGE -->\"></form>\n"+
		" </tbody>\n"+
		"</table>\n";
						
		this.setReturnURI=NVAuthorizeForm_setReturnURI;
		this.setTarget=NVAuthorizeForm_setTarget;
		this.setDisplayMode=NVAuthorizeForm_setDisplayMode;
		this.show=NVAuthorizeForm_show;
		this.hide=NVAuthorizeForm_hide;
		this.getHTMLSource=NVAuthorizeForm_getHTMLSource;
		this.authorizeMode=NVAuthorizeForm_authorizeMode;
		this.forgetMode=NVAuthorizeForm_forgetMode;
		this.setMode=NVAuthorizeForm_setMode;
		this.write=NVAuthorizeForm_write;
		this.setInnerHTML=NVAuthorizeForm_setInnerHTML;
		this.setInnerHTMLById=NVAuthorizeForm_setInnerHTMLById;
		this.setInnerHTMLByExpression=NVAuthorizeForm_setInnerHTMLByExpression;
		this.release=NVAuthorizeForm_release;

		this.setReturnURI( sURI );
		this.setTarget( sTarget );
		this.setDisplayMode( sDisplayMode );
	}
	
	function NVAuthorizeForm_setTarget(sTarget){
		if( sTarget )
			this.target=(sTarget.length)?sTarget.toString():'_self';
	}

	function NVAuthorizeForm_setReturnURI(sURI){
		if( sURI )
			this.returnURI=( sURI.length )?sURI.toString():top.location.pathname+top.location.search;
	}
	function NVAuthorizeForm_setDisplayMode(sDisplayMode){
		if( sDisplayMode && sDisplayMode.length && sDisplayMode.toString().toLowerCase() == 'none' )
			this.displayMode='none';
		else
			this.displayMode='block';
		if(!document.getElementById)return;
		var formContainer=document.getElementById(this.ID);
		if(formContainer&&formContainer.style&&formContainer.style.display)
			formContainer.style.display=this.displayMode;
	}
	function NVAuthorizeForm_show(){
		this.setDisplayMode('block');
	}
	function NVAuthorizeForm_hide(){
		this.setDisplayMode('none');
	}
	function NVAuthorizeForm_getHTMLSource(sURI, sTarget, sDisplayMode){
		this.setReturnURI(sURI);this.setTarget(sTarget);this.setDisplayMode(sDisplayMode);
		var source=this.htmlSource.replace( /<\!-- AuthorizeFormContainerID -->/gi, this.ID ).replace( /<\!-- rememberForm -->/gi, this.rememberFormName ).replace( /<\!-- ssAuthPart -->/gi, this.authID ).replace( /<\!-- ssRememberPart -->/gi, this.rememberID );
		if(this.mode=='auth')source=source.replace( /<\!-- ssAuthPartDisplay -->/gi, 'block' ).replace( /<\!-- ssRememberPartDisplay -->/gi, 'none' );
		else source=source.replace( /<\!-- ssAuthPartDisplay -->/gi, 'none' ).replace( /<\!-- ssRememberPartDisplay -->/gi, 'block' );
		return source.replace( /<\!-- RETURN_PAGE -->/gi, this.returnURI ).replace( /<\!-- DISPLAY_MODE -->/gi, this.displayMode ).replace( /<\!-- TARGET -->/gi, this.target ).replace( /<\!-- AUTH_ACTION -->/gi, this.authAction ).replace( /<\!-- FORGET_ACTION -->/gi, this.forgetAction ).replace( /<\!-- USER_LABEL -->/gi, this.userLabel ).replace( /<\!-- USER_COMMENT -->/gi, this.userComment ).replace( /<\!-- PASSWORD_LABEL -->/gi, this.passwordLabel ).replace( /<\!-- PASSWORD_COMMENT -->/gi, this.passwordComment ).replace( /<\!-- LOGIN_LABEL -->/gi, this.loginLabel ).replace( /<\!-- LOGIN_COMMENT -->/gi, this.loginComment ).replace( /<\!-- CANCEL_LABEL -->/gi, this.cancelLabel ).replace( /<\!-- CANCEL_COMMENT -->/gi, this.cancelComment ).replace( /<\!-- SEND_LABEL -->/gi, this.sendLabel ).replace( /<\!-- SEND_COMMENT -->/gi, this.sendComment ).replace( /<\!-- FORGET_LABEL -->/gi, this.forgetLabel ).replace( /<\!-- FORGET_COMMENT -->/gi, this.forgetComment ).replace( /<\!-- REMEMBER_MESSAGE -->/gi, this.rememberMessage ).replace( /<\!-- REGISTER_LABEL -->/gi, this.registerLabel ).replace( /<\!-- REGISTER_COMMENT -->/gi, this.registerComment ).replace( /<\!-- EMAIL_LABEL -->/gi, this.emailLabel ).replace( /<\!-- EMAIL_COMMENT -->/gi, this.emailComment );
	}
	function NVAuthorizeForm_write(sURI, sTarget, sDisplayMode){
		document.writeln( this.getHTMLSource(sURI, sTarget, sDisplayMode) );
	}
	
	function NVAuthorizeForm_setMode(){
		if(!document.getElementById)return;
		var formAuthPart=document.getElementById(this.authID);
		var formForgetPart=document.getElementById(this.rememberID);
		if(this.mode=='auth'){
			if(formForgetPart&&formForgetPart.style&&formForgetPart.style.display)
				formForgetPart.style.display='none';
			if(formAuthPart&&formAuthPart.style&&formAuthPart.style.display)
				formAuthPart.style.display='block';
		}else{
			if(formForgetPart&&formForgetPart.style&&formForgetPart.style.display)
				formForgetPart.style.display='block';
			if(formAuthPart&&formAuthPart.style&&formAuthPart.style.display)
				formAuthPart.style.display='none';
		}
	}
	function NVAuthorizeForm_authorizeMode(){
		this.mode='auth';
		this.setMode();
	}
	function NVAuthorizeForm_forgetMode(){
		this.mode='forget';
		this.setMode();
	}
	function NVAuthorizeForm_setInnerHTML( element, sURI, sTarget, sDisplayMode ){
		element.innerHTML='aaa';
		if(element&&element.innerHTML)
			element.innerHTML=this.getHTMLSource(sURI, sTarget, sDisplayMode);
	}
	function NVAuthorizeForm_setInnerHTMLById( sElementID, sURI, sTarget, sDisplayMode ){
		if( sElementID && (sElementID.toString() !='') && document.getElementById ){
			var element=document.getElementById(sElementID.toString());
			if(element&&element.innerHTML)
				element.innerHTML=this.getHTMLSource(sURI, sTarget, sDisplayMode);
		}
	}
	function NVAuthorizeForm_setInnerHTMLByExpression( sExpression, sURI, sTarget, sDisplayMode ){
		if( sExpression && (sExpression.toString() !='')){
			var element=eval(sExpression.toString());
			if(element&&element.innerHTML)
				element.innerHTML=this.getHTMLSource(sURI, sTarget, sDisplayMode);
		}
	}
	
	function NVAuthorizeForm_releaseForm(obj){
		delete obj;
	}

	function NVAuthorizeForm_release(){
		if(document.getElementById){
			var formContainer=document.getElementById(this.ID);
				if(formContainer.outerHTML)
					formContainer.outerHTML='';
			NVAuthorizeForm_releaseForm( this );
		}
	}
