//function tha replace the include
function include(script_filename) {
    document.write('<' + 'script');
    document.write(' language="javascript"');
    document.write(' type="text/javascript"');
    document.write(' src="' + script_filename + '">');
    document.write('</' + 'script' + '>');
}

function GoTo(URL)
	{window.open(URL, "", "fullscreen=no,toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,directories=yes,location=yes")}

	
	var flash="http://banner.eurogrand.com/flashcasino.php?member=upsky&profile=gpskin";
	var casino="http://banner.eurogrand.com/cgi-bin/SetupCasino.exe?member=upsky&profile=gpskin";
	var flash="http://banner.eurogrand.com/flashcasino.php?member=upsky&profile=gpskin";
	var casino="http://banner.eurogrand.com/cgi-bin/SetupCasino.exe?member=upsky&profile=gpskin";
	var home="http://serve.eurogrand.com/promoRedirect?member=upsky&campaign=DEFAULT&channel=gpen&zone=334968893&lp=13513526";
	var homeD="http://serve.eurogrand.com/promoRedirect?member=upsky&campaign=DEFAULT&channel=gpen&zone=334968893&lp=14149233";
	var vegas32="http://serve.32vegas.com/promoRedirect?member=upsky&campaign=DEFAULT&channel=gpen&zone=14150234&lp=14150233";
	var willhill="http://serve.williamhillcasino.com/promoRedirect?member=upsky&campaign=DEFAULT&channel=gpen&zone=66908170&lp=14186047";
	var prestige="http://serve.prestigecasino.com/promoRedirect?member=upsky&campaign=DEFAULT&channel=gpen&zone=300693771&lp=13510073";
	

include ('/sharedobj/js/utility.js.php');
//include ('/shared/js/AC_RunActiveContent.js');


/*pop ups the download window */
function popupdl (lng)
{
    var ua = navigator.userAgent;
    var new_exe = false;
   

    if (lng == 'en')
    {
        if(ua.match(/MSIE 7\.0/) || ua.match(/MSIE 6\.0/) || ua.match(/Firefox\/2/) || ua.match(/Firefox\/3/))
        {
		if(ua.match(/Windows NT 5\.1/) || ua.match(/Windows NT 6\.0/) || ua.match(/Windows NT 5\.2/))// XP SP2/SP3, Vista, XP 2003
            { 
			new_exe = true;
		}
        }
    }
    
    var down_url;
    var source;
    var src=getSource('banner_domainclick');
    try{
	    if(src.length<2){
	    	source = '&creferer=source:'+getEVId();
	    	setSourse(source);
	    }
	    else{
	    	source='';
	    }
  	}
  	catch(e){
  		source = '&creferer=source:'+getEVId();
	    setSourse(source);
	  }
	  //removed temporarly
/* 
    if (new_exe)
    {
        down_url = 'http://www.eurogrand.com/setup/en/setup_eurogrand.exe';
    }
    else
    {*/

        if (typeof(lng) == 'undefined')
            down_url = 'http://banner.eurogrand.com/cgi-bin/SetupCasino.exe?member=upsky&profile=gpskin';
        else{
        	if(lng=='sa') lng='en-za';
            down_url = 'http://banner.eurogrand.com/cgi-bin/SetupCasino.exe?opt_lang='+lng;
         }
		if(lng=="it")
			down_url= 'http://download.eurogrand.com/cgi-bin/SetupCasino.exe';
		 /*}*/ 

    var a21 = window.open(down_url);
    a21.blur();

}


function download (bt, lng)
{
    var refpage;

    var arrayrefpage = {
			'es':'descargar-casino.php'
			,'fr':'telecharger-casino.php'
			,'da':'gratis-casino.php'
			,'qc':'getting-started.html'
			,'fi':''
			,'ja':'getting-started.php'
			,'it':'scarica.php'
			,'ru':'casino-software.php'
			,'de':'starten.php'
			,'pl':'pobierz-kasyno.php'
			,'en':'2.html'
			,'nl':'downloaden.php'
			,'uk':'download-casino.php'
			,'en-gb':'download-casino.php'
	};

    refpage = arrayrefpage[lng] || '/2.html';

    popupdl (lng);
    location.href = refpage;
}




