/**
* Application specific JS code
*
* Built with mootools 1.2b Should be compatible with Full 1.2 once complete.
*
* Documentation at: http://docs12b.mootools.net/
*
* NOT compatible with 1.1  uses too many new shortcuts and wide use of CSS3 selectors / Element.Storage
*
* @revision $Rev: 346 $
*/
var MAYTREE = {};

/**
 * Loader.
 *
 * Runs init() method on each child object.
 */
MAYTREE.init = function() {
	var htmlEl = document.getElementsByTagName('html');
	htmlEl[0].className = 'js';
	for (prop in this) {
		if (typeof this[prop].init == 'function') {
			this[prop].init();
		}
	}
}

/**
 * General Form highlighting and help box showing.
 *
 */
MAYTREE.forms = {
	init : function() {
		$$('input[type=text], input[type=radio], input[type=password], textarea, select').each(function(item){
			this.activate(item);
		}.bind(this));
	},

	//Activate Form field highlighting
	activate : function(element){
		element.addEvents({
			'focus' : this.active,
			'blur' : this.deactive
		});
		element.getParent().addEvents({
			'mouseenter' : this.active.bind(element),
			'mouseleave' : this.deactive.bind(element)
		});
	},
	//highlights on
	active : function(){
		var parent = this.getParent();
		parent.addClass('active');
		var fieldHint = parent.getChildren('.field-hint');
		if (fieldHint) {
			fieldHint.set('tween', {duration: 250});
			fieldHint.tween('opacity', 1);
		}
	},

	//hightlights off
	deactive : function(event){
		var parent = this.getParent();
		parent.removeClass('active');
		var fieldHint = parent.getChildren('.field-hint');
		if (fieldHint) {
			fieldHint.tween('opacity', 0);
		}
	}

};

/**
 * Create interactive Multi row forms.
 *
 * Implements Templates and MultiForm Classes.
 *
 *
 */
MAYTREE.templates = {
	init : function() {
		//Callback to activate form helpers on form widgets.
		var activateCallback = function() {
			var inputs = $(this).getElements('input[type=text], select, textarea');
			for (i=0; i < inputs.length; i++) {
				MAYTREE.forms.activate(inputs[i]);
			}
		}

		if ($('publication-template')) {
			var count = $('publication-container').getElements('.line-block').length;
			//Use Callback to attach events to append Element block
			var PublicationForm = new multiForm('publication-template', {
					addButton : 'add-publication',
					container : 'publication-container',
					counter : count,
					onComplete : activateCallback
			});
		}
		if ($('education-template')) {
			var count = $('education-container').getElements('.line-block').length;
			//Use Callback to attach events to append Element block
			var EducationForm = new multiForm('education-template', {
					addButton : 'add-education',
					container : 'education-container',
					counter : count,
					onComplete : activateCallback
			});
		}
		if ($('org-affiliation-template')) {
			var count = $('org-affiliation-container').getElements('.line-block').length;
			//Use Callback to attach events to append Element block
			var PublicationForm = new multiForm('org-affiliation-template', {
					addButton : 'add-org-affiliation',
					container : 'org-affiliation-container',
					counter : count,
					onComplete : activateCallback
			});
		}
		if ($('media-citation-template')) {
			var count = $('media-citation-container').getElements('.line-block').length;
			//Use Callback to attach events to append Element block
			var MediaCitationForm = new multiForm('media-citation-template', {
					addButton : 'add-media-citation',
					container : 'media-citation-container',
					counter : count,
					onComplete : activateCallback
			});
		}
	}
};
/**
 * Areas of Expertise behavior.
 *
 *
 */
