<!--
function ShowMenu(id,menu,dir) {
	obj = document.getElementById('lev3_'+id);
	if (navigator.appName=='Netscape'||!obj) {
		window.location=dir;
		return;
	}
	par=menu.parentElement;
	td1=par.children(0);
	td3=par.children(2);
	img=td1.children(0);
	
	if (prev_show!=id) {
		obj.style.display = 'block';
		td3.className='lev21';
		img.src='/images/arr11.gif';
		img.className='arrimage1';
		td1.className='lev2a1';
		if (prev_show!='') {
			prev_obj = document.getElementById('lev3_'+prev_show);
			if (prev_obj) {
				prev_obj.style.display = 'none';
			}
			prev_menu = document.getElementById('lev2_'+prev_show);
			if (prev_menu) {
				td1=prev_menu.children(0);
				td1.className='lev2a';
				td3=prev_menu.children(2);
				img=td1.children(0);
				td3.className='lev2';
				img.src='/images/arr1.gif';
				img.className='arrimage';
			}
		}
		prev_show = id;
	} else {
		obj.style.display = 'none';
		prev_show = '';
		td3.className='lev2';
		img.src='/images/arr1.gif';
		img.className='arrimage';
		td1.className='lev2a';
	}
}

function ShowSubmenu(id,menu,dir) {
	obj = document.getElementById('lev5_'+id);
	if (navigator.appName=='Netscape'||!obj) {
		window.location=dir;
		return;
	}
	par=menu.parentElement;
	td1=par.children(0);
	td3=par.children(2);
	img=td1.children(0);
	if (prev_show_sub!=id) {
		obj.style.display = 'block';
		td3.className='lev41';
		td1.className='lev4a1';
		img.src='/images/arr41.gif';
		
		if (prev_show_sub!='') {
			prev_obj = document.getElementById('lev5_'+prev_show_sub);
			if (prev_obj) prev_obj.style.display = 'none';
			prev_menu = document.getElementById('lev4_'+prev_show_sub);
			if (prev_menu) {
				td3=prev_menu.children(2);
				td1=prev_menu.children(0);
				td3.className='lev4';
				td1.className='lev4a';
				img=td1.children(0);
				img.src='/images/arr4.gif';
			}
		}
		prev_show_sub = id;
	} else {
		obj.style.display = 'none';
		prev_show_sub = '';
		td1.className='lev4a';
		img.src='/images/arr4.gif';
		td3.className='lev4';
	}
}

function showmenutop(id,mobj) {
	obj=document.getElementById('topsubmenu'+id);
	if (!obj) return;
	tableobj=document.getElementById('mainmenutable');
	obj.style.left = 328 + tableobj.offsetLeft + mobj.offsetLeft + 1;
	obj.style.top = 		  mobj.offsetTop + 4 + 22;
	obj.style.display='block';
}


function hidemenutop(id) {
	obj=document.getElementById('topsubmenu'+id);
	if (!obj) return;
	obj.style.display='none';
}

function showframe(src) {
	obj=document.getElementById('popupframe');
	obj.src= 'about:blank';
	obj.src= src;
	table=document.getElementById('popuptable');
	table.style.display='block';
	table.style.top=document.body.scrollTop+100;
	table.style.left=(document.body.clientWidth/2)-250;
	
}

function hidetable() {
	obj=document.getElementById('popuptable');
	obj.style.display='none';
	obj.src= 'about:blank';
}

function openImage(src,nname) {
	window.open("/popup.php?img="+src,"popupimage", "scrollbars=0, resizable=0").focus();
}

function makeSelect(F)
{
	w = window.open(F, 'words', "toolbar=no,directories=no,status=no,menubar=no,width=200,height=300,resizable,scrollbars");
	w.focus();
}

function check(message)
{
	if(confirm(message))
	{
		return true
	}
	else
	{
		return false
	}
}

function validateFileExt()
{
    var elm     = event.srcElement;
    var val     = elm.value;
    var indexA  = val.length - 4;
    var indexB  = val.length;
    var indexC  = val.length - 5;
    var ext     = val.substring(indexA, indexB);
    var ext4    = val.substring(indexC, indexB);
 
    if( (ext != '.gif') && (ext != '.jpg') && (ext4 != '.jpeg') )
        alert('Ошибка расширения графического файла: Выбран файл с расширением не gif, jpg или jpeg! Отображение файла \"' + val + '\" в виде картинки может вызвать проблемы у браузера клиента. Если вы не уверены в формате этого файла или ошиблись - выберете другой графический файл.');
 
    event.returnValue = true;
}

function MM_openBrWindow(theURL, winName, features) 
{
    window.open(theURL, winName, features);
}

function isEmpty(str) 
{
    for( var intLoop = 0; intLoop < str.length; intLoop++ )
    {
        if( " " != str.charAt(intLoop) )
        {
            return false;
        }
    }
    return true;
}
 
function checkRequired(f) 
{
    var strError = "";
 
    for( var intLoop = 0; intLoop < f.elements.length; intLoop++ )
    {
        if( null != f.elements[intLoop].getAttribute("required"))
        {
            if( isEmpty(f.elements[intLoop].value) )
            {
                alert('Ошибка заполнения формы: обязательные поля (отмеченные звездочкой) должны быть заполнены!');
                return false;
            }
        }
    }
    return true;
}

