var pixFolder='/pix/panels/';

cmode=(mode==1)?1:cmode;
f1='<font face="Arial, Helvetica, sans-serif" size="2">';
f2='</font>';
ao=[];
tollerance=8;
function ly(id,pid){
	if(!pid){
		eval(id+'o=new dlayer(id);');
	}else{
		eval(id+'o=new dlayer(id,0,0,100,100,1,pid);');
	}
	eval('tmp='+id+'o');
	eval(id+'o='+id+'o.obj');
	eval(id+'o.o=tmp');
}

function panels(){
	ly('lb1');
	ly('lb2');
	ly('sb');
	ly('c');
	ly('mb1');
	ly('mb2');
	ly('p1');
	ly('p2');
	ly('p3');
	sbo.move(0,by);
	sbo.level(5);
	sbo.write('<nobr><a href="javascript:void(null);" onclick="h_p(sbo); return false;"><img src="'+pixFolder+'m'+mode+'/sb2.gif" border="0"></a><img src="'+pixFolder+'m'+mode+'/sb.gif" border="0"><img src="'+pixFolder+'m'+mode+'/sbc'+cmode+'.gif" name="sbc" border="0"></nobr>');
	sbo.img='sbc';
	lb1o.move(0,by);
	lb1o.level(4);
	lb1o.write('<img src="'+pixFolder+'m'+mode+'/lb.gif" border="0">');
	lb1o.o2=lb2o;
	lb2o.move(0,by);
	lb2o.level(6);
	lb2o.write('<a href="javascript:void(null);" onclick="h_p(sbo); return false;"><img src="'+pixFolder+'m'+mode+'/lb2.gif" border="0"></a><a href="javascript:void(null);" onclick="h_p(lb1o,lb2o); return false;"><img src="'+pixFolder+'m'+mode+'/lb3'+cmode+((lmode==true)?'p':'')+'.gif" border="0"></a><img src="'+pixFolder+'m'+mode+'/lbc'+cmode+'.gif" name="lbc" border="0">');
	lb2o.img='lbc';
	mb1o.move(0,by);
	mb1o.level(3);
	mb1o.write('<img src="'+pixFolder+'m'+mode+'/mb.gif" border="0">');
	mb1o.o2=mb2o;
	mb2o.move(0,by);
	mb2o.level(7);
	mb2o.write('<a href="javascript:void(null);" onclick="h_p(sbo); return false;"><img src="'+pixFolder+'m'+mode+'/mb2.gif" border="0"></a><a href="javascript:void(null);" onclick="h_p(lb1o,lb2o); return false;"><img src="'+pixFolder+'m'+mode+'/mb3.gif" border="0"></a><a href="javascript:void(null);" onclick="h_p(mb1o,mb2o); return false;"><img src="'+pixFolder+'m'+mode+'/mb4'+cmode+'.gif" border="0"></a><img src="'+pixFolder+'m'+mode+'/mbc'+cmode+'.gif" name="mbc" border="0">');
	mb2o.img='mbc';
	co.hide();
	co.write('<a href="javascript:void(null);" onclick="h_p(false,false,true); return false;"><img src="'+pixFolder+'close.gif" border="0"></a>');
	co.level(8);
	ly('sta');
	ly('sa');
	ly('lt');
	ly('laa');
	ly('pa');
	ly('pt');
	stao.hide();
	stao.value='';
	lto.hide();   
	lto.value='';
	pto.hide();
	pto.value='';
	p1o.hide();
	var twiiSearchWidth = (mode==1)?  149 : 160 
	var RMAwinX = (screen.width-RMAwinW)/2; 
	var RMAwinY = (screen.height-RMAwinH)/2;
	p1o.write('<table cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF"><tr valign="top"><td><form name="seek3" accept-charset="iso-8859-1"  action="http://search.le.va.twimm.net/sites/query2.html" method="get"><input type="hidden" name="col" value="manu"><input type="hidden" name="qp" value=""><input type="hidden" name="ht" value="0"><input type="hidden" name="qs" value=""><input type="hidden" name="qc" value=""><input type="hidden" name="pw" value="100%"><input type="hidden" name="ws" value="0"><INPUT type="hidden" name="la" value="en"><input type="hidden" name="qm" value="0"><input type="hidden" name="st" value="1"><input type="hidden" name="nh" value="10"><input type="hidden" name="lk" value="1"><input type="hidden" name="rf" value="0"><input type="hidden" name="oq" value=""><INPUT type="hidden" name="rq" value=0><input type="hidden" name="si" value="1"><input type="hidden" name="siteid" value="10"><img src="/1.gif" width="1" height="11"><br><table cellspacing="0" cellpadding="0" width="'+twiiSearchWidth+'" border="0"><tr><td align="center"><img src="/pix/panels/panel_search_logo.gif" width="149" height="35"><br><table cellspacing="0" cellpadding="0" border="0"><tr><td rowspan="4"><img src="/1.gif" width="10" height="1"></td><td colspan="2"><img src="/1.gif" width="1" height="5"><br><font face="Verdana,Helvetica,Arial" size=1><strong>&nbsp;Search the site for</strong></font></td><td rowspan="4"><img src="/1.gif" width="10" height="1"></td></tr><tr><td><input type="text" name="qt" value="" size="14"><img src="/1.gif" width="4" height="1"></td><td><input type="image" src="/pix/panels/panel_go.gif" width="20" height="20" border="0"></td></tr><tr><td colspan="2">&nbsp;<a href="'+sitRootUrl+'advancedsearch/default.sps"><font face="Verdana,Helvetica,Arial" size=1 color="#000000"><strong>Advanced Search</strong></font></a></td></tr></table></td><tr></table></td><td></form><img src="/1.gif" width="1" height="10"><br><table width=120 height=120 bgcolor="#FFCC00" cellpadding="2" cellspacing="0" border="0"><tr><td><table width=116 height=116 border="0" cellspacing="0" cellpadding="2" bgcolor="#FFCC00"><tr><td align="center" style="background-color:#000000;border-bottom:2px solid #FFCC00;"><a href="http://www.lycos.co.uk"><img src="http://www.lycos.co.uk/graphics/search/searchboxes/images/tinylogo.gif" alt="Lycos Search" border="0"></a></td></tr><tr><td><form action="http://www.lycos.co.uk/cgi-bin/pursuit" method="GET" name="lycosSearch"><font face="Verdana,Helvetica,Arial" size=1><div align="center"><input type="hidden" name="matchmode" value="and"><input type="hidden" name="mtemp" value="main"><input type="hidden" name="etemp" value="error"><strong>Search</strong><br><input type="text" NAME="query" VALUE="" size="12"><br><input type="hidden" name="loc" VALUE="odbottom"><input type="hidden" name="lpv" VALUE=1><br><input type="image" src="http://www.lycos.co.uk/graphics/search/searchboxes/images/getit_ylw.gif" border="0" alt="Start Search"></div></font></form></td></tr></table></td></tr></table></td><tr></table>');
	sbo.p=p1o;
	p2o.hide();
	p2o.write('<img src="'+pixFolder+'m'+mode+'/p2'+colmode+((lmode)?'p':'')+'.gif" border="0" usemap="#map2"><map name="map2">'+((lmode==false)?'<area shape="rect" coords="220,'+((mode==1)?52:66)+',263,'+((mode==1)?68:82)+'" href="javascript:void do_login();"><area shape="rect" coords="144,'+((mode==1)?72:86)+',263,'+((mode==1)?81:95)+'" href="javascript:Do_Forget()"><area shape="rect" coords="8,'+((mode==1)?72:86)+',98,'+((mode==1)?81:95)+'" href="javascript:do_register();">':'<area shape="rect" coords="219,'+((mode==1)?52:66)+',239,'+((mode==1)?72:86)+'" href="javascript:void window.open(\'/register/launch.sps\',\'login\',\'width=771,height=426,left=' + RMAwinX + ',top=' + RMAwinY + ', scrollbars=no,resizable=no\')">')+'</map>');
	lb1o.p=p2o;
	p3o.hide();
	p3o.write('<img src="'+pixFolder+'m'+mode+'/p3'+colmode+'.gif" border="0" usemap="#map3"><map name="map3"><area shape="rect" coords="21,'+((mode==1)?13:27)+',89,'+((mode==1)?22:36)+'" href="javascript\:LaunchRMA(\'matchPack\',rmaColor)"><area shape="rect" coords="21,'+((mode==1)?31:45)+',95,'+((mode==1)?39:53)+'" href="javascript\:LaunchRMA(\'matchTracker\',rmaColor)"><area shape="rect" coords="21,'+((mode==1)?49:63)+',63,'+((mode==1)?57:71)+'" href="'+videoLoungUrl+'"><area shape="rect" coords="20,'+((mode==1)?67:81)+',90,'+((mode==1)?75:89)+'" href="javascript\:LaunchRMA(\'comparison\',rmaColor)"><area shape="rect" coords="141,'+((mode==1)?12:26)+',190,'+((mode==1)?21:35)+'" href="javascript\:void window.open(\'http://ad.doubleclick.net/clk;5574177;8080196;t?http:\//videoloungetv.manutd.com\',\'MUTV\',\'scrollbars=no,width=770,height=500\')"><area shape="rect" coords="205,'+((mode==1)?50:64)+',260,'+((mode==1)?82:96)+'" href="http://ad.doubleclick.net/clk;4878769;7701984;k?http://www.vodafone.com/home/0,2064,LANGUAGE_ID%253D0,00.html" target="_blank"></map>');
//	p3o.write('<img src="'+pixFolder+'m'+mode+'/p3'+colmode+'.gif" border="0" usemap="#map3"><map name="map3"><area shape="rect" coords="21,'+((mode==1)?13:27)+',89,'+((mode==1)?22:36)+'" href="javascript\:LaunchRMA(\'matchPack\',rmaColor)"><area shape="rect" coords="21,'+((mode==1)?31:45)+',95,'+((mode==1)?39:53)+'" href="javascript\:LaunchRMA(\'matchTracker\',rmaColor)"><area shape="rect" coords="21,'+((mode==1)?49:63)+',63,'+((mode==1)?57:71)+'" href="javascript\:void window.open(\''+videoLoungUrl+'\',\'seered\',\'height=500,width=770,scrollbars=no,resizable=no\')"><area shape="rect" coords="20,'+((mode==1)?67:81)+',90,'+((mode==1)?75:89)+'" href="javascript\:LaunchRMA(\'comparison\',rmaColor)"><area shape="rect" coords="141,'+((mode==1)?12:26)+',190,'+((mode==1)?21:35)+'" href="javascript\:openRadioWindow(\''+sitRootUrl+'radio/popup/manuRadio.sps?link='+radioLink+'\', \'manuRadio\', 446, 233)"><area shape="rect" coords="140,'+((mode==1)?30:44)+',209,'+((mode==1)?40:54)+'" href="javascript\:LaunchRMA(\'squadProfile\',rmaColor)"><area shape="rect" coords="205,'+((mode==1)?50:64)+',260,'+((mode==1)?82:96)+'" href="http://ad.doubleclick.net/clk;4878769;7701984;k?http://www.vodafone.com/home/0,2064,LANGUAGE_ID%253D0,00.html" target="_blank"></map>');
	mb1o.p=p3o;
//	sao.write('<a href="javascript:void(null);" onclick="af(sao); return false;" style="cursor: default;"><img src="/pix/1.gif" border="1" height="21" width="115"></a>');
	sao.write('');
	sao.level(3);
	sao.dfx=100;
	sao.dfy=(mode==1)?36:50;
	sao.t=stao;sao.hide();
	if(!lmode){
		laao.write('<a href="javascript:void(null);" onclick="af(laao); return false;" style="cursor: default;"><img src="/pix/1.gif" border="0" height="21" width="115"></a>');
	}
	laao.level(3);
	laao.dfx=100;
	laao.dfy=(mode==1)?24:38;
	laao.t=lto;
	laao.hide();
	if(!lmode){
		pao.write('<a href="javascript:void(null);" onclick="af(pao); return false;" style="cursor: default;"><img src="/pix/1.gif" border="0" height="21" width="115"></a>');
	}
	pao.level(3);
	pao.dfx=100;
	pao.dfy=(mode==1)?47:61;
	pao.t=pto;pao.hide();
	ao=[sbo,lb1o,lb2o,mb1o,mb2o];
	pc(sbo,'sbc1','sbc2');
	pc(lb2o,'lbc1','lbc2');
	pc(mb2o,'mbc1','mbc2');
	ly('cu');
	cuo.level(2);
	cuo.hide();
	cuo.write('<img src="'+pixFolder+'cursor.gif" border="0">');
	cuo.relayer();
	p1o.df=[sao];
	p2o.df=[laao,pao];
	df=[sao,laao,pao];
	ike();
}
function h_p(o,o2,d){

//alert(o+'\n'+o2+'\n'+d)

	if(!d){
		for(var i=0;i<ao.length;i++){
			if(ao[i].moving){
				if(!o2){
					setTimeout('h_p('+o.obj+');',100);
				}else{
					setTimeout('h_p('+o.obj+','+o2.obj+');',100);
				}
				return;
			}
		}
		var f=false;
		for(var i=0;i<ao.length;i++){
			if(ao[i].y!=by){
				f=true;
			}
		}
	}
	if(o.y==by&&!f){
		o.p.relayer();
		o.relayer();
		ny=(mode==1)?by-o.p.h:by+o.p.h;
		o.glide(o.x,o.y,o.x,ny,10);
		if(o2){
			o2.relayer();
			o2.glide(o2.x,o2.y,o2.x,ny,10);
			cl(o.p,o,o2,1);
		}else{
			cl(o.p,o,false,1);
		}
	}else if((o.y==by&&f)||d){
		for(var i=0;i<ao.length;i++){
			if(o.id!=ao[i].id||(o2&&o2.id!=ao[i].id)){
				ao[i].glide(ao[i].x,ao[i].y,ao[i].x,by,10);
				if(ao[i].p){
					if(ao[i].o2){
						cl(ao[i].p,ao[i],ao[i].o2,1);
					}else{
						cl(ao[i].p,ao[i],false,1);
					}
					inf(ao[i].p,1);
				}
				if(!o2&&!d){
					setTimeout('h_p('+o.obj+');',10);
				}else if(o2&&!d){
					setTimeout('h_p('+o.obj+','+o2.obj+');',10);
				}
			}
		}
	}
}