MAYTREE.areaOfExpertise = {
	addButton : null,
	selectBox : null,
	textField : null,
	selectedOptions : null,
	observer : null,
	maxObjects : 10,
	/**
	 * Start up the form elements.
	 *
	 */
	init : function() {
		var selectedOptions = $('expertise-list');
		if (!selectedOptions) {
			return;
		}
		if (window.ExpertiseMax != undefined) {
			this.maxObjects = window.ExpertiseMax.toInt();
		}
		this.selectedOptions = selectedOptions;
		this.addButton = $('add-expertise-button');
		this.selectBox = $('expertise-options');
		this.textField = $('expertise-new');
		this.observer = new Observer(this.textField, this.filterOptions.bind(this), {delay : 500 });

		//clear select box on focus, so random elements aren't added.
		this.textField.addEvent('focus', function() {
			this.selectBox.getElements('option').set('selected', false)
		}.bind(this));

		this.addButton.addEvent('click', MAYTREE.areaOfExpertise.sendAddForm);
		this.selectBox.addEvent('dblclick', MAYTREE.areaOfExpertise.addOption);
		this.elementCount = this.selectedOptions.getElements('li').length;
		if (this.elementCount > 0) {
			this.addDeleteEvents();
		}
		this.resetElements();
		if (this.elementCount >= this.maxObjects) {
			this.disableElements();
			return false;
		}
	},
	/**
	 * Handle the click actions and do the ajax update.
	 *
	 */
	sendAddForm : function(e) {
		//stop the form submit.
		var extendedForm = $(this.form);
		extendedForm.addEvent('submit', $lambda(false));
		var queryString = extendedForm.toQueryString() + '&add-expertise';

		if (MAYTREE.areaOfExpertise.textField.get('value') != '') {
			MAYTREE.areaOfExpertise.textField.addClass('loading');

			var listRequest = new Request({
				url : baseUrl + '/expertises/createNew',
				onSuccess : MAYTREE.areaOfExpertise.updateList.bind(MAYTREE.areaOfExpertise)
			});
			listRequest.send(queryString);

			MAYTREE.areaOfExpertise.textField.set('value', '');
		}
	},
	/**
	 * Filter the existing list of options as typing occurs.
	 *
	 */
	filterOptions : function(list) {
		var value = this.textField.get('value').toLowerCase();
		var allOptions = this.selectBox.getElements('option');
		var optionValues = allOptions.get('text');
		optionValues.each(function(option) {
			if (option.toLowerCase().contains(value)) {
				allOptions[optionValues.indexOf(option)].setStyle('display', 'block');
			} else {
				allOptions[optionValues.indexOf(option)].setStyle('display', 'none');
			}
		});
	},
	/**
	 * Update the list with new elements.
	 *
	 */
	updateList : function(responseText, responseXml) {
		var jsonResponse = JSON.decode(responseText);
		var empty = true;
		for (var i = 0, len = jsonResponse.length; i < len; i++) {
			var el = jsonResponse[i];
			this.addExpertise(el, empty);
			empty = false;
		}
		this.textField.removeClass('loading');
		this.addDeleteEvents();
		this.resetElements();
	},
	/**
	 * Add delete element events to delete buttons.
	 *
	 */
	addDeleteEvents : function(container) {
		if (container == undefined) {
			var container = this.selectedOptions;
		}
		container.getElements('a').addEvent('click', function(e) {
			e = new Event(e).stop();
			$(this).getParent().destroy();
			MAYTREE.areaOfExpertise.elementCount--;
			if (MAYTREE.areaOfExpertise.elementCount < MAYTREE.areaOfExpertise.maxObjects) {
				MAYTREE.areaOfExpertise.enableElements();
			}
		});
	},
	/**
	 * Double click event handler.  Adds an option into the selected list.
	 *
	 */
	addOption : function() {
		var currentValue = this.get('value');
		var optionName = this.getElement('option[value=' + currentValue + ']').get('text');
		var bound = MAYTREE.areaOfExpertise.addExpertise.bind(MAYTREE.areaOfExpertise);
		bound({name : optionName, id : currentValue});
		MAYTREE.areaOfExpertise.addDeleteEvents();
		MAYTREE.areaOfExpertise.resetElements();
	},
	/**
	 * Reset all form elements once a selection is done.
	 *
	 */
	resetElements : function() {
		this.selectBox.getElements('option').set('selected', false).setStyle('display', 'block');
		this.textField.set('value', '');
		$(this.selectBox.form).removeEvents('submit');
	},
	/**
	 * Select element double click handler.
	 * Add an li to the ul element.
	 *
	 */
	addExpertise : function(valuesObj, empty) {
		valuesObj.i = this.elementCount;
		var innerHtml = '{name} <a href="#null" class="remove-expertise-{id}">Remove</a>' +
			'<input type="hidden" name="data[Expertise][{i}][id]" value="{id}" />'
		innerHtml = innerHtml.substitute(valuesObj);
		var liElement = new Element('li', {html : innerHtml});
		this.selectedOptions.adopt(liElement);
		this.elementCount++;
		if (this.elementCount >= this.maxObjects) {
			this.disableElements();
			return false;
		}
	},
	/**
	 * Disable form elements when maxObjects has been reached
	 *
	 */
	disableElements : function() {
		this.addButton.set('disabled', true);
		this.selectBox.set('disabled', true);
		this.textField.set('disabled', true);
	},
	/**
	 * Enable the form elements once element count is lower than maxObjects
	 *
	 */
	enableElements : function() {
		this.addButton.set('disabled', false);
		this.selectBox.set('disabled', false);
		this.textField.set('disabled', false);
	}
};

