function externalLinks() 

  { 

  if (!document.getElementsByTagName) return; 

  var anchors = document.getElementsByTagName("a"); 

  for (var i=0; i<anchors.length; i++) 

    { 

    var anchor = anchors[i]; 

    if (anchor.getAttribute("href") && 

      anchor.getAttribute("rel") == "external") 

    anchor.target = "_blank"; 

    } 

  }   

window.onload = externalLinks;

// 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;
}

/* colors tables in a striped fashion */
function stripe() {
	var even = false;

	var evenColor = arguments[1] ? arguments[1] : "#FEFAF0";
	var oddColor = arguments[2] ? arguments[2] : "#ffffff";

	var table = document.getElementsByTagName("table");
	if (! table) { return; }

	for(var g=0; g<table.length; g++){  //for all tables
   		var tbodies = table[g].getElementsByTagName("tbody"); //get child tags
		for (var h = 0; h < tbodies.length; h++) {
			var trs = tbodies[h].getElementsByTagName("tr");
			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");
        	  		for (var j = 0; j < tds.length; j++) {         // and iterate through them...
            			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 clearItemFull(obj){

	obj.value = "";
}

function clearItem(obj, val){

	if(obj.value == val)
		obj.value = "";

}

//adds deprecated Target attribute to external links on the fly
function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.href && anchor.rel == "external"){
			anchor.target = "_blank";
		}
	}
} 