// /*
// 	KND Function Library
// 	Version 1.0
// 	
// */
// 
// 
// 
// // // Developer Functions { sets up html console and key trigger }
// // function cl(message) {
// // 	if ($('console')){
// // 		$('console').appendText(message);
// // 		var breaker = new Element('br');
// // 		$('console').adopt(breaker);
// // 		 try {
// // 			var consoleScroll = new Fx.Scroll($('console')).toBottom();
// // 		 } catch(err) { alert(err); }
// // 	}	
// // }
// // 
// // function initDevTools() {
// // 	Event.Keys.control = 192;
// // 	window.addEvent( 'keydown', function( evt ){ 
// // 	if(evt.key == "control") 
// // 		$('adminTools').toggleClass('inactive');
// // 		$('container').toggleClass('console');
// // 	}); 
// // 	if($('devBtn')) {
// // 		$('devBtn').addEvent('click', function(){
// // 			$('adminTools').toggleClass('inactive');
// // 			$('devBtn').toggleClass('down');
// // 		})
// // 	}
// // 	
// // }
// 
// window.addEvent('domready', function(){ initDevTools();	cl('domready'); });
// 
// // Frontend Visual Effects
// 
// //Input Value fade in and out (with previous value if unchanged)
// function initInputFields() {		
// 	//$(document.body).getElements('input[type=text]').each(function(item, index) {
// 	$$('.search').each(function(item, index) {
// 			item.set('defaultValue', item.get('value'));
// 			item.addEvents({
// 				'focus': function() {
// 					if (item.get('value') == item.get('defaultValue')) {
// 						this.set('value', '');
// 					}
// 				},
// 					'blur': function() {
// 					if (item.get('value') == '') {
// 						this.setStyle('color','#fff');
// 						this.set('value', item.get('defaultValue'));
// 						this.tween('color','#7a7a7a');
// 						}
// 					}
// 				});
// 		});
// }
// window.addEvent('domready', function() {initInputFields();})
// 
// 
// // Zebra Striping, (container first, then the elements to be given the odd & even classes)
// function zebraStripe(container, alternator) { 
// 		container.getElements(alternator).each(function(el,i) {
// 		//do regular shading
// 		var _class = i % 2 ? 'even' : 'odd'; 
// 		el.addClass(_class);
// 	});		
// }
// function zebraTables() { $$('.zebraTable').each(function(table){ zebraStripe(table,'tr'); });} // Zebra Stripe all tables with the .zebraTable class. requires knd-lib.js
// 
// 
// 
// // Default 3 State Button Events
// function initBtn(button) { 
// 	button.addEvents({
// 		mouseup: function() {this.removeClass('down');},
// 	//	mouseout: function() {this.setStyle('background-position','left');},
// 	//	mouseover: function() {this.setStyle('background-position','center');},
// 		mousedown: function() {this.addClass('down');}
// 	});
// }
// 
// // Function to filter via a search string
// function inlineFilter(container, query, targetFields) {
// 	switch(targetFields) {
// 		case undefined:
// 			targetFields = 'p, span, td, input, h1, h2, h3, h4, h5';
// 			break;
// 		case '':
// 			targetFields = 'p, span, td, input, h1, h2, h3, h4, h5';
// 			break;	
// 		case null:
// 			targetFields = 'p, span, td, input, h1, h2, h3, h4, h5';
// 			break;			
// 		default:
// 			break;		
// 	}
// 	cl('searching for '+query+' in '+container.id+"\'s "+targetFields);
// 	query = query.capitalize();
// 	query = query.clean();
// 	cl('searchingPage for '+query);
// 	searchables = container.getElements('.searchable');
// 	searchables.each(function(searchable){
// 		var textBlob = "";
// 		searchable.getElements(targetFields).each(function(snippet){
// 			textBlob = textBlob + snippet.get('text') + ' ';
// 		});
// 		textBlob = textBlob.capitalize(); 
// 		textBlob = textBlob.clean();
// 		searchResultBool = textBlob.contains(query);	
// 		switch(searchResultBool) {
// 			case true:
// 				cl('search result: '+textBlob);
// 				searchable.setStyle('display', 'block');
// 				break;
// 			case false:
// 				searchable.setStyle('display', 'none');
// 				break;
// 			default:
// 				break;
// 		}
// 	});
// }
// 
// function initInlineFilters() {
// 	$$('.filter.search').each(function(search){
// 		var container = search.getProperty('container');
// 		var targetFields = search.getProperty('targetFields');
// 		$(search).addEvent('keyup', function(){
// 			//cl(search.id+' searching for '+search.value+' in '+container+"'s "+targetFields);
// 			var query = search.value;
// 			inlineFilter($(container), query, targetFields);
// 		})
// 	});	
// }
// 
// 
// 
// 
// 
// 
// 
// 
// 
// 
// 
// // Mootools Scroll Class
// 
// 
// Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(B,A){this.element=this.subject=$(B);this.parent(A);var D=this.cancel.bind(this,false);
// if($type(this.element)!="element"){this.element=$(this.element.getDocument().body);}var C=this.element;if(this.options.wheelStops){this.addEvent("start",function(){C.addEvent("mousewheel",D);
// },true);this.addEvent("complete",function(){C.removeEvent("mousewheel",D);},true);}},set:function(){var A=Array.flatten(arguments);this.element.scrollTo(A[0],A[1]);
// },compute:function(E,D,C){var B=[];var A=2;A.times(function(F){B.push(Fx.compute(E[F],D[F],C));});return B;},start:function(C,H){if(!this.check(arguments.callee,C,H)){return this;
// }var E=this.element.getSize(),F=this.element.getScrollSize();var B=this.element.getScroll(),D={x:C,y:H};for(var G in D){var A=F[G]-E[G];if($chk(D[G])){D[G]=($type(D[G])=="number")?D[G].limit(0,A):A;
// }else{D[G]=B[G];}D[G]+=this.options.offset[G];}return this.parent([B.x,B.y],[D.x,D.y]);},toTop:function(){return this.start(false,0);},toLeft:function(){return this.start(0,false);
// },toRight:function(){return this.start("right",false);},toBottom:function(){return this.start(false,"bottom");},toElement:function(B){var A=$(B).getPosition(this.element);
// return this.start(A.x,A.y);}});
// 
// 
// 