MAYTREE.candidates = {
	init : function(){
		var button = $('view-candidate-info');
		if (!button) {
			return;
		}
		var container = button.getParent().getNext();
		button.addEvent('click', function(e) {
			e = new Event(e).stop();
			AjaxTools.dim(container);
			this.set('load', {
				method : 'get',
				update : container,
				onComplete : function() {
					button.destroy();
				}
			}).load(this.get('href'));
		});
	}
}

/**
 * Collapsing Elements
 *
 * Creates widgets that slide open and closed on a button event
 *
 */
MAYTREE.collapsers = {
	init : function() {
		$$('.collapse .content').each(function(panel){
			var panelHeight = panel.getStyle('height');
			panel.store('originalHeight', panelHeight);
			var panelFx = new Fx.Tween(panel, {duration: 'short'});
			panelFx.set('height', 0);
			panel.store('closed', true);

			var button = panel.getParent().getElement('a.view');
			button.addEvent('click', function(e) {
				e = new Event(e).stop();
				//use closure reference to copy to local scope
				var _panel = panel;
				var _panelFx = panelFx;
				if (_panel.retrieve('closed')) {
					var nextHeight = _panel.retrieve('originalHeight');
					_panel.store('closed', false);
				} else {
					var nextHeight = 0;
					_panel.store('closed', true);
				}
				_panelFx.start('height', nextHeight);
			})
		});
	}
};
/**
 * Quick Search
 *
 * Has Cookie to remember open / closed state
 *
 */
MAYTREE.quickSearch = {
	cookieLife : 100,
	init : function(){
		var quickSearch = $('quick-search');
		if (!quickSearch) return false;
		this.Cookie = new AjaxTools.Cookie( {name : 'quickSearch'});

		//check for quicksearch cookie
		var state = this.Cookie.read('quickSearch')
		if (state == false || state == 'open') {
			var panel = quickSearch.getElement('div.content');
			var originalHeight = panel.retrieve('originalHeight');
			panel.setStyle('height', originalHeight);
		}
		//assign button handlers to write cookies for quick search.
		quickSearch.getElement('.summary-header a.view').addEvent('click', this.remember);
	},
	remember: function(e){
		var panel = this.getParent().getNext();
		var state = (panel.retrieve('closed')) ? 'closed' : 'open';
		MAYTREE.quickSearch.Cookie.write('quickSearch', state);
	}
};


