//------------------------------------------------------------------------------------------------
//tooltip
var offsetx = 12;
var offsety =  8;

function  newelement(newid)
{
    if(document.createElement)
    {
        var el = document.createElement('div');
        el.id = newid;
        with(el.style)
        {
            display = 'none';
            position = 'absolute';
        }
        el.innerHTML = '&nbsp;';
        document.body.appendChild(el);
    }
}
var ie5 = (document.getElementById && document.all);
var ns6 = (document.getElementById && !document.all);
var ua = navigator.userAgent.toLowerCase();
var isapple = (ua.indexOf('applewebkit') != -1 ? 1 : 0);
function getmouseposition(e)
{
    if(document.getElementById)
    {
        var iebody=(document.compatMode &&
        	document.compatMode != 'BackCompat') ?
        		document.documentElement : document.body;
        pagex = (isapple == 1 ? 0:(ie5)?iebody.scrollLeft:window.pageXOffset);
        pagey = (isapple == 1 ? 0:(ie5)?iebody.scrollTop:window.pageYOffset);
        mousex = (ie5)?event.x:(ns6)?clientX = e.clientX:false;
        mousey = (ie5)?event.y:(ns6)?clientY = e.clientY:false;

        var lixlpixel_tooltip = document.getElementById('tooltip');
        lixlpixel_tooltip.style.left = (mousex+pagex+offsetx) + 'px';
        lixlpixel_tooltip.style.top = (mousey+pagey+offsety) + 'px';
    }
}
function tooltip(tip)
{
    if(!document.getElementById('tooltip')) newelement('tooltip');
    var lixlpixel_tooltip = document.getElementById('tooltip');
    lixlpixel_tooltip.innerHTML = tip;
    lixlpixel_tooltip.style.display = 'block';
    document.onmousemove = getmouseposition;
}
function exit()
{
    document.getElementById('tooltip').style.display = 'none';
}

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

function check_otvet(form) {
	var good=1;

	if (form.z_otvet.value == "") {alert("Введите Ваш ответ!");good=0;}
    var filter2=/^[а-яА-Я0-9 ]+$/;
    if (!filter2.test(form.z_otvet.value)  && good==1){alert('Ответ должен состоять только из русских букв!'); good=0;}

	var cookieEnabled=(navigator.cookieEnabled)? true : false
	if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled)
	{
	  document.cookie="testcookie";
	  cookieEnabled=(document.cookie=="testcookie")? true : false;
	  document.cookie="";
	}
	if (!cookieEnabled && good==1) {alert('Включите cookie в настройках вашего браузера!'); good=0;}
	if (!getCookie("z_mail") && good==1)
	{
		var now = new Date();fixDate(now);now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
		var z_mail = prompt("Введите Ваш e-mail:", "");
		var filter=/^.+@.+\..{2,6}$/;
		if (filter.test(z_mail))
		{setCookie("z_mail", z_mail, now);good=1;}
		else
		{alert('Некорректный e-mail!'); good=0;}

	}

	if (good==1)
	{
		setCookie("z_riddle", form.z_riddle.value, z_time);
		form.z_mail.value=getCookie("z_mail");
		form.LMI_PAYMENT_DESC.value="Оплата за попытку ответа на загадку №"+form.z_riddle.value+" в Игре Загадка.";
		form.submit();
	}
}


function check_otvet2(form) {
	var good=1;

	if (form.z_otvet.value == "") {alert("Введите Ваш ответ!");good=0;}
    var filter2=/^[а-яА-Я0-9 ]+$/;
    if (!filter2.test(form.z_otvet.value)  && good==1){alert('Ответ должен состоять только из русских букв!'); good=0;}

	var cookieEnabled=(navigator.cookieEnabled)? true : false
	if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled)
	{
	  document.cookie="testcookie";
	  cookieEnabled=(document.cookie=="testcookie")? true : false;
	  document.cookie="";
	}
	if (!cookieEnabled && good==1) {alert('Включите cookie в настройках вашего браузера!'); good=0;}
	if (good==1)
	{
		setCookie("z_riddle", form.z_riddle.value, z_time);
		form.submit();
	}
}

