 // this function is needed to work around 
  // a bug in IE related to element attributes
  function hasClass(obj) {
     var result = false;
     if (obj.getAttributeNode("class") != null) {
         result = obj.getAttributeNode("class").value;
     }
     return result;
  }   

 function stripe(id) {

    // the flag we'll use to keep track of 
    // whether the current row is odd or even
    var even = false;
  
    // if arguments are provided to specify the colours
    // of the even & odd rows, then use the them;
    // otherwise use the following defaults:
    var evenColor = arguments[1] ? arguments[1] : "#fff";
    var oddColor = arguments[2] ? arguments[2] : "#eee";
  
    // obtain a reference to the desired table
    // if no such table exists, abort
    var table = document.getElementById(id);
    if (! table) { return; }
    
    // by definition, tables can have more than one tbody
    // element, so we'll have to get the list of child
    // &lt;tbody&gt;s 
    var tbodies = table.getElementsByTagName("tbody");

    // and iterate through them...
    for (var h = 0; h < tbodies.length; h++) {
    
     // find all the &lt;tr&gt; elements... 
      var trs = tbodies[h].getElementsByTagName("tr");
      
      // ... and iterate through them
      for (var i = 0; i < trs.length; i++) {

        // avoid rows that have a class attribute
        // or backgroundColor style
        if (! hasClass(trs[i]) &&
            ! trs[i].style.backgroundColor) {
 		  
          // get all the cells in this row...
          var tds = trs[i].getElementsByTagName("td");
        
          // and iterate through them...
          for (var j = 0; j < tds.length; j++) {
        
            var mytd = tds[j];

            // avoid cells that have a class attribute
            // or backgroundColor style
            if (! hasClass(mytd) &&
                ! mytd.style.backgroundColor) {
        
              mytd.style.backgroundColor =
                even ? evenColor : oddColor;
            
            }
          }
        }
        // flip from odd to even, or vice-versa
        even =  ! even;
      }
    }
  }


function showLiga(liga, jahr) {

	var zeit = jahr.slice(2)
	var bis = parseInt(zeit, 10) + 1 
    var x = '0'
    if (bis > 9) {
        x = ''
    }
	var datum = zeit + x + bis

	var link1 = 'http://' + datum + '.tt-liga.de/'
	var link2 = '/wochenbericht'
	var zielframe = document.getElementById('blockrandom')
	zielframe.setAttribute('src', link1+liga+link2)


}

function teamHistory() {



	var H1 = Array('60011H'  , '000LLNOH', '000LLNOH', '60011H', '60011H' , '000LLNOH')
	var H2 = Array('60021H'  , '60011H'  , '60021H' ,  '60021H', '60021H' , '60021H')
	var H3 = Array('6031H'   , '60032H'  , '60032H' ,  '6031H' , '60032H' , '60032H')
	var H4 = Array('60322H'  , '6031H'   , '6031H'  ,  '6031H' , '6031H'  , '60322H')
	var H5 = Array('60332H'  , '60322H'  , '60322H' ,  '60322H', '60322H' , '60321H')
	//var H6 = Array('60332H'  , '60321H' ,  '60331H', '60321H' , '60332H')
	var D1 = Array('000LLNOD', '000BLND' , '000LLNOD', '000LLNOD', '000LLNOD', '000LLNOD')
	var D2 = Array('60021D'  , '60021D'  , '60032D' ,  '60032D', '60032D' , '60032D')
	//var D3 = Array('60032D'  , '6031D'  ,  '6031D' , '60032D' , '60032D')
	var J1 = Array('60021J'  , '60011J'  , '60011J' ,  '60011J', '60011J' , '60011J')
	var J2 = Array('6031J'   , '60021J'  , '60021J' ,  '60021J', '60031J' , '60031J')
	//var J3 = Array('6031J'   , '6031J'  ,  '6031J' , '6031J'  , '6031J')

	var aktiv = document.getElementById('active_menu').firstChild.nodeValue
	var nummer = aktiv.slice(0, 1)
	var geschlecht = aktiv.slice(3, 4)
	var aktuell = ''
	aktuell = geschlecht + nummer
	linkText = 'Saison: '
	var x = 2009
	for (var i = 0; i < eval(aktuell).length; i++) {
		linkText += '<a href="#" onclick=" showLiga(\'' + eval(aktuell)[i] + '\',\'' + x + '\'); ">' + x + '</a>'
		if ((i+1) < eval(aktuell).length) {
			linkText += ', '
		}
		x -= 1
	}



	var meinFrame = document.getElementById('blockrandom')
	var history = document.createElement('div')
	history.setAttribute('id', 'history')
	history.innerHTML = linkText 
	meinFrame.parentNode.insertBefore(history, meinFrame)

	if (meinFrame) {  
		//meinFrame.setAttribute('src', damals)
		//alert('go')
	}

	
}