/**
 * Attach Wysiwyg Editors.
 *
 */
MAYTREE.editors = {
	init : function() {
		var editors = $$('.moo-editable').mooEditable( {
				buttons: 'bold,italic,|,insertunorderedlist,insertorderedlist,indent,outdent,|,undo,redo,|,toggleview'
		});
	}
}
/**
 * Text Area / input count down elements.
 *
 */

 MAYTREE.textCounter = {
 	init : function() {
 		$$('.letter-count-down .counter').each(function(counter) {
 			var textbox = counter.getParent().getParent().getElement('textarea');

 			textbox.addEvent('keyup', function() {
 				MAYTREE.textCounter.updateTotal(this, counter);
 			});

 			textbox.addEvent('mouseup', function() {
				updateOnTime.delay(1500);
 			});

 			this.updateTotal(textbox, counter);
 		}, this);
 	},
 	updateTotal : function(textarea, counter) {
 		var maxLength = textarea.get('maxLength');
 		var currentLength = textarea.get('value').length;
 		if (currentLength >= maxLength) {
 			textarea.value = textarea.get('value').substring(0, maxLength);
			if (currentLength > maxLength) {
				$('character-warning').set('styles', {
						'display' : 'block'
				});
			}
 			counter.set('text', 0);
 		} else {
 			counter.set('text', maxLength - currentLength);
			$('character-warning').set('styles', {
					'display' : 'none'
			});
 		}
 	}
 };

var updateOnTime = function() {
var textarea = $('CandidateBio');
var counter = $$('.letter-count-down .counter');
var maxLength = textarea.get('maxLength');
 		var currentLength = textarea.get('value').length;
 		if (currentLength >= maxLength) {
 			textarea.value = textarea.get('value').substring(0, maxLength);
			if (currentLength > maxLength) {
				$('character-warning').set('styles', {
						'display' : 'block'
				});
			}
 			counter.set('text', 0);
 		} else {
 			counter.set('text', maxLength - currentLength);
			$('character-warning').set('styles', {
					'display' : 'none'
			});
 		}
 	};
/**
 * Attach Window Event and load everything
 *
 */
window.addEvent('domready', function() {
	MAYTREE.init();
});





/**
 * Canditates => browse by category tooltip script
 *
 */
var ua = navigator.userAgent
var ps = navigator.productSub 
var dom = (document.getElementById)? 1:0
var ie4 = (document.all&&!dom)? 1:0
var ie5 = (document.all&&dom)? 1:0
var nn4 =(navigator.appName.toLowerCase() == "netscape" && parseInt(navigator.appVersion) == 4)
var nn6 = (dom&&!ie5)? 1:0
var sNav = (nn4||nn6||ie4||ie5)? 1:0
var cssFilters = ((ua.indexOf("MSIE 5.5")>=0||ua.indexOf("MSIE 6")>=0)&&ua.indexOf("Opera")<0)? 1:0
var Style=[],Text=[],Count=0,sbw=0,move=0,hs="",mx,my,scl,sct,ww,wh,obj,sl,st,ih,iw,vl,hl,sv,evlh,evlw,tbody
var HideTip = "eval(obj+sv+hl+';'+obj+sl+'=0;'+obj+st+'=-800')"
var doc_root = ((ie5&&ua.indexOf("Opera")<0||ie4)&&document.compatMode=="CSS1Compat")? "document.documentElement":"document.body"
var PX = (nn6)? "px" :"" 