function z_login()
{
	//document.getElementById('riddls').style.height=0;
	zlogin_win = open("", "LoginWindow",  "width=200,height=170,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no");
	zlogin_win.moveTo(screen.width/2-100, screen.height/2-140);
	zlogin_win.document.open();
	zlogin_win.document.write('<script language="JavaScript">function closeIt() { window.opener.document.getElementById("riddls").style.height='+z_height+'; close();};<\/script><link href="http://igra-zagadka.ru/light/zagadki.css" type=text/css rel=stylesheet>  <div id="z_login_div" class="z_login_div" style="height:'+z_height+'px;overflow:auto"><table class="zagadka">');
	zlogin_win.document.write('<tr> <td class="zagadka_text"  colspan="2"><center class="zagadka"><b>Авторизация</b></center></td></tr>');
	zlogin_win.document.write('<tr>');
	zlogin_win.document.write('<td class="zagadka_text"  colspan="2">');
	zlogin_win.document.write('<form name="z_login_form" action="http://igra-zagadka.ru/light/zagadki.php?action=login&ref='+z_ref+'" method="post">');
	zlogin_win.document.write('<br>Логин:&nbsp;&nbsp;&nbsp;<input class="zagadka_text" name="z_name" type="text" value="" size="10"><br>');
	zlogin_win.document.write('<br>Пароль:&nbsp;&nbsp;<input class="zagadka_text" name="z_pass" type="password" value="" size="10"><br><br>');
	zlogin_win.document.write('<input class="zagadka_submit" name="z_submit" type="button" onclick="document.z_login_form.submit();" value="Войти">');
	zlogin_win.document.write('<input class="zagadka_submit" name="z_cancel" type="button" onclick="closeIt()" value="Отмена">');
	zlogin_win.document.write('</form>');
	zlogin_win.document.write('</td>');
	zlogin_win.document.write('</tr>');
	zlogin_win.document.write('</table></div>');
	zlogin_win.document.close();
}
function CheckLogin()
{
	if ((!zlogin_win | zlogin_win.closed)){if(document.getElementById('market').style.height==0) {document.getElementById('riddls').style.height=z_height;}}
}

function z_unlogin()
{
	var z_login_text2='<select onChange=&quot;z_selector()&quot; class=&quot;zagadka&quot; id=&quot;z_menu&quot; name=&quot;z_menu&quot;>	<option value=&quot;z_game&quot; selected>Игра </option>		<option value=&quot;z_login&quot;> Вход </option>	</select>';
	//document.getElementById('riddls').style.height=0;
	zlogin_win = open("", "UnLoginWindow",  "width=200,height=90,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no");
	zlogin_win.moveTo(screen.width/2-100, screen.height/2-140);
	zlogin_win.document.open();
	zlogin_win.document.write('<script language="JavaScript">function closeIt() { window.opener.document.getElementById("riddls").style.height='+z_height+';  close();}; function z_unlogin_send(form){form.submit();}<\/script><link href="http://igra-zagadka.ru/light/zagadki.css" type=text/css rel=stylesheet><div id="z_login_div" class="z_login_div" style="height:'+z_height+'px;overflow:auto"><table class="zagadka">');
	zlogin_win.document.write('<tr> <td class="zagadka_text"  colspan="2"><center class="zagadka"><b>Выйти из аккаунта?</b></center></td></tr>');
	zlogin_win.document.write('<tr>');
	zlogin_win.document.write('<td class="zagadka_text"  colspan="2">');
	zlogin_win.document.write('<form name="z_unlogin_form" action="http://igra-zagadka.ru/light/zagadki.php?action=unlogin&ref='+z_ref+'" method="post">');
	zlogin_win.document.write('<input class="zagadka_submit" name="z_submit" type="button" onclick="window.opener.document.getElementById(\'z_login_text\').innerHTML=\''+z_login_text2 +'\'; z_unlogin_send(document.z_unlogin_form); " value="Да">');
	zlogin_win.document.write('<input class="zagadka_submit" name="z_cancel" type="button" onclick="closeIt()" value="Нет">');
	zlogin_win.document.write('</form>');
	zlogin_win.document.write('</td>');
	zlogin_win.document.write('</tr>');
	zlogin_win.document.write('</table></div>');
	zlogin_win.document.close();
}

