/*!
 * jQuery Expander Plugin v1.3
 *
 * Date: Sat Sep 17 00:37:34 2011 EDT
 * Requires: jQuery v1.3+
 *
 * Copyright 2011, Karl Swedberg
 * Dual licensed under the MIT and GPL licenses (just like jQuery):
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 *
 *
 *
*/
(function(c){c.expander={version:"1.3",defaults:{slicePoint:100,preserveWords:true,widow:4,expandText:"read more",expandPrefix:"&hellip; ",summaryClass:"summary",detailClass:"details",moreClass:"read-more",lessClass:"read-less",collapseTimer:0,expandEffect:"fadeIn",expandSpeed:250,collapseEffect:"fadeOut",collapseSpeed:200,userCollapse:true,userCollapseText:"read less",userCollapsePrefix:" ",onSlice:null,beforeExpand:null,afterExpand:null,onCollapse:null}};c.fn.expander=function(F){function G(a,e){var g=
"span",h=a.summary;if(e){g="div";h=h.replace(/(<\/[^>]+>)\s*$/,a.moreLabel+"$1");h='<div class="'+a.summaryClass+'">'+h+"</div>"}else h+=a.moreLabel;return[h,"<",g+' class="'+a.detailClass+'"',">",a.details,"</"+g+">"].join("")}function H(a){var e='<span class="'+a.moreClass+'">'+a.expandPrefix;e+='<a href="#">'+a.expandText+"</a></span>";return e}function u(a,e){if(a.lastIndexOf("<")>a.lastIndexOf(">"))a=a.slice(0,a.lastIndexOf("<"));if(e)a=a.replace(I,"");return a}function v(a,e){e.stop(true,true)[a.collapseEffect](a.collapseSpeed,
function(){e.prev("span."+a.moreClass).show().length||e.parent().children("div."+a.summaryClass).show().find("span."+a.moreClass).show()})}function J(a,e,g){if(a.collapseTimer)w=setTimeout(function(){v(a,e);c.isFunction(a.onCollapse)&&a.onCollapse.call(g,false)},a.collapseTimer)}var x=c.extend({},c.expander.defaults,F),K=/^<(?:area|br|col|embed|hr|img|input|link|meta|param).*>$/i,I=/(&(?:[^;]+;)?|\w+)$/,L=/<\/?(\w+)[^>]*>/g,y=/<(\w+)[^>]*>/g,z=/<\/(\w+)>/g,M=/^<[^>]+>.?/,w;this.each(function(){var a,
e,g,h,l,k,n,t,A=[],r=[],o={},p=this,f=c(this),B=c([]),b=c.meta?c.extend({},x,f.data()):x;k=!!f.find("."+b.detailClass).length;var q=!!f.find("*").filter(function(){return/^block|table|list/.test(c(this).css("display"))}).length,s=(q?"div":"span")+"."+b.detailClass,C="span."+b.moreClass,N=b.expandSpeed||0,m=c.trim(f.html());c.trim(f.text());var d=m.slice(0,b.slicePoint);if(!c.data(this,"expander")){c.data(this,"expander",true);c.each(["onSlice","beforeExpand","afterExpand","onCollapse"],function(i,
j){o[j]=c.isFunction(b[j])});d=u(d);for(summTagless=d.replace(L,"").length;summTagless<b.slicePoint;){newChar=m.charAt(d.length);if(newChar=="<")newChar=m.slice(d.length).match(M)[0];d+=newChar;summTagless++}d=u(d,b.preserveWords);h=d.match(y)||[];l=d.match(z)||[];g=[];c.each(h,function(i,j){K.test(j)||g.push(j)});h=g;e=l.length;for(a=0;a<e;a++)l[a]=l[a].replace(z,"$1");c.each(h,function(i,j){var D=j.replace(y,"$1"),E=c.inArray(D,l);if(E===-1){A.push(j);r.push("</"+D+">")}else l.splice(E,1)});r.reverse();
if(k){a=f.find(s).remove().html();d=f.html();m=d+a;k=""}else{a=m.slice(d.length);if(a.split(/\s+/).length<b.widow&&!k)return;k=r.pop()||"";d+=r.join("");a=A.join("")+a}b.moreLabel=f.find(C).length?"":H(b);if(q)a=m;d+=k;b.summary=d;b.details=a;b.lastCloseTag=k;if(o.onSlice)b=(g=b.onSlice.call(p,b))&&g.details?g:b;q=G(b,q);f.html(q);n=f.find(s);t=f.find(C);n.hide();t.find("a").unbind("click.expander").bind("click.expander",function(i){i.preventDefault();t.hide();B.hide();o.beforeExpand&&b.beforeExpand.call(p);
n.stop(false,true)[b.expandEffect](N,function(){n.css({zoom:""});o.afterExpand&&b.afterExpand.call(p);J(b,n,p)})});B=f.find("div."+b.summaryClass);b.userCollapse&&!f.find("span."+b.lessClass).length&&f.find(s).append('<span class="'+b.lessClass+'">'+b.userCollapsePrefix+'<a href="#">'+b.userCollapseText+"</a></span>");f.find("span."+b.lessClass+" a").unbind("click.expander").bind("click.expander",function(i){i.preventDefault();clearTimeout(w);i=c(this).closest(s);v(b,i);o.onCollapse&&b.onCollapse.call(p,
true)})}});return this};c.fn.expander.defaults=c.expander.defaults})(jQuery);
;
/*
 * 	Easy Slider 1.7 - jQuery plugin
 *	written by Alen Grakalic	
 *	http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding
 *
 *	Copyright (c) 2009 Alen Grakalic (http://cssglobe.com)
 *	Dual licensed under the MIT (MIT-LICENSE.txt)
 *	and GPL (GPL-LICENSE.txt) licenses.
 *
 *	Built for jQuery library
 *	http://jquery.com
 *
 */
 
