﻿// flash functions
	var f2 = false;
	var f3 = false;
	var f4 = false;
	var f5 = false;
	var f6 = false;
	var f7 = false;	
	var cId = 0;
	var mV = 7;
	var aV = 0;
	var hRV = false;
	var jsV = 1.0;
	var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;
	jsV = 1.1;
if(isIE && isWin){
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('f2 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	document.write('f3 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	document.write('f4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('f5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
	document.write('f6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
	document.write('f7 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
	document.write('</SCR' + 'IPT\> \n');
}
function checkFlash(rV){
	var ua=navigator.userAgent.toLowerCase();
	this.webtv = (ua.indexOf("webtv")>-1);
	this.ie = (parseFloat(ua.slice(ua.indexOf("msie")+5)));
	this.nn = (parseFloat(ua.slice(ua.indexOf("mozilla/")+8)));
	var browser = navigator.appName.toLowerCase();
	if (browser=="netscape"){
	this.netscape = true;
	}else{
	this.netscape = false;
	}
	this.mac = (ua.indexOf("mac")>-1);
	this.flash = false;
	
	if (navigator.plugins){
		if (navigator.plugins["Shockwave Flash 2.0"]
		|| navigator.plugins["Shockwave Flash"]){
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var fD = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var fV = parseInt(fD.charAt(fD.indexOf(".") - 1));
			f2 = fV == 2;
			f3 = fV == 3;
			f4 = fV == 4;
			f5 = fV == 5;
			f6 = fV == 6;
			f7 = fV == 7;			
		}
	}
	for (var i = 2; i <= mV; i++) {
		if (eval("f" + i) == true) aV = i;
	}
	// alert("version detected: " + aV);
	if (aV >= rV) {
		if (this.netscape && this.IEonly == 'TRUE' || this.mac && this.IEonly == 'TRUE'){
			this.flash = false;
		} else {
			this.flash = true;
		}
	}
}
function flashObj() {
	cId += 1;
	this.flashFile = "filename.swf";
	this.LiveConnect = "FALSE";
	this.IEonly = null;
      	this.wmode = "opaque";
      	this.redirect = null;
	this.DenyIEdl = "FALSE";
	this.altImg = "NoFlash.gif";
	this.bgcolor = null;
	this.altTxt = null;
	this.height = "400";
	this.width = "520";
	this.flashVars = null;
	this.ID = "flash"+ cId;
	this.name = "flash"+ cId;
	this.webTV = "true";
	this.quality = "best";
	this.scale = "exactfit";
	this.menu = "false";
	this.deviceFont = "false";
	this.FlashVer = 6;
	this.cabVersion = "6,0,0,0";
	this.render = writeFlashComponent;
}
function writeFlashComponent() {
	var Ticket=new checkFlash(this.FlashVer);
	var sCR;
		// alert("Flash is installed: " + Ticket.flash);
	if (Ticket.flash) {
		//	alert("deny ie DL:" + this.DenyIEdl);
		//	alert("mac: "+Ticket.mac);
		//	alert("netscape:"+Ticket.netscape);
		if (Ticket.mac || Ticket.netscape) {
			if (this.bgcolor){
//cdm 31.03.2004 - added base parameter			
					sCR="<EMBED SRC="+this.flashFile+" base=\".\" swLiveConnect="+this.LiveConnect+" WIDTH="+this.width+" HEIGHT="+this.height+" QUALITY="+this.quality+" SCALE="+this.scale+" FlashVars="+ this.flashVars +" wmode="+this.wmode+" ID="+this.ID+" NAME="+this.name+" MENU="+this.menu+" DEVICEFONT="+this.deviceFont+" BGCOLOR="+this.bgcolor+" TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED>";
					} else {
//cdm 31.03.2004 - added base parameter			
					sCR="<EMBED SRC="+this.flashFile+" base=\".\" swLiveConnect="+this.LiveConnect+" WIDTH="+this.width+" HEIGHT="+this.height+" QUALITY="+this.quality+" SCALE="+this.scale+" FlashVars="+ this.flashVars +" wmode="+this.wmode+" ID="+this.ID+" NAME="+this.name+" MENU="+this.menu+" DEVICEFONT="+this.deviceFont+" TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED>";
			}
		} else if (this.DenyIEdl=='TRUE') {
			//alert("using embed");
			sCR="<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version="+this.FlashVer+",0,0,0\" ID=\""+this.ID+"\" WIDTH=\""+this.width+"\" HEIGHT=\""+this.height+"\">\n";
			sCR+="<PARAM NAME=movie VALUE=\""+this.flashFile+"\">\n";						
			sCR+="<PARAM NAME=quality VALUE=\""+this.quality+"\">\n";
			sCR+="<PARAM NAME=scale VALUE=\""+this.scale+"\">\n";
			sCR+="<PARAM NAME=menu VALUE=\""+this.menu+"\">\n";
//cdm 31.03.2004 - added base parameter			
			sCR+="<PARAM NAME=base VALUE=\".\">\n";
			sCR+="<PARAM NAME=wmode VALUE=\""+this.wmode+"\">\n";
			if (this.bgcolor){
				sCR+="<PARAM NAME=bgcolor VALUE=\""+this.bgcolor+"\">\n";
			}
			if (this.flashVars){
				sCR+="<PARAM NAME=FlashVars VALUE=\""+this.flashVars+"\">\n";
			}
			sCR+="<PARAM NAME=devicefont VALUE=\""+this.deviceFont+"\">\n";
			if (this.bgcolor){
			sCR+="<EMBED SRC="+this.flashFile+" swLiveConnect="+this.LiveConnect+" WIDTH="+this.width+" HEIGHT="+this.height+" QUALITY="+this.quality+" SCALE="+this.scale+" wmode="+this.wmode+" ID="+this.ID+" NAME="+this.name+" MENU="+this.menu+" DEVICEFONT="+this.deviceFont+" FlashVars="+ this.flashVars +" BGCOLOR="+this.bgcolor+" TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED></OBJECT>";
			} else {
			sCR+="<EMBED SRC="+this.flashFile+" swLiveConnect="+this.LiveConnect+" WIDTH="+this.width+" HEIGHT="+this.height+" QUALITY="+this.quality+" SCALE="+this.scale+" wmode="+this.wmode+" ID="+this.ID+" NAME="+this.name+" MENU="+this.menu+" DEVICEFONT="+this.deviceFont+" FlashVars="+ this.flashVars +" TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED></OBJECT>";
			}
		} else if (Ticket.ie>=4 && this.DenyIEdl=='FALSE') {
			//alert("using object");
			sCR="<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version="+this.cabVersion+"\" ID=\""+this.ID+"\" WIDTH=\""+this.width+"\" HEIGHT=\""+this.height+"\">\n";
			sCR+="<PARAM NAME=movie VALUE=\""+this.flashFile+"\">\n";						
			sCR+="<PARAM NAME=quality VALUE=\""+this.quality+"\">\n";
			sCR+="<PARAM NAME=scale VALUE=\""+this.scale+"\">\n";
			sCR+="<PARAM NAME=menu VALUE=\""+this.menu+"\">\n";
//cdm 31.03.2004 - added base parameter			
			sCR+="<PARAM NAME=base VALUE=\".\">\n";
			sCR+="<PARAM NAME=wmode VALUE=\""+this.wmode+"\">\n";
			if (this.flashVars){
				sCR+="<PARAM NAME=FlashVars VALUE=\""+this.flashVars+"\">\n";
			}
			if (this.bgcolor){
				sCR+="<PARAM NAME=bgcolor VALUE=\""+this.bgcolor+"\">\n";
			}
			sCR+="<PARAM NAME=devicefont VALUE=\""+this.deviceFont+"\">\n";
			sCR+="</OBJECT>\n";
		} else if (Ticket.webtv) {
			//alert("using webtv embed");
			sCR="<EMBED SRC="+this.flashFile+" swLiveConnect=TRUE WIDTH="+this.width+" HEIGHT="+this.height+" QUALITY="+this.quality+" SCALE="+this.scale+" wmode="+this.wmode+" ID="+this.ID+" NAME="+this.name+" MENU="+this.menu+" DEVICEFONT="+this.deviceFont+" FlashVars="+ this.flashVars +" TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED>";
		}
	} else {
	if (this.redirect){
	 top.location.href = this.redirect;
	} else {
			if (this.altTxt){
			sCR = this.altTxt;
			} else {
			sCR="<IMG SRC="+this.altImg+" WIDTH="+this.width+" HEIGHT="+this.height+" BORDER=0>";
			}
		}
		}
	return sCR;
}

// menu
if(window.event + "" == "undefined") event = null;
function HM_f_PopUp(){return false};
function HM_f_PopDown(){return false};
popUp = HM_f_PopUp;
popDown = HM_f_PopDown;

function imgON(imgName) {
	if (document.images) {
		document[imgName].src = eval(imgName + "ON.src");
	}
}
function imgOFF(imgName) {
	if (document.images) {
		document[imgName].src = eval(imgName + "OFF.src");
	}
}
function getDateTime()
{
	var now = new Date();
	var e = '0' + now.getHours();
	if (e.length > 2) e = e.substring(1);
	d = e + ':';
	e = '0' + now.getMinutes();
	if (e.length > 2) e = e.substring(1);
	d += e + ' ';
	e = '0' + now.getDate();
	if (e.length > 2) e = e.substring(1);
	d += e + '/';
	e = '0' + (now.getMonth() + 1);
	if (e.length > 2) e = e.substring(1);
	d += e + '/' + now	.getFullYear();
	
	return d;
}

//Current Year for Footer - 24 January 2003 - Elisa
function getCurrentYear()
{
	var datestr = getDateTime();
	var yearstr = datestr.substring(datestr.length - 4,datestr.length);
	document.write(yearstr);
}

function pageNavigate(step, psize)
{
	var page = parseInt(psize,10)-1;
	var pre = "page=";
	var begin = baseUrl.indexOf(pre);
	var newIndex = 1;
	if (begin > 0) {
		begin += pre.length;
		var ixEnd = baseUrl.lastIndexOf('.');
		var oldIndex = parseInt(baseUrl.substring(begin, ixEnd),10);
		newIndex = oldIndex + parseInt(step,10);
		var newsLink;
		if (newIndex > 0)
			newsLink = baseUrl.substring(0,begin) + newIndex + baseUrl.substr(ixEnd);
		else {
			var pre2 = ",page=" + oldIndex;
			begin = baseUrl.indexOf(pre2);
			newsLink = baseUrl.substring(0,begin) + baseUrl.substring(begin + pre2.length);
		}
	}
	else {
		var pre2 = ".htm";
		begin = baseUrl.indexOf(pre2);
		newsLink = baseUrl.substring(0,begin) + ',page=1' + baseUrl.substring(begin);
	}

	if (newIndex >= 1)
		newsLink = newsLink.substring(0,newsLink.length-1) + 'x';
	else
		newsLink = newsLink.substring(0,newsLink.length-1) + 'l';
	
	window.location.href = newsLink;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

//util function written by: James Kerr 26/02/2002
//parameters: optional[int percentage of total screen height] 
//returns a percentage, as specified by the parameter percent, of the total screen height 
//if no parameter specified then returns 80% of total screen height by default
//if no/invalid parameter specified returns default percentage of total screen height
function getPercentageScreenHeight(percent) {
	
	var percentageScreenHeight;
	var defaultPercentage = 80;
		
	if(arguments.length > 0) {
		if(!isNaN(parseInt(arguments[0]))) {
			percentageScreenHeight = Math.round(screen.height*(parseInt(arguments[0])/100));
		}
	} 
	else {
		percentageScreenHeight = Math.round(screen.height*(defaultPercentage/100));
	}
	
	return percentageScreenHeight;
		
}	//end of function
	
	
	
//util function written by: James Kerr 26/02/2002
//parameters: optional[string (height in pixels/percentage of total screen height)] 
//function returns specified height if it is an int or
//returns a percentage of total screen height if '%' symbol is used e.g. 10% and number part is a valid int
//otherwise it returns the default percentage height of the total screen height
//if no/invalid parameter specified returns default percentage of total screen height: see function getPercentageScreenHeight(percent) 
function getPopUpHeight(height) {
	
	if(arguments.length <= 0) {
		return getPercentageScreenHeight();
	}
	else {
		if((String(arguments[0]).indexOf("%") != -1) && (arguments[0].length >= 2)) {
			if(!isNaN(parseInt(String(arguments[0]).substring(0,String(arguments[0]).indexOf("%"))))) {
				return getPercentageScreenHeight(parseInt(String(arguments[0]).substring(0,String(arguments[0]).indexOf("%"))));
			}
			else {
				return getPercentageScreenHeight();
			}
		}
		else if(!isNaN(parseInt(arguments[0]))) {
			return height;
		}
		else {
			return getPercentageScreenHeight();
		}
	}
		
}	//end of function


function fnOpenWindow(address, target, toolbar, location, directories, status, menubar, scrollbars, resizable, width, height, top, left) 
{
	if (!(top > '0'))
	{
		top = (window.screen.availHeight / 2) - (height / 2);
	}
	if (!(left > '0'))
	{
		left = (window.screen.availWidth / 2) - (width / 2);
	}
	var option = "toolbar="+toolbar+",location="+location+"directories="+directories+",status="+status+",menubar="+menubar+",scrollbars="+scrollbars+",resizable="+resizable+",width="+width+",height="+height+",top="+top+",left="+left;
	objWindow = window.open(address, target, option); 
	objWindow.focus();
}

function openPopup(address, target, width, height) 
{
	fnOpenWindow(address, target, 'no', 'no', 'no', 'no', 'no', 'no', 'no', width, height, '0', '0')
}


//util function written by: James Kerr 30/04/2002
//opens specified address in the window (window.opener) that opened the window from which this function is called
//if no window.opener exists (i.e. the current window was opened by the user) or the window.opener has been closed then a new window is opened using fnOpenWindow()
function fnOpenInOpenerWindow(address, target, toolbar, location, directories, status, menubar, scrollbars, resizable, width, height, top, left) 
{
	var objParentWindow = window.opener;
	
	if (objParentWindow && !objParentWindow.closed) {
		objParentWindow.location.href = address;
		objParentWindow.focus();
	} else {
		fnOpenWindow(address, target, toolbar, location, directories, status, menubar, scrollbars, resizable, width, height, top, left);
	}
}

//-------------- check RealPlayer - cdm 14.09.2002
var realEnabled = false;
var realOneEnabled = false;
var realState=false;
var G2=false;

function checkReal()
{
	
	numPlugins = navigator.plugins.length;
	for(i=0;i<numPlugins;i++)
	{
		plugin = navigator.plugins[i];
		if ((plugin.name.substring(0,10)=="RealPlayer")&&(plugin.name.indexOf("G2")>0)) realState=true;
	}

   	document.write('<script language=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('G2 = (NOT IsNull(CreateObject("rmocx.RealPlayer G2 Control")))\n');
	document.write('</script\> \n');
   	document.write('<script language=VBScript\>\non error resume next \nG2=(NOT IsNull(CreateObject("rmocx.RealPlayer G2 Control")))\n</script\>\n');
	return (realState||G2);
}

function linkReal(url,realUrl,realOneUrl)
{
	if( realOneEnabled )
		document.location.href = url;
	else
		if( realEnabled )
			window.open(realOneUrl);
		else
			window.open(realUrl);
}

//-------------- end check Real Player

//-------------- check realOne avoiding Avantgo pages

var strLocation = document.getElementById('AvantgoCheck'); //check for avantgo image id as location.href not supported 

if (!strLocation)
{
	document.write('<OBJECT ID="IERPCtl" WIDTH=0 HEIGHT=0 CLASSID="CLSID:FDC7A535-4070-4B92-A0EA-D9994BCC0DC5"></OBJECT>');		
}

function isRealOne() {
	RealOneInst = 'undetermined';
	var agt=navigator.userAgent.toLowerCase();
	var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
					&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
					&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
	if (is_nav) {
		IERPCtl = 0;
	}
	
	if (navigator.plugins) {
		if ((navigator.userAgent.charAt(8)) >= ('3')) {
			var nPlayerInstalled=2;
			var i=0;
			while (navigator.plugins[i]){
				if ((navigator.plugins[i].name) == 'RealOne Player Version Plugin'){
					nPlayerInstalled=1;
					szPlayerVersion=navigator.plugins[i].description;
					break;
					}
					i++;
				}
			
				if ( nPlayerInstalled == 2 ){
					var nRPVersion = IERPCtl.RealPlayerVersion;
					if ( nRPVersion == null ){
						nPlayerInstalled=2;
					} 
					else {
						nPlayerInstalled=1;
					}
				}
			}       
			if (nPlayerInstalled == 1){
				RealOneInst = 'installed';  
			} 
			if (nPlayerInstalled == 2){
				RealOneInst = 'notinstalled';
			}
		} else {
			RealOneInst = 'undetermined';
		}
		if (RealOneInst == 'installed') {
				if (agt.indexOf("(r1 ") != -1) {
						RealOneInst = 'using';
				}
		}
		return RealOneInst;     
	}


//-----> 21 August 2003 - Morena : update popup's link
	function loadlink(page,premium) {
		
		var agt=navigator.userAgent.toLowerCase();
		var is_aol = (agt.indexOf("aol") != -1);
		if (is_aol){
			window.location="http://uk.real.com/partners/efa/popups/aol.html" // version for AOL browsers
		}
		else{
			var checkbrowser = isRealOne(); // here's where people with R1 will go
			if (checkbrowser == 'using') {
				 window.location = (page);
			}
			if (checkbrowser == 'installed') {  // here's where people with R1 will go
				 window.location = (page);
			}
			if (checkbrowser =='undetermined' || checkbrowser =='notinstalled') {
			
			// now the tricky part : people we're not sure about yet
				
			numPlugins = navigator.plugins.length;
			oldRealPlayer = 'false';
			for (i = 0; i < numPlugins; i++)
			{
			  plugin = navigator.plugins[i];
			  if (plugin.name.substring(0,10)=="RealPlayer")
			  {
			  oldRealPlayer = 'true';
			  }
			}	
		}		
		if (navigator.userAgent.indexOf("Mac") != -1) {
		
			if (oldRealPlayer == 'true'){
				window.location = (page);
			} else {
				if (premium == 'yes') {
					window.open('http://uk.real.com/partners/efa/popups/premium.html','r1popup','width=250,height=300,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');
				}
				if (premium == 'no') {
					window.open('http://uk.real.com/partners/efa/popups/free.html' ,'r1popup','width=250,height=300,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');
				}
			}
		}
		
		else {if (navigator.userAgent.indexOf("95") != -1) {
			oldRealPlayer = 'false';
			document.writeln('<script language="VBscript">');
			document.writeln('on error resume next');
			document.writeln('RealPlayerG2 = not IsNull(CreateObject("rmocx.RealPlayer G2 Control"))');
			document.writeln('if (RealPlayerG2) then');
			document.writeln('oldRealPlayerIE=\"true\"');
			document.writeln('else');
			document.writeln('oldRealPlayerIE=\"false\"');
			document.writeln('end if');
			document.writeln('</scr' + 'ipt>'); 
			
			numPlugins = navigator.plugins.length;
			for (i = 0; i < numPlugins; i++)
			{
			plugin = navigator.plugins[i];
			if (plugin.name.substring(0,10)=="RealPlayer")
			{
			oldRealPlayer = 'true';
			}
		}
			if (oldRealPlayer == 'true' || oldRealPlayerIE == 'true'){	
			window.location = (page);
			} else {
			if (premium == 'yes') {
			window.open('http://uk.real.com/partners/efa/popups/premium.html','r1popup','width=250,height=300,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');
			}
			if (premium == 'no') {
			window.open('http://uk.real.com/partners/efa/popups/free.html','r1popup','width=250,height=300,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');
			}
			}	 	
		}	
		
		
		else {if (navigator.userAgent.indexOf("Win") != -1) {
				if (checkbrowser == 'using' || checkbrowser =='installed') {
				window.location = (page);
				} else {
				if (premium == 'yes') {
					window.open('http://uk.real.com/partners/efa/popups/premium.html','r1popup','width=250,height=300,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');
				}
				if (premium == 'no') {
					window.open('http://uk.real.com/partners/efa/popups/free.html','r1popup','width=250,height=300,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');
				}
			   }
		} else {
		
			window.open('http://uk.real.com/partners/efa/popups/otherOS.html','r1popup','width=250,height=160,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');	
		
		}
	}
	}
	}
}


//-----> 14 May 2004 - George : link for EURO Real check
	function loadlinkEURO(page,premium) {
	
		var aol_url = 'http://uk.real.com/partners/popups/aol.html';
		var other_url = 'http://uk.real.com/partners/popups/otherOS.html';
		var free_url = 'http://uk.real.com/partners/efa/2004/popups/free.html';
		var premium_url = 'http://uk.real.com/partners/efa/2004/popups/premium.html';
		
		var agt=navigator.userAgent.toLowerCase();
		var is_aol = (agt.indexOf("aol") != -1);
		if (is_aol){
			window.location=aol_url // version for AOL browsers
		}
		else{
			var checkbrowser = isRealOne(); // here's where people with R1 will go
			if (checkbrowser == 'using') {
				 window.location = (page);
			}
			if (checkbrowser == 'installed') {  // here's where people with R1 will go
				 window.location = (page);
			}
			if (checkbrowser =='undetermined' || checkbrowser =='notinstalled') {
			
			// now the tricky part : people we're not sure about yet
				
			numPlugins = navigator.plugins.length;
			oldRealPlayer = 'false';
			for (i = 0; i < numPlugins; i++)
			{
			  plugin = navigator.plugins[i];
			  if (plugin.name.substring(0,10)=="RealPlayer")
			  {
			  oldRealPlayer = 'true';
			  }
			}	
		}		
		if (navigator.userAgent.indexOf("Mac") != -1) {
		
			if (oldRealPlayer == 'true'){
				window.location = (page);
			} else {
				if (premium == 'yes') {
					window.open(premium_url,'r1popup','width=250,height=300,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');
				}
				if (premium == 'no') {
					window.open(free_url,'r1popup','width=250,height=300,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');
				}
			}
		}
		
		else {if (navigator.userAgent.indexOf("95") != -1) {
			oldRealPlayer = 'false';
			document.writeln('<script language="VBscript">');
			document.writeln('on error resume next');
			document.writeln('RealPlayerG2 = not IsNull(CreateObject("rmocx.RealPlayer G2 Control"))');
			document.writeln('if (RealPlayerG2) then');
			document.writeln('oldRealPlayerIE=\"true\"');
			document.writeln('else');
			document.writeln('oldRealPlayerIE=\"false\"');
			document.writeln('end if');
			document.writeln('</scr' + 'ipt>');
			
			numPlugins = navigator.plugins.length;
			for (i = 0; i < numPlugins; i++)
			{
			plugin = navigator.plugins[i];
			if (plugin.name.substring(0,10)=="RealPlayer")
			{
			oldRealPlayer = 'true';
			}
		}
			if (oldRealPlayer == 'true' || oldRealPlayerIE == 'true'){	
			window.location = (page);
			} else {
			if (premium == 'yes') {
			window.open(premium_url,'r1popup','width=250,height=300,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');
			}
			if (premium == 'no') {
			window.open(free_url,'r1popup','width=250,height=300,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');
			}
			}	 	
		}	
		
		
		else {if (navigator.userAgent.indexOf("Win") != -1) {
				if (checkbrowser == 'using' || checkbrowser =='installed') {
				window.location = (page);
				} else {
				if (premium == 'yes') {
					window.open(premium_url,'r1popup','width=250,height=300,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');
				}
				if (premium == 'no') {
					window.open(free_url,'r1popup','width=250,height=300,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');
				}
			   }
		} else {
		
			window.open(other_url,'r1popup','width=250,height=160,toolbar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,menubar=no');	
		
		}
	}
	}
	}
}

// end realone

//Header for Multilingua - 11 September 2002 Morena
//Ottimizzata da Savino e Stefano - 18 December 2002
//Inserito portoghese e russo - 20 January 2003
// Get value from Cookie
function GetCookie (name) 
{
  var result = null;
  var myCookie = " " + document.cookie + ";";
  var searchname = " " + name + "=";
  var startOfCookie = myCookie.indexOf(searchname);
  var endOfCookie;
  if (startOfCookie != -1) {
    startOfCookie += searchname.length; // skip past cookie name
    endOfCookie = myCookie.indexOf(";", startOfCookie);
    result = unescape(myCookie.substring(startOfCookie, endOfCookie));
  }
  return result;
}
// -----------------------------------------------------------------------------
// Clear Cookie
function ClearCookie (name) 
{
  var ThreeDays = 3 * 24 * 60 * 60 * 1000;
  var expDate = new Date();
  expDate.setTime (expDate.getTime() - ThreeDays);
  document.cookie = name + "=ImOutOfHere; expires=" + expDate.toGMTString();
}
// -----------------------------------------------------------------------------
// get number of element with particular namein a cookie (for duplicate name)
function GetCookieCount (name) 
{
  var result = 0;
  var myCookie = " " + document.cookie + ";";
  var searchName = " " + name + "=";
  var nameLength = searchName.length;
  var startOfCookie = myCookie.indexOf(searchName);
  while (startOfCookie != -1) {
    result += 1;
    startOfCookie = myCookie.indexOf(searchName, startOfCookie + nameLength);
  }
  return result;
}
// -----------------------------------------------------------------------------
// Get particular element by name and order (for duplicate name)
function GetCookieNum (name, cookieNum) 
{
  var result = null;
  if (cookieNum >= 1) {
    var myCookie = " " + document.cookie + ";";
    var searchName = " " + name + "=";
    var nameLength = searchName.length;
    var startOfCookie = myCookie.indexOf(searchName);
    var cntr = 0;
    for (cntr = 1; cntr < cookieNum; cntr++)
      startOfCookie = myCookie.indexOf(searchName, startOfCookie + nameLength);
    if (startOfCookie != -1) {
      startOfCookie += nameLength; // skip past cookie name
      var endOfCookie = myCookie.indexOf(";", startOfCookie);
      result = unescape(myCookie.substring(startOfCookie, endOfCookie));
    }
  }
  return result;
}
// -----------------------------------------------------------------------------
// Function getexpirydate - 23.10.2202 Luca Ferrero
function getexpirydate(numdays)
{
	var UTCstring;
	Today = new Date();
	nummilli = Date.parse(Today);
	Today.setTime(nummilli+numdays*24*60*60*1000);
	UTCstring = Today.toUTCString();
	return UTCstring;
}
// -----------------------------------------------------------------------------
// Set cookies
function SetCookie (name, value, duration, path, domain, secure) 
{
  var expString = ((duration == null) ? "" : ("; expires=" + getexpirydate(duration)));
  var pathString = ((path == null) ? "" : ("; path=" + path));
  var domainString = ((domain == null) ? "" : ("; domain=" + domain));
  var secureString = ((secure == true) ? "; secure" : "");
  document.cookie = name + "=" + escape (value) + expString + pathString + domainString + secureString;
}
// -----------------------------------------------------------------------------

// ------------------------------------------------------------------------------------- 
// test functions added for broadcasters euro action functionality - George 18.02.04

function testEURO ()
{
		
		switch (window.location.hostname){
			case "france2.euro2004.com": 
				strImg = '<img border="0" src="/ml/euro2004/images/action/bd/fr2.jpg" width="165" height="53">'; 
				break;
			case "france3.euro2004.com": 
				strImg = '<img border="0" src="/ml/euro2004/images/action/bd/fr3.jpg" width="165" height="53">'; 
				break;
			case "itv.euro2004.com": 
				strImg = '<img border="0" src="/ml/euro2004/images/action/bd/itv.gif" width="165" height="53">'; 
				break;
			case "rai.euro2004.com": 
				strImg = '<img border="0" src="/ml/euro2004/images/action/bd/rai.gif" width="165" height="53">'; 
				break;
			case "rtp.euro2004.com": 
				strImg = '<img border="0" src="/ml/euro2004/images/action/bd/rtp.gif" width="165" height="53">'; 
				break;
			case "tsr.euro2004.com": 
				strImg = '<img border="0" src="/ml/euro2004/images/action/bd/tsr.jpg" width="165" height="53">'; 
				break;
			default:
				strImg = '<img border="0" src="/ml/euro2004/images/action/bd/benq.gif" width="165" height="53">'; 
				break;
		}

		document.write('<td width="165" height="53" rowspan="2" align="center"><a href="/video/index.html">' + strImg + '</a></td>');
}


function contextEURO ()
{
		
		switch (window.location.hostname){
			case "france2.euro2004.com": 
				strImg = '/ml/euro2004/images/action/bd/efa_context_bg_fr2.gif'; 
				break;
			case "france3.euro2004.com": 
				strImg = '/ml/euro2004/images/action/bd/efa_context_bg_fr3.gif'; 
				break;
			case "itv.euro2004.com": 
				strImg = '/ml/euro2004/images/action/bd/efa_context_bg_itv.gif'; 
				break;
			case "rai.euro2004.com": 
				strImg = '/ml/euro2004/images/action/bd/efa_context_bg_rai.gif'; 
				break;
			case "rtp.euro2004.com": 
				strImg = '/ml/euro2004/images/action/bd/efa_context_bg_rtp.gif'; 
				break;
			case "tsr.euro2004.com": 
				strImg = '/ml/euro2004/images/action/bd/efa_context_bg_tsr.gif'; 
				break;
			default:
				strImg = '/ml/euro2004/images/action/efa_context_bg_benq.gif'; 
				break;
		}

		document.write('<table cellpadding="0" cellspacing="0"  border="0" align="left" width="417" height="280" background="' + strImg + '"></a></td>');
		document.write('<tr height="59"><td>&#160;</td></tr></table>');

}

// -----------------------------------------------------------------------------


// Function to check OS and browser - 10.03.2004 Savino
function BrowserType()
{
      this.ver=navigator.appVersion;
      this.agent=navigator.userAgent;
      this.dom=document.getElementById?1:0;
      this.mac=this.agent.indexOf("Mac")>-1;
      this.pc=this.agent.indexOf("Windows")>-1; 
      this.opera=this.agent.indexOf("Opera")>-1;
      this.ie55 =(this.agent.indexOf("MSIE 5.5")>-1 && !this.opera)?1:0;
      this.ie6=(this.agent.indexOf("MSIE 6")>-1 && !this.opera)?1:0;
      this.ns71=(this.agent.indexOf("Netscape/7.1")>-1)?1:0;
      this.ie523 =(this.agent.indexOf("MSIE 5.23")>-1)?1:0;
      this.saf=(this.agent.indexOf("Safari")>-1)?1:0;
      this.ie=(this.ie55 || this.ie6 || this.ie523);
      this.ns=(this.ns71);
      return this;
}


// Function to detect and display warning message for Mac users when subscribing for euro action - 25.06.2004 George
function MacDtc(url,lang)
{
	if (navigator.userAgent.indexOf("Mac") != -1) {
		switch (lang){
			case "en": 
				alert ('Sorry. The efa.com action service is not optimised for use with the Mac operating system.');
				break;
			case "it": 
				alert ('Sorry. The efa.com action service is not optimised for use with the Mac operating system.');
				break;
			case "fr": 
				alert ('Sorry. The efa.com action service is not optimised for use with the Mac operating system.');
				break;
			case "de": 
				alert ('Sorry. The efa.com action service is not optimised for use with the Mac operating system.');
				break;
			case "es": 
				alert ('Sorry. The efa.com action service is not optimised for use with the Mac operating system.');
				break;
			case "pt": 
				alert ('Sorry. The efa.com action service is not optimised for use with the Mac operating system.');
				break;
			case "ru": 
				alert ('Sorry. The efa.com action service is not optimised for use with the Mac operating system.');
				break;
			default: 
				alert ('Sorry. The efa.com action service is not optimised for use with the Mac operating system.');
				break;
		}		
	}
	window.open(url);
}


