var ns4=document.layers;
var ns6=document.getElementById&&!document.all;
var ie=document.all;
function launch(u){ u = "http://fifaworldcup.yahoo.com/06/broadband/m/go.php/06/broadband/player/dt?" + u;
 doPopup(u,799,600); }
function launchcv(u){ u = "http://fifaworldcup.yahoo.com/06/broadband/m/go.php/06/broadband/player/cv?" + u;
 doPopup(u,799,600); }
function vid(u){
 u = "http://cosmos.bcst.yahoo.com" + u;
 doPopup(u,793,608,"cosmosWin"); 
} 
function doPopup(urlstr, w, h, n)
{
 if (w == null) w = "750";
 if (h == null) h = "480";
 if (n == null) n = "popup"
 var options = "toolbar=no,width=" + w + ",height=" + h + ",left=20,top=20,status=no,scrollbars=0,resizable=no";
 var remote = window.open(urlstr,n,options);
 remote.focus();
 return false;
}
function yg_popup(u,n,w,h,k){
 var a=[],o=null,r=arguments;
 a[0]="width="+w+",height="+h;
 a[1]=",scrollbars="+((k&1)?1:0);
 a[2]=",resizable="+((k&2)?1:0);
 a[3]=",toolbar="+((k&4)?1:0);
 a[4]=",status="+((k&8)?1:0);
 a[5]=",location="+((k&16)?1:0);
 a[6]=",menubar="+((k&32)?1:0);
 if(r.length>=6){a[7]=(document.layers)?",screenX="+r[5]:",left="+r[5]}
 if(r.length>=7){a[8]=(document.layers)?",screenY="+r[6]:",top="+r[6]}
 a=a.join("");o=open(u,n,a);o.focus();
 return o;
}
function openSlideshow(id,prop,page) {
 if(id == undefined) id="f06_photos";
 if(prop == undefined) prop="en";
 if(page == undefined) page="/photos/slideshow.html"; 
 var w = yg_popup('/06/' + prop+page +'?id='+id + '&pgurl=' + escape(location.href),'ss_'+id,775,580,2,100,100);
 w.focus();
}
function openCCSlideshow(id,prop,page) {
 if(id == undefined) id="f06_confed_photos";
 if(prop == undefined) prop="en";
 if(page == undefined) page="/c/photos/slideshow.html"; 
 var w = yg_popup('/06/' + prop+page +'?id='+id + '&pgurl=' + escape(location.href),'ss_'+id,775,580,2,100,100);
 w.focus();
}
function openInParent(href) {
 if (top.window.opener) {
 ourparent = top.window.opener;
 top.window.opener.location.href=href;
 } else {
 ourparent = window.open(href,"_blank");
 }
 if (arguments.length>1 && arguments[1]=="noclose") {
 ourparent.focus();
 } else {
 top.window.close();
 }
}
function toggle(i) {
 var e = document.getElementById(i);
 var t = e.className;
 if (t.match('invisible')) { t = t.replace(/invisible/gi, 'visible'); }
 else { t = t.replace(/visible/gi, 'invisible'); }
 e.className = t;
}
function switchTabs() {
 for(var i=1; i<arguments.length; i++){ ylib_hide(ylib_getObj(arguments[i]),"none"); }
 ylib_show(ylib_getObj(arguments[0]),"block");
}
function yfifa_collectElementsByClass( className, element, results, noRecursionOnHit ) {
 if ( element == null ) element = document;
 if ( results == null ) results = [ ];
 if ( element.className != null )
 if ( (( " " + element.className + " ").indexOf( " " + className + " " )) != -1 ) {
 results [ results.length ] = element;
 if(noRecursionOnHit) return results; }
 var n = element.childNodes.length;
 for ( var i=0; i<n; ++i )
 yfifa_collectElementsByClass ( className, element.childNodes[i], results, noRecursionOnHit );
 return results;
}
 