/*
 *	markup example for $("#slider").easySlider();
 *	
 * 	<div id="slider">
 *		<ul>
 *			<li><img src="images/01.jpg" alt="" /></li>
 *			<li><img src="images/02.jpg" alt="" /></li>
 *			<li><img src="images/03.jpg" alt="" /></li>
 *			<li><img src="images/04.jpg" alt="" /></li>
 *			<li><img src="images/05.jpg" alt="" /></li>
 *		</ul>
 *	</div>
 *
 */

(function($) {

	$.fn.easySlider = function(options){
	  
		// default configuration properties
		var defaults = {			
			prevId: 		'prevBtn',
			prevText: 		'Previous',
			nextId: 		'nextBtn',	
			nextText: 		'Next',
			controlsShow:	true,
			controlsBefore:	'',
			controlsAfter:	'',	
			controlsFade:	true,
			firstId: 		'firstBtn',
			firstText: 		'First',
			firstShow:		false,
			lastId: 		'lastBtn',	
			lastText: 		'Last',
			lastShow:		false,				
			vertical:		false,
			speed: 			800,
			auto:			false,
			pause:			2000,
			continuous:		false, 
			numeric: 		false,
			numericId: 		'controls'
		}; 
		
		var options = $.extend(defaults, options);  
				
		this.each(function() {  
			var obj = $(this); 				
			var s = $("li", obj).length;
			var w = $("li", obj).width(); 
			var h = $("li", obj).height(); 
			var clickable = true;
			obj.width(w); 
			obj.height(h); 
			obj.css("overflow","hidden");
			var ts = s-1;
			var t = 0;
			$("ul", obj).css('width',s*w);			
			
			if(options.continuous){
				$("ul", obj).prepend($("ul li:last-child", obj).clone().css("margin-left","-"+ w +"px"));
				$("ul", obj).append($("ul li:nth-child(2)", obj).clone());
				$("ul", obj).css('width',(s+1)*w);
			};				
			
			if(!options.vertical) $("li", obj).css('float','left');
								
			if(options.controlsShow){
				var html = options.controlsBefore;				
				if(options.numeric){
					html += '<ol id="'+ options.numericId +'"></ol>';
				} else {
					if(options.firstShow) html += '<span id="'+ options.firstId +'"><a href=\"javascript:void(0);\">'+ options.firstText +'</a></span>';
					html += ' <span id="'+ options.prevId +'"><a href=\"javascript:void(0);\">'+ options.prevText +'</a></span>';
					html += ' <span id="'+ options.nextId +'"><a href=\"javascript:void(0);\">'+ options.nextText +'</a></span>';
					if(options.lastShow) html += ' <span id="'+ options.lastId +'"><a href=\"javascript:void(0);\">'+ options.lastText +'</a></span>';				
				};
				
				html += options.controlsAfter;						
				$(obj).after(html);										
			};
			
			if(options.numeric){									
				for(var i=0;i<s;i++){						
					$(document.createElement("li"))
						.attr('id',options.numericId + (i+1))
						.html('<a rel='+ i +' href=\"javascript:void(0);\">'+ (i+1) +'</a>')
						.appendTo($("#"+ options.numericId))
						.click(function(){							
							animate($("a",$(this)).attr('rel'),true);
						}); 												
				};							
			} else {
				$("a","#"+options.nextId).click(function(){		
					animate("next",true);
				});
				$("a","#"+options.prevId).click(function(){		
					animate("prev",true);				
				});	
				$("a","#"+options.firstId).click(function(){		
					animate("first",true);
				});				
				$("a","#"+options.lastId).click(function(){		
					animate("last",true);				
				});				
			};
			
			function setCurrent(i){
				i = parseInt(i)+1;
				$("li", "#" + options.numericId).removeClass("current");
				$("li#" + options.numericId + i).addClass("current");
			};
			
			function adjust(){
				if(t>ts) t=0;		
				if(t<0) t=ts;	
				if(!options.vertical) {
					$("ul",obj).css("margin-left",(t*w*-1));
				} else {
					$("ul",obj).css("margin-left",(t*h*-1));
				}
				clickable = true;
				if(options.numeric) setCurrent(t);
			};
			
			function animate(dir,clicked){
				if (clickable){
					clickable = false;
					var ot = t;				
					switch(dir){
						case "next":
							t = (ot>=ts) ? (options.continuous ? t+1 : ts) : t+1;						
							break; 
						case "prev":
							t = (t<=0) ? (options.continuous ? t-1 : 0) : t-1;
							break; 
						case "first":
							t = 0;
							break; 
						case "last":
							t = ts;
							break; 
						default:
							t = dir;
							break; 
					};	
					var diff = Math.abs(ot-t);
					var speed = diff*options.speed;						
					if(!options.vertical) {
						p = (t*w*-1);
						$("ul",obj).animate(
							{ marginLeft: p }, 
							{ queue:false, duration:speed, complete:adjust }
						);				
					} else {
						p = (t*h*-1);
						$("ul",obj).animate(
							{ marginTop: p }, 
							{ queue:false, duration:speed, complete:adjust }
						);					
					};
					
					if(!options.continuous && options.controlsFade){					
						if(t==ts){
							$("a","#"+options.nextId).hide();
							$("a","#"+options.lastId).hide();
						} else {
							$("a","#"+options.nextId).show();
							$("a","#"+options.lastId).show();					
						};
						if(t==0){
							$("a","#"+options.prevId).hide();
							$("a","#"+options.firstId).hide();
						} else {
							$("a","#"+options.prevId).show();
							$("a","#"+options.firstId).show();
						};					
					};				
					
					if(clicked) clearTimeout(timeout);
					if(options.auto && dir=="next" && !clicked){;
						timeout = setTimeout(function(){
							animate("next",false);
						},diff*options.speed+options.pause);
					};
			
				};
				
			};
			// init
			var timeout;
			if(options.auto){;
				timeout = setTimeout(function(){
					animate("next",false);
				},options.pause);
			};		
			
			if(options.numeric) setCurrent(0);
		
			if(!options.continuous && options.controlsFade){					
				$("a","#"+options.prevId).hide();
				$("a","#"+options.firstId).hide();				
			};				
			
		});
	  
	};

})(jQuery);