function pc(o,i,ii){
	o.c={};
	o.c.up=new Image();
	o.c.up.src=''+pixFolder+'m2/'+i+'.gif';
	o.c.down=new Image();
	o.c.down.src=''+pixFolder+'m2/'+ii+'.gif';
}

function sc(o,i,ni){
	if(ns4){
		o.css.document.images[ni].src=i;
	}else{
		document.images[ni].src=i;
	}
}

function cl(o,p,o2,f){
	if(f){
		o.show();
		if(mode==2&&cmode==1){
			if(o2){
				sc(o2,o2.c.down.src,o2.img);
			}else{
				sc(p,p.c.down.src,p.img);
			}
		}
	}
	if(mode==2){
		o.move(p.x,p.y-o.h);
		var t=(cmode==1)?by-o.y+p.h:by-o.y;
		o.clip(t,o.w,o.h,0);
	}else{
		o.move(p.x,p.y+p.h);
		o.clip(0,o.w,by-o.y+p.h,0);
	}
	if(p.moving){
		co.hide();
		if(o2){
			setTimeout('cl('+o.obj+','+p.obj+','+o2.obj+');',10);
		}else{
			setTimeout('cl('+o.obj+','+p.obj+');',10);
		}
	}else{
		if(p.y==by){
			if(mode==2&&cmode==1){
				if(o2){
					sc(o2,o2.c.up.src,o2.img);
				}else{
					sc(p,p.c.up.src,p.img);
				}
			}
		}else{
			if(mode==2){
				co.move(p.x+257,p.y+2);
			}else{
				co.move(p.x+248,p.y+2);
			}
			co.show();
			inf(p.p);
		}
	}
}

