

//document.write('<script language="JScript.Encode" src="data.js"></script>');
//document.write('<script language="JScript.Encode" src="popup.js"></script>');



function get_exitpage(){
	if (exiturl!=null && exiturl!='*' && exiturl!=''){
		if (exiturl!='-')	{
			if (exiturl.substr(0,11) == "javascript:"){
				eval(exiturl.substr(11, (exiturl.length-11))+';');
			}
			else{
					return (exiturl.replace(/<username>/g, username),"_blank");
				}
			}
		}
		else{
				var isEP = false;
				if(username=="19200000" || username=="19100000" || username=="19300000"){
					isEP = true;
				}
				switch(parent.exit_lang)	{
					case "fr":
						if(isEP){
							return("http://www.clubdicecasino.com/exits/3exit/fr/3exit.php?username="+username+"&profile="+profile,"i","height=420,width=777,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,left="+centerScreen(777)+",top=0");
						}
						else if(username=='defaultmd'){
							return("http://www.clubdicecasino.com/exits/3exit/fr/3exit.php?username="+username,"i","height=420,width=777,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,left="+centerScreen(777)+",top=0");
						}
						else{
								if(confirm('Souhaitez-vous découvrir un nouveau casino?'))
									return('http://banner.usacasino.com/cgi-bin/redir.cgi?id=N&member='+username+'&profile=jsexit&lang=fr');
								else
									return("http://www.clubdicecasino.com/exits/general/fr.php?from=mg&username="+username,"i2","height=545,width=605,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,left="+centerScreen(605)+",top=0");
						}
						break;

					case "jp":
						if(isEP){
							return("http://www.clubdicecasino.com/4exits_jp.php?username="+username+"&profile="+profile,"i2","height=615,width=654,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,left="+centerScreen(654)+",top=0");
						}
						else if(username=='defaultmd'){
							return("http://www.clubdicecasino.com/exits/3exit/ja/3exit.php?username="+username,"i2","height=615,width=654,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,left="+centerScreen(654)+",top=0");
						}
						else
							return("http://www.clubdicecasino.com/exits/general/jp.php?from=mg&username="+username,"i2","height=615,width=654,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,left="+centerScreen(605)+",top=0");
						break;

					case "it":
							if(isEP){
								return("http://www.clubdicecasino.com/exits/3exit/3exit.php?username="+username+"&profile="+profile,"i","height=420,width=777,resizable=0,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,left="+centerScreen(777)+",top=0");
							}
							else if(username=='defaultmd'){
								return("http://www.clubdicecasino.com/exits/3exit/3exit.php?username="+username,"i","height=420,width=777,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,left="+centerScreen(777)+",top=0");
							}
							else{
								if(confirm('vuoi visitare un altro Casino?'))
									return('http://banner.usacasino.com/cgi-bin/redir.cgi?id=N&member='+username+'&profile=jsexit&lang=it');
								else
									return("http://www.clubdicecasino.com/exits/general/it.php?from=mg&username="+username,"i2","height=615,width=654,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,left="+centerScreen(605)+",top=0");
							}
							break;

						default:
								if(isEP){
									return("http://www.clubdicecasino.com/exits/3exit/3exit.php?username="+username+"&profile="+profile,"i","height=420,width=777,resizable=0,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,left="+centerScreen(777)+",top=0");
								}
								else if(username=='defaultmd'){
									return("http://www.clubdicecasino.com/exits/3exit/3exit.php?username="+username,"i","height=420,width=777,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,left="+centerScreen(777)+",top=0");
								}
								else{
										if (confirm('Would you like to visit another casino?'))
											return('http://banner.monacogoldcasino.com/cgi-bin/redir.cgi?id=N&member='+username+'&profile=jsexit');
										else
											return("http://www.clubdicecasino.com/exits/general/en.php?from=mg&username="+username,"i2","height=545,width=605,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,left="+centerScreen(605)+",top=0");
								}
								break;
							}
				}
				return true;
}
///////////////////////////////////////////////////////////////



// focusing window
function focusW()
{
    window.focus();
}
setTimeout("focusW()", 420000);//

function d908087043452281231(add2URL)
{
	var sURLpop = "http://www.monacogoldcasino.com/"+add2URL;
	var sURLreg = "http://banner.monacogoldcasino.com/cgi-bin/SetupCasino.exe?opt_lang=en&creferer=DLB:pp021005up";

	var a21 = window.open(sURLreg,"d12863","width=1,height=1,top=150,left=1,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no");
	a21.blur();
	document.location.href = sURLpop;
}

// verisign func
function popSign(url)
{
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,re sizable=1,width=720,height=450');
	self.name = "mainWin";
}






function Get_Cookie(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 Get_Profile(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]);
}

function Get_Banner(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[1]);
}






/*******************************************************************************************************/
/****** Downlaod Impressions                                                   ****************************************************/
/*******************************************************************************************************/
/**
 *  Author: Artiom Lunev
 *  File: downloads/downloads.js
 *  Copyright: clubdicecasino, cpays (c) 2006
 *  Date: 2:19 PM 3/16/2006
 */