function yfifa_addEvent (el, sType, fn, capture) {
 capture = (capture) ? true : false;
 if (el.addEventListener) {
 el.addEventListener(sType, fn, capture);
 } else if (el.attachEvent) {
 el.attachEvent("on" + sType, fn);
 } else {
 el["on" + sType] = fn;
 }
}
 var fifa_tzc_DL_mouseX = fifa_tzc_DL_mouseY = 0;
 var fifa_tzc_time = 0;
 var fifa_tzc_javascript_loaded = false;
 var fifa_tzc_LANG = "en";
 var fifa_tzc_CLOSE_str = "close";
 function fifa_tzc_click(unix_time, display_str){
 var isDOM=(document.getElementById);
 var isMac=(navigator.userAgent.toLowerCase().indexOf("mac")!=-1);
 var isOpera=(window.opera); 
 if(!isDOM || isMac || isOpera){
 var url = "/06/en/inc/tzconv_module.html";
 if(document.layers) {
 url = "http://"+document.location.hostname+url;
 }
 url += "?popup=true&time="+unix_time+"&display_str="+display_str;
 var remote = window.open(url,"fifa_tzc_Window","toolbar=no,width=275,height=255,left=20,top=20,status=no,scrollbars=auto,resizable=yes");
 remote.focus();
 return; 
 }
 if(!fifa_tzc_javascript_loaded){
 fifa_tzc_time = unix_time;
 fifa_tzc_display_str = display_str;
 var e = document.createElement("script");
 e.src = "/06/js/tzconv_dhtml.js";
 e.type="text/javascript";
 document.getElementsByTagName("head")[0].appendChild(e); 
 fifa_tzc_javascript_loaded = true;
 }
 else fifa_tzc_Open(unix_time,display_str);
}
document.onmousemove = fifa_tzc_getMouseXY;
if (!document.all) document.captureEvents(Event.MOUSEMOVE);
function fifa_tzc_getMouseXY(e) {
 if (document.all) {
 fifa_tzc_DL_mouseX = event.clientX + document.body.scrollLeft
 fifa_tzc_DL_mouseY = event.clientY + document.body.scrollTop
 } else { fifa_tzc_DL_mouseX = e.pageX; fifa_tzc_DL_mouseY = e.pageY; } 
 if (fifa_tzc_DL_mouseX < 0)fifa_tzc_DL_mouseX = 0;// catch possible negative values in NS4
 if (fifa_tzc_DL_mouseY < 0)fifa_tzc_DL_mouseY = 0;
 return true;
}
 
