/*
Author:Cameron Milne
Date:July 2008
Hightlight the selected judge/finalist

*/
highlight = function(e,elName){
        
        browserName=navigator.appName;
        if (browserName.indexOf("Netscape")!=-1)
        browserName="NS"
        
        if (browserName.indexOf("Microsoft")!=-1)
        browserName="MSIE"

        if(browserName=="NS" && !document.layers){
            srcElement = e.target;
            srcElement = srcElement;
        }
        else{       
            srcElement = e.srcElement;
        }
      
        //Get all the p tags in the div element
        var elements = document.getElementById(elName).getElementsByTagName("P");
       
       //remove any classes
        for(i=0; i<elements.length; i++)
                elements[i].className = "";
                    
       
                   
        //Set the class on the selected judge
        if(srcElement.nodeName == "EM")
        para = srcElement.parentNode;        
        else
        para = srcElement.parentNode.firstChild.nextSibling;
        
        if(para)
        para.className ="selected";
             
        }


/*
Author:Cameron Milne
Date:July 2008
Open a new window
*/
function openNewWindow(url,target){
    window.open(url,target,"width=565,height=413");
    return false;
}


function openNewSizedWindow(url,target,elWidth,elHeight){
       window.open(url,target,"width=" + elWidth + ",height=" + elHeight + ",scrollbars=1");
    return false;
}


domap = function(elShow){
document.getElementById("fmap").src = "/img/home_flash/" + elShow + ".gif";
window.status = "";

}



// To fix the "Click to activate" issue with IE
function ieupdate(){
 var strBrowser = navigator.userAgent.toLowerCase();
 if(strBrowser.indexOf("msie") > -1 && strBrowser.indexOf("mac") < 0){
  var theObjects = document.getElementsByTagName('object');
  var theObjectsLen = theObjects.length;
  for (var i = 0; i < theObjectsLen; i++) {
   if(theObjects[i].outerHTML){
    if(theObjects[i].data){
     theObjects[i].removeAttribute('data');
    }
    var theParams = theObjects[i].getElementsByTagName("param");
    var theParamsLength = theParams.length;
    for (var j = 0; j < theParamsLength; j++) {
      if(theParams[j].name.toLowerCase() == 'flashvars'){
        var theFlashVars = theParams[j].value;
      }
    }
    var theOuterHTML = theObjects[i].outerHTML;
    var re = /<param name="FlashVars" value="">/ig;
    theOuterHTML = theOuterHTML.replace(re,"<param name='FlashVars' value='" + theFlashVars + "'>");
    theObjects[i].outerHTML = theOuterHTML;
   }
  }
 }
}
