      function showdetail(id){
            if(document.getElementById('H'+id).value==''){
              document.getElementById(id).style.display='';
              document.getElementById('H'+id).value='X'
            } else {
              document.getElementById(id).style.display='none';
              document.getElementById('H'+id).value=''
            }
        } 
         
	
	function setLyr(obj,lyr)
	{
		var newX = findPosX(obj);
		var newY = findPosY(obj);
		newY -= 200;
		var x = new getObj(lyr);
		x.style.top = newY + 'px';
		x.style.left = newX + 'px';
	}	
		
	function findPosX(obj){
		var curleft = 0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curleft += obj.offsetLeft
				obj = obj.offsetParent;
			}
		}
		else if (obj.x)
			curleft += obj.x;
		return curleft;
	}
	
	function findPosY(obj){
		var curtop = 0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curtop += obj.offsetTop
				obj = obj.offsetParent;
			}
		}
		else if (obj.y)
			curtop += obj.y;
		return curtop;
	}
	
	function getObj(name){
	 if (document.getElementById)
	 {
		   this.obj = document.getElementById(name);
		   this.style = document.getElementById(name).style;
	 }
	 else if (document.all)
	 {
		   this.obj = document.all[name];
		   this.style = document.all[name].style;
	 }
	 else if (document.layers)
	 {
		   if (document.layers[name])
		   {
		   	this.obj = document.layers[name];
		   	this.style = document.layers[name];
		   }
		   else
		   {
		    this.obj = document.layers.testP.layers[name];
		    this.style = document.layers.testP.layers[name];
		   }
	 }
	}	             

        function switchL3(id, imj){
        var laststatus;
          laststatus = document.getElementById("laststatus").value;
          if(document.getElementById('IMGL3' + id).name == 'arrow_right' || document.getElementById('IMGL3' + id).name == ''){
            document.getElementById('L3' + id).style.display='';
            document.getElementById('IMGL3' + id).src=imj + 'arrow_down.gif';
            document.getElementById('IMGL3' + id).name = 'arrow_down';
            try{
              if(laststatus != 'L3' + id){
                document.getElementById(laststatus).style.display='none';
                document.getElementById('IMG' + laststatus).src=imj + 'arrow_right.gif';
              }
            } catch(e){}

              if(navigator.appName.indexOf('Microsoft') == -1){
                showEventTypes_ns(id);
              } else {
                showEventTypes_ie(id);
              }
          } else {
            document.getElementById('L3' + id).style.display='none';
            document.getElementById('IMGL3' + id).src=imj + 'arrow_right.gif';
            document.getElementById('IMGL3' + id).name = 'arrow_right';
            if(laststatus == 'L3' + id){
              if(navigator.appName.indexOf('Microsoft') == -1){
                showEventTypes_ns("");
              } else {
                showEventTypes_ie("");
              }
            } else {
              if(nav == "ns"){
                showEventTypes_ns(id);
              } else {
                showEventTypes_ie(id);
              }
            }
          }
          document.getElementById("laststatus").value = 'L3' + id;
        }
          function showEventTypes_ns(id){
          var daterowch = 0;
          var isNoDateRow = false;
          daterowar = new Array();
           for(i=0; i < document.getElementsByTagName("tr").length; i++){
             if(document.getElementsByTagName("tr")[i].getAttribute("rowname") == "daterow"){
               daterowar[daterowch] = document.getElementsByTagName("tr")[i];
               daterowch = daterowch + 1;
             }
           }

             // Re-display all rows
             for(j=0; j < daterowar.length; j++){
                    daterowar[j].style.display = "";
                    daterowar[j].nextSibling.nextSibling.style.display = "";
                    for(k=0; k < daterowar[j].childNodes[3].childNodes[1].childNodes[1].childNodes.length; k++){
                      try{
                        if(daterowar[j].childNodes[3].childNodes[1].childNodes[1].childNodes[k].getAttribute("rowname") == "itemrow"){
                          daterowar[j].childNodes[3].childNodes[1].childNodes[1].childNodes[k].style.display = "";
                        } else {
                          daterowar[j].childNodes[3].childNodes[1].childNodes[1].childNodes[k].style.display = "none";
                        }
                      } catch(e){}
                    }
                 }

            if(id != ""){ // To hide the rows
             for(j=0; j < daterowar.length; j++){
                 daterowch = 0;
                 for(k=0; k < daterowar[j].childNodes[3].childNodes[1].childNodes[1].childNodes.length; k++){
                   try{
                    if(daterowar[j].childNodes[3].childNodes[1].childNodes[1].childNodes[k].getAttribute("name") == id){
                      daterowar[j].childNodes[3].childNodes[1].childNodes[1].childNodes[k].style.display = "";
                      daterowch = daterowch + 1;
                    } else {
                      daterowar[j].childNodes[3].childNodes[1].childNodes[1].childNodes[k].style.display = "none";
                    }
                   } catch(e){}
                 }
                  if(daterowch == 0){
                     daterowar[j].style.display = "none";
                     daterowar[j].nextSibling.nextSibling.style.display = "none";
                  }
                 }
              }
            }

        function showEventTypes_ie(id){
          var daterowch = 0;
          daterowar = new Array();
           for(i=0; i < document.getElementsByTagName("tr").length; i++){
             if(document.getElementsByTagName("tr")[i].getAttribute("rowname") == "daterow"){
               daterowar[daterowch] = document.getElementsByTagName("tr")[i];
               daterowch = daterowch + 1;
             }
           }
           // Re-display all rows
           for(j=0; j < daterowar.length; j++){
              daterowar[j].style.display = "";
              daterowar[j].nextSibling.style.display = "";
              for(k=0; k < daterowar[j].childNodes[1].childNodes[0].childNodes[0].childNodes.length; k++){
                try{
                  if(daterowar[j].childNodes[1].childNodes[0].childNodes[0].childNodes[k].getAttribute("rowname") == "itemrow"){
                    daterowar[j].childNodes[1].childNodes[0].childNodes[0].childNodes[k].style.display = "";
                  } else {
                    daterowar[j].childNodes[1].childNodes[0].childNodes[0].childNodes[k].style.display = "none";
                  }
                } catch(e){}
              }
           }
           if(id != ""){// To hide the rows
             for(j=0; j < daterowar.length; j++){
                 daterowch = 0;
                 for(k=0; k < daterowar[j].childNodes[1].childNodes[0].childNodes[0].childNodes.length; k++){

                   try{
                    if(daterowar[j].childNodes[1].childNodes[0].childNodes[0].childNodes[k].getAttribute("name") == id){
                      daterowar[j].childNodes[1].childNodes[0].childNodes[0].childNodes[k].style.display = "";
                      daterowch = daterowch + 1;
                    } else {
                      daterowar[j].childNodes[1].childNodes[0].childNodes[0].childNodes[k].style.display = "none";
                    }
                   } catch(e){}
                 }
                  if(daterowch == 0){
                     daterowar[j].style.display = "none";
                     daterowar[j].nextSibling.style.display = "none";
                  }
                 }
              }
            }

      function newWin(url){
        fixtures = window.open(url,"fixtures","width=750,height=550,left=50,top=50");
      }

     function showDetailPopup(e, obj, id){
        document.getElementById("detailpopup").innerHTML = document.getElementById(id).value;
         if(navigator.appName.indexOf("Microsoft") != -1){
          document.getElementById("detailpopup").style.top = e.clientY + document.body.scrollTop - 25 + "px";
         } else {
            document.getElementById("detailpopup").style.top = e.clientY + window.pageYOffset - 25 + "px";
         }
         document.getElementById("detailpopup").style.left = e.clientX + 10 + "px";
         document.getElementById("detailpopup").style.visibility = 'visible';
     }

     function hideDetailPopup(){
       document.getElementById("detailpopup").style.visibility = 'hidden';
     } 

           function toggleAlert(xHow) {
                var coverDiv = document.getElementById("coverDiv");
                var loadingDiv = document.getElementById("loadingDiv");
                if(xHow){
                var myWidth = 0, myHeight = 0;
                  if( typeof( window.innerWidth ) == 'number' ) {
                    //Non-IE
                    myWidth = window.innerWidth;
                    myHeight = window.innerHeight;
                  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
                    //IE 6+ in 'standards compliant mode'
                    myWidth = document.documentElement.clientWidth;
                    myHeight = document.documentElement.clientHeight;
                  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                    //IE 4 compatible
                    myWidth = document.body.clientWidth;
                    myHeight = document.body.clientHeight;
                  }

                    coverDiv.style.width = myWidth;
                    coverDiv.style.height = myHeight;
                    coverDiv.style.display  = "block";
                    loadingDiv.style.display  = "block";
                } else {
                    coverDiv.style.display  = "none";
                    loadingDiv.style.display  = "none";
                }                                
            }       

