function showLogin(type) {
	if($('userLoginForm'))$('userLoginForm').style.display=(type=='user'&&$('userLoginForm').style.display=='none')?'block':'none';
	if($('admLoginForm'))$('admLoginForm').style.display=(type=='adm'&&$('admLoginForm').style.display=='none')?'block':'none';
    hideLanguageSelect();
    hideCurrencySelect();
}
function hideLogin() {
	if($('userLoginForm'))$('userLoginForm').style.display='none';
	if($('admLoginForm'))$('admLoginForm').style.display='none';
}
function showLogout() {
	$('LogoutForm').style.display='';
    hideLanguageSelect();
    hideCurrencySelect();
}
function hideLogout() {
	if ($('LogoutForm')) $('LogoutForm').style.display='none';
}

function showCurrencySelect() {
	var obj=$('CurrencySelect');
	obj.style.display=obj.style.display!='none'?'none':'';
    hideLanguageSelect();
    hideLogin();
    hideLogout();
}
function hideCurrencySelect() {
	$('CurrencySelect').style.display='none';
}
function showLanguageSelect() {
	var obj=$('LanguageSelect');
	obj.style.display=obj.style.display!='none'?'none':'';
    hideCurrencySelect();
    hideLogin();
    hideLogout(); 
}
function hideLanguageSelect() {
   $('LanguageSelect').style.display='none'; 
}
function goToCabinet() {
	if (document.URL.lastIndexOf('/cabinet') != -1) showLogin('user');
	else document.location = 'http://www.dosug.cz/servlet/ru/cabinet';
}
function showMenu(place) {

var sel_block_add= '<div id="CurrencySelect" style="display:none; position: absolute;z-index:9999;">'+
'<div style="background: #fff; width:200px; border:1px solid #000000; position: absolute; left: 310px; ">'+
	'<form method="post" action="http://www.dosug.cz/servlet/ru/setdata" name="SelectPrefCurrency">'+
	'<input type="hidden" name="type" value="pref_currency" />'+
	'<input type="hidden" name="back" value="'+document.location+'" />'+
	'<table border="0" cellpadding="2" cellspacing="0" width="100%">'+
		'<tr>'+
			'<td bgcolor="#FF0000" align="center">'+
				'<font face="Arial" size="1" color="#FFFFFF"><b>ВЫБОР ВАЛЮТЫ</b></font>'+
			'</td>'+
			'<td bgcolor="#FF0000" align="right">'+
				'<a title="закрыть" href="#" onclick="hideCurrencySelect(); return false">'+
					'<img alt="закрыть" src="/s/images/close.png" border="0" width="18" height="16">'+
				'</a>'+
			'</td>'+
		'</tr>'+
		'<tr>'+
			'<td bgcolor="#F5F5F5" colspan="2">'+
				'<font face="Arial" size="2" color="#666666">выберете валюту в которой Вам удобнее видеть цены на сайте</font>'+
				'<div style="background-color: #FFFFFF">'+
					'<table border="0" width="100%" cellspacing="1">'+
						'<tr>'+
							'<td width="30%" align="right" bgcolor="#F5F5F5">'+
								'<input type="radio" value="0" name="id_currency" id="sel_cur_0" checked />'+
							'</td>'+
							'<td width="70%" bgcolor="#F5F5F5" align="left">'+
								'<font face="Arial" size="2"><b><label for="sel_cur_0">по-умолчанию</label></b></font>'+
							'</td>'+
						'</tr>'+
						'<tr>'+
							'<td width="30%" align="right" bgcolor="#F5F5F5">'+
								'<input type="radio" value="1" name="id_currency" id="sel_cur_1"" />'+
							'</td>'+
							'<td width="70%" bgcolor="#F5F5F5" align="left">'+
								'<font face="Arial" size="2"><b><label for="sel_cur_1">руб.</label></b></font>'+
							'</td>'+
						'</tr>'+
						'<tr>'+
							'<td width="30%" align="right" bgcolor="#F5F5F5">'+
								'<input type="radio" value="2" name="id_currency" id="sel_cur_2"" />'+
							'</td>'+
							'<td width="70%" bgcolor="#F5F5F5" align="left">'+
								'<font face="Arial" size="2"><b><label for="sel_cur_2">долл.</label></b></font>'+
							'</td>'+
						'</tr>'+
						'<tr>'+
							'<td width="30%" align="right" bgcolor="#F5F5F5">'+
								'<input type="radio" value="3" name="id_currency" id="sel_cur_3"" />'+
							'</td>'+
							'<td width="70%" bgcolor="#F5F5F5" align="left">'+
								'<font face="Arial" size="2"><b><label for="sel_cur_3">грн.</label></b></font>'+
							'</td>'+
						'</tr>'+
						'<tr>'+
							'<td width="30%" align="right" bgcolor="#F5F5F5">'+
								'<input type="radio" value="4" name="id_currency" id="sel_cur_4"" />'+
							'</td>'+
							'<td width="70%" bgcolor="#F5F5F5" align="left">'+
								'<font face="Arial" size="2"><b><label for="sel_cur_4">евро</label></b></font>'+
							'</td>'+
						'</tr>'+
						'<tr>'+
							'<td width="30%" align="right" bgcolor="#F5F5F5">'+
								'<input type="radio" value="5" name="id_currency" id="sel_cur_5"" />'+
							'</td>'+
							'<td width="70%" bgcolor="#F5F5F5" align="left">'+
								'<font face="Arial" size="2"><b><label for="sel_cur_5">czk</label></b></font>'+
							'</td>'+
						'</tr>'+
						'<tr>'+
							'<td width="30%" align="right" bgcolor="#F5F5F5">'+
								'<input type="radio" value="6" name="id_currency" id="sel_cur_6"" />'+
							'</td>'+
							'<td width="70%" bgcolor="#F5F5F5" align="left">'+
								'<font face="Arial" size="2"><b><label for="sel_cur_6">pln</label></b></font>'+
							'</td>'+
						'</tr>'+
					'</table>'+
				'</div>'+
			'</td>'+
		'</tr>'+
		'<tr>'+
			'<td bgcolor="#E2E2E2" colspan="2" align="center">'+
				'<a href="#" onclick="document.forms[\'SelectPrefCurrency\'].submit(); hideCurrencySelect(); return false;"><font face="Arial" size="1">ВЫБРАТЬ</font></a>'+
				' | '+
				'<a href="#" onclick="hideCurrencySelect(); return false"><font face="Arial" size="1">ОТМЕНИТЬ</font></a>'+
			'</td>'+
		'</tr>'+
	'</table>'+
	'</form>'+
'</div></div>'+

'<div id="LanguageSelect" style="display:none; position: absolute;z-index:9999;">'+
'<div style="background: #fff; width:200px; border:1px solid #000000; position: absolute; left: 350px; ">'+
	'<form method="get" action="/index.jsp" name="SelectPrefLanguage">'+
	'<input type="hidden" name="back" value="'+document.location+'" />'+
	'<table border="0" cellpadding="2" cellspacing="0" width="100%">'+
		'<tr>'+
			'<td bgcolor="#FF0000" align="center">'+
				'<font face="Arial" size="1" color="#FFFFFF"><b>ВЫБОР ЯЗЫКА</b></font>'+
			'</td>'+
			'<td bgcolor="#FF0000" align="right">'+
				'<a title="закрыть" href="#" onclick="hideLanguageSelect(); return false">'+
					'<img alt="закрыть" src="/s/images/close.png" border="0" width="18" height="16">'+
				'</a>'+
			'</td>'+
		'</tr>'+
		'<tr>'+
			'<td bgcolor="#F5F5F5" colspan="2">'+
				'<font face="Arial" size="2" color="#666666">выберете язык в котором Вам удобнее видеть страницы на сайте</font>'+
				'<div style="background-color: #FFFFFF">'+
					'<table border="0" width="100%" cellspacing="1">'+
						'<tr>'+
							'<td width="30%" align="right" bgcolor="#F5F5F5">'+
								'<input type="radio" value="ru" name="set_lang" id="sel_lng_ru"" checked />'+
							'</td>'+
							'<td width="70%" bgcolor="#F5F5F5" align="left">'+
								'<font face="Arial" size="2"><b><label for="sel_lng_ru">Русский</label></b></font>'+
							'</td>'+
						'</tr>'+
						'<tr>'+
							'<td width="30%" align="right" bgcolor="#F5F5F5">'+
								'<input type="radio" value="en" name="set_lang" id="sel_lng_en"" />'+
							'</td>'+
							'<td width="70%" bgcolor="#F5F5F5" align="left">'+
								'<font face="Arial" size="2"><b><label for="sel_lng_en">English</label></b></font>'+
							'</td>'+
						'</tr>'+
						'<tr>'+
							'<td width="30%" align="right" bgcolor="#F5F5F5">'+
								'<input type="radio" value="ua" name="set_lang" id="sel_lng_ua"" />'+
							'</td>'+
							'<td width="70%" bgcolor="#F5F5F5" align="left">'+
								'<font face="Arial" size="2"><b><label for="sel_lng_ua">Українська</label></b></font>'+
							'</td>'+
						'</tr>'+
						'<tr>'+
							'<td width="30%" align="right" bgcolor="#F5F5F5">'+
								'<input type="radio" value="cz" name="set_lang" id="sel_lng_cz"" />'+
							'</td>'+
							'<td width="70%" bgcolor="#F5F5F5" align="left">'+
								'<font face="Arial" size="2"><b><label for="sel_lng_cz">Česky</label></b></font>'+
							'</td>'+
						'</tr>'+
						'<tr>'+
							'<td width="30%" align="right" bgcolor="#F5F5F5">'+
								'<input type="radio" value="de" name="set_lang" id="sel_lng_de"" />'+
							'</td>'+
							'<td width="70%" bgcolor="#F5F5F5" align="left">'+
								'<font face="Arial" size="2"><b><label for="sel_lng_de">Deutsch</label></b></font>'+
							'</td>'+
						'</tr>'+
						'<tr>'+
							'<td width="30%" align="right" bgcolor="#F5F5F5">'+
								'<input type="radio" value="pl" name="set_lang" id="sel_lng_pl"" />'+
							'</td>'+
							'<td width="70%" bgcolor="#F5F5F5" align="left">'+
								'<font face="Arial" size="2"><b><label for="sel_lng_pl">Polski</label></b></font>'+
							'</td>'+
						'</tr>'+
					'</table>'+
				'</div>'+
			'</td>'+
		'</tr>'+
		'<tr>'+
			'<td bgcolor="#E2E2E2" colspan="2" align="center">'+
				'<a href="#" onclick="document.forms[\'SelectPrefLanguage\'].submit(); hideLanguageSelect(); return false;"><font face="Arial" size="1">ВЫБРАТЬ</font></a>'+
				' | '+
				'<a href="#" onclick="hideLanguageSelect(); return false"><font face="Arial" size="1">ОТМЕНИТЬ</font></a>'+
			'</td>'+
		'</tr>'+
	'</table>'+
	'</form>'+
'</div></div>';

	document.getElementById(place).innerHTML =
	'<div align="right">'+
		'<a href="http://www.dosug.cz/servlet/ru/gallery" class="menu1_top"> Фотогалерея</a>'+
		'<img src="/s/images/top_menu.gif" width="15" height="21" border="0" alt="" align="absmiddle" />'+
		'<a href="http://www.dosug.cz/servlet/ru/search" class="menu1_top"><b>Все поиски</b></a>'+
		'<img src="/s/images/top_menu.gif" width="15" height="21" border="0" alt="" align="absmiddle" />'+
		'<a href="#" onclick="showCurrencySelect(); return false;" class="menu1_top"> Выбор валюты</a>'+
		'<img src="/s/images/top_menu.gif" width="15" height="21" border="0" alt="" align="absmiddle" />'+
        '<a href="#" onclick="showLanguageSelect(); return false;" class="menu1_top"> Выбор языка</a>'+ 
        '<img src="/s/images/top_menu.gif" width="15" height="21" border="0" alt="" align="absmiddle" />'+
		'<a href="#" onclick="goToCabinet(); return false;" class="menu1_top"> <b>Вход в личный кабинет</b></a>'+
		'<img src="/s/images/top_menu.gif" width="15" height="21" border="0" alt="" align="absmiddle" />'+
//		'<a href="#" onclick="showLogin(\'adm\'); return false;" class="menu1_top"> <b>Вход для девочек</b></a>&nbsp;&nbsp;'+
		'<a href="http://www.dosug.cz/servlet/ru/admlogin" class="menu1_top"> <b>Вход для девочек</b></a>&nbsp;&nbsp;'+
	'</div>'+
    sel_block_add+

'<div id="userLoginForm" class="menu_message" style="display:none" align="right">'+
	'<br />'+
	'ЛИЧНЫЙ КАБИНЕТ<br />'+
	'<form action="http://www.dosug.cz/servlet/ru/login" method="POST">'+
'НИК <input type="text" name="login" /> ПАРОЛЬ <input type="password" name="password" /> <input type="submit" value="вход" />'+
 '<a href="#" onclick="hideLogin(); return false;">ОТМЕНА</a><br />'+
 '<input type="checkbox" name="remember" id="usr_remember" value="1" checked /> <label for="usr_remember">запомнить меня на этом компьютере</label><br />'+
	'<br />'+
	'<a href="http://www.dosug.cz/servlet/ru/register">ЗАРЕГИСТРИРОВАТЬСЯ</a> | '+
	'<a href="http://www.dosug.cz/servlet/ru/recover">восстановить пароль</a>'+
	'</form>'+
	'<br />'+
'</div>'+

'<div id="admLoginForm" class="menu_message" style="display:none" align="right">'+
	'<br />'+
	'ВХОД ДЛЯ ДЕВОЧЕК<br />'+
	'<form action="http://www.dosug.cz/servlet/ru/admlogin" method="POST">'+
	'КОД ДОСТУПА <input type="text" name="login" /> <input type="submit" value="вход" /> '+
	'<a href="#" onclick="hideLogin(); return false;">отмена</a><br />'+
	'<input type="checkbox" name="remember" id="adm_remember" value="1" checked /> <label for="adm_remember">запомнить меня на этом компьютере</label><br />'+
	'</form>'+
	'<br />'+
'</div>'+


'';
}

