/********************** Browser Detect */
var isNav, isIE, isNav6, isOp;
function BrowserCheck() {
var agt = navigator.userAgent.toLowerCase();
this.mac = (agt.indexOf("mac")!=-1);
var b = navigator.appName;
if (b=="Netscape") this.b = "ns";
else if (b=="Microsoft Internet Explorer") this.b = "ie";
else if (b=="Opera") this.b = "op";
else this.b = b;
this.v = parseInt(navigator.appVersion);
this.ns = (this.b=="ns" && this.v==4);
this.ns4 = (this.b=="ns" && this.v>=4 && this.v<5);
this.ns5 = (this.b=="ns" && this.v>=5);
this.op = (this.b=="op" && this.v>=4);
this.op5 = (this.b=="op" && this.v>=5);
this.ie = (this.b=="ie" && this.v>=4);
this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0);
this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0);
this.ie6 = (navigator.userAgent.indexOf('MSIE 6')>0);
if (this.ie5) this.v = 5;
this.min = (this.ns||this.ie);
}
is = new BrowserCheck();
isNav = false;
isDom = false;
isIE = false;
isScores = false;
isOp = false;
var browser;
if (is.ns4){
isNav = true;
browser = "ns4";
}
if (is.ie4){
isIE = true;
browser = "ie";
}
if (is.ie5 || is.ie6){
isIE = true;
browser = "ie";
}
if (is.op5){
isOp = true;
browser = "op";
}
if (is.ns5 || is.ie5 || is.ie6){
isDom = true;
browser = "dom";
}
if ((is.ie5 || is.ie6) && !is.mac){
isScores = true;
}
function divStyle(theDiv){
if (document.getElementById) return document.getElementById(theDiv).style;
return eval("document."+((document.all)?"all."+theDiv+".style":theDiv));
}
function clipDiv(thisDiv,cT,cR,cB,cL){
if (document.all || document.getElementById) divStyle(thisDiv).clip = "rect("+cT+" "+cR+" "+cB+" "+cL+")";
else{
divStyle(thisDiv).clip.top = cT;
divStyle(thisDiv).clip.bottom = cB;
divStyle(thisDiv).clip.left = cL;
divStyle(thisDiv).clip.right = cR;
}
}
function showDiv(thisDiv){ 
if (document.getElementById) node=document.getElementById(thisDiv).style.visibility='visible';
else divStyle(thisDiv).visibility = "visible"
}
function hideDiv(thisDiv){
if (document.getElementById) node = document.getElementById(thisDiv).style.visibility='hidden';
else divStyle(thisDiv).visibility=(document.all)?"hidden":"hide";
}
//*************** launch java scoreboard ****************
function Is() {
var agt=navigator.userAgent.toLowerCase()
this.major=parseInt(navigator.appVersion)
this.ie=(agt.indexOf("msie") != -1)
if ((agt.indexOf("Macintosh") != -1) && this.ie) {
this.ie3=(this.ie && (this.major == 3))
} else { 
this.ie3=(this.ie && (this.major == 2))
}
} 
var i=new Is();
var appletWindow = "";
function launch() {
width=402;
height=430;
if (i.ie3) {
width-=12;
height-=26;
}
if(i.major<=3){
width+=5; 
height+=4;
} 
var launchpage;
var url = location.pathname;
var ref = location.href;
launchpage='http://scoreboard.wimbledon.org/en_GB/ibmrealtime/jlenhanced_np_.html?'+ref;
if (appletWindow.closed || appletWindow==""){
appletWindow=window.open(launchpage,'wimbledon2003','width='+width+',height='+height+',top=0,left=0,resizable=no,status=yes');
if (appletWindow.opener == null) appletWindow.opener=self;
} 
appletWindow.focus(); 
}
// temp launch function, switch function names to activate
function launch1(){
location.href = "/en_GB/ibmrealtime/index.html"; 
}
/************************** NS Resize Script */
if (isNav){
origWidth = innerWidth;
origHeight = innerHeight;
}
function resizeDetected(){
if (isNav){
if (innerWidth != origWidth || innerHeight != origHeight){
location.href = location.href;
}
}
}
/***************************** pulldown redirect */
function _go(fName,sName) {
if (eval("document." + fName + "." + sName + ".options[document." + fName + "." + sName + ".selectedIndex].value")) 
location.href=eval("document." + fName + "." + sName + ".options[document." + fName + "." + sName + ".selectedIndex].value");
}
/***************************** search direct */
var search = true; //change to true to turn on search
function go_search(){
if (search){
document.search.submit();
} else { 
location.href = "/en_GB/search/index.html"; 
}
}
/**************************** IBM banner reanimation */
function reanimate(){
if (isDom){
document.getElementById("ibm_ban").src = "/images/nav/top/emark_bannerWIMBLEDON_ani.gif";
} else if (isNav){
document.ibm_ban.src = "/images/nav/top/emark_bannerWIMBLEDON_ani.gif";
} else if (isIE){
document.all.ibm_ban.src = "/images/nav/top/emark_bannerWIMBLEDON_ani.gif";
}
}