function add_riddle()
{	document.getElementById('riddls').style.height=0;
	document.getElementById('add_riddle').style.height=z_height;
	document.getElementById('riddls').style.display="none";
	document.getElementById('add_riddle').style.display="";
}

function add_riddle_close()
{
	document.getElementById('riddls').style.height=z_height;
	document.getElementById('add_riddle').style.height=0;
	document.getElementById('riddls').style.display="";
	document.getElementById('add_riddle').style.display="none";
}


function print_riddle()
{
var i=-1;
while (i<zagadki.length)
    {
		i++;
		if (i<zagadki.length)
		{
			var zag=zagadki[i].split("|");
			var ran=Math.round(Math.random()*10000);
			if ((z_good && z_bal<5) |!z_good)
			{
				document.write('<tr>');
				document.write('<td class="zagadka_text"><a href="#" class="zagadka" onmouseover="tooltip(\''+zag[2]+'\');" onmouseout="exit();">' + zag[1] + '</a></td>');
				document.write('<td class="zagadka_form">');
				document.write('<form name="pay' + zag[0] + '"  action="https://merchant.webmoney.ru/lmi/payment.asp" method="post">');
				document.write('<input name="LMI_PAYMENT_AMOUNT"  type="hidden" value="5">');
				document.write('<input name="LMI_PAYMENT_DESC"  type="hidden" value="">');
				document.write('<input name="LMI_PAYMENT_NO"  type="hidden" value="'+Math.round(Math.random()*10000)+'">');
				document.write('<input name="LMI_PAYEE_PURSE" type="hidden" value="R231630146905">');
				document.write('<input name="LMI_SIM_MODE" type="hidden" value="0">');
				document.write('<input name="z_ref" type="hidden" value="'+z_ref+'">');
				document.write('<input name="z_mail" type="hidden" value="">');
				document.write('<input name="z_link" type="hidden" value="'+encodeURIComponent(z_link)+'">');
				document.write('<input name="z_riddle" type="hidden" value="' + zag[0] + '">');
				document.write('<input class="zagadka_text" name="z_otvet"  type="text" value="" size="10">');
				document.write('&nbsp;&nbsp; <a onclick="check_otvet(document.pay' + zag[0] + ');" href="#" class="zagadka"><b>Отгадать</b></a>');
				document.write('</form>');
				document.write('</td>');
				document.write('</tr>');
			}
			else
			{				document.write('<tr>');
				document.write('<td class="zagadka_text"><a href="#" class="zagadka" onmouseover="tooltip(\''+zag[2]+'\');" onmouseout="exit();">' + zag[1] + '</a></td>');
				document.write('<td class="zagadka_form">');
				document.write('<form name="pay' + zag[0] + '"  action="http://igra-zagadka.ru/light.php?action=try&ref='+z_ref+'" method="post">');
				document.write('<input name="z_link" type="hidden" value="'+encodeURIComponent(z_link)+'">');
				document.write('<input name="z_riddle" type="hidden" value="' + zag[0] + '">');
				document.write('<input class="zagadka_text" name="z_otvet"  type="text" value="" size="10">');
				document.write('&nbsp;&nbsp; <a onclick="check_otvet2(document.pay' + zag[0] + ');" href="#" class="zagadka"><b>Отгадать</b></a>');
				document.write('</form>');
				document.write('</td>');
				document.write('</tr>');
			}
		}
    }

}


function market_open()
{
	document.getElementById('market').style.height=z_height;
	document.getElementById('riddls').style.height=0;
	document.getElementById('market').style.display="";
	document.getElementById('riddls').style.display="none";
}

function market_close()
{
	document.getElementById('riddls').style.height=z_height;
	document.getElementById('market').style.height=0;
	document.getElementById('riddls').style.display="";
	document.getElementById('market').style.display="none";
}