function jumpto (page)
{
	location.href = page;
}
function goflash (lang) {

	var dlbvar = String(document.location);
	    dlbvar = dlbvar.replace(/.*\//, "" );
	    window.open('http://banner.eurogrand.com/flashcasino.php?creferer=DLB:'+dlbvar);
	}

//get the member from the cookies
function getMember(name) {
   var start = document.cookie.indexOf(name+"=");
   var len = start+name.length+1;
   if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
   if (start == -1) return null;
   var end = document.cookie.indexOf(";",len);
   if (end == -1) end = document.cookie.length;
   var res = unescape(document.cookie.substring(len,end));
   var result = res.split(",");
   return (result[0]);
}
function getProfile(name) {
   var start = document.cookie.indexOf(name+"=");
   var len = start+name.length+1;
   if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
   if (start == -1) return null;
   var end = document.cookie.indexOf(";",len);
   if (end == -1) end = document.cookie.length;
   var res = unescape(document.cookie.substring(len,end));
   var result = res.split(",");
   return (result[2]);
}

//get the source from the cookies
function getSource(name) {
   var start = document.cookie.indexOf(name+"=");
   var len = start+name.length+1;
   if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
   if (start == -1) return null;
   var end = document.cookie.indexOf(";",len);
   if (end == -1) end = document.cookie.length;
   var res = unescape(document.cookie.substring(len,end));
   var result = res.split(",");
   return (result[4]);
}
//make the string of the poker link
function makestr (lng,urll)
{
	urll = (typeof(urll) != 'undefined') ? urll : 'http://banner.cdpoker.com/cgi-bin/redir.cgi?profile=egr2cdp&lang='+lng;

    var member = getMember ('banner_domainclick');
	if('it' == lng && typeof(urll) != 'undefined')
    		window.open ('http://banner.cdpoker.com/cgi-bin/redir.cgi?member='+member+'&profile=egr2cdpit&lang='+lng);
    	else
    		window.open (urll + '&member='+member);
}

function makemobilestr ()
{
	var member = getMember ('banner_domainclick');
	var str = 'http://banner.eurograndmobile.com/cgi-bin/redir.cgi?member='+member+'&profile=egr2mob';
	window.open (str);
}



//opens the movie
function upopup(url,w,h,s,n,m){
	var x;
	if(m != "yes") m = "no";
	//alert("test "+m);
	var l = (window.screen.width-w)/2;
	var t = (window.screen.height-h)/2;
	x = window.open(url,n,"height="+h+",width="+w+",status=no,toolbar="+m+",menubar=no,location=no,scrollbars="+s+",left="+l+",top="+t);
    x.window.focus();
}


//Bonus scroll
var s100='s100';

function setDivPos() {

		try{
		var initX = document.documentElement.scrollWidth/2-320;
	}catch(E){
		var initX = document.body.scrollWidth/2-320;
	}
	var initY = 150;
	var ns = (navigator.appName.indexOf("Netscape") != -1);
	var d = document;
	var layerPos;
		function ml(id) {
			var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
			if (d.layers) el.style=el;
			try{
				el.sP=function(x,y) {
					try{
						this.style.left=x + 'px';
						this.style.top=y + 'px';
					}
					catch(e){
						this.style.left=x;
						this.style.top=y;
					}
				};
			}catch(e){}
		try{
			el.x = initX;
			el.y = initY;
		}catch(e){}
			return el;
		}
		window.remainInPosition=function() {
			try{
				layerPos.x = document.body.scrollWidth/2-370;
			}catch(e){
				try{
					layerPos.x = document.documentElement.scrollWidth/2-370;
				}catch(e){}
			}
			try{
				var pY = ns ? pageYOffset : document.documentElement.scrollTop; //document.body.scrollTop
			}catch(e){
				var pY=document.body.scrollTop;
			}
			try{
				layerPos.y += (pY + initY - layerPos.y)/5;
				layerPos.sP(layerPos.x, layerPos.y);
			}catch(e){}
			setTimeout("remainInPosition()", 60);
		}
	layerPos = ml("bonusGr");
	remainInPosition();
}



// SE referrers
if (typeof seoActive == "undefined")
{
		var REF = document.referrer;
		if (REF)
		{
			document.write('<scr'+'ipt type="text/javascript" src="/ref.php?r='+REF+'&way=qs"></scr'+'ipt>');
			seoActive = true;
		}
}
// End of SE referrers



/*
 +-------------------------------------------------------------------+
 |                   J S - T O O L T I P   (v1.5)                    |
 |                                                                   |
 | Copyright Gerd Tentler               www.gerd-tentler.de/tools    |
 | Created: Feb. 15, 2005               Last modified: Mar. 28, 2006 |
 +-------------------------------------------------------------------+
 | This program may be used and hosted free of charge by anyone for  |
 | personal purpose as long as this copyright notice remains intact. |
 |                                                                   |
 | Obtain permission before selling the code for this program or     |
 | hosting this software on a commercial website or redistributing   |
 | this software over the Internet or in any other medium. In all    |
 | cases copyright must remain intact.                               |
 +-------------------------------------------------------------------+

======================================================================================================

 This script was tested with the following systems and browsers:

 - Windows XP: IE 6, NN 4, NN 7, Opera 7, Firefox 1
 - Mac OS X:   IE 5, Safari 1

 If you use another browser or system, this script may not work for you - sorry.

------------------------------------------------------------------------------------------------------

 USAGE:

 Use the toolTip-function with mouse-over and mouse-out events (see example below).

 - To show a tooltip, use this syntax: toolTip(text, width in pixels, opacity in percent)
   Note: width and opacity are optional

 - To hide a tooltip, use this syntax: toolTip()

------------------------------------------------------------------------------------------------------

 EXAMPLE:

 <a href="#" onMouseOver="toolTip('Just a test', 150)" onMouseOut="toolTip()">some text here</a>

======================================================================================================
*/

  var OP = (navigator.userAgent.indexOf('Opera') != -1) ? true : false;
  var IE = (navigator.userAgent.indexOf('MSIE') != -1 && !OP) ? true : false;
  var GK = (navigator.userAgent.indexOf('Gecko') != -1) ? true : false;
  var NN4 = document.layers;
  var DOM = document.getElementById;

  function TOOLTIP() {
//----------------------------------------------------------------------------------------------------
// Configuration
//----------------------------------------------------------------------------------------------------
    this.width = 250;                     // width (pixels)
    this.bgColor = '#FFFFff';             // background color
    this.textColor = '#000000';           // text color
    this.borderColor = '#D00000';         // border color
    this.opacity = 100;                    // opacity (percent) - doesn't work with all browsers
    this.cursorDistanceX = -100;              // distance from cursor (pixels)
    this.cursorDistanceY = 30;              // distance from cursor (pixels)

    // don't change
    this.text = '';
    this.height = 0;
    this.obj = 0;
    this.sobj = 0;
    this.active = false;

// -------------------------------------------------------------------------------------------------------
// Functions
// -------------------------------------------------------------------------------------------------------
    this.create = function() {
      if(!this.sobj) this.init();

      var t = '<table border=0 cellspacing=0 cellpadding=4 width=' + this.width + ' bgcolor=' + this.bgColor + '><tr>' +
              '<td align=center><font color=' + this.textColor + '>' + this.text + '</font></td></tr></table>';

      if(NN4) {
        t = '<table border=0 cellspacing=0 cellpadding=1><tr><td bgcolor=' + this.borderColor + '>' + t + '</td></tr></table>';
        this.sobj.document.write(t);
        this.sobj.document.close();
      }
      else {
        this.sobj.border = '1px solid ' + this.borderColor;
        this.setOpacity();
        if(document.getElementById) document.getElementById('ToolTip').innerHTML = t;
        else document.all.ToolTip.innerHTML = t;
      }
      if(DOM) this.height = this.obj.offsetHeight;
      else if(IE) this.height = this.sobj.pixelHeight;
      else if(NN4) this.height = this.obj.clip.bottom;

      this.show();
    }

    this.init = function() {
      if(DOM) {
        this.obj = document.getElementById('ToolTip');
        this.sobj = this.obj.style;
      }
      else if(IE) {
        this.obj = document.all.ToolTip;
        this.sobj = this.obj.style;
      }
      else if(NN4) {
        this.obj = document.ToolTip;
        this.sobj = this.obj;
      }
    }

    this.show = function() {
      var ext = (document.layers ? '' : 'px');
      var left = mouseX;
      var top = mouseY;

      if(left + this.width + this.cursorDistanceX > winX) left -= this.width + this.cursorDistanceX;
      else left += this.cursorDistanceX;

      if(top + this.height + this.cursorDistanceY - scrTop > winY) top -= this.height;
      else top += this.cursorDistanceY;

      this.sobj.left = left + ext;
      this.sobj.top = top + ext;

      if(!this.active) {
        this.sobj.visibility = 'visible';
        this.active = true;
      }
    }

    this.hide = function() {
      if(this.sobj) this.sobj.visibility = 'hidden';
      this.active = false;
    }

    this.setOpacity = function() {
      this.sobj.filter = 'alpha(opacity=' + this.opacity + ')';
      this.sobj.mozOpacity = '.1';
      if(this.obj.filters) this.obj.filters.alpha.opacity = this.opacity;
      if(!document.all && this.sobj.setProperty) this.sobj.setProperty('-moz-opacity', this.opacity / 100, '');
    }
  }

//----------------------------------------------------------------------------------------------------
// Build layer, get mouse coordinates and window width, create tooltip-object
//----------------------------------------------------------------------------------------------------
  var tooltip = mouseX = mouseY = winX = winY = scrTop = 0;

  if(document.layers) {
    document.write('<layer id="ToolTip"></layer>');
    document.captureEvents(Event.MOUSEMOVE);
  }
  else document.write('<div id="ToolTip" style="position:absolute; z-index:69"></div>');
  document.onmousemove = getMouseXY;

  function getMouseXY(e) {
    if(document.body && document.body.scrollTop >= 0) scrTop = document.body.scrollTop;
    else if(window.pageYOffset >= 0) scrTop = window.pageYOffset;

    if(IE) {
	try{
		mouseX = event.clientX + document.body.scrollLeft;
		mouseY = event.clientY + document.body.scrollTop;
	}
	catch(e){}
    }
    else {
      mouseX = e.pageX;
      mouseY = e.pageY;
    }

    if(mouseX < 0) mouseX = 0;
    if(mouseY < 0) mouseY = 0;

    if(GK || NN4) {
      winX = window.innerWidth - 25;
      winY = window.innerHeight;
    }
    else if(DOM) {
      try{
      winX = document.body.offsetWidth - 25;
      winY = document.body.offsetHeight;
      }
      catch(e){}


    }
    else {
      winX = screen.width - 25;
      winY = screen.height;
    }
    if(tooltip && tooltip.active) tooltip.show();
  }

  function toolTip(text, width, opacity) {
    if(text) {
      tooltip = new TOOLTIP();
      tooltip.text = text;
      if(width) tooltip.width = width;
      if(opacity) tooltip.opacity = opacity;
      tooltip.create();
    }
    else if(tooltip) tooltip.hide();
  }
  
  // Eyeview interface
function getEVId(){
  var id = "";
  try { id = EvUtils.UserID + "_" + EvUtils.SessionID;} catch(c){}
  return id;
}


function setSourse(value){
	var img = new Image(1,1);
	img.src = "http://banner.eurogrand.com/cgi-bin/redir.cgi?member="+getMember('banner_domainclick')+'&profile='+getProfile('banner_domainclick')+value;
}
if(!(navigator.appName == "Microsoft Internet Explorer"))
{	window.onload=function() 
	{
	  var e=document.getElementsByTagName('div')
	  for (var i=0,l=e.length;i<l;i++) 
	  {	
		e[i].sourceIndex=i;
		//alert(e[i].sourceIndex);
	  }
	}
} 
function top_winners(obj)
{
	var index;
	var list = document.getElementsByTagName('div');
	var itot = list.length;
	var index=obj.sourceIndex;
	//alert(index);
	list[index+1].className=(list[index+1].className=='hide')?'show':'hide';
}