function lf(pos, srcname, flashurl, advertiser, game, profile, extra, sizeX, sizeY) {
	var newurl = srcname+ '?clickTAG=' + fu(flashurl, game, advertiser, profile, extra, '%26');
	var obj = document.getElementById('id' + pos);
	try { obj.innerHTML = AC_FL_RunContent2( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0','width',sizeX,'height',sizeY,'src', newurl,'quality','high','wmode','transparent','pluginspage','http://www.macromedia.com/go/getflashplayer','movie', newurl);}
	catch (ex) { }
}

function lfu(flashurl, game, advertiser, profile, extra) {
	url =fu(flashurl, game, advertiser, profile, extra, '&') ;
	window.open(url);
}

function fu(flashurl, game, advertiser, profile, extra, sep) {
	return flashurl + '?game=' +game + sep +'advertisercode=' + advertiser + sep +  'profile=' + profile + sep + extra;
}

function MM_openBrWindow(theURL,winName,features){
	window.open(theURL,winName,features);
}

function centrePop(url,largeur,hauteur){
      var gauche = (screen.width - largeur)/2;
      var haut =  (screen.height - hauteur)/2;
      return window.open(url,"","width="+largeur+",height="+hauteur+",left="+gauche+",top="+haut+",scrollbars=yes");
}

function centrePopBonus(url,largeur,hauteur){
      var gauche = (screen.width - largeur)/2;
      var haut =  (screen.height - hauteur)/2;
      return window.open(url,"","width="+largeur+",height="+hauteur+",left="+gauche+",top="+haut+",scrollbars=no");
}

var coupon = null;

function couponPop(url, largeur,hauteur) {
    centrePop(url + "?coupon=" + coupon,largeur,hauteur);
}

function doPop(url,largeur,hauteur){
     centrePop(url,largeur,hauteur);
}

function PlayFlash() {
	window.location = url_flash;
}

function PlayFlash2() {
	var win = window.open('');
	win.location = url_flash;
}

function getexpirydate( nodays){
	var UTCstring;
	Today = new Date();
	nomilli=Date.parse(Today);
	Today.setTime(nomilli+nodays*24*60*60*1000);
	UTCstring = Today.toUTCString();
	return UTCstring;
}

// TODO: check the casinos where it is used. May be it should be removed
function DownloadCasino(cr) {
	var p = (url_download.indexOf('?') > 0) ? '&' : '?';
	try {p+='member=' + member + '&profile=' + profile;}
	catch (ex) {}
	p += (p.length > 1) ? '&' : '';
	if (cr) {p+='creferer=dp:'+cr;}
	parent.top.location.href=url_download + p;
//	document.location.replace(url_download + p);
//	window.location.href = url_download + p;
}

function Download(cr){
    if (document.Downloader && document.Downloader.object) Downloader.Run();
    else DownloadCasino(cr);
}

function Download2(){
    if(document.cookie.indexOf('download=0') == -1){
    	if (document.Downloader && document.Downloader.object) Downloader.Run();
    }
    var exp = new Date();
    exp.setTime(exp.getTime()+(30 * 24 * 60 * 60 * 1000));
    document.cookie='download=0; expires=' + exp.toGMTString();
}