function check_market(form) {
	var good=1;

	var cookieEnabled=(navigator.cookieEnabled)? true : false
	if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled)
	{
	  document.cookie="testcookie";
	  cookieEnabled=(document.cookie=="testcookie")? true : false;
	  document.cookie="";
	}
	if (!cookieEnabled && good==1) {alert('Включите cookie в настройках вашего браузера!'); good=0;}
	if (!getCookie("z_mail") && good==1)
	{
		var now = new Date();fixDate(now);now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
		var z_mail = prompt("Введите Ваш e-mail: ", "");
		var filter=/^.+@.+\..{2,6}$/;
		if (filter.test(z_mail))
		{setCookie("z_mail", z_mail, now);good=1;}
		else
		{alert('Некорректный e-mail!'); good=0;}

	}

	var z_pay = prompt("Сколько Вы хотите купить? (максимум - "+ form.z_pay_max.value+"): ", "");
    var filter2=/^[0-9]+$/;
    if (!filter2.test(z_pay)  && good==1){alert('Вводите только цифры!'); good=0;}
	if (z_pay>form.z_pay_max.value   && good==1) {alert("Нет такого количества возможностей по этой цене!\r\n (максимум - "+ form.z_pay_max.value+") ");good=0;}

	if (good==1)
	{
		form.LMI_PAYMENT_AMOUNT.value=z_pay*form.z_pay_price.value;
		form.z_mail.value=getCookie("z_mail");
		form.z_pay.value=z_pay;
		form.LMI_PAYMENT_DESC.value="Оплата сделки по преобретению возможностей у игрока "+form.z_pay_user.value+" по цене "+form.z_pay_price.value+" руб./шт., в количестве: "+z_pay+" шт. на бирже в Игре Загадка.";
		form.submit();
	}
}


function check_market2(form) {
	var good=1;

	var cookieEnabled=(navigator.cookieEnabled)? true : false
	if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled)
	{
	  document.cookie="testcookie";
	  cookieEnabled=(document.cookie=="testcookie")? true : false;
	  document.cookie="";
	}
	if (!cookieEnabled && good==1) {alert('Включите cookie в настройках вашего браузера!'); good=0;}

	var z_pay = prompt("Сколько Вы хотите купить? (максимум - "+ form.z_pay_max.value+"): ", "");
    var filter2=/^[0-9]+$/;
    if (!filter2.test(z_pay)  && good==1){alert('Вводите только цифры!'); good=0;}
	if (z_pay>form.z_pay_max.value   && good==1) {alert("Нет такого количества возможностей по этой цене!\r\n (максимум - "+ form.z_pay_max.value+") ");good=0;}

	if (good==1)
	{
		form.z_pay.value=z_pay;
		form.submit();
	}
}



function print_market()
{
var i=-1;
while (i<market.length)
    {
		i++;
		if (i<market.length)
		{
			var mar=market[i].split("|");
			if ((z_good && z_bal<5) |!z_good)
			{
				document.write('<tr height="11px">');
				document.write('<td class="zagadka_text"><a href="#" class="zagadka" onmouseover="tooltip(\'Доступное количество : <b>'+mar[3]+'</b> шт. <br />Цена: <b>'+mar[4]+'</b> руб./шт.<br /> Выставил: <b>'+mar[2]+'</b>\');" onmouseout="exit();">Возможность выставить загадку </a></td>');
				document.write('<td class="zagadka_form">');
				document.write('<form name="mar' + mar[0] + '"  action="https://merchant.webmoney.ru/lmi/payment.asp" method="post">');
				document.write('<input name="LMI_PAYMENT_AMOUNT"  type="hidden" value="">');
				document.write('<input name="LMI_PAYMENT_DESC"  type="hidden" value="">');
				document.write('<input name="LMI_PAYMENT_NO"  type="hidden" value="'+mar[0]+'">');
				document.write('<input name="LMI_PAYEE_PURSE" type="hidden" value="R231630146905">');
				document.write('<input name="LMI_SIM_MODE" type="hidden" value="0">');
				document.write('<input name="z_mail" type="hidden" value="">');
				document.write('<input name="z_link" type="hidden" value="'+encodeURIComponent(z_link)+'">');
				document.write('<input name="z_pay" type="hidden" value="0">');
				document.write('<input name="z_pay_num" type="hidden" value="' + mar[0] + '">');
				document.write('<input name="z_pay_user" type="hidden" value="' + mar[2] + '">');
				document.write('<input name="z_pay_max" type="hidden" value="' + mar[3] + '">');
				document.write('<input name="z_pay_price" type="hidden" value="' + mar[4] + '">');
				document.write('Цена: ' + mar[4] + ' руб./шт. &nbsp;&nbsp;<a onclick="check_market(document.mar' + mar[0] + ');" href="#" class="zagadka"><b>Купить</b></a>');
				document.write('</form>');
				document.write('</td>');
				document.write('</tr>');
			}
			else
			{

				document.write('<tr>');
				document.write('<td class="zagadka_text"><a href="#" class="zagadka" onmouseover="tooltip(\'Доступное количество : <b>'+mar[3]+'</b> шт. <br />Цена: <b>'+mar[4]+'</b> руб./шт.<br /> Выставил: <b>'+mar[2]+'</b>\');" onmouseout="exit();">Возможность выставить загадку </a></td>');
				document.write('<td class="zagadka_form">');
				document.write('<form name="mar' + mar[0] + '"  action="http://igra-zagadka.ru/light.php?action=pay_market&ref='+z_ref+'" method="post">');
				document.write('<input name="z_link" type="hidden" value="'+encodeURIComponent(z_link)+'">');
				document.write('<input name="z_pay" type="hidden" value="0">');
				document.write('<input name="z_pay_num" type="hidden" value="' + mar[0] + '">');
				document.write('<input name="z_pay_user" type="hidden" value="' + mar[2] + '">');
				document.write('<input name="z_pay_max" type="hidden" value="' + mar[3] + '">');
				document.write('<input name="z_pay_price" type="hidden" value="' + mar[4] + '">');
				document.write('Цена: ' + mar[4] + ' руб./шт. &nbsp;&nbsp;<a onclick="check_market2(document.mar' + mar[0] + ');" href="#" class="zagadka"><b>Купить</b></a>');
				document.write('</form>');
				document.write('</td>');
				document.write('</tr>');
			}
		}
    }

}

