/*
 ColorBox v1.2.6 - a full featured, light-weight, customizable lightbox based on jQuery 1.3
 (c) 2009 Jack Moore - www.colorpowered.com - jack@colorpowered.com
 Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
(function($){
 
 var open, element, settings, callback, maxWidth, maxHeight, loadedWidth, loadedHeight, interfaceHeight, interfaceWidth, index, $related, ssTimeout, $slideshow, $window, $close, $next, $prev, $current, $title, $modal, $wrap, $loadingOverlay, $loadingGraphic, $overlay, $modalContent, $loaded, $borderTopCenter, $borderMiddleLeft, $borderMiddleRight, $borderBottomCenter;
 
 /* Helper Functions */
 //function for IE6 to set the background overlay
 function IE6Overlay(){
 $overlay.css({"position":"absolute", width:$window.width(), height:$window.height(), top:$window.scrollTop(), left:$window.scrollLeft()});
 }

 function slideshow(){
 var stop;
 function start(){
 $slideshow
 .text(settings.slideshowStop)
 .bind("cbox_complete", function(){
 ssTimeout = setTimeout($.fn.colorbox.next, settings.slideshowSpeed);
 })
 .bind("cbox_load", function(){
 clearTimeout(ssTimeout); 
 }).one("click", function(){
 stop();
 $(this).removeClass('hover');
 });
 $modal.removeClass("cboxSlideshow_off").addClass("cboxSlideshow_on");
 }
 
 stop = function(){
 clearTimeout(ssTimeout);
 $slideshow
 .text(settings.slideshowStart)
 .unbind('cbox_complete cbox_load')
 .one("click", function(){
 start();
 ssTimeout = setTimeout($.fn.colorbox.next, settings.slideshowSpeed);
 $(this).removeClass('hover');
 });
 $modal.removeClass("cboxSlideshow_on").addClass("cboxSlideshow_off");
 };
 
 if(settings.slideshow && $related.length>1){
 if(settings.slideshowAuto){
 start();
 } else {
 stop();
 }
 }
 }

 function clearInline(){
 if($("#cboxInlineTemp").length > 0){
 $loaded.children().insertBefore("#cboxInlineTemp");
 $("#cboxInlineTemp").remove();
 }
 }

 function cbox_key(e) {
 if(e.keyCode == 37){
 e.preventDefault();
 $prev.click();
 } else if(e.keyCode == 39){
 e.preventDefault();
 $next.click();
 }
 }

 // Convert % values to pixels
 function setSize(size, dimension){
 dimension = dimension=='x' ? document.documentElement.clientWidth : document.documentElement.clientHeight;
 return (typeof size == 'string') ? (size.match(/%/) ? (dimension/100)*parseInt(size, 10) : parseInt(size, 10)) : size;
 }

 function isImage(url){
 return settings.photo ? true : url.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(.*))?$/i);
 }

 /* Initializes ColorBox when the DOM has loaded */
 $(function(){
 $.fn.colorbox.init();
 });

 $.fn.colorbox = function(options, custom_callback) {
 if(this.length){
 this.each(function(){
 var data = $(this).data("colorbox") ? $.extend({},
 $(this).data("colorbox"), options) : $.extend({}, $.fn.colorbox.settings, options);
 $(this).data("colorbox", data).addClass("cboxelement");
 });
 } else {
 $(this).data("colorbox", $.extend({}, $.fn.colorbox.settings, options));
 }
 
 $(this).unbind("click.colorbox").bind("click.colorbox", function (event) {
 
 element = this;
 
 settings = $(element).data('colorbox');
 
 //remove the focus from the anchor to prevent accidentally calling
 //colorbox multiple times (by pressing the 'Enter' key
 //after colorbox has opened, but before the user has clicked on anything else)
 element.blur();
 
 callback = custom_callback ? custom_callback : false;
 
 var rel = settings.rel ? settings.rel : element.rel;
 
 if (rel && rel != 'nofollow') {
 $related = $('.cboxelement').filter(function(){
 var relRelated = $(this).data("colorbox").rel ? $(this).data("colorbox").rel : this.rel;
 return (relRelated == rel);
 });
 index = $related.index(element);
 
 if(index<0){ //this checks direct calls to colorbox
 $related = $related.add(element);
 index = $related.length - 1;
 }
 
 } else {
 $related = $(element);
 index = 0;
 }
 if (!open) {
 $.event.trigger('cbox_open');
 $close.html(settings.close);
 $overlay.css({"opacity": settings.opacity}).show();
 open = true;
 $.fn.colorbox.position(setSize(settings.initialWidth, 'x'), setSize(settings.initialHeight, 'y'), 0);
 if ($.browser.msie && $.browser.version < 7) {
 $window.bind("resize scroll", IE6Overlay);
 }
 }
 slideshow();
 $.fn.colorbox.load();
 
 if(settings.overlayClose===true){
 $overlay.css({"cursor":"pointer"}).click($.fn.colorbox.close);
 }
 event.preventDefault();
 });
 
 if(options && options.open){
 $(this).triggerHandler('click.colorbox');
 }
 
 return this;
 };

 $.fn.colorbox.element = function(){
 return element;
 };

 /*
 Initialize the modal: store common calculations, preload the interface graphics, append the html.
 This preps colorbox for a speedy open when clicked, and lightens the burdon on the browser by only
 having to run once, instead of each time colorbox is opened.
 */
 $.fn.colorbox.init = function(){
 
 $window = $(window);
 
 $('body').prepend(
 $overlay = $('<div id="cboxOverlay" />').hide(), 
 $modal = $('<div id="colorbox" />')
 );
 
 $wrap = $('<div id="cboxWrapper" />').appendTo($modal).append(
 $('<div/>').append(
 $('<div id="cboxTopLeft"/>'),
 $borderTopCenter = $('<div id="cboxTopCenter"/>'),
 $('<div id="cboxTopRight"/>')
 ),
 $borderMiddleLeft = $('<div id="cboxMiddleLeft" />'),
 $modalContent = $('<div id="cboxContent" />'),
 $borderMiddleRight = $('<div id="cboxMiddleRight" />'),
 $('<div/>').append(
 $('<div id="cboxBottomLeft"/>'),
 $borderBottomCenter = $('<div id="cboxBottomCenter"/>'),
 $('<div id="cboxBottomRight"/>')
 )
 );
 
 $wrap.find("[id]").css({'float':'left'});
 
 $modalContent.append(
 //loaded is filled with temporary HTML to allow the CSS backgrounds for those elements to load before ColorBox is actually called.
 $loaded = $('<div id="cboxLoadedContent" style="width:0; height:0;" />'),
 $loadingOverlay = $('<div id="cboxLoadingOverlay" />'),
 $loadingGraphic = $('<div id="cboxLoadingGraphic" />'),
 $title = $('<div id="cboxTitle" />'),
 $current = $('<div id="cboxCurrent" />'),
 $slideshow = $('<div id="cboxSlideshow" />'),
 $next = $('<div id="cboxNext" />').click($.fn.colorbox.next),
 $prev = $('<div id="cboxPrevious" />').click($.fn.colorbox.prev),
 $close = $('<div id="cboxClose" />').click($.fn.colorbox.close)
 );
 
 $modalContent.children()
 .addClass("hover")
 .mouseover(function(){$(this).addClass("hover");})
 .mouseout(function(){$(this).removeClass("hover");})
 .hide();
 
 //precalculate sizes that will be needed multiple times.
 interfaceHeight = $borderTopCenter.height()+$borderBottomCenter.height()+$modalContent.outerHeight(true) - $modalContent.height();//Subtraction needed for IE6
 interfaceWidth = $borderMiddleLeft.width()+$borderMiddleRight.width()+$modalContent.outerWidth(true) - $modalContent.width();
 loadedHeight = $loaded.outerHeight(true);
 loadedWidth = $loaded.outerWidth(true);
 
 $modal.css({"padding-bottom":interfaceHeight,"padding-right":interfaceWidth}).hide();//the padding removes the need to do size conversions during the animation step.
 
 //Setup button & key events.
 $().bind("keydown.cbox_close", function(e){
 if (e.keyCode == 27) {
 e.preventDefault();
 $close.click();
 }
 });
 
 $modalContent.children().removeClass("hover");
 };
 
 //navigates to the next page/image in a set.
 $.fn.colorbox.next = function(){
 index = index < $related.length-1 ? index+1 : 0;
 $.fn.colorbox.load();
 };
 
 $.fn.colorbox.prev = function(){
 index = index > 0 ? index-1 : $related.length-1;
 $.fn.colorbox.load();
 };
 
 $.fn.colorbox.position = function(mWidth, mHeight, speed, loadedCallback){
 var winHeight = document.documentElement.clientHeight;
 var posTop = winHeight/2 - mHeight/2;
 var posLeft = document.documentElement.clientWidth/2 - mWidth/2;
 //keeps the box from expanding to an inaccessible area offscreen.
 if(mHeight > winHeight){posTop -=(mHeight - winHeight);}
 if(posTop < 0){posTop = 0;} 
 if(posLeft < 0){posLeft = 0;}
 
 posTop+=$window.scrollTop();
 posLeft+=$window.scrollLeft();
 
 mWidth = mWidth - interfaceWidth;
 mHeight = mHeight - interfaceHeight;
 
 //this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
 //but it has to be shrank down around the size of div#colorbox when it's done. If not,
 //it can invoke an obscure IE bug when using iframes.
 $wrap[0].style.width = $wrap[0].style.height = "9999px";

 function modalDimensions(that){
 //loading overlay size has to be sure that IE6 uses the correct height.
 $borderTopCenter[0].style.width = $borderBottomCenter[0].style.width = $modalContent[0].style.width = that.style.width;
 $loadingGraphic[0].style.height = $loadingOverlay[0].style.height = $modalContent[0].style.height = $borderMiddleLeft[0].style.height = $borderMiddleRight[0].style.height = that.style.height;
 }
 
 //setting the speed to 0 to reduce the delay between same-sized content.
 var animate_speed = ($modal.width()===mWidth && $modal.height() === mHeight) ? 0 : speed;
 $modal.dequeue().animate({height:mHeight, width:mWidth, top:posTop, left:posLeft}, {duration: animate_speed,
 complete: function(){
 modalDimensions(this);
 
 //shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
 $wrap[0].style.width = (mWidth+interfaceWidth) + "px";
 $wrap[0].style.height = (mHeight+interfaceHeight) + "px";
 
 if (loadedCallback) {loadedCallback();}
 if ($.browser.msie && $.browser.version < 7) {IE6Overlay();}
 },
 step: function(){
 modalDimensions(this);
 }
 });
 };
 
 $.fn.colorbox.dimensions = function(object){
 if(!open){ return; }
 
 $window.unbind('resize.cbox_resize');
 
 var speed = settings.transition=="none" ? 0 : settings.speed;
 $loaded.remove();
 $loaded = $(object);
 
 var width;
 var height;
 
 function getWidth(){
 if(settings.width){
 width = maxWidth;
 } else {
 width = maxWidth && maxWidth < $loaded.width() ? maxWidth : $loaded.width();
 }
 return width;
 }
 function getHeight(){
 if(settings.height){
 height = maxHeight;
 } else {
 height = maxHeight && maxHeight < $loaded.height() ? maxHeight : $loaded.height();
 }
 return height;
 }
 
 $loaded.hide().appendTo('body')
 .attr({id:'cboxLoadedContent'})
 .css({width:getWidth()})
 .css({height:getHeight()})//sets the height independently from the width in case the new width influences the value of height.
 .prependTo($modalContent);
 
 if ($.browser.msie && $.browser.version < 7) {
 $('select').not($('#colorbox select')).css({'visibility':'hidden'});
 }
 
 if($('#cboxPhoto').length > 0 && settings.height){
 var topMargin = (height - parseInt($('#cboxPhoto')[0].style.height, 10))/2;
 $('#cboxPhoto').css({marginTop:(topMargin > 0?topMargin:0)});
 }
 
 function setPosition(s){
 var mWidth = width+loadedWidth+interfaceWidth;
 var mHeight = height+loadedHeight+interfaceHeight;
 $.fn.colorbox.position(mWidth, mHeight, s, function(){
 if(!open){ return; }
 
 if($.browser.msie){
 //This fadeIn helps the bicubic resampling to kick-in.
 if($('#cboxPhoto').length > 0 ){$loaded.fadeIn(100);}
 //IE adds a filter when ColorBox fades in and out that can cause problems if the loaded content contains transparent pngs.
 $modal.css('filter','');
 }
 
 $modalContent.children().show();
 
 //Waited until the iframe is added to the DOM & it is visible before setting the src.
 //This increases compatability with pages using DOM dependent JavaScript.
 $('#cboxIframe').after("<iframe name='iframe_"+new Date().getTime()+"' frameborder=0 src='"+(settings.href ? settings.href : element.href)+"' />").remove();
 
 $loadingOverlay.hide();
 $loadingGraphic.hide();
 $slideshow.hide();
 
 if($related.length>1){
 $current.html(settings.current.replace(/\{current\}/, index+1).replace(/\{total\}/, $related.length));
 $next.html(settings.next);
 $prev.html(settings.previous);
 
 $().unbind('keydown', cbox_key).one('keydown', cbox_key);
 
 if(settings.slideshow){
 $slideshow.show();
 }
 } else {
 $current.add($next).add($prev).hide();
 }
 
 $title.html(settings.title ? settings.title : element.title);
 
 $.event.trigger('cbox_complete');
 
 if(callback){
 callback.call(element);
 }
 
 if (settings.transition === 'fade'){
 $modal.fadeTo(speed, 1, function(){
 if($.browser.msie){$modal.css('filter','');}
 });
 }
 
 $window.bind('resize.cbox_resize', function(){
 $.fn.colorbox.position(mWidth, mHeight, 0);
 });
 });
 }
 if (settings.transition == 'fade') {
 $modal.fadeTo(speed, 0, function(){setPosition(0);});
 } else {
 setPosition(speed);
 }
 
 if(settings.preloading && $related.length>1){
 var prev = index > 0 ? $related[index-1] : $related[$related.length-1];
 var next = index < $related.length-1 ? $related[index+1] : $related[0];
 
 var nextSrc = $(next).data('colorbox').href ? $(next).data('colorbox').href : next.href;
 var prevSrc = $(prev).data('colorbox').href ? $(prev).data('colorbox').href : prev.href;
 
 if(isImage(nextSrc)){
 $('<img />').attr('src', nextSrc);
 }
 if(isImage(prevSrc)){
 $('<img />').attr('src', prevSrc);
 }
 }
 };
 
 $.fn.colorbox.load = function(){
 
 element = $related[index];
 
 settings = $(element).data('colorbox');
 
 $.event.trigger('cbox_load');
 
 $loadingOverlay.show();
 $loadingGraphic.show();
 $close.show();
 clearInline();//puts inline elements back if they are being used
 
 // Evaluate the height based on the optional height and width settings.
 var height = settings.height ? setSize(settings.height, 'y') - loadedHeight - interfaceHeight : false;
 var width = settings.width ? setSize(settings.width, 'x') - loadedWidth - interfaceWidth : false;
 
 //Re-evaluate the maximum dimensions based on the optional maxheight and maxwidth.
 if(settings.maxHeight){
 maxHeight = settings.maxHeight ? setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight : false;
 height = height && height < maxHeight ? height : maxHeight;
 }
 if(settings.maxWidth){
 maxWidth = settings.maxWidth ? setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth : false;
 width = width && width < maxWidth ? width : maxWidth;
 }
 
 maxHeight = height;
 maxWidth = width;
 
 var href = settings.href ? settings.href : element.href;
 
 if (settings.inline) {
 $('<div id="cboxInlineTemp" />').hide().insertBefore($(href)[0]);
 $.fn.colorbox.dimensions($(href).wrapAll('<div/>').parent());
 } else if (settings.iframe) {
 $.fn.colorbox.dimensions(
 $("<div><div id='cboxIframe' /></div>")
 );//timestamp to prevent caching.
 } else if (isImage(href)){
 var loadingElement = new Image();
 loadingElement.onload = function(){
 loadingElement.onload = null;
 
 if((maxHeight || maxWidth) && settings.resize){
 var width = this.width;
 var height = this.height;
 var percent = 0;
 var that = this;
 
 var setResize = function(){
 height += height * percent;
 width += width * percent;
 that.height = height;
 that.width = width; 
 };
 if( maxWidth && width > maxWidth ){
 percent = (maxWidth - width) / width;
 setResize();
 }
 if( maxHeight && height > maxHeight ){
 percent = (maxHeight - height) / height;
 setResize();
 }
 }
 $.fn.colorbox.dimensions($("<div />").css({width:this.width, height:this.height}).append($(this).css({width:this.width, height:this.height, display:"block", margin:"auto", border:0}).attr('id', 'cboxPhoto')));
 if($related.length > 1){
 $(this).css({cursor:'pointer'}).click($.fn.colorbox.next);
 }
 if($.browser.msie && $.browser.version == 7){
 this.style.msInterpolationMode='bicubic';
 }
 };
 loadingElement.src = href;
 } else {
 $('<div />').load(href, function(data, textStatus){
 if(textStatus == "success"){
 $.fn.colorbox.dimensions($(this));
 } else {
 $.fn.colorbox.dimensions($("<p>Request unsuccessful.</p>"));
 }
 });
 } 
 };

 //public function for closing colorbox. To use this within an iframe use the following format: parent.$.fn.colorbox.close();
 $.fn.colorbox.close = function(){
 open = false;
 clearTimeout(ssTimeout);
 $window.unbind('resize.cbox_resize');
 $slideshow.unbind('cbox_complete cbox_load click');
 clearInline();
 $overlay.css({cursor:'auto'}).fadeOut('fast').unbind('click', $.fn.colorbox.close);
 $().unbind('keydown', cbox_key);
 
 if ($.browser.msie && $.browser.version < 7) {
 $('select').css({'visibility':'inherit'});
 $window.unbind('resize scroll', IE6Overlay);
 }
 
 $modalContent.children().hide();
 
 $modal
 .stop(true, false)
 .removeClass()
 .fadeOut('fast', function(){
 element.focus();
 $loaded.remove();
 $modal.css({'opacity':1});
 $.event.trigger('cbox_closed');
 });
 };

 /*
 ColorBox Default Settings.
 
 The colorbox() function takes one argument, an object of key/value pairs, that are used to initialize the modal.
 
 Please do not change these settings here, instead overwrite these settings when attaching the colorbox() event to your anchors.
 Example (Global) : $.fn.colorbox.settings.transition = "fade"; //changes the transition to fade for all colorBox() events proceeding it's declaration.
 Example (Specific) : $("a[href='http://www.google.com']").colorbox({width:"90%", height:"450px", iframe:true});
 
 See http://colorpowered.com/colorbox for details.
 */
 $.fn.colorbox.settings = {
 transition : "elastic",
 speed : 500,
 width : false,
 height : false,
 initialWidth : "400",
 initialHeight : "400",
 maxWidth : false,
 maxHeight : false,
 resize : true,
 inline : false,
 iframe : false,
 photo : false,
 href : false,
 title : false,
 rel : false,
 opacity : 0.8,
 preloading : true,
 current : "image {current} of {total}",
 previous : "previous",
 next : "next",
 close : "close",
 open : false,
 overlayClose : false,
 slideshow:false,
 slideshowAuto:true,
 slideshowSpeed: 2500,
 slideshowStart: "start slideshow",
 slideshowStop: "stop slideshow"
 };
})(jQuery);


