	

	var td_1      = window.document.getElementById("td_1");
	var flashcontent      = window.document.getElementById("flashcontent");
	td_1.width=736;
	flashcontent.width=736;

	if ((TypeGame=="1")||(TypeGame=="2"))
	{
		td_1.width=736;
		flashcontent.width=736;
		td_right.className="h_tbl_1_1_right";
		//h_tbl_1.className="h_tbl_1_1";
		//h_td_1.className="h_tbl_1_1";
	}	
	if (TypeGame=="3")
	{
		td_1.width=761;
		flashcontent.width=761;
		td_right.className="h_tbl_1_2_right";
		//h_tbl_1.className="h_tbl_1_2";
		//h_td_1.className="h_tbl_1_2";
	}	
	if (TypeGame=="4")
	{
		td_1.width=1063;
		flashcontent.width=1063;
		td_right.className="h_tbl_1_3_right";
		//h_tbl_1.className="h_tbl_1_3";
		//h_td_1.className="h_tbl_1_3";
		//h_td_2.className="h_tbl_1_3";
	}	
	if (TypeGame=="5")
	{
		td_1.width=736;
		flashcontent.width=736;
		td_right.className="h_tbl_1_1_right";
		//h_tbl_1.className="h_tbl_1_1";
		//h_td_1.className="h_tbl_1_1";
	}	

 
	

