
/*
 * This script is written by Geert Van Aken
 * Please read the official documentation for more information
 * about the functions of this file.
 *
 * http://altum.be/products/emailobfuscator
 *
 * Please do not remove this information from the file and
 * report improvements that you make to this sourcecode
 *
 * Version 1.1.0
 * Date 2006/04/11
 */

var monkeyCode = 4 << 4;
var oldStatusText = "";

function EOa() {
 return String.fromCharCode(monkeyCode);
}

function EOd(pText) {
 var splitted = pText.split(",");
 var result = "";

 for (i = 0 ; i < splitted.length ; i++) {
 result += String.fromCharCode(splitted[i]);
 }
 return result;
}

function EOp() {
 var prefix = EOd('109,97,105');
 prefix += EOd('108,116');
 return prefix + EOd('111,58');
}

function EOad(pName, pdomain) {
 EOad(pName, pDomain, null);
}

function EOinitStatus(pName, pDomain) {
 oldStatusText = window.status;
 window.status = Loc(pName, pDomain);
}

function EOrestoreStatus() {
 window.status = oldStatusText;
}

function EOae(pName, pDomain, pSubj, pHover, pText, pClass) {

// alert("pName = " + pName + "\npDomain = " + pDomain + "\npSubj = " + pSubj + "\npHover = " + pHover + "\npText = " + pText + "\npClass = " + pClass);

 var result = "<a href=\"JavaScript:EOad('" + pName + "','" + pDomain + "'";
 if (pSubj != null && pSubj.length > 2) {
 result += ",'" + pSubj + "'";
 }
 result += ");\"";

 if (pHover != null && pHover.length > 0) {
 result += " title=\"" + EOd(pHover) + "\"";
 }

 if (pClass != null && pClass.length > 0) {
 result += " class=\"" + pClass + "\"";
 }

 result += " onMouseOver=\"EOinitStatus('" + pName + "','" + pDomain + "');return true;\" onMouseOut=\"EOrestoreStatus();\"";

 result += ">" + EOd(pText) + "</a>";

// alert(result);

 document.write(result);

}

function EOad(pName, pDomain, pSubj) {
 var loc = Loc(pName, pDomain);
 if (pSubj != null && pSubj.length > 0) {
 loc += "?" + EOd('115,117,98,106,101,99,116') + "=" + encodeURIComponent(EOd(pSubj));
 }

 document.location = loc;
}

function Loc(pName, pDomain) {
 var first = EOd(pName);
 var second = EOd(pDomain);
 var loc = EOp() + first + EOa() + second; 
 
 return loc;
}