;
(function ($) {
	$(document).ready(function(){
	 // Reset Font Size
		var originalFontSize = $('div#content,div#content-home').css('font-size');
		$('a.resetFont').click(function(){
		$('div#content,div#content-home').css('font-size', originalFontSize);
		});
	 // Increase Font Size
	$('a.increaseFont').click(function(){
		var currentFontSize = $('div#content,div#content-home').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var newFontSize = currentFontSizeNum*1.1;
		$('div#content,div#content-home').css('font-size', newFontSize);
		return false;
	});
	 // Decrease Font Size
	$('a.decreaseFont').click(function(){
		var currentFontSize = $('div#content,div#content-home').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var newFontSize = currentFontSizeNum*0.9;
	$('div#content,div#content-home').css('font-size', newFontSize);
		return false;
	});
	
	// Add wrapper class to all img.video-thumb elements
	//$("img.video-thumb").before('<div class="playbutton"></div>');
	
	// Add pdf icons to pdf links
	$("a[href$='.pdf']").addClass("pdf");
 
	// Add txt icons to document links (doc, rtf, txt)
	//$("a[href$='.doc'], a[href$='.txt'], a[href$='.rft']").addClass("txt");
 
	// Add zip icons to Zip file links (zip, rar)
	//$("a[href$='.zip'], a[href$='.rar']").addClass("zip"); 
 
	// Add email icons to email links
	//$("a[href^='mailto:']").addClass("email");
 
	//Add external link icon to external links - 
	//$('a').filter(function() {
		//Compare the anchor tag's host name with location's host name
	   // return this.hostname && this.hostname !== location.hostname;
	  //}).addClass("external");
	//You might also want to set the _target attribute to blank
	/*
	$('a').filter(function() {
		//Compare the anchor tag's host name with location's host name
	    return this.hostname && this.hostname !== location.hostname;
	  }).addClass("external").attr("target", "_blank");
	*/
	// Summary Expansion for the body copy on Voices profiles
	$('div.node-voices-of-south-bend div.field-name-body, #block-views-random-voice-block div.views-field-body .inner').expander({
		slicePoint: 240,
  		widow: 2,
 		expandEffect: 'show',
		preserveWords: true,
		expandText: 'Read more',
 		userCollapseText: 'Show less'					   
	});
	
	$('#node-61 .field-name-body .field-item').expander({
		slicePoint: 388,
  		widow: 2,
 		expandEffect: 'show',
		preserveWords: true,
		expandText: 'Read more',
 		userCollapseText: 'Show less'					   
	});
	
	$('div.region-sidebar-second #block-block-3 div.content').expander({
		slicePoint: 240,
  		widow: 2,
 		expandEffect: 'show',
		preserveWords: true,
		expandText: 'Read more',
 		userCollapseText: 'Show less'			   
	});
	
	//$(".view-voices-list .item-list").easySlider({
//		auto: false,
//		continuous: false,
//		nextId: "next",
//		prevId: "prev"
//	});
	$('img.video-thumb, ul.multimedia-thumbs li img').before('<span class="video"></span');
	
	});
})(jQuery);;