function GoGame(type)
{
	TypeGame=type.gameType;
	var td_1      = window.document.getElementById("td_1");
	var flashcontent      = window.document.getElementById("flashcontent");
	var h_tbl_1     = window.document.getElementById("h_tbl_1");
	var h_td_1      = window.document.getElementById("h_td_1");
	var h_td_2      = window.document.getElementById("h_td_2");
	var td_right    = window.document.getElementById("td_right");

	if ((type.gameType=="1")||(type.gameType=="2")||(type.gameType=="5"))
	{
		td_1.width=736;
		flashcontent.width=736;
		td_right.className="h_tbl_1_1_right";
		//h_tbl_1.className="h_tbl_1_1";
		//h_td_1.className="h_tbl_1_1";
		//h_td_2.className="h_tbl_1_1";
	}	
	if (type.gameType=="3")
	{
		td_1.width=761;
		flashcontent.width=761;
		td_right.className="h_tbl_1_2_right";
		//h_tbl_1.className="h_tbl_1_2";
		//h_td_1.className="h_tbl_1_2";
		//h_td_2.className="h_tbl_1_2";
	}	
	if (type.gameType=="4")
	{
		td_1.width=1063;
		flashcontent.width=1063;
		td_right.className="h_tbl_1_3_right";
		//h_tbl_1.className="h_tbl_1_3";
		//h_td_1.className="h_tbl_1_3";
		//h_td_2.className="h_tbl_1_3";
	}	

	if(top.Test==2)
	{
	
		var ic  = window.document.getElementById('gameForm');
		ic.action = "../test.aspx?returngame=returngame&tg="+type.gameType;
		ic.submit();
/*
			if(window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm")!=null)
			{
				var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm");
				ic.action = "../game.aspx?name=flash&tg="+type.gameType+"&cg=1";
				ic.submit();
			}
			if(window.document.getElementById('flashcontent').contentWindow.document.getElementById("pay_forma")!=null)
			{
				var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("pay_forma");
				ic.action = "../game.aspx?name=flash&tg="+type.gameType+"&cg=1";
				ic.submit();
			}
*/
	}
	else
	{
		if(type.authorize==0)
		{
			var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm");
			ic.action = "content_default.aspx?name=flash&tg="+type.gameType+"&cg=1";
			ic.submit();
		}
		if(type.authorize==1)
		{
			if(window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm")!=null)
			{
				var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm");
				ic.action = "content_game.aspx?name=flash&tg="+type.gameType+"&cg=1";
				ic.submit();
			}
			if(window.document.getElementById('flashcontent').contentWindow.document.getElementById("pay_forma")!=null)
			{
				var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("pay_forma");
				ic.action = "content_game.aspx?name=flash&tg="+type.gameType+"&cg=1";
				ic.submit();
			}
		}
	}
	
}

function Reg()
{
	ClearSelection();
	DisableButtons(Language);
	if(window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm")!=null)
	{
		var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm");
		ic.action = "content_default.aspx?name=reg&tg=1";
		ic.submit();
	}	
}

function AddUser()
{
	var ic  = window.document.getElementById('defaultForm');
	ic.action = "default.aspx?reg=1";
	ic.submit();
}


function UpdateUser(par)
{
	ClearSelection();
	DisableButtons(Language);
	GoFirstType();
	if(window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm")!=null)
	{
		var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm");
		ic.action = "content_game.aspx?name=updateuser&par="+par;
		ic.submit();
	}	
	else
	{
		if(window.parent.document.getElementById('flashcontent').contentWindow.document.forms["forimageForm"]!=null)
		{
			var fif = window.parent.document.getElementById('flashcontent').contentWindow.document.forms["forimageForm"];
			fif.action = "content_game.aspx?name=updateuser&par="+par;
			fif.submit();
		}
	}
}

function UpdateUser2()
{
	GoFirstType();
	if(window.document.getElementById('flashcontent').contentWindow.document.getElementById("gameForm")!=null)
	{
		var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("gameForm");
		ic.action = "content_partner.aspx?action=get_update";
		ic.submit();
	}	
}

function AddMoney()
{
	ClearSelection();
	DisableButtons(Language);
	GoFirstType();
	if(window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm")!=null)
	{
		var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm");
		ic.action = "content_game.aspx?name=addmoney";
		ic.submit();
	}	
	else
	{
		if(window.parent.document.getElementById('flashcontent').contentWindow.document.forms["forimageForm"]!=null)
		{
			var fif = window.parent.document.getElementById('flashcontent').contentWindow.document.forms["forimageForm"];
			fif.action = "content_game.aspx?name=addmoney";
			fif.submit();
		}
	}
}

function AddMoney2()
{
	GoFirstType();
	if(window.document.getElementById('flashcontent').contentWindow.document.getElementById("gameForm")!=null)
	{
		var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("gameForm");
		ic.action = "content_partner.aspx?name=addmoney2";
		ic.submit();
	}	
}

function GoCabinet()
{
	ClearSelection();
	DisableButtons(Language);
	GoFirstType();
	if(window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm")!=null)
	{
		var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm");
		ic.action = "content_game.aspx?name=cabinet&t=1";
		ic.submit();
	}	
	else
	{
		if(window.parent.document.getElementById('flashcontent').contentWindow.document.forms["forimageForm"]!=null)
		{
			var fif = window.parent.document.getElementById('flashcontent').contentWindow.document.forms["forimageForm"];
			fif.action = "content_game.aspx?name=cabinet&t=1";
			fif.submit();
		}
	}
}

function GoCabinet2()
{
	GoFirstType();
	if(window.document.getElementById('flashcontent').contentWindow.document.getElementById("gameForm")!=null)
	{
		var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("gameForm");
		ic.action = "content_partner.aspx";
		ic.submit();
	}	
}

function GoCabinet3(pager)
{
	if(window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm")!=null)
	{
		var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm");
		ic.action = "content_game.aspx?name=cabinet&t=1&pager="+pager;
		ic.submit();
	}	
}


function Forgot()
{
	ClearSelection();
	DisableButtons(Language);
	GoFirstType();

	var ic  = window.parent.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm");
	ic.action = "content_default.aspx?name=forgot";
	ic.submit();
}


function Exit(par)
{
	var ic  = window.document.getElementById('gameForm');
	if(par==1)
		ic.action = "game.aspx?actionexit=exit";
	if(par==2)
		ic.action = "test.aspx?actionexit=exit";
	ic.submit();
}

function Exit2()
{
	var ic  = window.document.getElementById('gameForm');
	ic.action = "partner.aspx?actionexit=exit";
	ic.submit();
}



function RegPartner()
{
	if(window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm")!=null)
	{
		var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm");
		ic.action = "content_default.aspx?name=regpartner";
		ic.submit();
	}	
	window.scroll(0,-500);
}

function AddPartner()
{
	var ic  = window.document.getElementById('defaultForm');
	ic.action = "default.aspx?reg=1&user=partner";
	ic.submit();
}
function UpdatePartner()
{
	if(window.parent.document.getElementById('gameForm')!=null)
	{
		var ic  = window.parent.document.getElementById('gameForm');
		var name1 = ic.name1.value;
		var name2 = ic.name2.value;
		var name3 = ic.name3.value;
		var move  = ic.move.value;
		var info  = ic.info.value;
		ic.action = "partner.aspx?action=save&name1="+name1+"&name2="+name2+"&name3="+name3+
					"&move="+move+"&info="+info;
		ic.submit();
	}	
}
function ExitPartner()
{
	var ic  = window.document.getElementById('gameForm');
	ic.action = "partner.aspx?actionexit=exit";
	ic.submit();
}

function GoFirstType()
{
	var td_1      = window.document.getElementById("td_1");
	var flashcontent      = window.document.getElementById("flashcontent");
	td_1.width=736;
	flashcontent.width=736;

		td_1.width=736;
		flashcontent.width=736;
		td_right.className="h_tbl_1_1_right";
		//h_tbl_1.className="h_tbl_1_1";
		//h_td_1.className="h_tbl_1_1";
		//h_td_2.className="h_tbl_1_1";
}

function GoFaq(auth,type)
{
	
	var td_1      = window.document.getElementById("td_1");
	var flashcontent      = window.document.getElementById("flashcontent");
	var h_tbl_1     = window.document.getElementById("h_tbl_1");
	var h_td_1      = window.document.getElementById("h_td_1");
	var h_td_2      = window.document.getElementById("h_td_2");
	var td_right    = window.document.getElementById("td_right");

	td_1.width=736;
	flashcontent.width=736;
	td_right.className="h_tbl_1_1_right";
	//h_tbl_1.className="h_tbl_1_1";
	//h_td_1.className="h_tbl_1_1";
	//h_td_2.className="h_tbl_1_1";
	
	
	if(auth==0)
	{
		if(window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm")!=null)
		{
			var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm");
			if(type==1)
				ic.action = "content_default.aspx";
			else	
				ic.action = "content_default.aspx?name=faq&faq="+type;
			ic.submit();
		}
	}	
	if(auth==1)
	{
		if(window.parent.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm")!=null)
		{
			var ic  = window.parent.document.getElementById('flashcontent').contentWindow.document.getElementById("contentForm");
			if(type==1)
				ic.action = "content_game.aspx";
			else
				ic.action = "content_game.aspx?name=faq&faq="+type;
			ic.submit();
		}	
	}	
	if(auth==2)
	{
		if(window.document.getElementById('flashcontent').contentWindow.document.getElementById("gameForm")!=null)
		{
			var ic  = window.document.getElementById('flashcontent').contentWindow.document.getElementById("gameForm");
			if(type==1)
				ic.action = "content_game.aspx?name=faq&t="+type;
			else
				ic.action = "content_partner.aspx?name=faq&faq="+type;
			ic.submit();
		}	
	}	

}

function HeaderUpdate()
{
	UpdateUser(1);
}

function AddComments()
{
		if(document.getElementById("gameForm")!=null)
		{
			var f    = document.getElementById("buffer").contentWindow.document.forms["bufferForm"];
			var f2   = document.getElementById("field3").value;
			var length=f2.length;
			var f3="";
			var f4="";
			for(var i=0;i<length;i++)
			{
				var sss = f2.substr(i,1);
				if(sss=='<') f4="";
				else if(sss=='>')  f4="";
				else f3=f3+f2.substr(i,1);
			}
			f2=f3;
			
			var f3   = document.getElementById("field333");
			f3.value = f2;
			if(f2.length==0) alert("Наберите сообщение !")
			else if(f2.length>1000) alert("Не более 1000 символов !")
			else
			{
				f.action = "buffer.aspx?action=addcomments&comments="+f2+"&TypeGame="+TypeGame;
				f.submit();
			}	
		}
}

	function OnGreatBtnOver(id,id2,id3)
	{
		id.style.background="#035a93";
		id2.style.background="#035a93";
		id3.style.background="#035a93";
	}
	
	function OnGreatBtnOut(id,id2,id3)
	{
		id.style.background="#023f6e";
		id2.style.background="#023f6e";
		id3.style.background="#023f6e";
	}

	function OnMBtnOver(obj)
	{
		obj.style.background="#035a93";
	}
	
	function OnMBtnOut(obj)
	{
		obj.style.background="#023f6e";
	}

	function GoDefault()
	{
		if(window.document.getElementById("gameForm")!=null)
		{
			var ic  = window.document.getElementById('gameForm');
			ic.action = "game.aspx?actionexit=exit";
			ic.submit();
		}
	}
	
	function GoWebMoney(summa0,money,type)
	{
		if(window.document.getElementById("gameForm")!=null)
		{
			var ic  = window.document.getElementById('gameForm');
			ic.action = "game.aspx?ssl=yes&summa0="+summa0+"&summa="+money+"&type="+type;
			ic.submit();
		}
	}

	function GoGoldMoney(accountid,amount,worthof,memo)
	{
		if(window.document.getElementById("gameForm")!=null)
		{
			var ic  = window.document.getElementById('gameForm');
			ic.action = "game.aspx?ssl2=yes&accountid="+accountid+"&amount="+amount+"&worthof="+worthof+"&memo="+memo;
			ic.submit();
		}
	}

	function GoRuPay(summa0,money,type)
	{
		if(window.document.getElementById("gameForm")!=null)
		{
			var ic  = window.document.getElementById('gameForm');
			ic.action = "game.aspx?ssl3=yes&summa0="+summa0+"&summa="+money+"&type="+type;
			ic.submit();
		}
	}


	function GoYandexMoney(summa,method)
	{
		if(window.document.getElementById("gameForm")!=null)
		{
			var ic  = window.document.getElementById('gameForm');
			window.open("../game.aspx?ssl4=yes&summa="+summa+"&method="+method, "Window", 'width=830,height=690,scrollbars=yes,resizable=yes'); 
//			ic.action = "game.aspx?ssl4=yes&summa="+summa+"&method="+method;
//			ic.submit();
		}
	}
	
	function ClearSelection()
	{
   		var title	 = top.titleswf;
   		if(title!=null)
   		{
			title.clearSelection();
   		}
	}

	function GoTopUsers(typegame)
	{
		if(document.getElementById("buffer").contentWindow.document.forms["bufferForm"]!=null)
		{
			var f    = document.getElementById("buffer").contentWindow.document.forms["bufferForm"];
			f.action = "buffer.aspx?action=gettopusers&TypeGame="+typegame;
			f.submit();
		}
	}
	
	function GoTest()
	{
		if(window.document.getElementById("gameForm")!=null)
		{
			var ic  = window.document.getElementById('gameForm');
			ic.action = "game.aspx?test=gotest";
			ic.submit();
		}
	}
	function GoReal()
	{
		if(window.document.getElementById("gameForm")!=null)
		{
			var ic  = window.document.getElementById('gameForm');
			ic.action = "test.aspx?real=goreal";
			ic.submit();
		}
	}