function inf(o,e){
	if(o.df&&!e){
		for(var k=0;k<o.df.length;k++){
			o.df[k].move(o.df[k].dfx+o.x,o.df[k].dfy+o.y);
			o.df[k].show();
			o.df[k].t.show();
			o.df[k].t.write(gs(o.df[k]));
		}
	}else if(o.df&&e){
		for(var k=0;k<o.df.length;k++){
			o.df[k].hide();
			o.df[k].t.hide();
		}
		af(null);
	}
}

function af(o){
	for(var k=0;k<df.length;k++){
		df[k].active=false;
		df[k].t.write(gs(df[k]));
		cuo.hide();
	}
	if(o!=null){
		o.relayer();
		o.active=true;
		o.t.move(o.x+3,o.y+3);
		o.t.show();
		o.t.write(gs(o));
		o.t.relayer();
		cuo.move(o.t.x+o.t.w,o.t.y);
		cuo.show();
	}else{
		for(var k=0;k<df.length;k++){
			df[k].active=false;
			cuo.hide();
		}
	}
}

function gs(o){
	var v=o.t.value.substring(o.t.value.length-12,o.t.value.length);
	var tm='';
	if(o.t.id!='pt'){
		o.t.write('<nobr>'+f1+v+f2+'</nobr>');
		o.t.relayer();
	}else{
		for(var m=0;m<v.length;m++){
			tm+='*';
		}
		o.t.write('<nobr>'+f1+tm+f2+'</nobr>');
		o.t.relayer();
	}
	var u=1;
	while(o.w-tollerance<o.t.w&&o.t.value.length>0){
		v=v.substring(u,v.length);
		if(o.t.id!='pt'){
			o.t.write('<nobr>'+f1+v+f2+'</nobr>');
		}else{
			tm='';
			for(var m=0;m<v.length;m++){
				tm+='*';
			}
			o.t.write('<nobr>'+f1+tm+f2+'</nobr>');
		}
		o.t.relayer();
		u++;
	}
	if(o.t.id!='pt'){
		return f1+v+f2;
	}else{
		return f1+tm+f2;
	}
}