if(sNav) {
	window.onresize = ReloadTip
	document.onmousemove = MoveTip
	if(nn4) document.captureEvents(Event.MOUSEMOVE) 
}	
if(nn4||nn6) {
	mx = "e.pageX"
	my = "e.pageY"
	scl = "window.pageXOffset"
	sct = "window.pageYOffset"	
	if(nn4) {
		obj = "document.TipLayer."
		sl = "left"
		st = "top"
		ih = "clip.height"
		iw = "clip.width"
		vl = "'show'"
		hl = "'hide'"
		sv = "visibility="
	}
	else obj = "document.getElementById('TipLayer')."
} 
if(ie4||ie5) {
	obj = "TipLayer."
	mx = "event.x"
	my = "event.y"
	scl = "eval(doc_root).scrollLeft"
	sct = "eval(doc_root).scrollTop"
	if(ie5) {
		mx = mx+"+"+scl 
		my = my+"+"+sct
	}
}
if(ie4||dom){
	sl = "style.left"
	st = "style.top"
	ih = "offsetHeight"
	iw = "offsetWidth"
	vl = "'visible'"
	hl = "'hidden'"
	sv = "style.visibility="
}
if(ie4||ie5||ps>=20020823) {
	ww = "eval(doc_root).clientWidth"
	wh = "eval(doc_root).clientHeight"
}	 
else { 
	ww = "window.innerWidth"
	wh = "window.innerHeight"
	evlh = eval(wh)
	evlw = eval(ww)
	sbw=15
}	

function applyCssFilter(){
	if(cssFilters&&FiltersEnabled) { 
		var dx = " progid:DXImageTransform.Microsoft."
		TipLayer.style.filter = "revealTrans()"+dx+"Fade(Overlap=1.00 enabled=0)"+dx+"Inset(enabled=0)"+dx+"Iris(irisstyle=PLUS,motion=in enabled=0)"+dx+"Iris(irisstyle=PLUS,motion=out enabled=0)"+dx+"Iris(irisstyle=DIAMOND,motion=in enabled=0)"+dx+"Iris(irisstyle=DIAMOND,motion=out enabled=0)"+dx+"Iris(irisstyle=CROSS,motion=in enabled=0)"+dx+"Iris(irisstyle=CROSS,motion=out enabled=0)"+dx+"Iris(irisstyle=STAR,motion=in enabled=0)"+dx+"Iris(irisstyle=STAR,motion=out enabled=0)"+dx+"RadialWipe(wipestyle=CLOCK enabled=0)"+dx+"RadialWipe(wipestyle=WEDGE enabled=0)"+dx+"RadialWipe(wipestyle=RADIAL enabled=0)"+dx+"Pixelate(MaxSquare=35,enabled=0)"+dx+"Slide(slidestyle=HIDE,Bands=25 enabled=0)"+dx+"Slide(slidestyle=PUSH,Bands=25 enabled=0)"+dx+"Slide(slidestyle=SWAP,Bands=25 enabled=0)"+dx+"Spiral(GridSizeX=16,GridSizeY=16 enabled=0)"+dx+"Stretch(stretchstyle=HIDE enabled=0)"+dx+"Stretch(stretchstyle=PUSH enabled=0)"+dx+"Stretch(stretchstyle=SPIN enabled=0)"+dx+"Wheel(spokes=16 enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=0,motion=forward enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=0,motion=reverse enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=1,motion=forward enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=1,motion=reverse enabled=0)"+dx+"Zigzag(GridSizeX=8,GridSizeY=8 enabled=0)"+dx+"Alpha(enabled=0)"+dx+"Dropshadow(OffX=3,OffY=3,Positive=true,enabled=0)"+dx+"Shadow(strength=3,direction=135,enabled=0)"
	}
}

