/*
PanoScroll v1.3
Release Date: 	January 13, 2010
Homepage:		http://steve.deadlycomputer.com/portfolio/PanoScroll
Examples: 		http://steve.deadlycomputer.com/portfolio/PanoScroll#examples

Copyright (c) 2010 stephen giorgi

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

(function(a){a.fn.extend({panoScroll:function(b){var c={name:null,direction:"left",scrollSpeed:60,originalPos:0,numPx:1,auto:false};var b=a.extend(c,b);return this.each(function(){var f=b;var l="#"+f.name;var g=f.direction;var k=f.scrollSpeed;var d=f.originalPos;var h=f.numPx;var m=f.auto;var j=f.autoControls;var e=this;var i=a(this);i.addClass("panView");if(m==true){if(g=="left"||g=="up"){h=-h}else{if(g=="right"||g=="down"){h=h}}if(g=="left"||g=="right"){i.everyTime(k,e,function(o){d=d+h;i.css("background-position",d+"px 0");return d})}else{if(g=="up"||g=="down"){i.everyTime(k,e,function(o){d=d+h;i.css("background-position","0 "+d+"px");return d})}}}else{if(g=="left"||g=="right"){i.append('<div class="sLeft sCtrl" title="Scroll Left">Scroll Left</div><div class="sPause" title="Pause">Pause</div><div class="sRight sCtrl" title="Scroll Right">Scroll Right</div>')}else{if(g=="up"||g=="down"){i.append('<div class="sUp sCtrl" title="Scroll Up">Scroll Up</div><div class="sPause" title="Pause">Pause</div><div class="sDown sCtrl" title="Scroll Down">Scroll Down</div>')}}a(l+" div.sLeft").click(function(){a(l+" div.sCtrl").fadeOut();i.everyTime(k,e,function(o){d=d-h;i.css("background-position",d+"px 0");return d})});a("#"+l+" div.sRight").click(function(){a(l+" div.sCtrl").fadeOut();i.everyTime(k,e,function(o){d=d+h;i.css("background-position",d+"px 0");return d})});a("#"+l+" div.sUp").click(function(){a(l+" div.sCtrl").fadeOut();i.everyTime(k,e,function(o){d=d-h;i.css("background-position","0 "+d+"px");return d})});a("#"+l+" div.sDown").click(function(){a(l+" div.sCtrl").fadeOut();i.everyTime(k,e,function(o){d=d+h;i.css("background-position","0 "+d+"px");return d})});a("#"+l+" div.sPause").click(function(){i.stopTime(e);a(l+" div.sCtrl").fadeIn()})}})}})})(jQuery);jQuery.fn.extend({everyTime:function(f,e,h,g){return this.each(function(){jQuery.timer.add(this,f,e,h,g)})},oneTime:function(e,d,f){return this.each(function(){jQuery.timer.add(this,e,d,f,1)})},stopTime:function(d,c){return this.each(function(){jQuery.timer.remove(this,d,c)})}});jQuery.extend({timer:{global:[],guid:1,dataKey:"jQuery.timer",regex:/^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1000,das:10000,hs:100000,ks:1000000},timeParse:function(h){if(h==undefined||h==null){return null}var f=this.regex.exec(jQuery.trim(h.toString()));if(f[2]){var e=parseFloat(f[1]);var g=this.powers[f[2]]||1;return e*g}else{return h}},add:function(o,i,p,m,k){var j=0;if(jQuery.isFunction(p)){if(!k){k=m}m=p;p=i}i=jQuery.timer.timeParse(i);if(typeof i!="number"||isNaN(i)||i<0){return}if(typeof k!="number"||isNaN(k)||k<0){k=0}k=k||0;var l=jQuery.data(o,this.dataKey)||jQuery.data(o,this.dataKey,{});if(!l[p]){l[p]={}}m.timerID=m.timerID||this.guid++;var n=function(){if((++j>k&&k!==0)||m.call(o,j)===false){jQuery.timer.remove(o,p,m)}};n.timerID=m.timerID;if(!l[p][m.timerID]){l[p][m.timerID]=window.setInterval(n,i)}this.global.push(o)},remove:function(j,f,i){var h=jQuery.data(j,this.dataKey),g;if(h){if(!f){for(f in h){this.remove(j,f,i)}}else{if(h[f]){if(i){if(i.timerID){window.clearInterval(h[f][i.timerID]);delete h[f][i.timerID]}}else{for(var i in h[f]){window.clearInterval(h[f][i]);delete h[f][i]}}for(g in h[f]){break}if(!g){g=null;delete h[f]}}}for(g in h){break}if(!g){jQuery.removeData(j,this.dataKey)}}}}});jQuery(window).bind("unload",function(){jQuery.each(jQuery.timer.global,function(d,c){jQuery.timer.remove(c)})});