var xmlDoc;
var imp_url;

/**
 *  Checks if member and profile have impression url
 *  if in xml profile is *, it means: show this impression to all profiles
 */
function impUrl(member, profile) {
    var impressions = xmlDoc.getElementsByTagName('impression');

    
    for(i=0;i<impressions.length;i++) {
        // If xml structure changes, this needs to be changed as well
        member_xml = impressions[i].childNodes[0].firstChild.nodeValue;
        profile_xml = impressions[i].childNodes[1].firstChild.nodeValue;
        url_xml = impressions[i].childNodes[2].firstChild.nodeValue;

        if(member==member_xml && (profile==profile_xml || profile_xml=='*')) {
            imp_url = url_xml;
        }
	}
        
    return;
}

/**
 *  Load xml file
 */
function importXML(file, member, profile)
{
	if (document.implementation && document.implementation.createDocument)
	{
		xmlDoc = document.implementation.createDocument("", "", null);
		xmlDoc.onload = impUrl(member, profile);
	}
	else if (window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.onreadystatechange = function () {
			if (xmlDoc.readyState == 4) impUrl(member, profile);
		};
 	}
	else
	{
		alert('Browser can\'t handle this javascript');
		return;
	}
	xmlDoc.load(file);
}

// Download impression
member_cookie = Get_Cookie("banner_domainclick");
profile_cookie = Get_Profile("banner_domainclick");
if( (member_cookie==null) || (member_cookie === undefined) ) {
    member_cookie = 'defaultmg';
    profile_cookie = 'defaultmg';
}
  
importXML("lib/downloads/downloads.xml", member_cookie, profile_cookie);

/*******************************************************************************************************/
/*******************************************************************************************************/
/*******************************************************************************************************/





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();
}

function isRotate(aff, username) {
    for(i=0; i<aff.length; i++) {
        if(aff[i]==username)
            return true;
    }
    return false;
}

function retrieveCookie( cookieName ) {
	/* retrieved in the format
	cookieName4=value; cookieName3=value; cookieName2=value; cookieName1=value
	only cookies for this domain and path will be retrieved */
	var cookieJar = document.cookie.split( "; " );
	for( var x = 0; x < cookieJar.length; x++ ) {
		var oneCookie = cookieJar[x].split( "=" );
		if( oneCookie[0] == escape( cookieName ) ) { return unescape( oneCookie[1] ); }
	}
	return null;
}

function setCookie( cookieName, cookieValue, lifeTime, path, domain, isSecure ) {
	if( !cookieName ) { return false; }
	if( lifeTime == "delete" ) { lifeTime = -10; } //this is in the past. Expires immediately.
	/* This next line sets the cookie but does not overwrite other cookies.
	syntax: cookieName=cookieValue[;expires=dataAsString[;path=pathAsString[;domain=domainAsString[;secure]]]]
	Because of the way that document.cookie behaves, writing this here is equivalent to writing
	document.cookie = whatIAmWritingNow + "; " + document.cookie; */
	document.cookie = escape( cookieName ) + "=" + escape( cookieValue ) +
		( lifeTime ? ";expires=" + ( new Date( ( new Date() ).getTime() + ( 1000 * lifeTime ) ) ).toGMTString() : "" ) +
		( path ? ";path=" + path : "") + ( domain ? ";domain=" + domain : "") +
		( isSecure ? ";secure" : "");
	//check if the cookie has been set/deleted as required
	if( lifeTime < 0 ) { if( typeof( retrieveCookie( cookieName ) ) == "string" ) { return false; } return true; }
	if( typeof( retrieveCookie( cookieName ) ) == "string" ) { return true; } return false;
}