function check_add_riddle(form) {
	var good=1;

	if (form.z_otvet.value == "") {alert("Введите ответ!");good=0;}
    var filter2=/^[а-яА-Я0-9 ]+$/;
    if (!filter2.test(form.z_otvet.value)  && good==1){alert('Ответ должен состоять только из русских букв!'); good=0;}

	var cookieEnabled=(navigator.cookieEnabled)? true : false
	if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled)
	{
	  document.cookie="testcookie";
	  cookieEnabled=(document.cookie=="testcookie")? true : false;
	  document.cookie="";
	}
	if (!cookieEnabled && good==1) {alert('Включите cookie в настройках вашего браузера!'); good=0;}

	if (good==1)
	{
		form.submit();
	}
}


function print_all()
{	document.write('<div id="riddls" class="riddls" style="height:'+z_height+'px;overflow:auto"><table class="zagadka">');
	document.write('<tr><td colspan="2"><center class="zagadka"><b>Заработай своим умом - сыграй в Загадку! '+err+'</b></center></td></tr>');
	print_riddle();
	document.write('<tr> ');
	document.write('<td align="left"><div id="z_login_text">'+z_login_text+'</div></td>');
	document.write('<td align="right"><a target="_blank" href="http://igra-zagadka.ru/?page=rules&ref='+z_ref+'" class="zagadka"><b>Правила игры</b></a></td>');
	document.write('</tr>');
	document.write('</table></div>');

	document.write('<div id="market" class="market" style="height:0px;overflow:auto;display:none"><table class="zagadka">');
	document.write('<td  colspan="2"><center class="zagadka"><a href="#" class="zagadka" onmouseover="tooltip(\'Не смогли отгадать загадку? <br />- Купите возможность у одного из игроков, <br />выставьте загадку и пусть она приносит Вам доход!\');" onmouseout="exit();"><b>::БИРЖА ВОЗМОЖНОСТЕЙ::</b> </a></center></td>');
	print_market();
	document.write('<tr> ');
	document.write('<td align="left"><div id="z_login_text"></div></td>');
	document.write('<td align="right"><a href="#" class="zagadka" onclick="market_close()"><b>[закрыть]</b></a></td>');
	document.write('</tr>');
	document.write('</table></div>');

	document.write('<div id="add_riddle" class="add_riddle" style="height:0px;overflow:auto;display:none">');
	document.write('<table class="zagadka">');
	document.write('<tr> ');
	document.write('<td colspan="2"><center class="zagadka"><b><br>Выставить загадку:</b></center></td>');
	document.write('</tr>');
	document.write('<tr> ');
	document.write('<form name="z_add" action="http://igra-zagadka.ru/light.php?action=add_riddle&ref='+z_ref+'" method="post">');
	document.write('<input name="z_link" type="hidden" value="'+encodeURIComponent(z_link)+'">');
	document.write('<tr valign="top">');
	document.write('<td class="zagadka_text"><b>Текст загадки:</b><br><textarea name="zagadka_text" rows="4" cols="20"></textarea>');
	document.write('<br><b>Комментарий для администрации:</b><br><textarea name="comment_text" rows="4" cols="20"></textarea></td>');
	document.write('<td class="zagadka_form">');
	document.write('<b>Ответ:</b><br><input class="zagadka_text" name="z_otvet" type="text" value="" size="20"><br>');
	document.write('<br><a onclick="check_add_riddle(document.z_add);" href="#" class="zagadka"><b>Выставить</b></a>');
	document.write('</form>');
	document.write('</td>');
	document.write('<tr align="right"> ');
	document.write('<td class="zagadka_text"></td>');
	document.write('<td align="right" class="zagadka_form"><a href="#" class="zagadka" onclick="add_riddle_close()"><b>[закрыть]</b></a></td>');
	document.write('</tr>');
	document.write('</table>');
	document.write('</div>');



}