(function($){$.facebox=function(data,klass){$.facebox.loading();if(data.ajax){fillFaceboxFromAjax(data.ajax,klass)}else{if(data.image){fillFaceboxFromImage(data.image,klass)}else{if(data.div){fillFaceboxFromHref(data.div,klass)}else{if($.isFunction(data)){data.call($)}else{$.facebox.reveal(data,klass)}}}}};$.extend($.facebox,{settings:{opacity:0.4,overlay:true,loadingImage:base+"_img/en/facebox/loading.gif",closeImage:base+"_img/en/facebox/closelabel.gif",imageTypes:["png","jpg","jpeg","gif"],faceboxHtml:' <div id="facebox" style="display:none;"> <div class="popup"> <table> <tbody> <tr> <td class="tl"/><td class="b"/><td class="tr"/> </tr> <tr> <td class="b"/> <td class="body"> <div class="content"> </div> <div class="footer"> <a href="#" class="close"> <img src="/facebox/closelabel.gif" title="close" class="close_image" /> </a> </div> </td> <td class="b"/> </tr> <tr> <td class="bl"/><td class="b"/><td class="br"/> </tr> </tbody> </table> </div> </div>'},loading:function(){init();if($("#facebox .loading").length==1){return true}showOverlay();$("#facebox .content").empty();$("#facebox .body").children().hide().end().append('<div class="loading"><img src="'+$.facebox.settings.loadingImage+'"/></div>');$("#facebox").css({top:getPageScroll()[1]+(getPageHeight()/10),left:$(window).width()/2-205}).show();$(document).bind("keydown.facebox",function(e){if(e.keyCode==27){$.facebox.close()}return true});$(document).trigger("loading.facebox")},reveal:function(data,klass){$(document).trigger("beforeReveal.facebox");if(klass){$("#facebox .content").addClass(klass)}$("#facebox .content").append(data);$("#facebox .loading").remove();$("#facebox .body").children().fadeIn("normal");$("#facebox").css("left",$(window).width()/2-($("#facebox table").width()/2));$(document).trigger("reveal.facebox").trigger("afterReveal.facebox")},close:function(){$(document).trigger("close.facebox");return false}});$.fn.facebox=function(settings){init(settings);function clickHandler(){$.facebox.loading(true);var klass=this.rel.match(/facebox\[?\.(\w+)\]?/);if(klass){klass=klass[1]}fillFaceboxFromHref(this.href,klass);return false}return this.bind("click.facebox",clickHandler)};function init(settings){if($.facebox.settings.inited){return true}else{$.facebox.settings.inited=true}$(document).trigger("init.facebox");makeCompatible();var imageTypes=$.facebox.settings.imageTypes.join("|");$.facebox.settings.imageTypesRegexp=new RegExp(".("+imageTypes+")$","i");if(settings){$.extend($.facebox.settings,settings)}$("body").append($.facebox.settings.faceboxHtml);var preload=[new Image(),new Image()];preload[0].src=$.facebox.settings.closeImage;preload[1].src=$.facebox.settings.loadingImage;$("#facebox").find(".b:first, .bl, .br, .tl, .tr").each(function(){preload.push(new Image());preload.slice(-1).src=$(this).css("background-image").replace(/url\((.+)\)/,"$1")});$("#facebox .close").click($.facebox.close);$("#facebox .close_image").attr("src",$.facebox.settings.closeImage)}function getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft}else{if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft}}}return new Array(xScroll,yScroll)}function getPageHeight(){var windowHeight;if(self.innerHeight){windowHeight=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){windowHeight=document.documentElement.clientHeight}else{if(document.body){windowHeight=document.body.clientHeight}}}return windowHeight}function makeCompatible(){var $s=$.facebox.settings;$s.loadingImage=$s.loading_image||$s.loadingImage;$s.closeImage=$s.close_image||$s.closeImage;$s.imageTypes=$s.image_types||$s.imageTypes;$s.faceboxHtml=$s.facebox_html||$s.faceboxHtml}function fillFaceboxFromHref(href,klass){if(href.match(/#/)){var url=window.location.href.split("#")[0];var target=href.replace(url,"");$.facebox.reveal($(target).show().replaceWith("<div id='facebox_moved'></div>"),klass)}else{if(href.match($.facebox.settings.imageTypesRegexp)){fillFaceboxFromImage(href,klass)}else{fillFaceboxFromAjax(href,klass)}}}function fillFaceboxFromImage(href,klass){var image=new Image();image.onload=function(){$.facebox.reveal('<div class="image"><img src="'+image.src+'" /></div>',klass)};image.src=href}function fillFaceboxFromAjax(href,klass){$.get(href,function(data){$.facebox.reveal(data,klass)})}function skipOverlay(){return $.facebox.settings.overlay==false||$.facebox.settings.opacity===null}function showOverlay(){if(skipOverlay()){return}if($("#facebox_overlay").length==0){$("body").append('<div id="facebox_overlay" class="facebox_hide"></div>')}$("#facebox_overlay").hide().addClass("facebox_overlayBG").css("opacity",$.facebox.settings.opacity).click(function(){$(document).trigger("close.facebox")}).fadeIn(200);return false}function hideOverlay(){if(skipOverlay()){return}$("#facebox_overlay").fadeOut(200,function(){$("#facebox_overlay").removeClass("facebox_overlayBG");$("#facebox_overlay").addClass("facebox_hide");$("#facebox_overlay").remove()});return false}$(document).bind("close.facebox",function(){$(document).unbind("keydown.facebox");$("#facebox").fadeOut(function(){if($("#facebox_moved").length==0){$("#facebox .content").removeClass().addClass("content")}else{$("#facebox_moved").replaceWith($("#facebox .content").children().hide())}hideOverlay();$("#facebox .loading").remove();$("#videoplayer").remove()})})})(jQuery);

;jQuery.fn.defval=function(text){return this.each(function(){if(this.type!='text'&&this.type!='password'&&this.type!='textarea')return;var fld_current=this;if(this.value==''){this.value=text}else{return}$(this).focus(function(){if(this.value==text||this.value=='')this.value=''});$(this).blur(function(){if(this.value==text||this.value=='')this.value=text});$(this).parents("form").each(function(){$(this).submit(function(){if(fld_current.value==text){fld_current.value=''}})})})};

(function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var b=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var c=$(this),ul=$("ul",c),tLi=$("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v}var f=$("li",ul),itemLength=f.size(),curr=o.start;c.css("visibility","visible");f.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});c.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var g=o.vertical?height(f):width(f);var h=g*itemLength;var j=g*v;f.css({width:f.width(),height:f.height()});ul.css(sizeCss,h+"px").css(animCss,-(curr*g));c.css(sizeCss,j+"px");if(o.btnPrev)$(o.btnPrev).click(function(){return go(curr-o.scroll)});if(o.btnNext)$(o.btnNext).click(function(){return go(curr+o.scroll)});if(o.btnGo)$.each(o.btnGo,function(i,a){$(a).click(function(){return go(o.circular?o.visible+i:i)})});if(o.mouseWheel&&c.mousewheel)c.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll)});if(o.auto)setInterval(function(){go(curr+o.scroll)},o.auto+o.speed);function vis(){return f.slice(curr).slice(0,v)};function go(a){if(!b){if(o.beforeStart)o.beforeStart.call(this,vis());if(o.circular){if(a<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*g)+"px");curr=a==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll}else if(a>=itemLength-v+1){ul.css(animCss,-((v)*g)+"px");curr=a==itemLength-v+1?v+1:v+o.scroll}else curr=a}else{if(a<0||a>itemLength-v)return;else curr=a}b=true;ul.animate(animCss=="left"?{left:-(curr*g)}:{top:-(curr*g)},o.speed,o.easing,function(){if(o.afterEnd)o.afterEnd.call(this,vis());b=false});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled")}}return false}})};function css(a,b){return parseInt($.css(a[0],b))||0};function width(a){return a[0].offsetWidth+css(a,'marginLeft')+css(a,'marginRight')};function height(a){return a[0].offsetHeight+css(a,'marginTop')+css(a,'marginBottom')}})(jQuery);

