
/* ---------------- tmv authored scripts for minor DOM and style fixes------------------ */


if (navigator.appName=="Microsoft Internet Explorer") var isIE=true;
	

function adjustHeights(obj,h) {
	obj.each(function(el){
		el.parentNode.style.height=h;
	})
}


/* this affects all tables on a page 
	c is the hex color of the background for odd rows */
function alternatingTDs(c) {
	/* extend lines for IE7 by adding nbsp's */
	$$('table td').each(function(el){
		if (el.innerHTML=='') el.innerHTML ='&nbsp;';
	});
	/* if c is empty, use a default color */
	if (!c) c='#222';
	/* change bg for alternating rows */
	var wRow='';
	$$('table').each(function(el){
		wRow='odd';
		$$('tr').each(function(ele){
			if (wRow=='even') {ele.style.backgroundColor=c;  wRow ='odd'; }
			else wRow = 'even';
		});
	});
}





/* adds effects to regisration filters and/or in-page navigation */
function addColorChange(nav,col) {
	if (navigator.appName=="Microsoft Internet Explorer") var isIE=true;

	// if nav exists, fade in bgcolor on nav element
	if (nav) {
		nav.each(function(el){
			if(isIE) el.style.backgroundColor=col; 
				else el.tween('background-color',col);
		});
	}
}



/* sets the effects for alumni page */
function setupEffects(nav,obj) {
	if (navigator.appName=="Microsoft Internet Explorer") var isIE=true;
	// fade in the main object in mozilla
	if (!isIE) {
		if(obj) { obj.fade('hide');	obj.fade('in'); }
		if(nav) nav.tween('background-color', '#7aaa3a');		
	}
}



/*  NOT USED - keeping here just in case */
/* made for Alumni pages only right now, will abstract for multi-use soon */

function setupPaging(nav,obj) {
	if (navigator.appName=="Microsoft Internet Explorer") var isIE=true;
	var HL = '#7aaa3a';
	var norm = '#123';
//	obj[0].fade('hide');
//	obj[0].fade('in');
	nav.each(function(el){
		el.addEvent('click', function(){ 
			obj.each(function(el){el.style.display='none'});
			$(el.innerHTML).style.display='block';
			$(el.innerHTML).fade('hide');
			$(el.innerHTML).fade('in');
			nav.each(function(ele){
				if(isIE) ele.style.backgroundColor=norm;
					else ele.tween('background-color',norm);
			});
			if(isIE) this.style.backgroundColor=HL;
				else this.tween('background-color',HL);
		});
	});
}



/*
  MooPop: unobtrusive javascript popups via late binding using mootools 1.2
  copyright (c) 2007-2008 by gonchuki - http://blog.gonchuki.com
  version:	1.1
  released: June 23, 2008
  This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    http://creativecommons.org/licenses/by-sa/3.0/
*/ var moopop={width:0,height:0,captureByRel:function(attrVal,parent){this.capture((parent||document).getElements('a[rel*='+(attrVal||'popup')+']'));},capture:function(el,width,height){if($defined(width)&&$defined(height)){this.width=width;this.height=height;}
switch($type(el)){case'string':el=$$(el);case'element':case'array':$splat(el).each(this.add_pop_to,this);}
this.width=null;this.height=null;},add_pop_to:function(el){el.addEvent('click',function(e){e.stop();this.popup(el);}.bind(this));var size=el.get('rel').match(/\[(\d+),\s*(\d+)/)||['',this.width,this.height];var resizable=el.get('rel').match(/,(r)/)||[];if(size[1])el.store('popupprops','width='+size[1]+', height='+size[2]+(resizable[1]?', resizable=yes':'')+',scrollbars=yes');},popup:function(el){window.open(el.get('href'),el.get('name')||'',el.retrieve('popupprops')||'');}};