function z_selector(){	select=document.getElementById("z_menu").value;
	document.getElementById("z_menu").selected="z_game";

    switch(select){

        case "z_login":
            z_login();
        break;

        case "z_unlogin":
            z_unlogin();
        break;

        case "add_riddle":
            add_riddle();
        break;

        case "market_open":
            market_open();
        break;

        default:
        break;
    }
}


printall=0;
var z_link=document.location;
var z_height=300;
var err="";
var zlogin_win="";
//Timer=window.setInterval("CheckLogin()",1000);
var z_time = new Date();fixDate(z_time);z_time.setTime(z_time.getTime() + 1 * 24 * 60 * 60 * 1000);
var z_bal_text=''; 		if (z_good) {var z_bal_text='  &nbsp;&nbsp;&nbsp;<b class="zagadka">Баланс:'+z_bal+'</b>';}
var z_add_riddle=''; 	if (z_good>0) {z_add_riddle='<option value="add_riddle">Выставить загадку</option>';}
var z_marker_text='';	if (market.length>0) {z_marker_text='<option value="market_open">Купить возможность</option>';}
var z_login_enter='<option value="z_login"> Войти </option>';
if (z_name) z_login_enter='<option value="z_unlogin"> Выход </option>';
var z_login_text='<select onChange="z_selector()" class="zagadka" id="z_menu" name="z_menu"><option value="z_game" name="z_game" id="z_game" selected>Игра '+z_name+'</option>'+z_marker_text+z_add_riddle+z_login_enter+'</select>'+z_bal_text;

if (z_act=='bad')
{
	err='<br><font color="red">Ваш ответ не верен!</font><br>';
}

if (z_act=='fail')
{
	err='<br><font color="red">Платеж не исполнен (</font>';
}

if (z_act=='add')
{
	err='<br><font color="green">Поздравляем! Вы отгадали загадку!!! </font>';
}

if (z_act=='add_ok')
{
	err='<br><font color="green">Ваша загадка добавлена!</font><br>';
}

if (z_act=='add_bad')
{
	err='<br><font color="red">Загадка не добавлена!</font><br>';
}

if (z_act=='add_bad_no_good')
{
	err='<br><font color="red">Загадка не добавлена: Вы пытаетесь добавить загадку не отгадав ни одной!</font><br>';
}

if (z_act=='no_market_pozition')
{
	err='<br><font color="red">Нет такой позиции на бирже!</font><br>';
}

if (z_act=='bad_count')
{
	err='<br><font color="red">На бирже нет такого количества возможностей по этой цене!!</font><br>';
}

if (z_act=='bad_balance')
{
	err='<br><font color="red">У вас не достаточно денег!</font><br>';
}

if (z_act=='good_pay_market')
{
	err='<br><font color="green">Поздравляем! Сделка завершена успешно!</font><br>';
}


print_all();