$().ready(function() {

selectMainMenu("mainmenu-");
selectMainMenu("mli-",1);
selectMainMenu("aboxi-",1);
selectMainMenu("mli-sub-",2);
selectMainMenu("mli-subsub-",3);
//$('.cell , .omd-cell p, .ec-directors').equalHeight();

 //$('p').widont();
 $('a[rel*=facebox]').facebox();


 var v1 = $(".telus-form").validate({rules: {
 sComment: {
 required: false,
 maxlength: 2500
 }
 }});

 jQuery.validator.addMethod("postalzip", function(value) {
 if(jQuery.trim(value) == ""){
 return true;
 }else{
 var val = value.toUpperCase();
 var re = new RegExp(/\b[ABCEGHJKLMNPRSTVXY][0-9][A-Z] ?[0-9][A-Z][0-9]\b/);
 var re_zip = new RegExp(/\b[0-9]{5}\b/);
 
 return (re.exec(val) || re_zip.exec(val));
 }
 }, "Please enter a valid Postal or Zip Code");
 
 $('a[rel^="ext"]').attr('target', '_blank');

 
 //addPeriods();
 if(searchterm == ""){
 $("#search").defval(search_text_init);
 }

 setupSplash();


});

function setupSplash(){
 $(".enter-input").live("click", function(){
 $('#entry-form').submit(); 
 });
};

String.prototype.unescapeHtml = function () {
 var temp = document.createElement("div");
 temp.innerHTML = this;
 var result = temp.childNodes[0].nodeValue;
 temp.removeChild(temp.firstChild)
 return result;
} 

function addPeriods(){
 $("h2,h3,h6").each(function (i) { 
 this.innerHTML = this.innerHTML + "."; 
 });
};