function stm(t,s) {
  if(sNav) {
  	if(t.length<2||s.length<25) {
		var ErrorNotice = "DHTML TIP MESSAGE VERSION 1.2 ERROR NOTICE.\n"
		if(t.length<2&&s.length<25) alert(ErrorNotice+"It looks like you removed an entry or more from the Style Array and Text Array of this tip.\nTheir should be 25 entries in every Style Array even though empty and 2 in every Text Array. You defined only "+s.length+" entries in the Style Array and "+t.length+" entry in the Text Array. This tip won't be viewed to avoid errors")
		else if(t.length<2) alert(ErrorNotice+"It looks like you removed an entry or more from the Text Array of this tip.\nTheir should be 2 entries in every Text Array. You defined only "+t.length+" entry. This tip won't be viewed to avoid errors.")
		else if(s.length<25) alert(ErrorNotice+"It looks like you removed an entry or more from the Style Array of this tip.\nTheir should be 25 entries in every Style Array even though empty. You defined only "+s.length+" entries. This tip won't be viewed to avoid errors.")
 	}
  	else {
		var ab = "" ;var ap = ""
		var titCol = (s[0])? "COLOR='"+s[0]+"'" : ""
		var txtCol = (s[1])? "COLOR='"+s[1]+"'" : ""
		var titBgCol = (s[2])? "BGCOLOR='"+s[2]+"'" : ""
		var txtBgCol = (s[3])? "BGCOLOR='"+s[3]+"'" : ""
		var titBgImg = (s[4])? "BACKGROUND='"+s[4]+"'" : ""	
		var txtBgImg = (s[5])? "BACKGROUND='"+s[5]+"'" : ""
		var titTxtAli = (s[6] && s[6].toLowerCase()!="left")? "ALIGN='"+s[6]+"'" : ""
		var txtTxtAli = (s[7] && s[7].toLowerCase()!="left")? "ALIGN='"+s[7]+"'" : ""   
		var add_height = (s[15])? "HEIGHT='"+s[15]+"'" : ""
		if(!s[8])  s[8] = "Verdana,Arial,Helvetica"
		if(!s[9])  s[9] = "Verdana,Arial,Helvetica"					
		if(!s[12]) s[12] = 1
		if(!s[13]) s[13] = 1
		if(!s[14]) s[14] = 200
		if(!s[16]) s[16] = 0
		if(!s[17]) s[17] = 0
		if(!s[18]) s[18] = 10
		if(!s[19]) s[19] = 10
		hs = s[11].toLowerCase() 
		if(ps==20001108){
		if(s[2]) ab="STYLE='border:"+s[16]+"px solid"+" "+s[2]+"'"
		ap="STYLE='padding:"+s[17]+"px "+s[17]+"px "+s[17]+"px "+s[17]+"px'"}


		var closeLink=(hs=="sticky")? "<TD ALIGN='right'><FONT SIZE='"+s[12]+"' FACE='"+s[8]+"'><A HREF='javascript:void(0)' ONCLICK='stickyhide()' STYLE='text-decoration:none;color:"+s[0]+"'><small>CLOSE</small></A></FONT></TD>":""


		var title=(t[0]||hs=="sticky")? "" : ""
//  var title=(t[0]||hs=="sticky")? "<TABLE WIDTH='100%' BORDER='0' CELLPADDING='0' CELLSPACING='0'><TR><TD "+titTxtAli+"><FONT SIZE='"+s[12]+"' FACE='"+s[8]+"' "+titCol+"><B>"+t[0]+"</B></FONT></TD></TR></TABLE>" : ""
		
		
		var txt="<div id='tips' style='WIDTH:"+s[14]+";margin:5;background:"+s[3]+";'>"+t[1]+"</div>"
		if(nn4) {
			with(eval(obj+"document")) {
				open()
				write(txt)
				close()
			}
		}
		else eval(obj+"innerHTML=txt")
		tbody = {
			Pos:s[10].toLowerCase(), 
			Xpos:s[18],
			Ypos:s[19], 
			Transition:s[20],
			Duration:s[21], 
			Alpha:s[22],
			ShadowType:s[23].toLowerCase(),
			ShadowColor:s[24],
			Width:parseInt(eval(obj+iw)+3+sbw)
		}
		if(ie4) { 
			TipLayer.style.width = s[14]
	 		tbody.Width = s[14]
		}
		Count=0	
		move=1
 	 }
  }
}

