Team:WITS-CSIR SA/plugins.js

From 2011.igem.org

/*

* jQuery Nivo Slider v2.5.1
* http://nivo.dev7studios.com
*
* Copyright 2011, Gilbert Pellegrom
* Free to use and abuse under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
* 
* March 2010
*/

(function($){var NivoSlider=function(element,options){var settings=$.extend({},$.fn.nivoSlider.defaults,options);var vars={currentSlide:0,currentImage:,totalSlides:0,randAnim:,running:false,paused:false,stop:false};var slider=$(element);slider.data('nivo:vars',vars);slider.css('position','relative');slider.addClass('nivoSlider');var kids=slider.children();kids.each(function(){var child=$(this);var link=;if(!child.is('img')){if(child.is('a')){child.addClass('nivo-imageLink');link=child;} child=child.find('img:first');} var childWidth=child.width();if(childWidth==0)childWidth=child.attr('width');var childHeight=child.height();if(childHeight==0)childHeight=child.attr('height');if(childWidth>slider.width()){slider.width(childWidth);} if(childHeight>slider.height()){slider.height(childHeight);} if(link!=){link.css('display','none');} child.css('display','none');vars.totalSlides++;});if(settings.startSlide>0){if(settings.startSlide>=vars.totalSlides)settings.startSlide=vars.totalSlides-1;vars.currentSlide=settings.startSlide;} if($(kids[vars.currentSlide]).is('img')){vars.currentImage=$(kids[vars.currentSlide]);}else{vars.currentImage=$(kids[vars.currentSlide]).find('img:first');} if($(kids[vars.currentSlide]).is('a')){$(kids[vars.currentSlide]).css('display','block');}

slider.css('background','url("'+vars.currentImage.attr('src')+'") no-repeat');slider.append($('

').css({display:'none',opacity:settings.captionOpacity}));var processCaption=function(settings){var nivoCaption=$('.nivo-caption',slider);if(vars.currentImage.attr('title')!=){var title=vars.currentImage.attr('title');if(title.substr(0,1)=='#')title=$(title).html();if(nivoCaption.css('display')=='block'){nivoCaption.find('p').fadeOut(settings.animSpeed,function(){$(this).html(title);$(this).fadeIn(settings.animSpeed);});}else{nivoCaption.find('p').html(title);}

nivoCaption.fadeIn(settings.animSpeed);}else{nivoCaption.fadeOut(settings.animSpeed);}} processCaption(settings);var timer=0;if(!settings.manualAdvance&&kids.length>1){timer=setInterval(function(){nivoRun(slider,kids,settings,false);},settings.pauseTime);}

if(settings.directionNav){slider.append('
<a class="nivo-prevNav">'+settings.prevText+'</a><a class="nivo-nextNav">'+settings.nextText+'</a>
');if(settings.directionNavHide){$('.nivo-directionNav',slider).hide();slider.hover(function(){$('.nivo-directionNav',slider).show();},function(){$('.nivo-directionNav',slider).hide();});}

$('a.nivo-prevNav',slider).live('click',function(){if(vars.running)return false;clearInterval(timer);timer=;vars.currentSlide-=2;nivoRun(slider,kids,settings,'prev');});$('a.nivo-nextNav',slider).live('click',function(){if(vars.running)return false;clearInterval(timer);timer=;nivoRun(slider,kids,settings,'next');});}

if(settings.controlNav){var nivoControl=$('
');slider.append(nivoControl);for(var i=0;i<kids.length;i++){if(settings.controlNavThumbs){var child=kids.eq(i);if(!child.is('img')){child=child.find('img:first');}

if(settings.controlNavThumbsFromRel){nivoControl.append('<a class="nivo-control" rel="'+i+'"><img src="'+child.attr('rel')+'" alt="" /></a>');}else{nivoControl.append('<a class="nivo-control" rel="'+i+'"><img src="'+child.attr('src').replace(settings.controlNavThumbsSearch,settings.controlNavThumbsReplace)+'" alt="" /></a>');}}else{nivoControl.append('<a class="nivo-control" rel="'+i+'">'+(i+1)+'</a>');}} $('.nivo-controlNav a:eq('+vars.currentSlide+')',slider).addClass('active');$('.nivo-controlNav a',slider).live('click',function(){if(vars.running)return false;if($(this).hasClass('active'))return false;clearInterval(timer);timer=;slider.css('background','url("'+vars.currentImage.attr('src')+'") no-repeat');vars.currentSlide=$(this).attr('rel')-1;nivoRun(slider,kids,settings,'control');});} if(settings.keyboardNav){$(window).keypress(function(event){if(event.keyCode=='37'){if(vars.running)return false;clearInterval(timer);timer=;vars.currentSlide-=2;nivoRun(slider,kids,settings,'prev');} if(event.keyCode=='39'){if(vars.running)return false;clearInterval(timer);timer=;nivoRun(slider,kids,settings,'next');}});} if(settings.pauseOnHover){slider.hover(function(){vars.paused=true;clearInterval(timer);timer=;},function(){vars.paused=false;if(timer==&&!settings.manualAdvance){timer=setInterval(function(){nivoRun(slider,kids,settings,false);},settings.pauseTime);}});} slider.bind('nivo:animFinished',function(){vars.running=false;$(kids).each(function(){if($(this).is('a')){$(this).css('display','none');}});if($(kids[vars.currentSlide]).is('a')){$(kids[vars.currentSlide]).css('display','block');} if(timer==&&!vars.paused&&!settings.manualAdvance){timer=setInterval(function(){nivoRun(slider,kids,settings,false);},settings.pauseTime);}

settings.afterChange.call(this);});var createSlices=function(slider,settings,vars){for(var i=0;i<settings.slices;i++){var sliceWidth=Math.round(slider.width()/settings.slices);if(i==settings.slices-1){slider.append($('
').css({left:(sliceWidth*i)+'px',width:(slider.width()-(sliceWidth*i))+'px',height:'0px',opacity:'0',background:'url("'+vars.currentImage.attr('src')+'") no-repeat -'+((sliceWidth+(i*sliceWidth))-sliceWidth)+'px 0%'}));}else{slider.append($('
').css({left:(sliceWidth*i)+'px',width:sliceWidth+'px',height:'0px',opacity:'0',background:'url("'+vars.currentImage.attr('src')+'") no-repeat -'+((sliceWidth+(i*sliceWidth))-sliceWidth)+'px 0%'}));}}} var createBoxes=function(slider,settings,vars){var boxWidth=Math.round(slider.width()/settings.boxCols);var boxHeight=Math.round(slider.height()/settings.boxRows);for(var rows=0;rows<settings.boxRows;rows++){for(var cols=0;cols<settings.boxCols;cols++){if(cols==settings.boxCols-1){slider.append($('
').css({opacity:0,left:(boxWidth*cols)+'px',top:(boxHeight*rows)+'px',width:(slider.width()-(boxWidth*cols))+'px',height:boxHeight+'px',background:'url("'+vars.currentImage.attr('src')+'") no-repeat -'+((boxWidth+(cols*boxWidth))-boxWidth)+'px -'+((boxHeight+(rows*boxHeight))-boxHeight)+'px'}));}else{slider.append($('
').css({opacity:0,left:(boxWidth*cols)+'px',top:(boxHeight*rows)+'px',width:boxWidth+'px',height:boxHeight+'px',background:'url("'+vars.currentImage.attr('src')+'") no-repeat -'+((boxWidth+(cols*boxWidth))-boxWidth)+'px -'+((boxHeight+(rows*boxHeight))-boxHeight)+'px'}));}}}}

var nivoRun=function(slider,kids,settings,nudge){var vars=slider.data('nivo:vars');if(vars&&(vars.currentSlide==vars.totalSlides-1)){settings.lastSlide.call(this);} if((!vars||vars.stop)&&!nudge)return false;settings.beforeChange.call(this);if(!nudge){slider.css('background','url("'+vars.currentImage.attr('src')+'") no-repeat');}else{if(nudge=='prev'){slider.css('background','url("'+vars.currentImage.attr('src')+'") no-repeat');} if(nudge=='next'){slider.css('background','url("'+vars.currentImage.attr('src')+'") no-repeat');}} vars.currentSlide++;if(vars.currentSlide==vars.totalSlides){vars.currentSlide=0;settings.slideshowEnd.call(this);} if(vars.currentSlide<0)vars.currentSlide=(vars.totalSlides-1);if($(kids[vars.currentSlide]).is('img')){vars.currentImage=$(kids[vars.currentSlide]);}else{vars.currentImage=$(kids[vars.currentSlide]).find('img:first');} if(settings.controlNav){$('.nivo-controlNav a',slider).removeClass('active');$('.nivo-controlNav a:eq('+vars.currentSlide+')',slider).addClass('active');} processCaption(settings);$('.nivo-slice',slider).remove();$('.nivo-box',slider).remove();if(settings.effect=='random'){var anims=new Array('sliceDownRight','sliceDownLeft','sliceUpRight','sliceUpLeft','sliceUpDown','sliceUpDownLeft','fold','fade','boxRandom','boxRain','boxRainReverse','boxRainGrow','boxRainGrowReverse');vars.randAnim=anims[Math.floor(Math.random()*(anims.length+1))];if(vars.randAnim==undefined)vars.randAnim='fade';} if(settings.effect.indexOf(',')!=-1){var anims=settings.effect.split(',');vars.randAnim=anims[Math.floor(Math.random()*(anims.length))];if(vars.randAnim==undefined)vars.randAnim='fade';} vars.running=true;if(settings.effect=='sliceDown'||settings.effect=='sliceDownRight'||vars.randAnim=='sliceDownRight'||settings.effect=='sliceDownLeft'||vars.randAnim=='sliceDownLeft'){createSlices(slider,settings,vars);var timeBuff=0;var i=0;var slices=$('.nivo-slice',slider);if(settings.effect=='sliceDownLeft'||vars.randAnim=='sliceDownLeft')slices=$('.nivo-slice',slider)._reverse();slices.each(function(){var slice=$(this);slice.css({'top':'0px'});if(i==settings.slices-1){setTimeout(function(){slice.animate({height:'100%',opacity:'1.0'},settings.animSpeed,,function(){slider.trigger('nivo:animFinished');});},(100+timeBuff));}else{setTimeout(function(){slice.animate({height:'100%',opacity:'1.0'},settings.animSpeed);},(100+timeBuff));} timeBuff+=50;i++;});} else if(settings.effect=='sliceUp'||settings.effect=='sliceUpRight'||vars.randAnim=='sliceUpRight'||settings.effect=='sliceUpLeft'||vars.randAnim=='sliceUpLeft'){createSlices(slider,settings,vars);var timeBuff=0;var i=0;var slices=$('.nivo-slice',slider);if(settings.effect=='sliceUpLeft'||vars.randAnim=='sliceUpLeft')slices=$('.nivo-slice',slider)._reverse();slices.each(function(){var slice=$(this);slice.css({'bottom':'0px'});if(i==settings.slices-1){setTimeout(function(){slice.animate({height:'100%',opacity:'1.0'},settings.animSpeed,,function(){slider.trigger('nivo:animFinished');});},(100+timeBuff));}else{setTimeout(function(){slice.animate({height:'100%',opacity:'1.0'},settings.animSpeed);},(100+timeBuff));} timeBuff+=50;i++;});} else if(settings.effect=='sliceUpDown'||settings.effect=='sliceUpDownRight'||vars.randAnim=='sliceUpDown'||settings.effect=='sliceUpDownLeft'||vars.randAnim=='sliceUpDownLeft'){createSlices(slider,settings,vars);var timeBuff=0;var i=0;var v=0;var slices=$('.nivo-slice',slider);if(settings.effect=='sliceUpDownLeft'||vars.randAnim=='sliceUpDownLeft')slices=$('.nivo-slice',slider)._reverse();slices.each(function(){var slice=$(this);if(i==0){slice.css('top','0px');i++;}else{slice.css('bottom','0px');i=0;} if(v==settings.slices-1){setTimeout(function(){slice.animate({height:'100%',opacity:'1.0'},settings.animSpeed,,function(){slider.trigger('nivo:animFinished');});},(100+timeBuff));}else{setTimeout(function(){slice.animate({height:'100%',opacity:'1.0'},settings.animSpeed);},(100+timeBuff));} timeBuff+=50;v++;});} else if(settings.effect=='fold'||vars.randAnim=='fold'){createSlices(slider,settings,vars);var timeBuff=0;var i=0;$('.nivo-slice',slider).each(function(){var slice=$(this);var origWidth=slice.width();slice.css({top:'0px',height:'100%',width:'0px'});if(i==settings.slices-1){setTimeout(function(){slice.animate({width:origWidth,opacity:'1.0'},settings.animSpeed,,function(){slider.trigger('nivo:animFinished');});},(100+timeBuff));}else{setTimeout(function(){slice.animate({width:origWidth,opacity:'1.0'},settings.animSpeed);},(100+timeBuff));} timeBuff+=50;i++;});} else if(settings.effect=='fade'||vars.randAnim=='fade'){createSlices(slider,settings,vars);var firstSlice=$('.nivo-slice:first',slider);firstSlice.css({'height':'100%','width':slider.width()+'px'});firstSlice.animate({opacity:'1.0'},(settings.animSpeed*2),,function(){slider.trigger('nivo:animFinished');});} else if(settings.effect=='slideInRight'||vars.randAnim=='slideInRight'){createSlices(slider,settings,vars);var firstSlice=$('.nivo-slice:first',slider);firstSlice.css({'height':'100%','width':'0px','opacity':'1'});firstSlice.animate({width:slider.width()+'px'},(settings.animSpeed*2),,function(){slider.trigger('nivo:animFinished');});} else if(settings.effect=='slideInLeft'||vars.randAnim=='slideInLeft'){createSlices(slider,settings,vars);var firstSlice=$('.nivo-slice:first',slider);firstSlice.css({'height':'100%','width':'0px','opacity':'1','left':,'right':'0px'});firstSlice.animate({width:slider.width()+'px'},(settings.animSpeed*2),,function(){firstSlice.css({'left':'0px','right':});slider.trigger('nivo:animFinished');});} else if(settings.effect=='boxRandom'||vars.randAnim=='boxRandom'){createBoxes(slider,settings,vars);var totalBoxes=settings.boxCols*settings.boxRows;var i=0;var timeBuff=0;var boxes=shuffle($('.nivo-box',slider));boxes.each(function(){var box=$(this);if(i==totalBoxes-1){setTimeout(function(){box.animate({opacity:'1'},settings.animSpeed,,function(){slider.trigger('nivo:animFinished');});},(100+timeBuff));}else{setTimeout(function(){box.animate({opacity:'1'},settings.animSpeed);},(100+timeBuff));} timeBuff+=20;i++;});} else if(settings.effect=='boxRain'||vars.randAnim=='boxRain'||settings.effect=='boxRainReverse'||vars.randAnim=='boxRainReverse'||settings.effect=='boxRainGrow'||vars.randAnim=='boxRainGrow'||settings.effect=='boxRainGrowReverse'||vars.randAnim=='boxRainGrowReverse'){createBoxes(slider,settings,vars);var totalBoxes=settings.boxCols*settings.boxRows;var i=0;var timeBuff=0;var rowIndex=0;var colIndex=0;var box2Darr=new Array();box2Darr[rowIndex]=new Array();var boxes=$('.nivo-box',slider);if(settings.effect=='boxRainReverse'||vars.randAnim=='boxRainReverse'||settings.effect=='boxRainGrowReverse'||vars.randAnim=='boxRainGrowReverse'){boxes=$('.nivo-box',slider)._reverse();} boxes.each(function(){box2Darr[rowIndex][colIndex]=$(this);colIndex++;if(colIndex==settings.boxCols){rowIndex++;colIndex=0;box2Darr[rowIndex]=new Array();}});for(var cols=0;cols<(settings.boxCols*2);cols++){var prevCol=cols;for(var rows=0;rows<settings.boxRows;rows++){if(prevCol>=0&&prevCol<settings.boxCols){(function(row,col,time,i,totalBoxes){var box=$(box2Darr[row][col]);var w=box.width();var h=box.height();if(settings.effect=='boxRainGrow'||vars.randAnim=='boxRainGrow'||settings.effect=='boxRainGrowReverse'||vars.randAnim=='boxRainGrowReverse'){box.width(0).height(0);} if(i==totalBoxes-1){setTimeout(function(){box.animate({opacity:'1',width:w,height:h},settings.animSpeed/1.3,,function(){slider.trigger('nivo:animFinished');});},(100+time));}else{setTimeout(function(){box.animate({opacity:'1',width:w,height:h},settings.animSpeed/1.3);},(100+time));}})(rows,prevCol,timeBuff,i,totalBoxes);i++;} prevCol--;} timeBuff+=100;}}} var shuffle=function(arr){for(var j,x,i=arr.length;i;j=parseInt(Math.random()*i),x=arr[--i],arr[i]=arr[j],arr[j]=x);return arr;} var trace=function(msg){if(this.console&&typeof console.log!="undefined") console.log(msg);} this.stop=function(){if(!$(element).data('nivo:vars').stop){$(element).data('nivo:vars').stop=true;trace('Stop Slider');}} this.start=function(){if($(element).data('nivo:vars').stop){$(element).data('nivo:vars').stop=false;trace('Start Slider');}} settings.afterLoad.call(this);return this;};$.fn.nivoSlider=function(options){return this.each(function(key,value){var element=$(this);if(element.data('nivoslider'))return element.data('nivoslider');var nivoslider=new NivoSlider(this,options);element.data('nivoslider',nivoslider);});};$.fn.nivoSlider.defaults={effect:'random',slices:15,boxCols:8,boxRows:4,animSpeed:500,pauseTime:3000,startSlide:0,directionNav:true,directionNavHide:true,controlNav:true,controlNavThumbs:false,controlNavThumbsFromRel:false,controlNavThumbsSearch:'.jpg',controlNavThumbsReplace:'_thumb.jpg',keyboardNav:true,pauseOnHover:true,manualAdvance:false,captionOpacity:0.8,prevText:'Prev',nextText:'Next',beforeChange:function(){},afterChange:function(){},slideshowEnd:function(){},lastSlide:function(){},afterLoad:function(){}};$.fn._reverse=[].reverse;})(jQuery);

/****************************************************************
 *                                                              *
 *  JQuery Curvy Corners by Mike Jolley                         *
 *  http://blue-anvil.com                                       *
 *  ------------                                                *
 *  Version 1.81                                                 *
 *                                                              *
 *  Origionaly by: Cameron Cooke and Tim Hutchison.             *
 *  Website: http://www.curvycorners.net                        *
 *                                                              *
 *  This library is free software; you can redistribute         *
 *  it and/or modify it under the terms of the GNU              *
 *  Lesser General Public License as published by the           *
 *  Free Software Foundation; either version 2.1 of the         *
 *  License, or (at your option) any later version.             *
 *                                                              *
 *  This library is distributed in the hope that it will        *
 *  be useful, but WITHOUT ANY WARRANTY; without even the       *
 *  implied warranty of MERCHANTABILITY or FITNESS FOR A        *
 *  PARTICULAR PURPOSE. See the GNU Lesser General Public       *
 *  License for more details.                                   *
 *                                                              *
 *  You should have received a copy of the GNU Lesser           *
 *  General Public License along with this library;             *
 *  Inc., 59 Temple Place, Suite 330, Boston,                   *
 *  MA 02111-1307 USA                                           *
 *                                                              *
 ****************************************************************/

(function($){$.fn.corner=function(options){function BlendColour(Col1,Col2,Col1Fraction){var red1=parseInt(Col1.substr(1,2),16);var green1=parseInt(Col1.substr(3,2),16);var blue1=parseInt(Col1.substr(5,2),16);var red2=parseInt(Col2.substr(1,2),16);var green2=parseInt(Col2.substr(3,2),16);var blue2=parseInt(Col2.substr(5,2),16);if(Col1Fraction>1||Col1Fraction<0)Col1Fraction=1;var endRed=Math.round((red1*Col1Fraction)+(red2*(1-Col1Fraction)));if(endRed>255)endRed=255;if(endRed<0)endRed=0;var endGreen=Math.round((green1*Col1Fraction)+(green2*(1-Col1Fraction)));if(endGreen>255)endGreen=255;if(endGreen<0)endGreen=0;var endBlue=Math.round((blue1*Col1Fraction)+(blue2*(1-Col1Fraction)));if(endBlue>255)endBlue=255;if(endBlue<0)endBlue=0;return"#"+IntToHex(endRed)+IntToHex(endGreen)+IntToHex(endBlue);} function IntToHex(strNum){base=strNum/16;rem=strNum%16;base=base-(rem/16);baseS=MakeHex(base);remS=MakeHex(rem);return baseS++remS;} function MakeHex(x){if((x>=0)&&(x<=9)){return x;}else{switch(x){case 10:return"A";case 11:return"B";case 12:return"C";case 13:return"D";case 14:return"E";case 15:return"F";};return"F";};} function pixelFraction(x,y,r){var pixelfraction=0;var xvalues=new Array(1);var yvalues=new Array(1);var point=0;var whatsides="";var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(x,2)));if((intersect>=y)&&(intersect<(y+1))){whatsides="Left";xvalues[point]=0;yvalues[point]=intersect-y;point=point+1;};var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(y+1,2)));if((intersect>=x)&&(intersect<(x+1))){whatsides=whatsides+"Top";xvalues[point]=intersect-x;yvalues[point]=1;point=point+1;};var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(x+1,2)));if((intersect>=y)&&(intersect<(y+1))){whatsides=whatsides+"Right";xvalues[point]=1;yvalues[point]=intersect-y;point=point+1;};var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(y,2)));if((intersect>=x)&&(intersect<(x+1))){whatsides=whatsides+"Bottom";xvalues[point]=intersect-x;yvalues[point]=0;};switch(whatsides){case"LeftRight":pixelfraction=Math.min(yvalues[0],yvalues[1])+((Math.max(yvalues[0],yvalues[1])-Math.min(yvalues[0],yvalues[1]))/2);break;case"TopRight":pixelfraction=1-(((1-xvalues[0])*(1-yvalues[1]))/2);break;case"TopBottom":pixelfraction=Math.min(xvalues[0],xvalues[1])+((Math.max(xvalues[0],xvalues[1])-Math.min(xvalues[0],xvalues[1]))/2);break;case"LeftBottom":pixelfraction=(yvalues[0]*xvalues[1])/2;break;default:pixelfraction=1;};return pixelfraction;} function rgb2Hex(rgbColour){try{var rgbArray=rgb2Array(rgbColour);var red=parseInt(rgbArray[0]);var green=parseInt(rgbArray[1]);var blue=parseInt(rgbArray[2]);var hexColour="#"+IntToHex(red)+IntToHex(green)+IntToHex(blue);}catch(e){alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex");};return hexColour;} function rgb2Array(rgbColour){var rgbValues=rgbColour.substring(4,rgbColour.indexOf(")"));var rgbArray=rgbValues.split(", ");return rgbArray;} function format_colour(colour){var returnColour="transparent";if(colour!=""&&colour!="transparent") {if(colour.substr(0,3)=="rgb") {returnColour=rgb2Hex(colour);} else if(colour.length==4) {returnColour="#"+colour.substring(1,2)+colour.substring(1,2)+colour.substring(2,3)+colour.substring(2,3)+colour.substring(3,4)+colour.substring(3,4);} else {returnColour=colour;};};return returnColour;};function strip_px(value){return parseInt(((value!="auto"&&value.indexOf("%")==-1&&value!=""&&value.indexOf("px")!==-1)?value.slice(0,value.indexOf("px")):0))} function drawPixel(box,intx,inty,colour,transAmount,height,newCorner,image,bgImage,cornerRadius,isBorder,borderWidth,boxWidth,settings){var $$=$(box);var pixel=document.createElement("div");$(pixel).css({height:height,width:"1px",position:"absolute","font-size":"1px",overflow:"hidden"});var topMaxRadius=Math.max(settings.tl?settings.tl.radius:0,settings.tr?settings.tr.radius:0);if(image==-1&&bgImage!=""){if(topMaxRadius>0) $(pixel).css("background-position","-"+((boxWidth-cornerRadius-borderWidth)+intx)+"px -"+(($$.height()+topMaxRadius-borderWidth)-inty)+"px");else $(pixel).css("background-position","-"+((boxWidth-cornerRadius-borderWidth)+intx)+"px -"+(($$.height())-inty)+"px");$(pixel).css({"background-image":bgImage,"background-repeat":$$.css("background-repeat"),"background-color":colour});} else {if(!isBorder)$(pixel).css("background-color",colour).addClass('hasBackgroundColor');else $(pixel).css("background-color",colour);};if(transAmount!=100) setOpacity(pixel,transAmount);$(pixel).css({top:inty+"px",left:intx+"px"});return pixel;};function setOpacity(obj,opacity){opacity=(opacity==100)?99.999:opacity;if($.browser.safari&&obj.tagName!="IFRAME") {var rgbArray=rgb2Array(obj.style.backgroundColor);var red=parseInt(rgbArray[0]);var green=parseInt(rgbArray[1]);var blue=parseInt(rgbArray[2]);obj.style.backgroundColor="rgba("+red+", "+green+", "+blue+", "+opacity/100+")";} else if(typeof(obj.style.opacity)!="undefined") {obj.style.opacity=opacity/100;} else if(typeof(obj.style.MozOpacity)!="undefined") {obj.style.MozOpacity=opacity/100;} else if(typeof(obj.style.filter)!="undefined") {obj.style.filter="alpha(opacity:"+opacity+")";} else if(typeof(obj.style.KHTMLOpacity)!="undefined") {obj.style.KHTMLOpacity=opacity/100;}} function applyCorners(box,settings){var $$=$(box);var thebgImage=$$.css("backgroundImage");var topContainer=null;var bottomContainer=null;var masterCorners=new Array();var contentDIV=null;var boxHeight=strip_px($$.css("height"))?strip_px($$.css("height")):box.scrollHeight;var boxWidth=strip_px($$.css("width"))?strip_px($$.css("width")):box.scrollWidth;var borderWidth=strip_px($$.css("borderTopWidth"))?strip_px($$.css("borderTopWidth")):0;var boxPaddingTop=strip_px($$.css("paddingTop"));var boxPaddingBottom=strip_px($$.css("paddingBottom"));var boxPaddingLeft=strip_px($$.css("paddingLeft"));var boxPaddingRight=strip_px($$.css("paddingRight"));var boxColour=format_colour($$.css("backgroundColor"));var bgImage=(thebgImage!="none"&&thebgImage!="initial")?thebgImage:"";var borderColour=format_colour($$.css("borderTopColor"));var borderString=borderWidth+"px"+" solid "+borderColour;var topMaxRadius=Math.max(settings.tl?settings.tl.radius:0,settings.tr?settings.tr.radius:0);var botMaxRadius=Math.max(settings.bl?settings.bl.radius:0,settings.br?settings.br.radius:0);$$.addClass('hasCorners').css({"padding":"0","borderColor":box.style.borderColour,'overflow':'visible'});if(box.style.position!="absolute")$$.css("position","relative");if(($.browser.msie)){if($.browser.version==6&&box.style.width=="auto"&&box.style.height=="auto")$$.css("width","100%");$$.css("zoom","1");$($$+" *").css("zoom","normal");} for(var t=0;t<2;t++){switch(t){case 0:if(settings.tl||settings.tr){var newMainContainer=document.createElement("div");topContainer=box.appendChild(newMainContainer);$(topContainer).css({width:"100%","font-size":"1px",overflow:"hidden",position:"absolute","padding-left":borderWidth,"padding-right":borderWidth,height:topMaxRadius+"px",top:0-topMaxRadius+"px",left:0-borderWidth+"px"}).addClass('topContainer');};break;case 1:if(settings.bl||settings.br){var newMainContainer=document.createElement("div");bottomContainer=box.appendChild(newMainContainer);$(bottomContainer).css({width:"100%","font-size":"1px",overflow:"hidden",position:"absolute","padding-left":borderWidth,"padding-right":borderWidth,height:botMaxRadius,bottom:0-botMaxRadius+"px",left:0-borderWidth+"px"}).addClass('bottomContainer');};break;};};if(settings.autoPad==true){var contentContainer=document.createElement("div");var contentContainer2=document.createElement("div");var clearDiv=document.createElement("div");$(contentContainer2).css({margin:"0","padding-bottom":boxPaddingBottom,"padding-top":boxPaddingTop,"padding-left":boxPaddingLeft,"padding-right":boxPaddingRight,'overflow':'visible'}).addClass('hasBackgroundColor content_container');$(contentContainer).css({position:"relative",'float':"left",width:"100%","margin-top":"-"+(topMaxRadius-borderWidth)+"px","margin-bottom":"-"+(botMaxRadius-borderWidth)+"px"}).addClass="autoPadDiv";$(clearDiv).css("clear","both");contentContainer2.appendChild(contentContainer);contentContainer2.appendChild(clearDiv);$$.wrapInner(contentContainer2);};if(topContainer)$$.css("border-top",0);if(bottomContainer)$$.css("border-bottom",0);var corners=["tr","tl","br","bl"];for(var i in corners){if(i>-1<4){var cc=corners[i];if(!settings[cc]){if(((cc=="tr"||cc=="tl")&&topContainer!=null)||((cc=="br"||cc=="bl")&&bottomContainer!=null)){var newCorner=document.createElement("div");$(newCorner).css({position:"relative","font-size":"1px",overflow:"hidden"});if(bgImage=="") $(newCorner).css("background-color",boxColour);else $(newCorner).css("background-image",bgImage).css("background-color",boxColour);;switch(cc) {case"tl":$(newCorner).css({height:topMaxRadius-borderWidth,"margin-right":settings.tr.radius-(borderWidth*2),"border-left":borderString,"border-top":borderString,left:-borderWidth+"px","background-repeat":$$.css("background-repeat"),"background-position":borderWidth+"px 0px"});break;case"tr":$(newCorner).css({height:topMaxRadius-borderWidth,"margin-left":settings.tl.radius-(borderWidth*2),"border-right":borderString,"border-top":borderString,left:borderWidth+"px","background-repeat":$$.css("background-repeat"),"background-position":"-"+(topMaxRadius+borderWidth)+"px 0px"});break;case"bl":if(topMaxRadius>0) $(newCorner).css({height:botMaxRadius-borderWidth,"margin-right":settings.br.radius-(borderWidth*2),"border-left":borderString,"border-bottom":borderString,left:-borderWidth+"px","background-repeat":$$.css("background-repeat"),"background-position":"0px -"+($$.height()+topMaxRadius-borderWidth+1)+"px"});else $(newCorner).css({height:botMaxRadius-borderWidth,"margin-right":settings.br.radius-(borderWidth*2),"border-left":borderString,"border-bottom":borderString,left:-borderWidth+"px","background-repeat":$$.css("background-repeat"),"background-position":"0px -"+($$.height())+"px"});break;case"br":if(topMaxRadius>0) $(newCorner).css({height:botMaxRadius-borderWidth,"margin-left":settings.bl.radius-(borderWidth*2),"border-right":borderString,"border-bottom":borderString,left:borderWidth+"px","background-repeat":$$.css("background-repeat"),"background-position":"-"+settings.bl.radius+borderWidth+"px -"+($$.height()+topMaxRadius-borderWidth+1)+"px"});else $(newCorner).css({height:botMaxRadius-borderWidth,"margin-left":settings.bl.radius-(borderWidth*2),"border-right":borderString,"border-bottom":borderString,left:borderWidth+"px","background-repeat":$$.css("background-repeat"),"background-position":"-"+settings.bl.radius+borderWidth+"px -"+($$.height())+"px"});break;};};}else{if(masterCorners[settings[cc].radius]){var newCorner=masterCorners[settings[cc].radius].cloneNode(true);}else{var newCorner=document.createElement("DIV");$(newCorner).css({height:settings[cc].radius,width:settings[cc].radius,position:"absolute","font-size":"1px",overflow:"hidden"});var borderRadius=parseInt(settings[cc].radius-borderWidth);for(var intx=0,j=settings[cc].radius;intx<j;intx++){if((intx+1)>=borderRadius) var y1=-1;else var y1=(Math.floor(Math.sqrt(Math.pow(borderRadius,2)-Math.pow((intx+1),2)))-1);if(borderRadius!=j){if((intx)>=borderRadius) var y2=-1;else var y2=Math.ceil(Math.sqrt(Math.pow(borderRadius,2)-Math.pow(intx,2)));if((intx+1)>=j) var y3=-1;else var y3=(Math.floor(Math.sqrt(Math.pow(j,2)-Math.pow((intx+1),2)))-1);};if((intx)>=j) var y4=-1;else var y4=Math.ceil(Math.sqrt(Math.pow(j,2)-Math.pow(intx,2)));if(y1>-1)newCorner.appendChild(drawPixel(box,intx,0,boxColour,100,(y1+1),newCorner,-1,bgImage,settings[cc].radius,0,borderWidth,boxWidth,settings));if(borderRadius!=j){for(var inty=(y1+1);inty<y2;inty++){if(settings.antiAlias){if(bgImage!=""){var borderFract=(pixelFraction(intx,inty,borderRadius)*100);if(borderFract<30){newCorner.appendChild(drawPixel(box,intx,inty,borderColour,100,1,newCorner,0,bgImage,settings[cc].radius,1,borderWidth,boxWidth,settings));}else{newCorner.appendChild(drawPixel(box,intx,inty,borderColour,100,1,newCorner,-1,bgImage,settings[cc].radius,1,borderWidth,boxWidth,settings));};}else{var pixelcolour=BlendColour(boxColour,borderColour,pixelFraction(intx,inty,borderRadius));newCorner.appendChild(drawPixel(box,intx,inty,pixelcolour,100,1,newCorner,0,bgImage,settings[cc].radius,cc,1,borderWidth,boxWidth,settings));};};};if(settings.antiAlias){if(y3>=y2) {if(y2==-1)y2=0;newCorner.appendChild(drawPixel(box,intx,y2,borderColour,100,(y3-y2+1),newCorner,0,bgImage,0,1,borderWidth,boxWidth,settings));}}else{if(y3>=y1) {newCorner.appendChild(drawPixel(box,intx,(y1+1),borderColour,100,(y3-y1),newCorner,0,bgImage,0,1,borderWidth,boxWidth,settings));}};var outsideColour=borderColour;}else{var outsideColour=boxColour;var y3=y1;};if(settings.antiAlias){for(var inty=(y3+1);inty<y4;inty++){newCorner.appendChild(drawPixel(box,intx,inty,outsideColour,(pixelFraction(intx,inty,j)*100),1,newCorner,((borderWidth>0)?0:-1),bgImage,settings[cc].radius,1,borderWidth,boxWidth,settings));};};};masterCorners[settings[cc].radius]=newCorner.cloneNode(true);};if(cc!="br"){for(var t=0,k=newCorner.childNodes.length;t<k;t++){var pixelBar=newCorner.childNodes[t];var pixelBarTop=strip_px($(pixelBar).css("top"));var pixelBarLeft=strip_px($(pixelBar).css("left"));var pixelBarHeight=strip_px($(pixelBar).css("height"));if(cc=="tl"||cc=="bl"){$(pixelBar).css("left",settings[cc].radius-pixelBarLeft-1+"px");};if(cc=="tr"||cc=="tl"){$(pixelBar).css("top",settings[cc].radius-pixelBarHeight-pixelBarTop+"px");};switch(cc){case"tr":$(pixelBar).css("background-position","-"+Math.abs((boxWidth-settings[cc].radius+borderWidth)+pixelBarLeft)+"px -"+Math.abs(settings[cc].radius-pixelBarHeight-pixelBarTop-borderWidth)+"px");break;case"tl":$(pixelBar).css("background-position","-"+Math.abs((settings[cc].radius-pixelBarLeft-1)-borderWidth)+"px -"+Math.abs(settings[cc].radius-pixelBarHeight-pixelBarTop-borderWidth)+"px");break;case"bl":if(topMaxRadius>0) $(pixelBar).css("background-position","-"+Math.abs((settings[cc].radius-pixelBarLeft-1)-borderWidth)+"px -"+Math.abs(($$.height()+topMaxRadius-borderWidth+1))+"px");else $(pixelBar).css("background-position","-"+Math.abs((settings[cc].radius-pixelBarLeft-1)-borderWidth)+"px -"+Math.abs(($$.height()))+"px");break;};};};};if(newCorner){switch(cc){case"tl":if($(newCorner).css("position")=="absolute")$(newCorner).css("top","0");if($(newCorner).css("position")=="absolute")$(newCorner).css("left","0");if(topContainer)topContainer.appendChild(newCorner);break;case"tr":if($(newCorner).css("position")=="absolute")$(newCorner).css("top","0");if($(newCorner).css("position")=="absolute")$(newCorner).css("right","0");if(topContainer)topContainer.appendChild(newCorner);break;case"bl":if($(newCorner).css("position")=="absolute")$(newCorner).css("bottom","0");if(newCorner.style.position=="absolute")$(newCorner).css("left","0");if(bottomContainer)bottomContainer.appendChild(newCorner);break;case"br":if($(newCorner).css("position")=="absolute")$(newCorner).css("bottom","0");if($(newCorner).css("position")=="absolute")$(newCorner).css("right","0");if(bottomContainer)bottomContainer.appendChild(newCorner);break;};};};};var radiusDiff=new Array();radiusDiff["t"]=Math.abs(settings.tl.radius-settings.tr.radius);radiusDiff["b"]=Math.abs(settings.bl.radius-settings.br.radius);for(z in radiusDiff){if(z=="t"||z=="b"){if(radiusDiff[z]){var smallerCornerType=((settings[z+"l"].radius<settings[z+"r"].radius)?z+"l":z+"r");var newFiller=document.createElement("div");$(newFiller).css({height:radiusDiff[z],width:settings[smallerCornerType].radius+"px",position:"absolute","font-size":"1px",overflow:"hidden","background-color":boxColour,"background-image":bgImage});switch(smallerCornerType) {case"tl":$(newFiller).css({"bottom":"0","left":"0","border-left":borderString,"background-position":"0px -"+(settings[smallerCornerType].radius-borderWidth)});topContainer.appendChild(newFiller);break;case"tr":$(newFiller).css({"bottom":"0","right":"0","border-right":borderString,"background-position":"0px -"+(settings[smallerCornerType].radius-borderWidth)+"px"});topContainer.appendChild(newFiller);break;case"bl":$(newFiller).css({"top":"0","left":"0","border-left":borderString,"background-position":"0px -"+($$.height()+settings[smallerCornerType].radius-borderWidth)});bottomContainer.appendChild(newFiller);break;case"br":$(newFiller).css({"top":"0","right":"0","border-right":borderString,"background-position":"0px -"+($$.height()+settings[smallerCornerType].radius-borderWidth)});bottomContainer.appendChild(newFiller);break;}};var newFillerBar=document.createElement("div");$(newFillerBar).css({position:"relative","font-size":"1px",overflow:"hidden","background-color":boxColour,"background-image":bgImage,"background-repeat":$$.css("background-repeat")});switch(z){case"t":if(topContainer){if(settings.tl.radius&&settings.tr.radius){$(newFillerBar).css({height:topMaxRadius-borderWidth+"px","margin-left":settings.tl.radius-borderWidth+"px","margin-right":settings.tr.radius-borderWidth+"px","border-top":borderString}).addClass('hasBackgroundColor');if(bgImage!="") $(newFillerBar).css("background-position","-"+(topMaxRadius+borderWidth)+"px 0px");topContainer.appendChild(newFillerBar);};$$.css("background-position","0px -"+(topMaxRadius-borderWidth+1)+"px");};break;case"b":if(bottomContainer){if(settings.bl.radius&&settings.br.radius){$(newFillerBar).css({height:botMaxRadius-borderWidth+"px","margin-left":settings.bl.radius-borderWidth+"px","margin-right":settings.br.radius-borderWidth+"px","border-bottom":borderString});if(bgImage!=""&&topMaxRadius>0) $(newFillerBar).css("background-position","-"+(settings.bl.radius-borderWidth)+"px -"+($$.height()+topMaxRadius-borderWidth+1)+"px");else $(newFillerBar).css("background-position","-"+(settings.bl.radius-borderWidth)+"px -"+($$.height())+"px").addClass('hasBackgroundColor');bottomContainer.appendChild(newFillerBar);};};break;};};};$$.prepend(topContainer);$$.prepend(bottomContainer);} var settings={tl:{radius:8},tr:{radius:8},bl:{radius:8},br:{radius:8},antiAlias:true,autoPad:true,validTags:["div"]};if(options&&typeof(options)!='string') $.extend(settings,options);return this.each(function(){if(!$(this).is('.hasCorners')){applyCorners(this,settings);}});};})(jQuery);

/* Mosaic - Sliding Boxes and Captions jQuery Plugin Version 1.0.1 www.buildinternet.com/project/mosaic

By Sam Dunn / One Mighty Roar (www.onemightyroar.com) Released under MIT License / GPL License

  • /

(function(a){if(!a.omr){a.omr=new Object()}a.omr.mosaic=function(c,b){var d=this;d.$el=a(c);d.el=c;d.$el.data("omr.mosaic",d);d.init=function(){d.options=a.extend({},a.omr.mosaic.defaultOptions,b);d.load_box()};d.load_box=function(){if(d.options.preload){a(d.options.backdrop,d.el).hide();a(d.options.overlay,d.el).hide();a(window).load(function(){if(d.options.options.animation=="fade"&&a(d.options.overlay,d.el).css("opacity")==0){a(d.options.overlay,d.el).css("filter","alpha(opacity=0)")}a(d.options.overlay,d.el).fadeIn(200,function(){a(d.options.backdrop,d.el).fadeIn(200)});d.allow_hover()})}else{a(d.options.backdrop,d.el).show();a(d.options.overlay,d.el).show();d.allow_hover()}};d.allow_hover=function(){switch(d.options.animation){case"fade":a(d.el).hover(function(){a(d.options.overlay,d.el).stop().fadeTo(d.options.speed,d.options.opacity)},function(){a(d.options.overlay,d.el).stop().fadeTo(d.options.speed,0)});break;case"slide":startX=a(d.options.overlay,d.el).css(d.options.anchor_x)!="auto"?a(d.options.overlay,d.el).css(d.options.anchor_x):"0px";startY=a(d.options.overlay,d.el).css(d.options.anchor_y)!="auto"?a(d.options.overlay,d.el).css(d.options.anchor_y):"0px";var f={};f[d.options.anchor_x]=d.options.hover_x;f[d.options.anchor_y]=d.options.hover_y;var e={};e[d.options.anchor_x]=startX;e[d.options.anchor_y]=startY;a(d.el).hover(function(){a(d.options.overlay,d.el).stop().animate(f,d.options.speed)},function(){a(d.options.overlay,d.el).stop().animate(e,d.options.speed)});break}};d.init()};a.omr.mosaic.defaultOptions={animation:"fade",speed:150,opacity:1,preload:0,anchor_x:"left",anchor_y:"bottom",hover_x:"0px",hover_y:"0px",overlay:".mosaic-overlay",backdrop:".mosaic-backdrop"};a.fn.mosaic=function(b){return this.each(function(){(new a.omr.mosaic(this,b))})}})(jQuery);

$(function(){

 if ($('#slider').length > 0) {
   $('#slider').nivoSlider();
   // SetEqualHeights();
 }

});