/*
 * jQuery history plugin
 *
 * Copyright (c) 2006 Taku Sano (Mikage Sawatari)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Modified by Lincoln Cooper to add Safari support and only call the callback once during initialization
 * for msie when no initial hash supplied.
 * API rewrite by Lauris Bukšis-Haberkorns
 */

(function($) {

function History()
{
 this._curHash = '';
 this._callback = function(hash){};
};

$.extend(History.prototype, {

 init: function(callback) {
 this._callback = callback;
 this._curHash = location.hash;

 if($.browser.msie) {
 // To stop the callback firing twice during initilization if no hash present
 if (this._curHash == '') {
 this._curHash = '#';
 }

 // add hidden iframe for IE
 $("body").prepend('<iframe id="jQuery_history" style="display: none;"></iframe>');
 var iframe = $("#jQuery_history")[0].contentWindow.document;
 iframe.open();
 iframe.close();
 iframe.location.hash = this._curHash;
 }
 else if ($.browser.safari) {
 // etablish back/forward stacks
 this._historyBackStack = [];
 this._historyBackStack.length = history.length;
 this._historyForwardStack = [];
 this._isFirst = true;
 this._dontCheck = false;
 }
 this._callback(this._curHash.replace(/^#/, ''));
 setInterval(this._check, 100);
 },

 add: function(hash) {
 // This makes the looping function do something
 this._historyBackStack.push(hash);
 
 this._historyForwardStack.length = 0; // clear forwardStack (true click occured)
 this._isFirst = true;
 },
 
 _check: function() {
 if($.browser.msie) {
 // On IE, check for location.hash of iframe
 var ihistory = $("#jQuery_history")[0];
 var iframe = ihistory.contentDocument || ihistory.contentWindow.document;
 var current_hash = iframe.location.hash;
 if(current_hash != $.history._curHash) { 
 location.hash = current_hash;
 $.history._curHash = current_hash;
 $.history._callback(current_hash.replace(/^#/, '')); 
 }
 } else if ($.browser.safari) {
 if (!$.history._dontCheck) {
 var historyDelta = history.length - $.history._historyBackStack.length;
 
 if (historyDelta) { // back or forward button has been pushed
 $.history._isFirst = false;
 if (historyDelta < 0) { // back button has been pushed
 // move items to forward stack
 for (var i = 0; i < Math.abs(historyDelta); i++) $.history._historyForwardStack.unshift($.history._historyBackStack.pop());
 } else { // forward button has been pushed
 // move items to back stack
 for (var i = 0; i < historyDelta; i++) $.history._historyBackStack.push($.history._historyForwardStack.shift());
 }
 var cachedHash = $.history._historyBackStack[$.history._historyBackStack.length - 1];
 if (cachedHash != undefined) {
 $.history._curHash = location.hash;
 $.history._callback(cachedHash);
 }
 } else if ($.history._historyBackStack[$.history._historyBackStack.length - 1] == undefined && !$.history._isFirst) {
 // back button has been pushed to beginning and URL already pointed to hash (e.g. a bookmark)
 // document.URL doesn't change in Safari
 if (location.hash.indexOf('#') >= 0) {
 $.history._callback(location.hash.split('#')[1]);
 } else {
 $.history._callback('');
 }
 $.history._isFirst = true;
 }
 }
 } else {
 // otherwise, check for location.hash
 var current_hash = location.hash;
 if(current_hash != $.history._curHash) {
 $.history._curHash = current_hash;
 $.history._callback(current_hash.replace(/^#/, ''));
 }
 }
 },

 isKonqueror: function() {
 return /KHTML|Konqueror/.test(navigator.userAgent);
 },

 load: function(hash) {
 var newhash;

 if ($.browser.safari) {
 newhash = hash;
 } else {
 newhash = (this.isKonqueror() ? '' : '#') + hash;
 location.hash = newhash;
 }

 this._curHash = newhash;
 
 if ($.browser.msie) {
 var ihistory = $("#jQuery_history")[0]; // TODO: need contentDocument?
 var iframe = ihistory.contentWindow.document;
 iframe.open();
 iframe.close();
 iframe.location.hash = newhash;
 this._callback(hash);
 }
 else if ($.browser.safari) {
 this._dontCheck = true;
 // Manually keep track of the history values for Safari
 this.add(hash);
 
 // Wait a while before allowing checking so that Safari has time to update the "history" object
 // correctly (otherwise the check loop would detect a false change in hash).
 var fn = function() {$.history._dontCheck = false;};
 window.setTimeout(fn, 200);
 this._callback(hash);
 // N.B. "location.hash=" must be the last line of code for Safari as execution stops afterwards.
 // By explicitly using the "location.hash" command (instead of using a variable set to "location.hash") the
 // URL in the browser and the "history" object are both updated correctly.
 location.hash = newhash;
 }
 else {
 this._callback(hash);
 }
 }
});

$(document).ready(function() {
 $.history = new History(); // singleton instance
});

})(jQuery);
/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/9/2009
 * @author Ariel Flesler
 * @version 1.4.1
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function($){var m=$.scrollTo=function(b,h,f){$(window).scrollTo(b,h,f)};m.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1};m.window=function(b){return $(window).scrollable()};$.fn.scrollable=function(){return this.map(function(){var b=this,h=!b.nodeName||$.inArray(b.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!h)return b;var f=(b.contentWindow||b).document||b.ownerDocument||b;return $.browser.safari||f.compatMode=='BackCompat'?f.body:f.documentElement})};$.fn.scrollTo=function(l,j,a){if(typeof j=='object'){a=j;j=0}if(typeof a=='function')a={onAfter:a};if(l=='max')l=9e9;a=$.extend({},m.defaults,a);j=j||a.speed||a.duration;a.queue=a.queue&&a.axis.length>1;if(a.queue)j/=2;a.offset=n(a.offset);a.over=n(a.over);return this.scrollable().each(function(){var k=this,o=$(k),d=l,p,g={},q=o.is('html,body');switch(typeof d){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px)?$/.test(d)){d=n(d);break}d=$(d,this);case'object':if(d.is||d.style)p=(d=$(d)).offset()}$.each(a.axis.split(''),function(b,h){var f=h=='x'?'Left':'Top',i=f.toLowerCase(),c='scroll'+f,r=k[c],s=h=='x'?'Width':'Height';if(p){g[c]=p[i]+(q?0:r-o.offset()[i]);if(a.margin){g[c]-=parseInt(d.css('margin'+f))||0;g[c]-=parseInt(d.css('border'+f+'Width'))||0}g[c]+=a.offset[i]||0;if(a.over[i])g[c]+=d[s.toLowerCase()]()*a.over[i]}else g[c]=d[i];if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],u(s));if(!b&&a.queue){if(r!=g[c])t(a.onAfterFirst);delete g[c]}});t(a.onAfter);function t(b){o.animate(g,j,a.easing,b&&function(){b.call(this,l,a)})};function u(b){var h='scroll'+b;if(!q)return k[h];var f='client'+b,i=k.ownerDocument.documentElement,c=k.ownerDocument.body;return Math.max(i[h],c[h])-Math.min(i[f],c[f])}}).end()};function n(b){return typeof b=='object'?b:{top:b,left:b}}})(jQuery);
/**
 * jCarousel - Riding carousels with jQuery
 * http://sorgalla.com/jcarousel/
 *
 * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * Built on top of the jQuery library
 * http://jquery.com
 *
 * Inspired by the "Carousel Component" by Bill Scott
 * http://billwscott.com/carousel/
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(9($){$.1v.C=9(o){z 4.1b(9(){3p r(4,o)})};8 q={Z:F,25:1,21:1,u:7,1c:3,15:7,1K:\'2X\',2c:\'2Q\',1q:0,B:7,1j:7,1G:7,2F:7,2B:7,2z:7,2x:7,2v:7,2s:7,2p:7,1S:\'<P></P>\',1Q:\'<P></P>\',2m:\'2l\',2k:\'2l\',1O:7,1L:7};$.C=9(e,o){4.5=$.16({},q,o||{});4.Q=F;4.D=7;4.H=7;4.t=7;4.U=7;4.R=7;4.N=!4.5.Z?\'1H\':\'26\';4.E=!4.5.Z?\'24\':\'23\';8 a=\'\',1e=e.K.1e(\' \');1r(8 i=0;i<1e.I;i++){6(1e[i].2y(\'C-2w\')!=-1){$(e).1E(1e[i]);8 a=1e[i];1p}}6(e.2t==\'3o\'||e.2t==\'3n\'){4.t=$(e);4.D=4.t.19();6(4.D.1o(\'C-H\')){6(!4.D.19().1o(\'C-D\'))4.D=4.D.B(\'<P></P>\');4.D=4.D.19()}10 6(!4.D.1o(\'C-D\'))4.D=4.t.B(\'<P></P>\').19()}10{4.D=$(e);4.t=$(e).3h(\'>2o,>2n,P>2o,P>2n\')}6(a!=\'\'&&4.D.19()[0].K.2y(\'C-2w\')==-1)4.D.B(\'<P 3g=" \'+a+\'"></P>\');4.H=4.t.19();6(!4.H.I||!4.H.1o(\'C-H\'))4.H=4.t.B(\'<P></P>\').19();4.R=$(\'.C-11\',4.D);6(4.R.u()==0&&4.5.1Q!=7)4.R=4.H.1z(4.5.1Q).11();4.R.V(4.K(\'C-11\'));4.U=$(\'.C-17\',4.D);6(4.U.u()==0&&4.5.1S!=7)4.U=4.H.1z(4.5.1S).11();4.U.V(4.K(\'C-17\'));4.H.V(4.K(\'C-H\'));4.t.V(4.K(\'C-t\'));4.D.V(4.K(\'C-D\'));8 b=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 c=4.t.32(\'1F\');8 d=4;6(c.u()>0){8 f=0,i=4.5.21;c.1b(9(){d.1I(4,i++);f+=d.S(4,b)});4.t.y(4.N,f+\'T\');6(!o||o.u===J)4.5.u=c.u()}4.D.y(\'1y\',\'1A\');4.U.y(\'1y\',\'1A\');4.R.y(\'1y\',\'1A\');4.2G=9(){d.17()};4.2b=9(){d.11()};4.1U=9(){d.2q()};6(4.5.1j!=7)4.5.1j(4,\'2a\');6($.2A.28){4.1f(F,F);$(27).1u(\'2I\',9(){d.1t()})}10 4.1t()};8 r=$.C;r.1v=r.2H={C:\'0.2.3\'};r.1v.16=r.16=$.16;r.1v.16({1t:9(){4.A=7;4.G=7;4.X=7;4.13=7;4.14=F;4.1d=7;4.O=7;4.W=F;6(4.Q)z;4.t.y(4.E,4.1s(4.5.21)+\'T\');8 p=4.1s(4.5.25);4.X=4.13=7;4.1i(p,F);$(27).22(\'2E\',4.1U).1u(\'2E\',4.1U)},2D:9(){4.t.2C();4.t.y(4.E,\'3u\');4.t.y(4.N,\'3t\');6(4.5.1j!=7)4.5.1j(4,\'2D\');4.1t()},2q:9(){6(4.O!=7&&4.W)4.t.y(4.E,r.M(4.t.y(4.E))+4.O);4.O=7;4.W=F;6(4.5.1G!=7)4.5.1G(4);6(4.5.15!=7){8 a=4;8 b=1k.1P(4.1m()/4.5.15),N=0,E=0;$(\'1F\',4.t).1b(9(i){N+=a.S(4,b);6(i+1<a.A)E=N});4.t.y(4.N,N+\'T\');4.t.y(4.E,-E+\'T\')}4.1c(4.A,F)},3s:9(){4.Q=1h;4.1f()},3r:9(){4.Q=F;4.1f()},u:9(s){6(s!=J){4.5.u=s;6(!4.Q)4.1f()}z 4.5.u},3q:9(i,a){6(a==J||!a)a=i;6(4.5.u!==7&&a>4.5.u)a=4.5.u;1r(8 j=i;j<=a;j++){8 e=4.L(j);6(!e.I||e.1o(\'C-1a-1D\'))z F}z 1h},L:9(i){z $(\'.C-1a-\'+i,4.t)},2u:9(i,s){8 e=4.L(i),20=0,2u=0;6(e.I==0){8 c,e=4.1B(i),j=r.M(i);1n(c=4.L(--j)){6(j<=0||c.I){j<=0?4.t.2r(e):c.1X(e);1p}}}10 20=4.S(e);e.1E(4.K(\'C-1a-1D\'));1R s==\'3l\'?e.3k(s):e.2C().3j(s);8 a=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 b=4.S(e,a)-20;6(i>0&&i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))-b+\'T\');4.t.y(4.N,r.M(4.t.y(4.N))+b+\'T\');z e},1V:9(i){8 e=4.L(i);6(!e.I||(i>=4.A&&i<=4.G))z;8 d=4.S(e);6(i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))+d+\'T\');e.1V();4.t.y(4.N,r.M(4.t.y(4.N))-d+\'T\')},17:9(){4.1C();6(4.O!=7&&!4.W)4.1T(F);10 4.1c(((4.5.B==\'1Z\'||4.5.B==\'G\')&&4.5.u!=7&&4.G==4.5.u)?1:4.A+4.5.1c)},11:9(){4.1C();6(4.O!=7&&4.W)4.1T(1h);10 4.1c(((4.5.B==\'1Z\'||4.5.B==\'A\')&&4.5.u!=7&&4.A==1)?4.5.u:4.A-4.5.1c)},1T:9(b){6(4.Q||4.14||!4.O)z;8 a=r.M(4.t.y(4.E));!b?a-=4.O:a+=4.O;4.W=!b;4.X=4.A;4.13=4.G;4.1i(a)},1c:9(i,a){6(4.Q||4.14)z;4.1i(4.1s(i),a)},1s:9(i){6(4.Q||4.14)z;6(4.5.B!=\'18\')i=i<1?1:(4.5.u&&i>4.5.u?4.5.u:i);8 a=4.A>i;8 b=r.M(4.t.y(4.E));8 f=4.5.B!=\'18\'&&4.A<=1?1:4.A;8 c=a?4.L(f):4.L(4.G);8 j=a?f:f-1;8 e=7,l=0,p=F,d=0;1n(a?--j>=i:++j<i){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K(\'C-1a-1D\'));c[a?\'1z\':\'1X\'](e)}c=e;d=4.S(e);6(p)l+=d;6(4.A!=7&&(4.5.B==\'18\'||(j>=1&&(4.5.u==7||j<=4.5.u))))b=a?b+d:b-d}8 g=4.1m();8 h=[];8 k=0,j=i,v=0;8 c=4.L(i-1);1n(++k){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K(\'C-1a-1D\'));c.I==0?4.t.2r(e):c[a?\'1z\':\'1X\'](e)}c=e;8 d=4.S(e);6(d==0){3f(\'3e: 3d 1H/26 3c 1r 3b. 3a 39 38 37 36 35. 34...\');z 0}6(4.5.B!=\'18\'&&4.5.u!==7&&j>4.5.u)h.33(e);10 6(p)l+=d;v+=d;6(v>=g)1p;j++}1r(8 x=0;x<h.I;x++)h[x].1V();6(l>0){4.t.y(4.N,4.S(4.t)+l+\'T\');6(a){b-=l;4.t.y(4.E,r.M(4.t.y(4.E))-l+\'T\')}}8 n=i+k-1;6(4.5.B!=\'18\'&&4.5.u&&n>4.5.u)n=4.5.u;6(j>n){k=0,j=n,v=0;1n(++k){8 e=4.L(j--);6(!e.I)1p;v+=4.S(e);6(v>=g)1p}}8 o=n-k+1;6(4.5.B!=\'18\'&&o<1)o=1;6(4.W&&a){b+=4.O;4.W=F}4.O=7;6(4.5.B!=\'18\'&&n==4.5.u&&(n-k+1)>=1){8 m=r.Y(4.L(n),!4.5.Z?\'1l\':\'1N\');6((v-m)>g)4.O=v-g-m}1n(i-->o)b+=4.S(4.L(i));4.X=4.A;4.13=4.G;4.A=o;4.G=n;z b},1i:9(p,a){6(4.Q||4.14)z;4.14=1h;8 b=4;8 c=9(){b.14=F;6(p==0)b.t.y(b.E,0);6(b.5.B==\'1Z\'||b.5.B==\'G\'||b.5.u==7||b.G<b.5.u)b.2j();b.1f();b.1M(\'2i\')};4.1M(\'31\');6(!4.5.1K||a==F){4.t.y(4.E,p+\'T\');c()}10{8 o=!4.5.Z?{\'24\':p}:{\'23\':p};4.t.1i(o,4.5.1K,4.5.2c,c)}},2j:9(s){6(s!=J)4.5.1q=s;6(4.5.1q==0)z 4.1C();6(4.1d!=7)z;8 a=4;4.1d=30(9(){a.17()},4.5.1q*2Z)},1C:9(){6(4.1d==7)z;2Y(4.1d);4.1d=7},1f:9(n,p){6(n==J||n==7){8 n=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!=\'A\')||4.5.u==7||4.G<4.5.u);6(!4.Q&&(!4.5.B||4.5.B==\'A\')&&4.5.u!=7&&4.G>=4.5.u)n=4.O!=7&&!4.W}6(p==J||p==7){8 p=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!=\'G\')||4.A>1);6(!4.Q&&(!4.5.B||4.5.B==\'G\')&&4.5.u!=7&&4.A==1)p=4.O!=7&&4.W}8 a=4;4.U[n?\'1u\':\'22\'](4.5.2m,4.2G)[n?\'1E\':\'V\'](4.K(\'C-17-1w\')).1J(\'1w\',n?F:1h);4.R[p?\'1u\':\'22\'](4.5.2k,4.2b)[p?\'1E\':\'V\'](4.K(\'C-11-1w\')).1J(\'1w\',p?F:1h);6(4.U.I>0&&(4.U[0].1g==J||4.U[0].1g!=n)&&4.5.1O!=7){4.U.1b(9(){a.5.1O(a,4,n)});4.U[0].1g=n}6(4.R.I>0&&(4.R[0].1g==J||4.R[0].1g!=p)&&4.5.1L!=7){4.R.1b(9(){a.5.1L(a,4,p)});4.R[0].1g=p}},1M:9(a){8 b=4.X==7?\'2a\':(4.X<4.A?\'17\':\'11\');4.12(\'2F\',a,b);6(4.X!==4.A){4.12(\'2B\',a,b,4.A);4.12(\'2z\',a,b,4.X)}6(4.13!==4.G){4.12(\'2x\',a,b,4.G);4.12(\'2v\',a,b,4.13)}4.12(\'2s\',a,b,4.A,4.G,4.X,4.13);4.12(\'2p\',a,b,4.X,4.13,4.A,4.G)},12:9(a,b,c,d,e,f,g){6(4.5[a]==J||(1R 4.5[a]!=\'2h\'&&b!=\'2i\'))z;8 h=1R 4.5[a]==\'2h\'?4.5[a][b]:4.5[a];6(!$.2W(h))z;8 j=4;6(d===J)h(j,c,b);10 6(e===J)4.L(d).1b(9(){h(j,4,d,c,b)});10{1r(8 i=d;i<=e;i++)6(i!==7&&!(i>=f&&i<=g))4.L(i).1b(9(){h(j,4,i,c,b)})}},1B:9(i){z 4.1I(\'<1F></1F>\',i)},1I:9(e,i){8 a=$(e).V(4.K(\'C-1a\')).V(4.K(\'C-1a-\'+i));a.1J(\'2V\',i);z a},K:9(c){z c+\' \'+c+(!4.5.Z?\'-2U\':\'-Z\')},S:9(e,d){8 a=e.2g!=J?e[0]:e;8 b=!4.5.Z?a.1x+r.Y(a,\'2f\')+r.Y(a,\'1l\'):a.2e+r.Y(a,\'2d\')+r.Y(a,\'1N\');6(d==J||b==d)z b;8 w=!4.5.Z?d-r.Y(a,\'2f\')-r.Y(a,\'1l\'):d-r.Y(a,\'2d\')-r.Y(a,\'1N\');$(a).y(4.N,w+\'T\');z 4.S(a)},1m:9(){z!4.5.Z?4.H[0].1x-r.M(4.H.y(\'2T\'))-r.M(4.H.y(\'2S\')):4.H[0].2e-r.M(4.H.y(\'2R\'))-r.M(4.H.y(\'3i\'))},2P:9(i,s){6(s==J)s=4.5.u;z 1k.2O((((i-1)/s)-1k.2N((i-1)/s))*s)+1}});r.16({3m:9(d){z $.16(q,d||{})},Y:9(e,p){6(!e)z 0;8 a=e.2g!=J?e[0]:e;6(p==\'1l\'&&$.2A.28){8 b={\'1y\':\'1A\',\'2M\':\'2L\',\'1H\':\'1q\'},1Y,1W;$.29(a,b,9(){1Y=a.1x});b[\'1l\']=0;$.29(a,b,9(){1W=a.1x});z 1W-1Y}z r.M($.y(a,p))},M:9(v){v=2K(v);z 2J(v)?0:v}})})(3v);',62,218,'||||this|options|if|null|var|function||||||||||||||||||||list|size||||css|return|first|wrap|jcarousel|container|lt|false|last|clip|length|undefined|className|get|intval|wh|tail|div|locked|buttonPrev|dimension|px|buttonNext|addClass|inTail|prevFirst|margin|vertical|else|prev|callback|prevLast|animating|visible|extend|next|circular|parent|item|each|scroll|timer|split|buttons|jcarouselstate|true|animate|initCallback|Math|marginRight|clipping|while|hasClass|break|auto|for|pos|setup|bind|fn|disabled|offsetWidth|display|before|block|create|stopAuto|placeholder|removeClass|li|reloadCallback|width|format|attr|animation|buttonPrevCallback|notify|marginBottom|buttonNextCallback|ceil|buttonPrevHTML|typeof|buttonNextHTML|scrollTail|funcResize|remove|oWidth2|after|oWidth|both|old|offset|unbind|top|left|start|height|window|safari|swap|init|funcPrev|easing|marginTop|offsetHeight|marginLeft|jquery|object|onAfterAnimation|startAuto|buttonPrevEvent|click|buttonNextEvent|ol|ul|itemVisibleOutCallback|reload|prepend|itemVisibleInCallback|nodeName|add|itemLastOutCallback|skin|itemLastInCallback|indexOf|itemFirstOutCallback|browser|itemFirstInCallback|empty|reset|resize|itemLoadCallback|funcNext|prototype|load|isNaN|parseInt|none|float|floor|round|index|swing|borderTopWidth|borderRightWidth|borderLeftWidth|horizontal|jcarouselindex|isFunction|normal|clearTimeout|1000|setTimeout|onBeforeAnimation|children|push|Aborting|loop|infinite|an|cause|will|This|items|set|No|jCarousel|isNaN|class|find|borderBottomWidth|append|html|string|defaults|OL|UL|new|has|unlock|lock|10px|0px|jQuery'.split('|'),0,{}))


 function scroll()
 {
 $j('#scroll').after('<div id="nav" class="nav"></div>').cycle({ 
 fx: 'fade', 
 timeout: 0,
 pager: '#nav',
 pagerAnchorBuilder: function(idx, slide)
 {
 return '<a href="#" id="scrollNav'+idx+'"></a>';
 }
 
 }); 
 }
 
 function setHoverDetails()
 {
 var lastHover = null; 
 var focusEvt = function(eventObj){ eventObj.target.noHide = true; }
 var blurEvt = function(eventObj){ eventObj.target.noHide = false; }

 $j(".prod_info_cont").each(function(){ 
 $j(this).hide(); 
 });
 $j(".prod_cont").mouseenter(function(eventObject){ 
 $j(this).children('#prod_img').fadeIn("slow",0.2);
 $j(this).children('#prod_img').hide();
 $j(this).children('.prod_info_cont').show();
 });
 $j(".prod_cont").mouseleave(function(eventObject){
 $j(this).children('.prod_info_cont').fadeIn("slow",0.2);
 $j(this).children('.prod_info_cont').hide();
 $j(this).children('#prod_img').show();
 }); 
 }
 
 $j(document).ready(function(){
 $j('.priceGuide').click(function(){
 $j.scrollTo( '.converter_box', 1500);
 return false;
 });
 
 var priceEnquiryForm = new VarienForm('priceEnquiry');
 priceEnquiryForm.submit = function() {
 if(this.validator.validate()) {
 this.form.submit();
 }
 }.bind(priceEnquiryForm);
 });