//popup window
function openWindow(windowURL,windowName,windowWidth,windowHeight,scroll,center) {
 newWindow = window.open(windowURL,windowName,'width='+windowWidth+',height='+windowHeight+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollbars='+scroll+',resizable=0');
 newWindow.focus(); 
 if (center) {
 newWindow.moveTo((screen.width-windowWidth)/2,(screen.height-windowHeight)/2)
 }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
 window.open(theURL,winName,features);
}

var prevpage = "";
var prevsubpageactive = "";

function selectMainMenu(prefix, idx){
 if(idx ==undefined){
 idx = 0;
 }
 
 var thepagename;
 if(subsection.length == 0){
 thepagename = "home"
 }else{
 
 thepagename = subsection[idx];
 
 if(idx == 2 && hassubitems){
 $("#"+prefix+thepagename).parent().addClass("down")
 }
 
 
 }

 $("#"+prefix+thepagename).addClass("selected");
 if(prevpage !=""){
 $("#"+prefix+prevpage).removeClass("selected");
 }
 //alert("#"+prefix+thepagename);
 prevpage ="#"+prefix+thepagename;

};

function adjustHeader(){
 $("#header-bg").hide();
 $("#cu-header").css("min-height","42px");
};

function adjustHeaderSpace(){
 $("#cu-header").css("margin-bottom","0");
}

function writeBC(i, ln){ 
 var linkname = "";
 if(ln[i] === undefined){
 linkname = ln[0];
 }else{
 linkname = ln[i];
 }

 $(".final-location").removeClass("final-location"); 
 var html = '<img src="'+base+'_img/en/arrow-grey-sm.gif" alt="separator" class="sep" /><span class="final-location">'+linkname +'</span>';
 $("#extended-bc").html(html);
};

 function setInitial(div, arr){
 var idx = 0;
 var anc = window.location;
 if(anc !== undefined){
 var anUrl = anc.toString();
 $("."+div+" a").each(function(i){
 var ahref = $(this).attr("href");
 if(anUrl.indexOf(ahref) >= 0){
 idx = i;
 } 
 }); 
 }
 writeBC(idx,arr);
 }
 

 var helvetica35 = { src: base+'_flash/swf/sifr3_helvetica_35.swf' };
 var helvetica45 = { src: base+'_flash/swf/sifr3_helvetica_45.swf' };
 var helvetica55 = { src: base+'_flash/swf/sifr3_helvetica_55.swf' };
 
 //sIFR.useStyleCheck = true;
 sIFR.activate(helvetica35,helvetica45,helvetica55);
 
 sifrReplace();
 
function sifrReplace(){
 
 sIFR.replace(helvetica35, {
 selector: '#cu-header h1',
 wmode: 'transparent',
 css: [
 '.sIFR-root { color: #49166d; }'
 ,'a { text-decoration: none; }' 
 ]
 });
 
 /*sIFR.replace(helvetica45, {
 selector: 'h3',
 wmode: 'transparent',
 css: [
 '.sIFR-root { color: #49166d; }'
 ,'a { text-decoration: none; }' 
 ]
 });*/
 
 sIFR.replace(helvetica35, {
 selector: 'h2.top-header-large',
 wmode: 'transparent',
 css: [
 '.sIFR-root { color: #49166d; }'
 ,'a { text-decoration: none; }' 
 ]
 });
 
 sIFR.replace(helvetica45, {
 selector: 'h2.med-header-green',
 wmode: 'transparent',
 css: [
 '.sIFR-root { color: #66cc00; }'
 ,'a { text-decoration: none; }' 
 ]
 });
 
 sIFR.replace(helvetica45, {
 selector: 'h2',
 wmode: 'transparent',
 css: [
 '.sIFR-root { color: #49166d; }'
 ,'a { text-decoration: none; }' 
 ]
 });
 
 sIFR.replace(helvetica55, {
 selector: 'h3',
 wmode: 'transparent',
 css: [
 '.sIFR-root { color: #49166d; }'
 ,'a { text-decoration: none; }' 
 ]
 });


};

/*
 * jQuery corner plugin
 *
 * version 1.92 (12/18/2007)
 *
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */

/**
 * The corner() method provides a simple way of styling DOM elements. 
 *
 * corner() takes a single string argument: $().corner("effect corners width")
 *
 * effect: The name of the effect to apply, such as round or bevel. 
 * If you don't specify an effect, rounding is used.
 *
 * corners: The corners can be one or more of top, bottom, tr, tl, br, or bl. 
 * By default, all four corners are adorned. 
 *
 * width: The width specifies the width of the effect; in the case of rounded corners this 
 * will be the radius of the width. 
 * Specify this value using the px suffix such as 10px, and yes it must be pixels.
 *
 * For more details see: http://methvin.com/jquery/jq-corner.html
 * For a full demo see: http://malsup.com/jquery/corner/
 *
 *
 * @example $('.adorn').corner();
 * @desc Create round, 10px corners 
 *
 * @example $('.adorn').corner("25px");
 * @desc Create round, 25px corners 
 *
 * @example $('.adorn').corner("notch bottom");
 * @desc Create notched, 10px corners on bottom only
 *
 * @example $('.adorn').corner("tr dog 25px");
 * @desc Create dogeared, 25px corner on the top-right corner only
 *
 * @example $('.adorn').corner("round 8px").parent().css('padding', '4px').corner("round 10px");
 * @desc Create a rounded border effect by styling both the element and its parent
 * 
 * @name corner
 * @type jQuery
 * @param String options Options which control the corner style
 * @cat Plugins/Corner
 * @return jQuery
 * @author Dave Methvin (dave.methvin@gmail.com)
 * @author Mike Alsup (malsup@gmail.com)
 */
 
 (function($){$.fn.corner=function(o){var k=$.browser.msie&&/MSIE 6.0/.test(navigator.userAgent);function sz(a,p){return parseInt($.css(a,p))||0};function hex2(s){var s=parseInt(s).toString(16);return(s.length<2)?'0'+s:s};function gpc(a){for(;a&&a.nodeName.toLowerCase()!='html';a=a.parentNode){var v=$.css(a,'backgroundColor');if(v.indexOf('rgb')>=0){if($.browser.safari&&v=='rgba(0, 0, 0, 0)')continue;var b=v.match(/\d+/g);return'#'+hex2(b[0])+hex2(b[1])+hex2(b[2])}if(v&&v!='transparent')return v}return'#ffffff'};function getW(i){switch(t){case'round':return Math.round(q*(1-Math.cos(Math.asin(i/q))));case'cool':return Math.round(q*(1+Math.cos(Math.asin(i/q))));case'sharp':return Math.round(q*(1-Math.cos(Math.acos(i/q))));case'bite':return Math.round(q*(Math.cos(Math.asin((q-i-1)/q))));case'slide':return Math.round(q*(Math.atan2(i,q/i)));case'jut':return Math.round(q*(Math.atan2(q,(q-i-1))));case'curl':return Math.round(q*(Math.atan(i)));case'tear':return Math.round(q*(Math.cos(i)));case'wicked':return Math.round(q*(Math.tan(i)));case'long':return Math.round(q*(Math.sqrt(i)));case'sculpt':return Math.round(q*(Math.log((q-i-1),q)));case'dog':return(i&1)?(i+1):q;case'dog2':return(i&2)?(i+1):q;case'dog3':return(i&3)?(i+1):q;case'fray':return(i%2)*q;case'notch':return q;case'bevel':return i+1}};o=(o||"").toLowerCase();var l=/keep/.test(o);var m=((o.match(/cc:(#[0-9a-f]+)/)||[])[1]);var n=((o.match(/sc:(#[0-9a-f]+)/)||[])[1]);var q=parseInt((o.match(/(\d+)px/)||[])[1])||10;var r=/round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;var t=((o.match(r)||['round'])[0]);var u={T:0,B:1};var x={TL:/top|tl/.test(o),TR:/top|tr/.test(o),BL:/bottom|bl/.test(o),BR:/bottom|br/.test(o)};if(!x.TL&&!x.TR&&!x.BL&&!x.BR)x={TL:1,TR:1,BL:1,BR:1};var y=document.createElement('div');y.style.overflow='hidden';y.style.height='1px';y.style.backgroundColor=n||'transparent';y.style.borderStyle='solid';return this.each(function(a){var b={T:parseInt($.css(this,'paddingTop'))||0,R:parseInt($.css(this,'paddingRight'))||0,B:parseInt($.css(this,'paddingBottom'))||0,L:parseInt($.css(this,'paddingLeft'))||0};if($.browser.msie)this.style.zoom=1;if(!l)this.style.border='none';y.style.borderColor=m||gpc(this.parentNode);var c=$.curCSS(this,'height');for(var j in u){var f=u[j];if((f&&(x.BL||x.BR))||(!f&&(x.TL||x.TR))){y.style.borderStyle='none '+(x[j+'R']?'solid':'none')+' none '+(x[j+'L']?'solid':'none');var d=document.createElement('div');$(d).addClass('jquery-corner');var g=d.style;f?this.appendChild(d):this.insertBefore(d,this.firstChild);if(f&&c!='auto'){if($.css(this,'position')=='static')this.style.position='relative';g.position='absolute';g.bottom=g.left=g.padding=g.margin='0';if($.browser.msie)g.setExpression('width','this.parentNode.offsetWidth');else g.width='100%'}else if(!f&&$.browser.msie){if($.css(this,'position')=='static')this.style.position='relative';g.position='absolute';g.top=g.left=g.right=g.padding=g.margin='0';var h=0;if(k||!$.boxModel)h=sz(this,'borderLeftWidth')+sz(this,'borderRightWidth');k?g.setExpression('width','this.parentNode.offsetWidth - '+h+'+ "px"'):g.width='100%'}else{g.margin=!f?'-'+b.T+'px -'+b.R+'px '+(b.T-q)+'px -'+b.L+'px':(b.B-q)+'px -'+b.R+'px -'+b.B+'px -'+b.L+'px'}for(var i=0;i<q;i++){var w=Math.max(0,getW(i));var e=y.cloneNode(false);e.style.borderWidth='0 '+(x[j+'R']?w:0)+'px 0 '+(x[j+'L']?w:0)+'px';f?d.appendChild(e):d.insertBefore(e,d.firstChild)}}}})};$.fn.uncorner=function(o){return $('.jquery-corner',this).remove()}})(jQuery);
 
 

var FarmerSlide = {
 fsdefaults : defaults = {
 featurediv : "features",
 statusdiv : "status",
 statuscontainer : "carousel-status",
 statuscontainerlist : "status-list",
 selectclass : "selected",
 changelink : "ff-link",
 btnNext: "",
 btnPrev: "",
 btnGo: null,
 auto: 5000, 
 speed: 500,
 vertical: false,
 circular: true,
 visible: 1,
 pauseonmouseover : true,
 easing: "easeInOutQuad",
 fade: false
 },

 oMainTemplate: null,
 navClick : false,
 currItem : null,
 clickid: 0,


 init : function (options){
 this.o = jQuery.extend({}, this.fsdefaults, options);
 this.initSlide();
 },

 initSlide: function(){ 
 var m = this;
 var c = m.getControls();
 m.setCarouselLink(); 
 var ae = this.carouselEnd;
 var cs = (this.o.fade) ? this.carouselStart : null;
 jQuery("#"+this.o.featurediv).jCarouselLite({
 auto: m.o.auto,
 speed: m.o.speed,
 vertical: m.o.vertical,
 easing: m.o.easing,
 afterEnd: ae,
 beforeStart: cs,
 pauseonmouseover : m.o.pauseonmouseover,
 fade: m.o.fade,
 visible: m.o.visible,
 btnNext: m.o.btnNext,
 btnPrev: m.o.btnPrev,
 btnPrev: m.o.btnGo,
 circular: m.o.circular,
 btnGo: c
 });

 },

 getControls : function(){
 var temp = [];
 var features = jQuery("#"+this.o.featurediv+" li");
 var c = features.length;
 for(var i = 0; i < c; i++){
 temp.push("."+this.o.statusdiv+"-"+i);
 }
 return temp;
 },
 
 drawStatus : function(thediv){
 var m = this;
 
 var html = '<ul class="'+this.o.statuscontainerlist+'">';
 var c = jQuery("#"+this.o.featurediv+" li").length;
 var alink = '<a href="javascript:void(0)"></a>'
 
 for(var i = 0; i < c; i++){ 
 if(i ==0){
 html += '<li class="'+m.o.selectclass+' status-'+i+'">'+alink+'</li>';
 }else{
 html += '<li class="status-'+i+'">'+alink+'</li>';
 } 
 } 
 html = html + '</ul>';
 jQuery("#"+thediv).html(html); 
 
 var stats = jQuery("#"+thediv+" li");
 stats.click(function () { 
 stats.removeClass(m.o.selectclass);
 jQuery(this).addClass(m.o.selectclass);
 m.navClick = true;
 });
 },
 
 carouselStart : function(el){
 //el = jQuery(el);
 },
 
 carouselEnd : function(el){
 el = jQuery(el);
 if(FarmerSlide.o.fade){
 FarmerSlide.currItem = el;
 }else{ 
 var ana = el.children("a");
 jQuery("#"+FarmerSlide.o.changelink).attr("href",ana.attr("href"));
 }
 
 if(!FarmerSlide.navClick)
 FarmerSlide.incrementStatus(FarmerSlide.o.statuscontainer); 
 },

 setCarouselLink : function(){
 this.drawStatus(this.o.statuscontainer);
 
 var c = jQuery("#"+this.o.featurediv+" li");
 var thelink = jQuery(c[0]).children("a").attr("href");
 jQuery("#"+this.o.changelink).attr("href",thelink);
 },
 
 incrementStatus: function(thediv){
 var lis = jQuery("#"+thediv+" li");
 
 for(var i = 0; i < lis.length; i++){
 lis[i] = jQuery(lis[i]);
 var sel = (lis[i].hasClass(this.o.selectclass)) ? true : false; 
 if(sel){
 lis[i].removeClass(this.o.selectclass);
 if(i == (lis.length-1)){
 jQuery(lis[0]).addClass(this.o.selectclass);
 }else{
 jQuery(lis[parseInt(i+1)]).addClass(this.o.selectclass);
 } 
 break;
 }
 } 
 
 }

};


jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});

/**
 * jCarouselLite - jQuery plugin to navigate images/any content in a carousel style widget.
 * @requires jQuery v1.2 or above
 *
 * http://gmarwaha.com/jquery/jcarousellite/
 *
 * Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Modified by FarmerDane to add Pausing, select stop and super fade
 *
 * Version: 1.0.1111111111111111111111
 * Note: Requires jquery 1.2 or above from version 1.0.1
 */
(function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,pauseonmouseover:true,speed:200,easing:null,vertical:false,fade:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var auto_on=null;var clicked=false;var running=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var div=$(this),ul=$("ul",div),tLi=$("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v}var li=$("li",ul),itemLength=li.size(),curr=o.start;div.css("visibility","visible");li.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});div.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var liSize=o.vertical?height(li):width(li);var ulSize=liSize*itemLength;var divSize=liSize*v;li.css({width:li.width(),height:li.height()});ul.css(sizeCss,ulSize+"px").css(animCss,-(curr*liSize));div.css(sizeCss,divSize+"px");if(o.btnPrev)$(o.btnPrev).click(function(){return go(curr-o.scroll)});if(o.btnNext)$(o.btnNext).click(function(){return go(curr+o.scroll)});if(o.btnGo)$.each(o.btnGo,function(i,val){$(val).click(function(){if(auto_on){clicked=true;clearInterval(auto_on);running=false}return go(o.circular?o.visible+i:i)})});if(o.mouseWheel&&div.mousewheel)div.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll)});if(o.auto){auto_on=setInterval(startanim,o.auto+o.speed);if(o.pauseonmouseover){$(this).hover(function(){running=false;clearInterval(auto_on)},function(){if(!clicked){auto_on=setInterval(startanim,o.auto+o.speed)}})}}function startanim(){go(curr+o.scroll)};function vis(){return li.slice(curr).slice(0,v)};function go(to){if(!running){if(o.beforeStart)o.beforeStart.call(this,vis());if(o.circular){if(to<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*liSize)+"px");curr=to==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll}else if(to>=itemLength-v+1){ul.css(animCss,-((v)*liSize)+"px");curr=to==itemLength-v+1?v+1:v+o.scroll}else{curr=to}}else{if(to<0||to>itemLength-v)return;else{curr=to}}running=true;if(!o.fade){ul.animate(animCss=="left"?{left:-(curr*liSize)}:{top:-(curr*liSize)},o.speed,o.easing,function(){if(o.afterEnd)o.afterEnd.call(this,vis());running=false})}else{var direction=(animCss=="left")?"left":"top";ul.fadeTo(1200,0.1,function(){ul.css(direction,-(curr*liSize)).fadeTo(1200,1)});if(o.afterEnd)o.afterEnd.call(this,vis());running=false}if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled")}}return false}})};function css(el,prop){return parseInt($.css(el[0],prop))||0};function width(el){return el[0].offsetWidth+css(el,'marginLeft')+css(el,'marginRight')};function height(el){return el[0].offsetHeight+css(el,'marginTop')+css(el,'marginBottom')}})(jQuery);