function fw(k){
	var o;
	for(var i=0;i<df.length;i++){
		if(df[i].active){
			o=df[i];
		}
	}
	if(k=='dl'){
		o.t.value=o.t.value.substring(0,o.t.value.length-1);
	}else if(k=='spc'&&o.t.value.charAt(o.t.value.length-1)!=' '){
		o.t.value+=' ';
	}else if(k!='spc'){
		o.t.value+=k;
	}
	o.t.write(gs(o));
	cuo.show();
	cuo.move(((o.t.value.charAt(o.t.value.length-1)!=' ')?o.t.x+o.t.w:o.t.x+o.t.w+5),o.t.y);
}

function ike(){
	d.onkeypress=kd;
	if(ie4||ie5){
		d.onkeydown=cb;
		for(var v=0;v<d.forms.length;v++){
			if(!d.forms[v].name=='twiiSearch'||!d.forms[v].name=='lycosSearch'){
				d.forms[v].onclick=new Function('h_p(false,false,true);');
			}
		}
	}
	if(ns4){
		d.captureEvents(Event.KEYPRESS);
	}
}

function cb(e){
	kk=event.keyCode;
	if(kk==8){
		var o=null;
		for(var i=0;i<df.length;i++){
			if(df[i].active){
				o=df[i];
			}
		}
		if(o==null){
			return true;
		}else{
			fw('dl');
			event.cancelBubble=true;
			return false;
		}
	}else{
		return true;
	}
}

