﻿function ChangeAccount(UserName,Password)
{
	
	if ( window.external )
	{
		//alert(window.external.LogUName);
	  window.external.LogUName = UserName;           
	  window.external.SetID3 = Password;                     
	  window.external.Recall = 1;  
	  window.external.LogUName(UserName);
	  window.external.SilentLogin(UserName, Password, true);
	  window.external.BackToLobby( );
	}
}

// JScript File

function GoBonusLink()
{
 pageTracker._trackEvent('FlashObjects', 'PromoClick', 'BonusButton');
}

function GoPlayLink()
{
		
	pageTracker._trackEvent('FlashObjects', 'PromoClick', 'DownloadButton');
}

function JS_OnSubMenuOpen()
{
	//alert('OK')
	if (document.getElementById('player_container')!=null)
	document.getElementById('player_container').style.zIndex=4;
	//document.getElementById('textcontent1').style.zIndex=-1;
	//if (document.getElementById('player_container')!=null)
//alert(document.getElementById('textcontent1').style.zIndex)
//document.getElementById('textcontent1').style.zIndex=-100;
//document.getElementById('textcontent1').style.zIndex=-5;
//document.getElementById('player_container').style.zIndex=4;

//document.getElementById('textcontent').style.zIndex=-100;
//	alert(document.getElementById('player_container').style.zIndex)

}

function JS_OnSubMenuClose()
{
	//document.getElementById('player_container').style.zIndex=4;
	//document.getElementById('textcontent1').style.zIndex=3;
	if (document.getElementById('player_container')!=null)
	document.getElementById('player_container').style.zIndex=1;
	//	if (document.getElementById('player_container')!=null)
//document.getElementById('textcontent1').style.zIndex=3 ;	
//document.getElementById('player_container').style.zIndex=1;

}

function onLogin()
{
}

function onLogOut()
{
}

function LoadMe()
{
MoveCir();
}




function MoveCir()
{

	cf=document.getElementById('CircleFlash');
	cf.style.display="block";
	
	var top=document.body.scrollTop+document.documentElement.scrollTop+screen.availHeight/2 ;
	cf.style.top=top+"px";
	cf.style.top=top+"px";
	if (navigator.userAgent.indexOf("MSIE")>0)
	{
		//cf.style.top=top
	}
	else
	{
		
	}
			
}

var _popup=true;
function checkUnload2()
{

	//if (_popup)
	//{
	if (false){
	if (getCookie("seenBUG3")!=1){
            if (confirm("Хотите сыграть и получить бонусы прямо сейчас?"))
			{
			 // window.open("/ru/myaccount/limitedregistration.aspx","new")
			  window.open("/beforeyougo.aspx?btag=GF_DIRECT","new1")
			}
			else
			{
			  window.open("/beforeyougo.aspx?btag=GF_DIRECT","new1")
			}
	}
	}
	d = new Date();
        t = d.getTime()+30*24*3600*1000;
        d1 = new Date(t);
        exp=d1.toUTCString(); 
        setCookie("seenBUG3", "1", exp, "/");
		

}


function LoadMeF()
{
var lnks=document.getElementsByTagName('a') 
for (var i=0; i<lnks.length;i++) 
{ 
	if (lnks[i].href.indexOf("goldfishka.com")>-1)
		lnks[i].onclick=function(){_popup=false} 
} 
}



function getCookie(name) {
    var cookie = " " + document.cookie;
    var search = " " + name + "=";
    var setStr = null;
    var offset = 0;
    var end = 0;
    if (cookie.length > 0) {
        offset = cookie.indexOf(search);
        if (offset != -1) {
            offset += search.length;
            end = cookie.indexOf(";", offset)
            if (end == -1) {
                end = cookie.length;
            }
                setStr = unescape(cookie.substring(offset, end));
            }
    }
    return(setStr);
} 

function setCookie (name, value, expires, path, domain, secure) {
      document.cookie = name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}




