// JavaScript Document

var isMSIE = (window.navigator.appName.toLowerCase().indexOf("micro") != -1) ? true : false;
  // this function is need 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;
  }   
  	// this function finds all tables with in the page and styles them with the stripe function.
	function stripeAll(arg){
		var evenColor = arguments[1] ? arguments[1] : "#fff";
   		var oddColor = arguments[2] ? arguments[2] : "#e0e0e0";
		var topColor = arguments[3] ? arguments[3] : "#cfcfcf";
		var contentElem = document.getElementById(arg);
		myTables = contentElem.getElementsByTagName("table");
		for (var i = 0; i < myTables.length; i++) {
			if(myTables[i].className == "zebra") stripe(myTables[i],evenColor,oddColor,topColor); // skin only tables with the class .zebra
		}
	}

 function stripe(id) {
    // the flag we'll use to keep track of 
    // whether the current row is odd or even
    var even = false;
    // find the first row
	var frow = true;
	// if arguments are provided to specify the colours
    // of the even & odd rows, then use the them;
    // otherwise use the following defaults:
    evenColor = arguments[1];
    oddColor = arguments[2];
	topColor = arguments[3];
	// obtain a reference to the desired table
    // if no such table exists, abort
	//var table = document.getElementById(id);
    var table = id;
	if (! table) { return; }
    // clean up table
	table.setAttribute("border", "0");
	table.cellPadding = 0;
	table.cellSpacing = 0;
    // 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 <tr> elements... 
      var trs = tbodies[h].getElementsByTagName("tr");
      // ... and iterate through all <tr>
      for (var i = 0; i < trs.length; i++) {		
         // 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];
		      	if(i == 0) {
					if((tds.length-1) == j) { // end of row
						mytd.setAttribute( isMSIE ? "id" : "class" ,"Table_Title_End");
					} else {
						mytd.setAttribute( isMSIE ? "id" : "class" ,"Table_Title");
					}					
				} else {
					if((tds.length-1) == j) { // end of row
						mytd.setAttribute( isMSIE ? "id" : "class" , even ? "TableRow_EVEN_END" : "TableRow_ODD_END");
					} else {
						mytd.setAttribute( isMSIE ? "id" : "class" , even ? "TableRow_EVEN" : "TableRow_ODD");
					}
				}
          }
        // flip from odd to even, or vice-versa
        even =  ! even;
      }
    }
  }
  
  
function avia_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