function kd(e){
	b=false;
	for(var k=0;k<df.length;k++){
		if(df[k].active==true){
			b=true;
		}
	}
	if(b==false){
		return;
	}
	var kc;
	if(ns4){
		kc=e.which;
	}
	if(ie4||ie5){
		kc=event.keyCode;
	}
	if(ns6){
		kc=e.charCode;
		kc=(e.which!=8)?kc:8;
	}
	if(kc==8){
		fw('dl');
	}else if(kc==32){
		fw('spc');
	}else{
		if(lc(kc)){
			fw(String.fromCharCode(kc));
		}
	}
	return false;
}

function lc(k){
	ak=[64,46,45,95,43];
	if(k>=48&&k<=57){
		return true;
	}
	if(k>=65&&k<=90){
		return true;
	}
	if(k>=97&&k<=122){
		return true;
	}
	for(var i=0;i<ak.length;i++){
		if(ak[i]==k){
			return true;
		}
	}
	return false;
}

function run_search(){
	d.seek3.qt.value=stao.value;d.seek3.submit();
}

function do_login(){
	if(ecrmDown){
	alert('The Login facility is currently unavailable.\n\nPlease try again soon.');
	return
	}
	var currentPage=window.location.href;
	window.open('/register/loginattempt.sps?siteLogon=1&username='+escape(lto.value)+'&password='+escape(pto.value)+'&url='+currentPage+'','login','width=771,height=426,top=100,left=100,resizable=no,status=no,location=no,menubar=no')
}

function do_register(){
var RMAwinX = (screen.width-RMAwinW)/2; 
var RMAwinY = (screen.height-RMAwinH)/2;
	if(ecrmDown){
		alert('The Login facility is currently unavailable.\n\nPlease try again soon.');
		return
	}
	var currentPage=window.location.href;
	window.open('/register/launch.sps?siteLogon=1&username=&password=&addvalue='+currentPage+'','login','width=771,height=426,left=' + RMAwinX + ',top=' + RMAwinY + ',resizable=no,status=no,location=no,menubar=no')
}

function Do_Forget(){
var RMAwinX = (screen.width-RMAwinW)/2; 
var RMAwinY = (screen.height-RMAwinH)/2;
	window.open('/register/login.sps?forgotpwd=1','login','width=771,height=426,left=' + RMAwinX + ',top=' + RMAwinY + ', resizable=no,status=no,location=no,menubar=no')	
}