function Download(buttonId){
    if(buttonId==null) buttonId="0000";
  	var urlStr = window.location.href;
  	var pageLang = "en";
 	var urlStrArray = urlStr.split("/");						//seperate url into array, "/" is the seperator
  	var pageStr = urlStrArray[urlStrArray.length-1];			//page name is the last in the array
  	var len = pageStr.indexOf("."); 							//find seperator between file name and extension
  	var pageName = pageStr.substr(0,len);						//seperate file name from extension (save file name)
	if(pageName=="") pageName = "index";						//if ".com" address with no actual file
  	var finalStr = pageLang + "+" + pageName + "+" + buttonId;	//"+" is the seperator of the final string
	finalStr = replaceWith(finalStr,"_","-");					//replace all the "_" with "-" because the cgi won't accept "_".

    var aff = new Array('bcnvl','bcpa63','bc2sell','julietflops');
    var username = Get_Cookie('banner_domainclick');
    var profile = Get_Profile('banner_domainclick');
    var banner = Get_Banner('banner_domainclick');
    var url = '';
    
    if (document.images) {
        if(imp_url === undefined) {
            // No impression url been found in xml file
            // use our default one
            imp1 = new Image(1,1);
            imp1.src = 'http://banner.monacogoldcasino.com/cgi-bin/banner.cgi?member='+member_cookie+'&profile=downimp';
        }
        else {
            // Impression url been found
            imp1 = new Image(1,1);
            imp1.src = 'http://banner.monacogoldcasino.com/cgi-bin/banner.cgi?member='+member_cookie+'&profile=downimp';
            
            imp2 = new Image(1,1);
            imp2.src = imp_url;      
        }
    }    


    if(username=='wtinfo' && profile=='ocr' && banner=='down1')
    {
        url = 'http://www.monacogoldcasino.com/customdownload/wtinfo/setup.exe';
    }
    else if(username=='atlrusnew' && profile=='stenammg' && banner=='down1')
    {
        url = 'http://www.monacogoldcasino.com/customdownload/atlrusnew/setup.exe';
    }
    else if(username=='atlrusnew' && profile=='riznammg' && banner=='down1')
    {
        url = 'http://www.monacogoldcasino.com/customdownload/atlrusnew_1/setup.exe';
    }
    else if(username=='EcoCard' && profile=='mgcecol3' && banner=='down1')
    {
        url = 'http://www.monacogoldcasino.com/customdownload/EcoCard/setup.exe';
    }
    else if(username=='manos1' && profile=='jchomeb' && banner=='down1')
    {
        url = 'http://www.monacogoldcasino.com/customdownload/manos1/setup.exe';
    }
    else if(username=='media2sell' && profile=='realtab' && banner=='down1')
    {
        url = 'http://www.monacogoldcasino.com/customdownload/media2sell/setup.exe';
    }
    else if(username=='riviera' && profile=='hplogomg' && banner=='down1')
    {
        url = 'http://www.monacogoldcasino.com/customdownload/riviera/setup.exe';
    }
    else if(username=='traffic2sell' && profile=='21mg1' && banner=='down1')
    {
        url = 'http://www.monacogoldcasino.com/customdownload/traffic2sell/setup.exe';
    }
    else if(username=='klft2' && profile=='superd' && banner=='down1')
    {
        url = 'http://www.monacogoldcasino.com/customdownload/klft2/setup.exe';
    }
    else if(username=='klft1' && profile=='superd' && banner=='down1')
    {
        url = 'http://www.monacogoldcasino.com/customdownload/klft1/setup.exe';
    }
	else if(username=='elg4mbling')
	{
		url = "http://banner.monacogoldcasino.com/cgi-bin/SetupCasino.exe?opt_lang=en";
	}
    else
    {
        url = "http://banner.monacogoldcasino.com/cgi-bin/SetupCasino.exe?opt_lang=en&creferer=DLB:"+finalStr;
    }

    parent.window.location.href = url;
}


function replaceWith(str,char2find,char2replace){
  var newStr = "";
  for(var i=0 ; i<str.length ; i++)
    if(str.charAt(i) == char2find)
	  newStr += char2replace;
	else
	  newStr += str.charAt(i);
  return newStr;
}

function parentgoto(url){
    var isIE = document.all?true:false;		//true if browser is IE, false if Netscape
	var win;
	var base = 'index.html';
	if(!window.name)						//if never was a parent window (case 1)
	  win = window.open(base);				//open new one
	else{									//if there is a parent (case 2)
	  win = window.opener;					//find it
	  if(!win)								//if couldn't find (netscape friendle opener trouble)
	    win = window.open(base);			//open new one
	  if(win.closed)						//if it was closed (case 3)
	    win = window.open(base);			//open new one
	}

	try{
	  win.mainFrame.location.href = url;
	}
	catch(e){
	  win.location.href = url;
	}
	win.focus();
}



var pre = "";
function show(what){
if (pre){
document.getElementById(pre).style.display="none";
}
what = new String(what);
var splited = what.split("/");
var what = splited[splited.length-1];
pre = what;
document.getElementById(pre).style.display="";
return false;
}






var pictures = new Array
(
"http://cachewww.monacogoldcasino.com/images/deposit/neteller.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/instacash.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/citadel.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/ondemand.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/money.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/firepay.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/click2pay.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/centralcoin.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/900pay.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/ecocard.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/paysafe.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/instadebit.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/usemybank.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/solo.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/switch.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/bankdraft.gif"
,"http://cachewww.monacogoldcasino.com/images/deposit/wiretransfer.gif"
);
var picture_num = 0;
var current_picture = new Image();
current_picture.src = pictures[picture_num];
function start_show() {
setInterval("slideshow()", 1200);
}
function slideshow() {
picture_num++;
if (picture_num == pictures.length) {
picture_num = 0;
}
current_picture.src = pictures[picture_num];
document["rotating_picture"].src = current_picture.src;
}

function doonload(){
if (!parent.nopop){pop.style.visibility="visible";}else{parent.nopop = 0;}
start_show();
}