function talkToSWF(pipeName,func,a,b) { 
 var pipeSWF = "/06/modules/photoBrowse/pipe.swf";
 if(typeof(ylib_getObj) != "undefined"){
 var sPCMobj = ylib_getObj("talkToSWF_div");
 if(sPCMobj == undefined) return false;}
 else return false;
 var theNub = "<embed src="+pipeSWF+" name=pipe id=pipe loop=false type='application/x-shockwave-flash' width=5 height=5 pluginspage='http://www.macromedia.com/go/getflashplayer'";
 theNub += " bgcolor=#ff601f flashvars='i="+pipeName+","+func+","+a+","+b+"'></embed>";
 sPCMobj.innerHTML = theNub;
} 
function isFlashVersion(minVersion){
 plugin=(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"])?navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin:0;
 
 if(plugin){plugin=parseInt(plugin.description.substring(plugin.description.indexOf(".")-1))>=minVersion;}
 else if(navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && navigator.userAgent.indexOf("Windows")>=0){
 document.write('<SCR'+'IPT LANGUAGE="VBScript"> '+'on error resume next \n'+'plugin = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+minVersion+'")))'+'</SCR'+'IPT>');}
 
 if(plugin)return true; else return false;
}
function ylsTabs(aLabel, aPage) {
 this.aLabel = aLabel;
 this.aPage = aPage;
 this.lastTab = 0;
 this.currentTab = 0;
 this.tabDiv = '';
 this.tabDiv = document.getElementById('tabs');
 this.setDiv = function(div) {
 this.tabDiv = document.getElementById(div);
 }
 this.build = function(selected,add_ems) {
 var tab, newA, newEM, page, className;
 var html = '';
 var c = '';
 this.lastTab = selected;
 for (tab = 0; tab < this.aLabel.length; tab++) {
 if(add_ems) newEM = document.createElement("EM");
 newA = document.createElement("A");
 newA.href = 'javascript:void(0);';
 newA.title = 'Select ' + this.aLabel[tab] + ' tab';
 newA.innerHTML = this.aLabel[tab];
 var className = '';
 var page = document.getElementById(this.aPage[tab]);
 if (selected == tab) {
 className = 'on ';
 if (page) page.style.display = 'block';
 }
 else { if (page) page.style.display = 'none'; }
 newA.className = className + this.getTabClass(tab);
 newA.selection = tab;
 newA.owner = this;
 try {
 newA.addEventListener("mousedown", this.clickTabEvent, false);
 newA.addEventListener("keydown", this.keyTabEvent, false);
 newA.childNodes[0].selection = tab;
 newA.childNodes[0].owner = this;
 }
 catch (e) {
 newA.attachEvent('onmousedown', this.clickTabEvent);
 newA.attachEvent('onkeydown', this.keyTabEvent);
 }
 if(add_ems) { newEM.appendChild(newA);
 this.tabDiv.appendChild(newEM); }
 else { this.tabDiv.appendChild(newA); }
 }
 }
 this.clickTab = function(tab) {
 if (this.lastTab != tab) {
 this.tabDiv.childNodes[this.lastTab].className = this.getTabClass(this.lastTab);
 this.tabDiv.childNodes[tab].className = this.getTabClass(tab) + ' on';
 document.getElementById(aPage[this.lastTab]).style.display = 'none';
 }
 document.getElementById(this.aPage[tab]).style.display = 'block';
 this.lastTab = tab;
 if (this.clickListener) return(this.clickListener(this, tab));
 else return(false);
 }
 this.clickTabEvent = function(e) {
 if (!e) e = window.event;
 var source;
 if (e.srcElement) source = e.srcElement;
 else source = e.target;
 source.owner.clickTab(source.selection);
 }
 this.keyTabEvent = function(e) {
 if (!e)
 e = window.event;
 if (e.keyCode) {
 if (e.keyCode == 13) {
 var source;
 if (e.srcElement)
 source = e.srcElement;
 else
 source = e.target;
 source.owner.clickTab(source.selection);
 }
 }
 }
 this.addListener = function(func) { this.clickListener = func; }
 this.getTabClass = function(tab) {
 if (tab == 0) return 'first';
 else if (tab == this.aLabel.length - 1) return 'last';
 else return '';
 }
}
 
 document.onkeydown = fixTargets;
 document.onmousedown = fixTargets; 
 gTargetsFixed = false;
 function fixTargets(evt) { 
 try {
 if( !document.body ) return; if ( gTargetsFixed ) return;
 gTargetsFixed = true;
 fixupTargetByTag( document.body, "A", adTestAnchor )
 fixupTargetByTag( document.body, "FORM", adTestForm )
 }
 catch(err) {}
}
function fixupTargetByTag( scope, tagtype, testFn ) { 
 var tags = scope.getElementsByTagName(tagtype);
 for(var i = 0; i < tags.length ; i++) {
 if( testFn( tags[i] ) ) {
 if( tags[i].target && tags[i].target == "_top" )
 continue;
 tags[i].target= "_blank";
} } }
function adTestAnchor(theTag) {
 if( theTag.href )
 if( theTag.href.indexOf( "S=" )>0 && theTag.href.indexOf( "D=" )>0 && theTag.href.indexOf( "o=0" )==-1) return true;
 return false;
}
function adTestForm(theTag) {
 if( theTag.action )
 if( theTag.action.indexOf( "S=" )>0 && theTag.href.indexOf( "D=" )>0 && theTag.href.indexOf( "o=0" )==-1) return true;
 return false;
}
 
 
// Browser Detect v2.1.6
// documentation: http://www.dithered.com/javascript/browser_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)
 
function BrowserDetect() {
 var ua = navigator.userAgent.toLowerCase();
 
 // browser engine name
 this.isGecko = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
 this.isAppleWebKit = (ua.indexOf('applewebkit') != -1);
 
 // browser name
 this.isKonqueror = (ua.indexOf('konqueror') != -1);
 this.isSafari = (ua.indexOf('safari') != - 1);
 this.isOmniweb = (ua.indexOf('omniweb') != - 1);
 this.isOpera = (ua.indexOf('opera') != -1);
 this.isIcab = (ua.indexOf('icab') != -1);
 this.isAol = (ua.indexOf('aol') != -1);
 this.isIE = (ua.indexOf('msie') != -1 && !this.isOpera && (ua.indexOf('webtv') == -1) );
 this.isMozilla = (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length);
 this.isFirebird = (ua.indexOf('firebird/') != -1);
 this.isNS = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ((ua.indexOf('mozilla')!= -1) && !this.isOpera && !this.isSafari && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) ); 
 // spoofing and compatible browsers
 this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE); 
 this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);
 
 // rendering engine versions
 this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
 this.equivalentMozilla = ( (this.isGecko) ? parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ) : -1 );
 this.appleWebKitVersion = ( (this.isAppleWebKit) ? parseFloat( ua.substring( ua.indexOf('applewebkit/') + 12) ) : -1 );
 this.versionMinor = parseFloat(navigator.appVersion);
 if (this.isGecko && !this.isMozilla) {
 this.versionMinor = parseFloat( ua.substring( ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1 ) );
 }
 else if (this.isMozilla) {
 this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
 }
 else if (this.isIE && this.versionMinor >= 4) { 
 this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
 }
 else if (this.isKonqueror) {
 this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
 }
 else if (this.isSafari) {
 this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('safari/') + 7 ) );
 }
 else if (this.isOmniweb) { 
 this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('omniweb/') + 8 ) );
 }
 else if (this.isOpera) {
 this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera') + 6 ) );
 }
 else if (this.isIcab) {
 this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab') + 5 ) );
 }
 this.versionMajor = parseInt(this.versionMinor);
 // dom support
 this.isDOM1 = (document.getElementById);
 this.isDOM2Event = (document.addEventListener && document.removeEventListener);
 // css compatibility mode
 this.mode = document.compatMode ? document.compatMode : 'BackCompat';
 // platform
 this.isWin = (ua.indexOf('win') != -1);
 this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );
 this.isMac = (ua.indexOf('mac') != -1);
 this.isUnix = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
 this.isLinux = (ua.indexOf('linux') != -1);
 // specific browser shortcuts
 this.isNS4x = (this.isNS && this.versionMajor == 4);
 this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);
 this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);
 this.isNS4up = (this.isNS && this.versionMinor >= 4);
 this.isNS6x = (this.isNS && this.versionMajor == 6);
 this.isNS6up = (this.isNS && this.versionMajor >= 6);
 this.isNS7x = (this.isNS && this.versionMajor == 7);
 this.isNS7up = (this.isNS && this.versionMajor >= 7);
 this.isIE4x = (this.isIE && this.versionMajor == 4);
 this.isIE4up = (this.isIE && this.versionMajor >= 4);
 this.isIE5x = (this.isIE && this.versionMajor == 5);
 this.isIE55 = (this.isIE && this.versionMinor == 5.5);
 this.isIE5up = (this.isIE && this.versionMajor >= 5);
 this.isIE6x = (this.isIE && this.versionMajor == 6);
 this.isIE6up = (this.isIE && this.versionMajor >= 6);
 this.isIE4xMac = (this.isIE4x && this.isMac);
}
var browser = new BrowserDetect(); var yfifa_PhotoViewer_interval;
 var yfifa_PhotoViewer_playMode = "pause";
 var yfifa_PhotoViewer_selectedTab = 0;
 var yfifa_PhotoViewer_photoIndexPerTab = new Array(); 