function checkRequiredEmpty(f) 
{
    var strError = "";
 
    for( var intLoop = 0; intLoop < f.elements.length; intLoop++ )
    {
        if( null != f.elements[intLoop].getAttribute("required"))
        {
            if( isEmpty(f.elements[intLoop].value) )
            {
                alert('Ошибка заполнения формы: поля должны быть заполнены!');
                return false;
            }
        }
    }
    return true;
}

function MM_jumpMenu(targ,selObj,restore)
{ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

function MM_callJS(jsStr) 
{ //v2.0
	return eval(jsStr)
}

function FlashOpen(furl,fwidth,fheight) 
{
	flash=window.open("","flash","height=fwidth,width=fheight");
	flash.document.write("<html><title>Flash Demo</title>");
	flash.document.write("<body bgcolor='white' onblur=window.close()>");
	flash.document.write("<center><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0' width="+fwidth+" height="+fheight+"></center>");
	flash.document.write("<param name=movie value="+furl+">");
	flash.document.write("<param name=quality value=high>");
	flash.document.write("<embed src="+furl+" quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width="+fwidth+" height="+fheight+">");
	flash.document.write("</embed>");
	flash.document.write("</object></center>");
	flash.document.write("</body></html>");
}

function enter(argument1,argument2) 
{
	document.barform.pagenum.value  = argument1;
	document.barform.pagemode.value = argument2;
	document.barform.submit();
}

function htmlEditor(name)
{
  win_name = name;
  win = "window.open('/obj/admin/htmleditor/editor.html', '" + win_name +"', 'toolbar=no,directories=no,status=no,menubar=no,width=640,height=480,resizable,scrollbars=no');";
  w   = eval(win);
  w.focus();
}

function setSelectOptions(the_form, the_select, do_check)
{
    var selectObject = document.forms[the_form].elements[the_select];
    var selectCount  = selectObject.length;

    for (var i = 0; i < selectCount; i++) {
        selectObject.options[i].selected = do_check;
    } // end for

    return true;
} // end of the 'setSelectOptions()' function

// функция чистит передаваемый текст от спец символов. Таблица символов может быть неполной.
function ClearChars(theText) {
	output 		= new String;
	Temp 		= new Array();
	Temp2 		= new Array();
	TextSize 	= theText.length;
	
	for (i = 0; i < TextSize; i++) {
		switch (theText.charCodeAt(i))
		{
			case 130 :
				Temp[i] = 44;
				break;
			case 132 :
				Temp[i] = 34;
				break;
			case 133 :
				Temp[i] = 46;
				break;
			case 139 :
				Temp[i] = 123;
				break;
			case 145 :
				Temp[i] = 34;
				break;
			case 146 :
				Temp[i] = 34;
				break;
			case 147 :
				Temp[i] = 34;
				break;
			case 148 :
				Temp[i] = 34;
				break;
			case 149 :
				Temp[i] = 42;
				break;
			case 150 :
				Temp[i] = 45;
				break;
			case 151 :
				Temp[i] = 45;
				break;
			case 155 :
				Temp[i] = 125;
				break;
			case 171 :
				Temp[i] = 34;
				break;
			case 187 :
				Temp[i] = 34;
				break;
			case 173 :
				Temp[i] = 45;
				break;
			default :
				Temp[i] = theText.charCodeAt(i);
		}
	}
	
	for (i = 0; i < TextSize; i++) {
		output += String.fromCharCode(Temp[i]);
	}
	
	return output;
}

function FlashOpen(furl,fwidth,fheight) 
{
	flash=window.open("","flash","height=fwidth,width=fheight");
	flash.document.write("<html><title>Flash Demo</title>");
	flash.document.write("<body bgcolor='white' onblur=window.close()>");
	flash.document.write("<center><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0' width="+fwidth+" height="+fheight+"></center>");
	flash.document.write("<param name=movie value="+furl+">");
	flash.document.write("<param name=quality value=high>");
	flash.document.write("<embed src="+furl+" quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width="+fwidth+" height="+fheight+">");
	flash.document.write("</embed>");
	flash.document.write("</object></center>");
	flash.document.write("</body></html>");
}

function MM_openBrWindow(theURL, winName, features) 
{
    window.open(theURL, winName, features);

}

function check_radio(form_name) 
{
	if( form_name.name.value == '' )
	{
		alert('Введите имя!');
		
		return false;
	}
	
	if( form_name.email.value == '' )
	{
		alert('Введите e-mail!');
		
		return false;
	}

	if( form_name.id[0].checked || form_name.id[1].checked )
	{
		return true;
	}
	else
	{
		alert('Выберите раздел, на который хотите подписаться!');
	
		return false;
	}
}

<!--
function BestSize(psrc) {
var win_h;
var win_w;
var pics=new Image(); 

pics.src=psrc;
win_w=pics.width;
win_h=pics.height;
MM_openBrWindow(pics.src,'1','width='+win_w+',height='+win_h+',resizable=no,location=0,menubar=0,toolbar=0,scrollbars=no, margin=0');
}

//-->
