if (document.getElementById && document.images) {

// Globals
	if (typeof rootVirtual == 'undefined') { var rootVirtual = ''; }

// config:  pop-up defaults
	var popClass 	= "popup";
	var popName		= "popWin";
	var popPrefix	= "pup-";
	var popW		= 400;
	var popH		= 300;
	

	
// End configs =============================================================
	


// utilities ------------
	
	function isArray(obj) {
		if (isNaN(obj.length)) { return false; }
		else { return true; }
	}


	/**
	* inArray();
	* Searches array for specified value
	*/
	Array.prototype.inArray = function (value) {
		var i; 
		for (i=0; i < this.length; i++) {
			if (this[i] === value) { return true; } 
		}
		return false; 
	}; 
	
	/**
	* isNumeric();
	* Determines if specified value is numeric -- considers floats numeric
	*/
	function isNumeric(x) {
		var nums = "0123456789.";
		var IsNumber=true;
		var Char;
		for (i = 0; i < x.length && IsNumber == true; i++) {
			Char = x.charAt(i);
			if (nums.indexOf(Char) == -1) { IsNumber = false; }
		}
		return IsNumber;
	}

	/*  addEvent
	*	Example:
	*	addEvent(window, 'load', function() {
	*		document.getElementById('myfield').focus()
	*	});
	*/
	if (typeof addEvent == 'undefined') {
		function addEvent(obj, evType, fn){
			if (obj.addEventListener){
				obj.addEventListener(evType, fn, true);
				return true;
			} else if (obj.attachEvent){
				var r = obj.attachEvent("on"+evType, fn);
				return r;
			} else {
				return false;
			}
		}
	}


	/**
	* popUp();
	* Pop-up window launcher. Used by function popupHandler()
	*/
	function popUp(winURL,t,w,h,s){
		var specs="width="+w+",height="+h+",";
		if (s && s!='') {
			specs += s;
		}
		var scrX=Math.round((screen.width/2)-(w/2));
		var scrY=Math.round((screen.height/2)-(h/2));
		if(scrY>100){
			scrY=scrY-40;
		}
		specs+='top='+scrY+',left='+scrX;
		var win=window.open(winURL,t,specs);
		win.focus();
	}
	


// [ end utilities ] -----------------------------



// [ Custom Handlers ] ----------------------------

	/**
	* popupHandler();
	* Pop-up window launch handler. Keys off of specified CSS classes.
	* Dependency:  function popUp()
	*/
	function popupHandler() { 
	  // ensure required vars are defined
		if (typeof popClass == 'undefined' || popClass == '') 	{ var popClass = 'popup'; }
		if (typeof popName == 'undefined' || popName == '') 	{ var popName = 'popWin'; }
		if (typeof popW == 'undefined' || popW == '') 			{ var popW = 400; }
		if (typeof popH == 'undefined' || popH == '') 			{ var popH = 300; }

		var cl=popClass.length;
		var a=document.getElementsByTagName("a");
		for(var i=0; i<a.length; i++) { 
			var ca=document.getAttribute?a[i].getAttribute("class").split(" "):a[i].className.split(" ");
			if(ca[0]===popClass) { 
				a[i].onclick=function () { 
					var w = popW;  var h = popH; var s='';
					var ca2=document.getAttribute ? this.getAttribute("class").split(" ") : this.className.split(" ");
					for (var i=0; i<ca2.length; i++) {
						if (ca2[i].substring(0,popPrefix.length) === popPrefix) {
							var aaa = ca2[i].substring(popPrefix.length,ca2[1].length);
							c = aaa.split("_");
							for (var z=0; z<c.length; z++) {
								if (c[z].substring(0,1)=='w') { w = c[z].substring(1,c[z].length); }
								else if (c[z].substring(0,1)=='h') { h = c[z].substring(1,c[z].length); }
								else { s += c[z] +"=1,"; }
							}					
						}
					}
					var t=this.getAttribute("target")?this.getAttribute("target"):popName;
					popUp(this.getAttribute("href"),t,w,h,s);
					return false;
				}
			}
		}
	}
	
	
	
	/**
	* _stripeTable
	* Converts ALA's "Zebra Tables" to unobtrusive implementation keying off of CSS class applied to table.
	* @param stripeClass string CSS class name to key off of.  Defaults to "stripe"; override with a global var.
	*/
	function _stripeTable() {
		if (typeof stripeClass == 'undefined' || stripeClass == '')  { var stripeClass = 'stripe'; }
		var tables = document.getElementsByTagName("table");
		var tableId;
		for (i=0; i<tables.length; i++) {
			var tc=document.getAttribute ? tables[i].getAttribute("class").split(" ") : tables[i].className.split(" ");
			for (ii=0; ii<tc.length; ii++) {
				if (tc[ii] == stripeClass) {
					if (tableId = tables[i].getAttribute("id")) {  // make sure we can find the blighter
						stripe(tableId);
					}
				}
			} // end for: CSS check
		} // end for: tables check
	} // Ende
	

	// [ Table Striper ] ----------------------------------------
	/*
	@source	http://www.alistapart.com/articles/zebratables/
	@usage
			<table id="MyStuff">
			<tr>
				<td> One </td>
			</tr>
			<tr>
				<td> Two </td>
			</tr>
			</table>
	
			<script type="text/javascript">
			//<![CDATA[
				stripe('MyStuff'); // use script defaults
				// OR:  specify custom
				// stripe('MyStuff', '#fff', '#edf3fe');
			//]]>
			</script>
	
	*/
	
	function hasClass(obj) {  // required work around for IE bug
	   var result = false;
	   if (obj.getAttributeNode("class") != null) {result = obj.getAttributeNode("class").value;}
	   return result;
	}   
	
	function stripe(id) {
	  var even = false;
	  var evenColor = arguments[1] ? arguments[1] : "#eeeeee";
	  var oddColor = arguments[2] ? arguments[2] : "#ffffff";
	
	  var table = document.getElementById(id);
	  if (! table) { return; }
	  var tbodies = table.getElementsByTagName("tbody");
	  for (var h = 0; h < tbodies.length; h++) {
	    var trs = tbodies[h].getElementsByTagName("tr");
	    for (var i = 0; i < trs.length; i++) {
	   if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
	        var tds = trs[i].getElementsByTagName("td");
	        for (var j = 0; j < tds.length; j++) {
	          var mytd = tds[j];
	       		if (! hasClass(mytd) && ! mytd.style.backgroundColor) { mytd.style.backgroundColor = even ? evenColor : oddColor; }
		  } }
	      even =  ! even;
	} } }
	
	// -- end table striper -------------------


	


// INITS ===============

	addEvent(window, 'load', _stripeTable);
	addEvent(window, 'load', popupHandler);

} // close Object tests
// [ END FILE ]