function yfifa_PhotoViewer_Init() { 
 if(!document.getElementById) return;
 var aObjs;
 if((browser.isIE && browser.versionMajor < 5) || (browser.isNS && browser.versionMajor < 5) || (browser.isOpera && browser.versionMajor < 7))return;
 var allDIVs = yfifa_collectElementsByClass("yfifa-photoControls",null,null,true); 
 for(var i=0, divObj; divObj = allDIVs[i]; i++) {
 yfifa_PhotoViewer_photoIndexPerTab[i] = 0;
 divObj.style.display = "block"; 
 for(var j = 0,str; str = ["prev","pause","next"][j]; j++) {
 aObjs = yfifa_collectElementsByClass(str,divObj,null,true); // there is only one
 aObjs[0].href = "javascript:void(null)";
 aObjs[0].tabNumber = i; 
 aObjs[0].buttonType = j; 
 aObjs[0].onclick = function() { yfifa_PhotoViewer_Click(this); }; 
 }
 }
 if(allDIVs.length > 0)
 yfifa_PhotoViewer_interval = setInterval("yfifa_PhotoViewer_SwitchImage(1)",3000);
}
function yfifa_PhotoViewer_Click(aObj) {
 if(typeof(yfifa_PhotoViewer_interval) != "undefined") clearInterval(yfifa_PhotoViewer_interval);
 yfifa_PhotoViewer_selectedTab = aObj.tabNumber;
 switch(aObj.buttonType) {
 case 0: yfifa_PhotoViewer_SwitchImage(-1); break;
 case 1: yfifa_PhotoViewer_playMode = aObj.className = (aObj.className =="play")?"pause":"play";
 if(yfifa_PhotoViewer_playMode=="pause") yfifa_PhotoViewer_SwitchImage(1); break;
 case 2: yfifa_PhotoViewer_SwitchImage(1); break;
 }
 if(yfifa_PhotoViewer_playMode == "pause")
 yfifa_PhotoViewer_interval = setInterval("yfifa_PhotoViewer_SwitchImage(1)",5000);
 }