function MoveTip(e) {
	if(move) {
		var X,Y,MouseX = eval(mx),MouseY = eval(my); tbody.Height = parseInt(eval(obj+ih)+3)
		tbody.wiw = parseInt(eval(ww+"+"+scl)); tbody.wih = parseInt(eval(wh+"+"+sct))
		switch(tbody.Pos) {
			case "left" : X=MouseX-tbody.Width-tbody.Xpos; Y=MouseY+tbody.Ypos; break
			case "center": X=MouseX-(tbody.Width/2); Y=MouseY+tbody.Ypos; break
			case "float": X=tbody.Xpos+eval(scl); Y=tbody.Ypos+eval(sct); break	
			case "fixed": X=tbody.Xpos; Y=tbody.Ypos; break		
			default: X=MouseX+tbody.Xpos; Y=MouseY+tbody.Ypos
		}

		if(tbody.wiw<tbody.Width+X) X = tbody.wiw-tbody.Width
		if(tbody.wih<tbody.Height+Y+sbw) {
			if(tbody.Pos=="float"||tbody.Pos=="fixed") Y = tbody.wih-tbody.Height-sbw
			else Y = MouseY-tbody.Height
		}
		if(X<0) X=0 
		eval(obj+sl+"=X+PX;"+obj+st+"=Y+PX")
		ViewTip()
	}
}

function ViewTip() {
  	Count++
	if(Count == 1) {
		if(cssFilters&&FiltersEnabled) {	
			for(Index=28; Index<31; Index++) { TipLayer.filters[Index].enabled = 0 }
			for(s=0; s<28; s++) { if(TipLayer.filters[s].status == 2) TipLayer.filters[s].stop() }
			if(tbody.Transition == 51) tbody.Transition = parseInt(Math.random()*50)
			var applyTrans = (tbody.Transition>-1&&tbody.Transition<24&&tbody.Duration>0)? 1:0
			var advFilters = (tbody.Transition>23&&tbody.Transition<51&&tbody.Duration>0)? 1:0
			var which = (applyTrans)?0:(advFilters)? tbody.Transition-23:0 
			if(tbody.Alpha>0&&tbody.Alpha<100) {
	  			TipLayer.filters[28].enabled = 1
	  			TipLayer.filters[28].opacity = tbody.Alpha
			}
			if(tbody.ShadowColor&&tbody.ShadowType == "simple") {
	  			TipLayer.filters[29].enabled = 1
	  			TipLayer.filters[29].color = tbody.ShadowColor
			}
			else if(tbody.ShadowColor&&tbody.ShadowType == "complex") {
	  			TipLayer.filters[30].enabled = 1
	  			TipLayer.filters[30].color = tbody.ShadowColor
			}
			if(applyTrans||advFilters) {
				eval(obj+sv+hl)
	  			if(applyTrans) TipLayer.filters[0].transition = tbody.Transition
	  			TipLayer.filters[which].duration = tbody.Duration 
	  			TipLayer.filters[which].apply()
			}
		}
 		eval(obj+sv+vl)
		if(cssFilters&&FiltersEnabled&&(applyTrans||advFilters)) TipLayer.filters[which].play()
		if(hs == "sticky") move=0
  	}
}

function stickyhide() {
	eval(HideTip)
}

function ReloadTip() {
	 if(nn4&&(evlw!=eval(ww)||evlh!=eval(wh))) location.reload()
	 else if(hs == "sticky") eval(HideTip)
}

function htm() {
	if(sNav) {
		if(hs!="keep") {
			move=0; 
			if(hs!="sticky") eval(HideTip)
		}	
	} 
}

/*
 * DHTML tip message version 1.2 copyright Essam Gamal 2003 (http://migoicons.tripod.com, migoicons@hotmail.com) Created on : 06/03/2003 Script featured on and can be found at Dynamic Drive (http://www.dynamicdrive.com)
 * end tooltop
 */