function yfifa_PhotoViewer_SwitchImage(i) {
 var t = yfifa_PhotoViewer_selectedTab;
 if(typeof(i) == "undefined" || i == "") i=1;
 yfifa_PhotoViewer_photoIndexPerTab[t] += i;
 if(yfifa_PhotoViewer_photoIndexPerTab[t] < 0 ) 
 yfifa_PhotoViewer_photoIndexPerTab[t] = yfifa_PhotoViewer_data[t].length - 1;
 if(yfifa_PhotoViewer_photoIndexPerTab[t] >= yfifa_PhotoViewer_data[t].length) 
 yfifa_PhotoViewer_photoIndexPerTab[t] = 0;
 
 elObj = document.getElementById("yfifa-photoImg"+t);
 if(elObj && typeof(elObj) != "undefined") {
 elObj.src = yfifa_PhotoViewer_data[t][yfifa_PhotoViewer_photoIndexPerTab[t]][2];
 elObj = document.getElementById("yfifa-photoText"+t);
 if(elObj && typeof(elObj) != "undefined") 
 elObj.innerHTML = yfifa_PhotoViewer_data[t][yfifa_PhotoViewer_photoIndexPerTab[t]][1];
 elObj = document.getElementById("yfifa-photoCountText"+t);
 if(elObj && typeof(elObj) != "undefined") 
 elObj.innerHTML = yfifa_PhotoViewer_data[t][yfifa_PhotoViewer_photoIndexPerTab[t]][0];
 }
}
 
 function fifa_display_team_dropdown(){
 var ua = navigator.userAgent.toLowerCase();
 if (ua.indexOf('mac') < 0 ) {
 var s="";
 s+= "<div class=selectTeam>";
 s+= "<form name=pick>";
 s+= "<span class=v10b>Select a Team</span>";
 s+= "<SELECT class=a10 id=na OnChange=\"location.href=\'/06/";
 s+= "en";
 s+= "/w/team/overview.html?team=\'+selectNA.options[selectedIndex].value\" name=\"selectNA\">";
var c = new Array(" = ","Angola=ang","Argentina=arg","Australia=aus","Brazil=bra","Costa Rica=crc","Côte d'Ivoire=civ","Croatia=cro","Czech Republic=cze","Ecuador=ecu","England=eng","France=fra","Germany=ger","Ghana=gha","Iran=irn","Italy=ita", "Japan=jpn", "Korea Republic=kor","Mexico=mex","Netherlands=ned","Paraguay=par","Poland=pol","Portugal=por","Saudi Arabia=ksa","Serbia & Montenegro=scg","Spain=esp","Sweden=swe","Switzerland=sui","Togo=tog","Trinidad & Tobago=tri","Tunisia=tun","Ukraine=ukr","USA=usa" );
i=0;
while (i<c.length){
 cdn = c[i];
 sepa=cdn.indexOf("=");
 a=cdn.substr(0,sepa);
 b=cdn.substr(sepa+1);
 s+= "<option value=\'" + b + "\' id=na>" + a + "</option>";
i++;};
s+= "</select></div></form>";
document.write(s);
}}

