/**
 * Define a cross-browser console 
 * Source: http://patik.com/blog/complete-cross-browser-console-log/
 */

// Tell IE9 to use its built-in console
if (Function.prototype.bind && console && typeof console.log == "object") {
    ["log","info","warn","error","assert","dir","clear","profile","profileEnd"]
        .forEach(function (method) {
            console[method] = this.call(console[method], console);
        }, Function.prototype.bind);
}

// log() -- The complete, cross-browser (we don't judge!) console.log wrapper for his or her logging pleasure
if (!window.log) {
    window.log = function () {
    log.history = log.history || [];  // store logs to an array for reference
    log.history.push(arguments);
        // Modern browsers
        if (typeof console != 'undefined' && typeof console.log == 'function') {
            
            // Opera 11
            if (window.opera) {
                var i = 0;
                while (i < arguments.length) {
                    console.log("Item " + (i+1) + ": " + arguments[i]);
                    i++;
                }
            }
            
            // All other modern browsers
            else if ((Array.prototype.slice.call(arguments)).length == 1 && typeof Array.prototype.slice.call(arguments)[0] == 'string') {
                console.log( (Array.prototype.slice.call(arguments)).toString() );
            }
            else {
                console.log( Array.prototype.slice.call(arguments) );
            }
            
        }
        
        // IE8
        else if (!Function.prototype.bind && typeof console != 'undefined' && typeof console.log == 'object') {
            Function.prototype.call.call(console.log, console, Array.prototype.slice.call(arguments));
        }
        
        // IE7 and lower, and other old browsers
        else {
            // Inject Firebug lite
            if (!document.getElementById('firebug-lite')) {
                // Include the script
                var script = document.createElement('script');
                script.type = "text/javascript";
                script.id = 'firebug-lite';
                // If you run the script locally, point to /path/to/firebug-lite/build/firebug-lite.js
                script.src = 'https://getfirebug.com/firebug-lite.js';
                // If you want to expand the console window by default, uncomment this line
                //document.getElementsByTagName('HTML')[0].setAttribute('debug','true');
                document.getElementsByTagName('HEAD')[0].appendChild(script);
                setTimeout(function () { log( Array.prototype.slice.call(arguments) ); }, 2000);
            }
            else {
                // FBL was included but it hasn't finished loading yet, so try again momentarily
                setTimeout(function () { log( Array.prototype.slice.call(arguments) ); }, 500);
            }
        }
    }
};
/**
 * Override core drupal behavior to fix nested divs bug in inteaction 
 * between core ajax and views.
 *
 * See: http://drupal.org/node/1031600
 *
 * Blame: Alex
 *
 */

if (typeof Drupal.ajax != 'undefined') {
 
  Drupal.ajax.prototype.commands.insert = function (ajax, response, status) {
  
    // Get information from the response. If it is not there, default to
    // our presets.
    var wrapper = response.selector ? jQuery(response.selector) : jQuery(ajax.wrapper);
    var method = response.method || ajax.method;
    var effect = ajax.getEffect(response);
  
    // We don't know what response.data contains: it might be a string of text
    // without HTML, so don't rely on jQuery correctly iterpreting
    // $(response.data) as new HTML rather than a CSS selector. Also, if
    // response.data contains top-level text nodes, they get lost with either
    // $(response.data) or $('<div></div>').replaceWith(response.data).
  	
    var new_content_wrapped = jQuery('<div></div>').html(response.data);
    var new_content = new_content_wrapped.contents();
  
    // For legacy reasons, the effects processing code assumes that new_content
    // consists of a single top-level element. Also, it has not been
    // sufficiently tested whether attachBehaviors() can be successfully called
    // with a context object that includes top-level text nodes. However, to
    // give developers full control of the HTML appearing in the page, and to
    // enable Ajax content to be inserted in places where DIV elements are not
    // allowed (e.g., within TABLE, TR, and SPAN parents), we check if the new
    // content satisfies the requirement of a single top-level element, and
    // only use the container DIV created above when it doesn't. For more
    // information, please see http://drupal.org/node/736066.
    
    /**
     * Dhmedia fix - if this is a views request, don't wrap the response in divs.
     */  
    
    if ((new_content.length != 1 || new_content.get(0).nodeType != 1) && ajax.submit.view_args == undefined) {
  	  new_content = new_content_wrapped;
    }
  
    // If removing content from the wrapper, detach behaviors first.
    switch (method) {
  	  case 'html':
  	  case 'replaceWith':
  	  case 'replaceAll':
  	  case 'empty':
  	  case 'remove':
  	    var settings = response.settings || ajax.settings || Drupal.settings;
  	    Drupal.detachBehaviors(wrapper, settings);
    }
  
    // Add the new content to the page.
    wrapper[method](new_content);
  
    // Immediately hide the new content if we're using any effects.
    if (effect.showEffect != 'show') {
  	  new_content.hide();
    }
  
    // Determine which effect to use and what content will receive the
    // effect, then show the new content.
    if (jQuery('.ajax-new-content', new_content).length > 0) {
  	  jQuery('.ajax-new-content', new_content).hide();
  	  new_content.show();
  	  jQuery('.ajax-new-content', new_content)[effect.showEffect](effect.showSpeed);
    }
    else if (effect.showEffect != 'show') {
  	  new_content[effect.showEffect](effect.showSpeed);
    }
  
    // Attach all JavaScript behaviors to the new content, if it was successfully
    // added to the page, this if statement allows #ajax['wrapper'] to be
    // optional.
    if (new_content.parents('html').length > 0) {
  	  // Apply any settings from the returned JSON if available.
  	  var settings = response.settings || ajax.settings || Drupal.settings;
  	  Drupal.attachBehaviors(new_content, settings);
    }
  }
};
/**
 * Override the core drupal error to replace the ajax error with console
 * logging.
 */

if (typeof(Drupal.ajax) != "undefined") {

  Drupal.ajax.prototype.error = function(response, uri) {
  
    /* 
     * alert(Drupal.ajaxError(response, uri));
     * 
     * Above alert replaced with console.log below
     */    
    
    console.log(Drupal.ajaxError(response, uri));
  
    // Remove the progress element.
  
    if (this.progress.element) {
  
      jQuery(this.progress.element).remove();
  
    }
  
    if (this.progress.object) {
  
      this.progress.object.stopMonitoring();
  
    }
  
    // Undo hide.
  
    jQuery(this.wrapper).show();
  
    // Re-enable the element.
  
    jQuery(this.element).removeClass('progress-disabled').removeAttr('disabled');
  
    // Reattach behaviors, if they were detached in beforeSerialize().
  
    if (this.form) {
  
      var settings = response.settings || this.settings || Drupal.settings;
  
      Drupal.attachBehaviors(this.form, settings);
  
    }
  
  }

};
/*

Quicksand 1.2.2

Reorder and filter items with a nice shuffling animation.

Copyright (c) 2010 Jacek Galanciak (razorjack.net) and agilope.com
Big thanks for Piotr Petrus (riddle.pl) for deep code review and wonderful docs & demos.

Dual licensed under the MIT and GPL version 2 licenses.
http://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt
http://github.com/jquery/jquery/blob/master/GPL-LICENSE.txt

Project site: http://razorjack.net/quicksand
Github site: http://github.com/razorjack/quicksand

*/

(function ($) {
    $.fn.quicksand = function (collection, customOptions) {     
        var options = {
            duration: 750,
            easing: 'swing',
            attribute: 'data-id', // attribute to recognize same items within source and dest
            adjustHeight: 'auto', // 'dynamic' animates height during shuffling (slow), 'auto' adjusts it before or after the animation, false leaves height constant
            useScaling: true, // disable it if you're not using scaling effect or want to improve performance
            enhancement: function(c) {}, // Visual enhacement (eg. font replacement) function for cloned elements
            selector: '> *',
            dx: 0,
            dy: 0
        };
        $.extend(options, customOptions);
        
        if ($.browser.msie || (typeof($.fn.scale) == 'undefined')) {
            // Got IE and want scaling effect? Kiss my ass.
            options.useScaling = false;
        }
        
        var callbackFunction;
        if (typeof(arguments[1]) == 'function') {
            var callbackFunction = arguments[1];
        } else if (typeof(arguments[2] == 'function')) {
            var callbackFunction = arguments[2];
        }
    
        
        return this.each(function (i) {
            var val;
            var animationQueue = []; // used to store all the animation params before starting the animation; solves initial animation slowdowns
            var $collection = $(collection).clone(); // destination (target) collection
            var $sourceParent = $(this); // source, the visible container of source collection
            var sourceHeight = $(this).css('height'); // used to keep height and document flow during the animation
            
            var destHeight;
            var adjustHeightOnCallback = false;
            
            var offset = $($sourceParent).offset(); // offset of visible container, used in animation calculations
            var offsets = []; // coordinates of every source collection item            
            
            var $source = $(this).find(options.selector); // source collection items
            
            // Replace the collection and quit if IE6
            if ($.browser.msie && $.browser.version.substr(0,1)<7) {
                $sourceParent.html('').append($collection);
                return;
            }

            // Gets called when any animation is finished
            var postCallbackPerformed = 0; // prevents the function from being called more than one time
            var postCallback = function () {
                
                if (!postCallbackPerformed) {
                    postCallbackPerformed = 1;
                    
                    // hack: 
                    // used to be: $sourceParent.html($dest.html()); // put target HTML into visible source container
                    // but new webkit builds cause flickering when replacing the collections
                    $toDelete = $sourceParent.find('> *');
                    $sourceParent.prepend($dest.find('> *'));
                    $toDelete.remove();
                         
                    if (adjustHeightOnCallback) {
                        $sourceParent.css('height', destHeight);
                    }
                    options.enhancement($sourceParent); // Perform custom visual enhancements on a newly replaced collection
                    if (typeof callbackFunction == 'function') {
                        callbackFunction.call(this);
                    }                    
                }
            };
            
            // Position: relative situations
            var $correctionParent = $sourceParent.offsetParent();
            var correctionOffset = $correctionParent.offset();
            if ($correctionParent.css('position') == 'relative') {
                if ($correctionParent.get(0).nodeName.toLowerCase() == 'body') {

                } else {
                    correctionOffset.top += (parseFloat($correctionParent.css('border-top-width')) || 0);
                    correctionOffset.left +=( parseFloat($correctionParent.css('border-left-width')) || 0);
                }
            } else {
                correctionOffset.top -= (parseFloat($correctionParent.css('border-top-width')) || 0);
                correctionOffset.left -= (parseFloat($correctionParent.css('border-left-width')) || 0);
                correctionOffset.top -= (parseFloat($correctionParent.css('margin-top')) || 0);
                correctionOffset.left -= (parseFloat($correctionParent.css('margin-left')) || 0);
            }
            
            // perform custom corrections from options (use when Quicksand fails to detect proper correction)
            if (isNaN(correctionOffset.left)) {
                correctionOffset.left = 0;
            }
            if (isNaN(correctionOffset.top)) {
                correctionOffset.top = 0;
            }
            
            correctionOffset.left -= options.dx;
            correctionOffset.top -= options.dy;

            // keeps nodes after source container, holding their position
            $sourceParent.css('height', $(this).height());
            
            // get positions of source collections
            $source.each(function (i) {
                offsets[i] = $(this).offset();
            });
            
            // stops previous animations on source container
            $(this).stop();
            var dx = 0; var dy = 0;
            $source.each(function (i) {
                $(this).stop(); // stop animation of collection items
                var rawObj = $(this).get(0);
                if (rawObj.style.position == 'absolute') {
                    dx = -options.dx;
                    dy = -options.dy;
                } else {
                    dx = options.dx;
                    dy = options.dy;                    
                }

                rawObj.style.position = 'absolute';
                rawObj.style.margin = '0';

                rawObj.style.top = (offsets[i].top - parseFloat(rawObj.style.marginTop) - correctionOffset.top + dy) + 'px';
                rawObj.style.left = (offsets[i].left - parseFloat(rawObj.style.marginLeft) - correctionOffset.left + dx) + 'px';
            });
                    
            // create temporary container with destination collection
            var $dest = $($sourceParent).clone();
            var rawDest = $dest.get(0);
            rawDest.innerHTML = '';
            rawDest.setAttribute('id', '');
            rawDest.style.height = 'auto';
            rawDest.style.width = $sourceParent.width() + 'px';
            $dest.append($collection);      
            // insert node into HTML
            // Note that the node is under visible source container in the exactly same position
            // The browser render all the items without showing them (opacity: 0.0)
            // No offset calculations are needed, the browser just extracts position from underlayered destination items
            // and sets animation to destination positions.
            $dest.insertBefore($sourceParent);
            $dest.css('opacity', 0.0);
            rawDest.style.zIndex = -1;
            
            rawDest.style.margin = '0';
            rawDest.style.position = 'absolute';
            rawDest.style.top = offset.top - correctionOffset.top + 'px';
            rawDest.style.left = offset.left - correctionOffset.left + 'px';
            
            
    
            

            if (options.adjustHeight === 'dynamic') {
                // If destination container has different height than source container
                // the height can be animated, adjusting it to destination height
                $sourceParent.animate({height: $dest.height()}, options.duration, options.easing);
            } else if (options.adjustHeight === 'auto') {
                destHeight = $dest.height();
                if (parseFloat(sourceHeight) < parseFloat(destHeight)) {
                    // Adjust the height now so that the items don't move out of the container
                    $sourceParent.css('height', destHeight);
                } else {
                    //  Adjust later, on callback
                    adjustHeightOnCallback = true;
                }
            }
                
            // Now it's time to do shuffling animation
            // First of all, we need to identify same elements within source and destination collections    
            $source.each(function (i) {
                var destElement = [];
                if (typeof(options.attribute) == 'function') {
                    
                    val = options.attribute($(this));
                    $collection.each(function() {
                        if (options.attribute(this) == val) {
                            destElement = $(this);
                            return false;
                        }
                    });
                } else {
                    destElement = $collection.filter('[' + options.attribute + '=' + $(this).attr(options.attribute) + ']');
                }
                if (destElement.length) {
                    // The item is both in source and destination collections
                    // It it's under different position, let's move it
                    if (!options.useScaling) {
                        animationQueue.push(
                                            {
                                                element: $(this), 
                                                animation: 
                                                    {top: destElement.offset().top - correctionOffset.top, 
                                                     left: destElement.offset().left - correctionOffset.left, 
                                                     opacity: 1.0
                                                    }
                                            });

                    } else {
                        animationQueue.push({
                                            element: $(this), 
                                            animation: {top: destElement.offset().top - correctionOffset.top, 
                                                        left: destElement.offset().left - correctionOffset.left, 
                                                        opacity: 1.0, 
                                                        scale: '1.0'
                                                       }
                                            });

                    }
                } else {
                    // The item from source collection is not present in destination collections
                    // Let's remove it
                    if (!options.useScaling) {
                        animationQueue.push({element: $(this), 
                                             animation: {opacity: '0.0'}});
                    } else {
                        animationQueue.push({element: $(this), animation: {opacity: '0.0', 
                                         scale: '0.0'}});
                    }
                }
            });
            
            $collection.each(function (i) {
                // Grab all items from target collection not present in visible source collection
                
                var sourceElement = [];
                var destElement = [];
                if (typeof(options.attribute) == 'function') {
                    val = options.attribute($(this));
                    $source.each(function() {
                        if (options.attribute(this) == val) {
                            sourceElement = $(this);
                            return false;
                        }
                    });                 

                    $collection.each(function() {
                        if (options.attribute(this) == val) {
                            destElement = $(this);
                            return false;
                        }
                    });
                } else {
                    sourceElement = $source.filter('[' + options.attribute + '=' + $(this).attr(options.attribute) + ']');
                    destElement = $collection.filter('[' + options.attribute + '=' + $(this).attr(options.attribute) + ']');
                }
                
                var animationOptions;
                if (sourceElement.length === 0) {
                    // No such element in source collection...
                    if (!options.useScaling) {
                        animationOptions = {
                            opacity: '1.0'
                        };
                    } else {
                        animationOptions = {
                            opacity: '1.0',
                            scale: '1.0'
                        };
                    }
                    // Let's create it
                    d = destElement.clone();
                    var rawDestElement = d.get(0);
                    rawDestElement.style.position = 'absolute';
                    rawDestElement.style.margin = '0';
                    rawDestElement.style.top = destElement.offset().top - correctionOffset.top + 'px';
                    rawDestElement.style.left = destElement.offset().left - correctionOffset.left + 'px';
                    d.css('opacity', 0.0); // IE
                    if (options.useScaling) {
                        d.css('transform', 'scale(0.0)');
                    }
                    d.appendTo($sourceParent);
                    
                    animationQueue.push({element: $(d), 
                                         animation: animationOptions});
                }
            });
            
            $dest.remove();
            options.enhancement($sourceParent); // Perform custom visual enhancements during the animation
            for (i = 0; i < animationQueue.length; i++) {
                animationQueue[i].element.animate(animationQueue[i].animation, options.duration, options.easing, postCallback);
            }
        });
    };
})(jQuery);;
/*
 *
 * jqTransform
 * by mathieu vilaplana mvilaplana@dfc-e.com
 * Designer ghyslain armand garmand@dfc-e.com
 *
 *
 * Version 1.0 25.09.08
 * Version 1.1 06.08.09
 * Add event click on Checkbox and Radio
 * Auto calculate the size of a select element
 * Can now, disabled the elements
 * Correct bug in ff if click on select (overflow=hidden)
 * No need any more preloading !!
 * 
 ******************************************** */
 
(function($){
	var defaultOptions = {preloadImg:true};
	var jqTransformImgPreloaded = false;

	var jqTransformPreloadHoverFocusImg = function(strImgUrl) {
		//guillemets to remove for ie
		strImgUrl = strImgUrl.replace(/^url\((.*)\)/,'$1').replace(/^\"(.*)\"$/,'$1');
		var imgHover = new Image();
		imgHover.src = strImgUrl.replace(/\.([a-zA-Z]*)$/,'-hover.$1');
		var imgFocus = new Image();
		imgFocus.src = strImgUrl.replace(/\.([a-zA-Z]*)$/,'-focus.$1');				
	};

	
	/***************************
	  Labels
	***************************/
	var jqTransformGetLabel = function(objfield){
		var selfForm = $(objfield.get(0).form);
		var oLabel = objfield.next();
		if(!oLabel.is('label')) {
			oLabel = objfield.prev();
			if(oLabel.is('label')){
				var inputname = objfield.attr('id');
				if(inputname){
					oLabel = selfForm.find('label[for="'+inputname+'"]');
				} 
			}
		}
		if(oLabel.is('label')){return oLabel.css('cursor','pointer');}
		return false;
	};
	
	/* Hide all open selects */
	var jqTransformHideSelect = function(oTarget){
		var ulVisible = $('.jqTransformSelectWrapper ul:visible');
		ulVisible.each(function(){
			var oSelect = $(this).parents(".jqTransformSelectWrapper:first").find("select").get(0);
			//do not hide if click on the label object associated to the select
			if( !(oTarget && oSelect.oLabel && oSelect.oLabel.get(0) == oTarget.get(0)) ){$(this).hide();}
		});
	};
	/* Check for an external click */
	var jqTransformCheckExternalClick = function(event) {
		if ($(event.target).parents('.jqTransformSelectWrapper').length === 0) { jqTransformHideSelect($(event.target)); }
	};

	/* Apply document listener */
	var jqTransformAddDocumentListener = function (){
		$(document).mousedown(jqTransformCheckExternalClick);
	};	
			
	/* Add a new handler for the reset action */
	var jqTransformReset = function(f){
		var sel;
		$('.jqTransformSelectWrapper select', f).each(function(){sel = (this.selectedIndex<0) ? 0 : this.selectedIndex; $('ul', $(this).parent()).each(function(){$('a:eq('+ sel +')', this).click();});});
		$('a.jqTransformCheckbox, a.jqTransformRadio', f).removeClass('jqTransformChecked');
		$('input:checkbox, input:radio', f).each(function(){if(this.checked){$('a', $(this).parent()).addClass('jqTransformChecked');}});
	};

	/***************************
	  Buttons
	 ***************************/
	$.fn.jqTransInputButton = function(){
		return this.each(function(){
			var newBtn = $('<button id="'+ this.id +'" name="'+ this.name +'" type="'+ this.type +'" class="'+ this.className +' jqTransformButton"><span><span>'+ $(this).attr('value') +'</span></span>')
				.hover(function(){newBtn.addClass('jqTransformButton_hover');},function(){newBtn.removeClass('jqTransformButton_hover')})
				.mousedown(function(){newBtn.addClass('jqTransformButton_click')})
				.mouseup(function(){newBtn.removeClass('jqTransformButton_click')})
			;
			$(this).replaceWith(newBtn);
		});
	};
	
	/***************************
	  Text Fields 
	 ***************************/
	$.fn.jqTransInputText = function(){
		return this.each(function(){
			var $input = $(this);
	
			if($input.hasClass('jqtranformdone') || !$input.is('input')) {return;}
			$input.addClass('jqtranformdone');
	
			var oLabel = jqTransformGetLabel($(this));
			oLabel && oLabel.bind('click',function(){$input.focus();});
	
			var inputSize=$input.width();
			if($input.attr('size')){
				inputSize = $input.attr('size')*10;
				$input.css('width',inputSize);
			}
			
			$input.addClass("jqTransformInput").wrap('<div class="jqTransformInputWrapper"><div class="jqTransformInputInner"><div></div></div></div>');
			var $wrapper = $input.parent().parent().parent();
			$wrapper.css("width", inputSize+10);
			$input
				.focus(function(){$wrapper.addClass("jqTransformInputWrapper_focus");})
				.blur(function(){$wrapper.removeClass("jqTransformInputWrapper_focus");})
				.hover(function(){$wrapper.addClass("jqTransformInputWrapper_hover");},function(){$wrapper.removeClass("jqTransformInputWrapper_hover");})
			;
	
			/* If this is safari we need to add an extra class */
			$.browser.safari && $wrapper.addClass('jqTransformSafari');
			$.browser.safari && $input.css('width',$wrapper.width()+16);
			this.wrapper = $wrapper;
			
		});
	};
	
	/***************************
	  Check Boxes 
	 ***************************/	
	$.fn.jqTransCheckBox = function(){
		return this.each(function(){
			if($(this).hasClass('jqTransformHidden')) {return;}

			var $input = $(this);
			var inputSelf = this;

			//set the click on the label
			var oLabel=jqTransformGetLabel($input);
			oLabel && oLabel.click(function(){aLink.trigger('click');});
			
			var aLink = $('<a href="#" class="jqTransformCheckbox"></a>');
			//wrap and add the link
			$input.addClass('jqTransformHidden').wrap('<span class="jqTransformCheckboxWrapper"></span>').parent().prepend(aLink);
			//on change, change the class of the link
			$input.change(function(){
				this.checked && aLink.addClass('jqTransformChecked') || aLink.removeClass('jqTransformChecked');
				return true;
			});
			// Click Handler, trigger the click and change event on the input
			aLink.click(function(){
				//do nothing if the original input is disabled
				if($input.attr('disabled')){return false;}
				//trigger the envents on the input object
				$input.trigger('click').trigger("change");	
				return false;
			});

			// set the default state
			this.checked && aLink.addClass('jqTransformChecked');		
		});
	};
	/***************************
	  Radio Buttons 
	 ***************************/	
	$.fn.jqTransRadio = function(){
		return this.each(function(){
			if($(this).hasClass('jqTransformHidden')) {return;}

			var $input = $(this);
			var inputSelf = this;
				
			oLabel = jqTransformGetLabel($input);
			oLabel && oLabel.click(function(){aLink.trigger('click');});
	
			var aLink = $('<a href="#" class="jqTransformRadio" rel="'+ this.name +'"></a>');
			$input.addClass('jqTransformHidden').wrap('<span class="jqTransformRadioWrapper"></span>').parent().prepend(aLink);
			
			$input.change(function(){
				inputSelf.checked && aLink.addClass('jqTransformChecked') || aLink.removeClass('jqTransformChecked');
				return true;
			});
			// Click Handler
			aLink.click(function(){
				if($input.attr('disabled')){return false;}
				$input.trigger('click').trigger('change');
	
				// uncheck all others of same name input radio elements
				$('input[name="'+$input.attr('name')+'"]',inputSelf.form).not($input).each(function(){
					$(this).attr('type')=='radio' && $(this).trigger('change');
				});
	
				return false;					
			});
			// set the default state
			inputSelf.checked && aLink.addClass('jqTransformChecked');
		});
	};
	
	/***************************
	  TextArea 
	 ***************************/	
	$.fn.jqTransTextarea = function(){
		return this.each(function(){
			var textarea = $(this);
	
			if(textarea.hasClass('jqtransformdone')) {return;}
			textarea.addClass('jqtransformdone');
	
			oLabel = jqTransformGetLabel(textarea);
			oLabel && oLabel.click(function(){textarea.focus();});
			
			var strTable = '<table cellspacing="0" cellpadding="0" border="0" class="jqTransformTextarea">';
			strTable +='<tr><td id="jqTransformTextarea-tl"></td><td id="jqTransformTextarea-tm"></td><td id="jqTransformTextarea-tr"></td></tr>';
			strTable +='<tr><td id="jqTransformTextarea-ml">&nbsp;</td><td id="jqTransformTextarea-mm"><div></div></td><td id="jqTransformTextarea-mr">&nbsp;</td></tr>';	
			strTable +='<tr><td id="jqTransformTextarea-bl"></td><td id="jqTransformTextarea-bm"></td><td id="jqTransformTextarea-br"></td></tr>';
			strTable +='</table>';					
			var oTable = $(strTable)
					.insertAfter(textarea)
					.hover(function(){
						!oTable.hasClass('jqTransformTextarea-focus') && oTable.addClass('jqTransformTextarea-hover');
					},function(){
						oTable.removeClass('jqTransformTextarea-hover');					
					})
				;
				
			textarea
				.focus(function(){oTable.removeClass('jqTransformTextarea-hover').addClass('jqTransformTextarea-focus');})
				.blur(function(){oTable.removeClass('jqTransformTextarea-focus');})
				.appendTo($('#jqTransformTextarea-mm div',oTable))
			;
			this.oTable = oTable;
			if($.browser.safari){
				$('#jqTransformTextarea-mm',oTable)
					.addClass('jqTransformSafariTextarea')
					.find('div')
						.css('height',textarea.height())
						.css('width',textarea.width())
				;
			}
		});
	};
	
	/***************************
	  Select 
	 ***************************/	
	$.fn.jqTransSelect = function(){
		return this.each(function(index){
			var $select = $(this);

			if($select.hasClass('jqTransformHidden')) {return;}
			if($select.attr('multiple')) {return;}

			var oLabel  =  jqTransformGetLabel($select);
			/* First thing we do is Wrap it */
			var $wrapper = $select
				.addClass('jqTransformHidden')
				.wrap('<div class="jqTransformSelectWrapper"></div>')
				.parent()
				.css({zIndex: 10-index})
			;
			
			/* Now add the html for the select */
			$wrapper.prepend('<div><span></span><a href="#" class="jqTransformSelectOpen"></a></div><ul></ul>');
			var $ul = $('ul', $wrapper).css('width',$select.width()).hide();
			/* Now we add the options */
			$('option', this).each(function(i){
				var oLi = $('<li><a href="#" index="'+ i +'">'+ $(this).html() +'</a></li>');
				$ul.append(oLi);
			});
			
			/* Add click handler to the a */
			$ul.find('a').click(function(){
					$('a.selected', $wrapper).removeClass('selected');
					$(this).addClass('selected');	
					/* Fire the onchange event */
					if ($select[0].selectedIndex != $(this).attr('index') && $select[0].onchange) { $select[0].selectedIndex = $(this).attr('index'); $select[0].onchange(); }
					$select[0].selectedIndex = $(this).attr('index');
					$('span:eq(0)', $wrapper).html($(this).html());
					$ul.hide();
					return false;
			});
			/* Set the default */
			$('a:eq('+ this.selectedIndex +')', $ul).click();
			$('span:first', $wrapper).click(function(){$("a.jqTransformSelectOpen",$wrapper).trigger('click');});
			oLabel && oLabel.click(function(){$("a.jqTransformSelectOpen",$wrapper).trigger('click');});
			this.oLabel = oLabel;
			
			/* Apply the click handler to the Open */
			var oLinkOpen = $('a.jqTransformSelectOpen', $wrapper)
				.click(function(){
					//Check if box is already open to still allow toggle, but close all other selects
					if( $ul.css('display') == 'none' ) {jqTransformHideSelect();} 
					if($select.attr('disabled')){return false;}

					$ul.slideToggle('fast', function(){					
						var offSet = ($('a.selected', $ul).offset().top - $ul.offset().top);
						$ul.animate({scrollTop: offSet});
					});
					return false;
				})
			;

			// Set the new width
			var iSelectWidth = $select.outerWidth();
			var oSpan = $('span:first',$wrapper);
			var newWidth = (iSelectWidth > oSpan.innerWidth())?iSelectWidth+oLinkOpen.outerWidth():$wrapper.width();
			$wrapper.css('width',newWidth);
			$ul.css('width',newWidth-2);
			oSpan.css({width:iSelectWidth});
		
			// Calculate the height if necessary, less elements that the default height
			//show the ul to calculate the block, if ul is not displayed li height value is 0
			$ul.css({display:'block',visibility:'hidden'});
			var iSelectHeight = ($('li',$ul).length)*($('li:first',$ul).height());//+1 else bug ff
			(iSelectHeight < $ul.height()) && $ul.css({height:iSelectHeight,'overflow':'hidden'});//hidden else bug with ff
			$ul.css({display:'none',visibility:'visible'});
			
		});
	};
	$.fn.jqTransform = function(options){
		var opt = $.extend({},defaultOptions,options);
		
		/* each form */
		 return this.each(function(){
			var selfForm = $(this);
			if(selfForm.hasClass('jqtransformdone')) {return;}
			selfForm.addClass('jqtransformdone');
			
			$('input:submit, input:reset, input[type="button"]', this).jqTransInputButton();			
			$('input:text, input:password', this).jqTransInputText();			
			$('input:checkbox', this).jqTransCheckBox();
			$('input:radio', this).jqTransRadio();
			$('textarea', this).jqTransTextarea();
			
			if( $('select', this).jqTransSelect().length > 0 ){jqTransformAddDocumentListener();}
			selfForm.bind('reset',function(){var action = function(){jqTransformReset(this);}; window.setTimeout(action, 10);});
			
			//preloading dont needed anymore since normal, focus and hover image are the same one
			/*if(opt.preloadImg && !jqTransformImgPreloaded){
				jqTransformImgPreloaded = true;
				var oInputText = $('input:text:first', selfForm);
				if(oInputText.length > 0){
					//pour ie on eleve les ""
					var strWrapperImgUrl = oInputText.get(0).wrapper.css('background-image');
					jqTransformPreloadHoverFocusImg(strWrapperImgUrl);					
					var strInnerImgUrl = $('div.jqTransformInputInner',$(oInputText.get(0).wrapper)).css('background-image');
					jqTransformPreloadHoverFocusImg(strInnerImgUrl);
				}
				
				var oTextarea = $('textarea',selfForm);
				if(oTextarea.length > 0){
					var oTable = oTextarea.get(0).oTable;
					$('td',oTable).each(function(){
						var strImgBack = $(this).css('background-image');
						jqTransformPreloadHoverFocusImg(strImgBack);
					});
				}
			}*/
			
			
		}); /* End Form each */
				
	};/* End the Plugin */

})(jQuery);
				   ;
/**
* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne brian(at)cherne(dot)net
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:5,interval:200,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);;
/*!
 * jQuery Tools v1.2.6 - The missing UI library for the Web
 * 
 * scrollable/scrollable.js
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/
 * 
 */
(function(a){a.tools=a.tools||{version:"v1.2.6"},a.tools.scrollable={conf:{activeClass:"active",circular:!1,clonedClass:"cloned",disabledClass:"disabled",easing:"swing",initialIndex:0,item:"> *",items:".items",keyboard:!0,mousewheel:!1,next:".next",prev:".prev",size:1,speed:400,vertical:!1,touch:!0,wheelSpeed:0}};function b(a,b){var c=parseInt(a.css(b),10);if(c)return c;var d=a[0].currentStyle;return d&&d.width&&parseInt(d.width,10)}function c(b,c){var d=a(c);return d.length<2?d:b.parent().find(c)}var d;function e(b,e){var f=this,g=b.add(f),h=b.children(),i=0,j=e.vertical;d||(d=f),h.length>1&&(h=a(e.items,b)),e.size>1&&(e.circular=!1),a.extend(f,{getConf:function(){return e},getIndex:function(){return i},getSize:function(){return f.getItems().size()},getNaviButtons:function(){return n.add(o)},getRoot:function(){return b},getItemWrap:function(){return h},getItems:function(){return h.find(e.item).not("."+e.clonedClass)},move:function(a,b){return f.seekTo(i+a,b)},next:function(a){return f.move(e.size,a)},prev:function(a){return f.move(-e.size,a)},begin:function(a){return f.seekTo(0,a)},end:function(a){return f.seekTo(f.getSize()-1,a)},focus:function(){d=f;return f},addItem:function(b){b=a(b),e.circular?(h.children().last().before(b),h.children().first().replaceWith(b.clone().addClass(e.clonedClass))):(h.append(b),o.removeClass("disabled")),g.trigger("onAddItem",[b]);return f},seekTo:function(b,c,k){b.jquery||(b*=1);if(e.circular&&b===0&&i==-1&&c!==0)return f;if(!e.circular&&b<0||b>f.getSize()||b<-1)return f;var l=b;b.jquery?b=f.getItems().index(b):l=f.getItems().eq(b);var m=a.Event("onBeforeSeek");if(!k){g.trigger(m,[b,c]);if(m.isDefaultPrevented()||!l.length)return f}var n=j?{top:-l.position().top}:{left:-l.position().left};i=b,d=f,c===undefined&&(c=e.speed),h.animate(n,c,e.easing,k||function(){g.trigger("onSeek",[b])});return f}}),a.each(["onBeforeSeek","onSeek","onAddItem"],function(b,c){a.isFunction(e[c])&&a(f).bind(c,e[c]),f[c]=function(b){b&&a(f).bind(c,b);return f}});if(e.circular){var k=f.getItems().slice(-1).clone().prependTo(h),l=f.getItems().eq(1).clone().appendTo(h);k.add(l).addClass(e.clonedClass),f.onBeforeSeek(function(a,b,c){if(!a.isDefaultPrevented()){if(b==-1){f.seekTo(k,c,function(){f.end(0)});return a.preventDefault()}b==f.getSize()&&f.seekTo(l,c,function(){f.begin(0)})}});var m=b.parents().add(b).filter(function(){if(a(this).css("display")==="none")return!0});m.length?(m.show(),f.seekTo(0,0,function(){}),m.hide()):f.seekTo(0,0,function(){})}var n=c(b,e.prev).click(function(a){a.stopPropagation(),f.prev()}),o=c(b,e.next).click(function(a){a.stopPropagation(),f.next()});e.circular||(f.onBeforeSeek(function(a,b){setTimeout(function(){a.isDefaultPrevented()||(n.toggleClass(e.disabledClass,b<=0),o.toggleClass(e.disabledClass,b>=f.getSize()-1))},1)}),e.initialIndex||n.addClass(e.disabledClass)),f.getSize()<2&&n.add(o).addClass(e.disabledClass),e.mousewheel&&a.fn.mousewheel&&b.mousewheel(function(a,b){if(e.mousewheel){f.move(b<0?1:-1,e.wheelSpeed||50);return!1}});if(e.touch){var p={};h[0].ontouchstart=function(a){var b=a.touches[0];p.x=b.clientX,p.y=b.clientY},h[0].ontouchmove=function(a){if(a.touches.length==1&&!h.is(":animated")){var b=a.touches[0],c=p.x-b.clientX,d=p.y-b.clientY;f[j&&d>0||!j&&c>0?"next":"prev"](),a.preventDefault()}}}e.keyboard&&a(document).bind("keydown.scrollable",function(b){if(!(!e.keyboard||b.altKey||b.ctrlKey||b.metaKey||a(b.target).is(":input"))){if(e.keyboard!="static"&&d!=f)return;var c=b.keyCode;if(j&&(c==38||c==40)){f.move(c==38?-1:1);return b.preventDefault()}if(!j&&(c==37||c==39)){f.move(c==37?-1:1);return b.preventDefault()}}}),e.initialIndex&&f.seekTo(e.initialIndex,0,function(){})}a.fn.scrollable=function(b){var c=this.data("scrollable");if(c)return c;b=a.extend({},a.tools.scrollable.conf,b),this.each(function(){c=new e(a(this),b),a(this).data("scrollable",c)});return b.api?c:this}})(jQuery);
;
/*
 * jScrollPane - v2.0.0beta11 - 2011-07-04
 * http://jscrollpane.kelvinluck.com/
 *
 * Copyright (c) 2010 Kelvin Luck
 * Dual licensed under the MIT and GPL licenses.
 */
(function(b,a,c){b.fn.jScrollPane=function(e){function d(D,O){var az,Q=this,Y,ak,v,am,T,Z,y,q,aA,aF,av,i,I,h,j,aa,U,aq,X,t,A,ar,af,an,G,l,au,ay,x,aw,aI,f,L,aj=true,P=true,aH=false,k=false,ap=D.clone(false,false).empty(),ac=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aI=D.css("paddingTop")+" "+D.css("paddingRight")+" "+D.css("paddingBottom")+" "+D.css("paddingLeft");f=(parseInt(D.css("paddingLeft"),10)||0)+(parseInt(D.css("paddingRight"),10)||0);function at(aR){var aM,aO,aN,aK,aJ,aQ,aP=false,aL=false;az=aR;if(Y===c){aJ=D.scrollTop();aQ=D.scrollLeft();D.css({overflow:"hidden",padding:0});ak=D.innerWidth()+f;v=D.innerHeight();D.width(ak);Y=b('<div class="jspPane" />').css("padding",aI).append(D.children());am=b('<div class="jspContainer" />').css({width:ak+"px",height:v+"px"}).append(Y).appendTo(D)}else{D.css("width","");aP=az.stickToBottom&&K();aL=az.stickToRight&&B();aK=D.innerWidth()+f!=ak||D.outerHeight()!=v;if(aK){ak=D.innerWidth()+f;v=D.innerHeight();am.css({width:ak+"px",height:v+"px"})}if(!aK&&L==T&&Y.outerHeight()==Z){D.width(ak);return}L=T;Y.css("width","");D.width(ak);am.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}Y.css("overflow","auto");if(aR.contentWidth){T=aR.contentWidth}else{T=Y[0].scrollWidth}Z=Y[0].scrollHeight;Y.css("overflow","");y=T/ak;q=Z/v;aA=q>1;aF=y>1;if(!(aF||aA)){D.removeClass("jspScrollable");Y.css({top:0,width:am.width()-f});n();E();R();w();ai()}else{D.addClass("jspScrollable");aM=az.maintainPosition&&(I||aa);if(aM){aO=aD();aN=aB()}aG();z();F();if(aM){N(aL?(T-ak):aO,false);M(aP?(Z-v):aN,false)}J();ag();ao();if(az.enableKeyboardNavigation){S()}if(az.clickOnTrack){p()}C();if(az.hijackInternalLinks){m()}}if(az.autoReinitialise&&!aw){aw=setInterval(function(){at(az)},az.autoReinitialiseDelay)}else{if(!az.autoReinitialise&&aw){clearInterval(aw)}}aJ&&D.scrollTop(0)&&M(aJ,false);aQ&&D.scrollLeft(0)&&N(aQ,false);D.trigger("jsp-initialised",[aF||aA])}function aG(){if(aA){am.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'),b('<div class="jspDragBottom" />'))),b('<div class="jspCap jspCapBottom" />')));U=am.find(">.jspVerticalBar");aq=U.find(">.jspTrack");av=aq.find(">.jspDrag");if(az.showArrows){ar=b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",aE(0,-1)).bind("click.jsp",aC);af=b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",aE(0,1)).bind("click.jsp",aC);if(az.arrowScrollOnHover){ar.bind("mouseover.jsp",aE(0,-1,ar));af.bind("mouseover.jsp",aE(0,1,af))}al(aq,az.verticalArrowPositions,ar,af)}t=v;am.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){t-=b(this).outerHeight()});av.hover(function(){av.addClass("jspHover")},function(){av.removeClass("jspHover")}).bind("mousedown.jsp",function(aJ){b("html").bind("dragstart.jsp selectstart.jsp",aC);av.addClass("jspActive");var s=aJ.pageY-av.position().top;b("html").bind("mousemove.jsp",function(aK){V(aK.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",ax);return false});o()}}function o(){aq.height(t+"px");I=0;X=az.verticalGutter+aq.outerWidth();Y.width(ak-X-f);try{if(U.position().left===0){Y.css("margin-left",X+"px")}}catch(s){}}function z(){if(aF){am.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'),b('<div class="jspDragRight" />'))),b('<div class="jspCap jspCapRight" />')));an=am.find(">.jspHorizontalBar");G=an.find(">.jspTrack");h=G.find(">.jspDrag");if(az.showArrows){ay=b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",aE(-1,0)).bind("click.jsp",aC);x=b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",aE(1,0)).bind("click.jsp",aC);
if(az.arrowScrollOnHover){ay.bind("mouseover.jsp",aE(-1,0,ay));x.bind("mouseover.jsp",aE(1,0,x))}al(G,az.horizontalArrowPositions,ay,x)}h.hover(function(){h.addClass("jspHover")},function(){h.removeClass("jspHover")}).bind("mousedown.jsp",function(aJ){b("html").bind("dragstart.jsp selectstart.jsp",aC);h.addClass("jspActive");var s=aJ.pageX-h.position().left;b("html").bind("mousemove.jsp",function(aK){W(aK.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",ax);return false});l=am.innerWidth();ah()}}function ah(){am.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){l-=b(this).outerWidth()});G.width(l+"px");aa=0}function F(){if(aF&&aA){var aJ=G.outerHeight(),s=aq.outerWidth();t-=aJ;b(an).find(">.jspCap:visible,>.jspArrow").each(function(){l+=b(this).outerWidth()});l-=s;v-=s;ak-=aJ;G.parent().append(b('<div class="jspCorner" />').css("width",aJ+"px"));o();ah()}if(aF){Y.width((am.outerWidth()-f)+"px")}Z=Y.outerHeight();q=Z/v;if(aF){au=Math.ceil(1/y*l);if(au>az.horizontalDragMaxWidth){au=az.horizontalDragMaxWidth}else{if(au<az.horizontalDragMinWidth){au=az.horizontalDragMinWidth}}h.width(au+"px");j=l-au;ae(aa)}if(aA){A=Math.ceil(1/q*t);if(A>az.verticalDragMaxHeight){A=az.verticalDragMaxHeight}else{if(A<az.verticalDragMinHeight){A=az.verticalDragMinHeight}}av.height(A+"px");i=t-A;ad(I)}}function al(aK,aM,aJ,s){var aO="before",aL="after",aN;if(aM=="os"){aM=/Mac/.test(navigator.platform)?"after":"split"}if(aM==aO){aL=aM}else{if(aM==aL){aO=aM;aN=aJ;aJ=s;s=aN}}aK[aO](aJ)[aL](s)}function aE(aJ,s,aK){return function(){H(aJ,s,this,aK);this.blur();return false}}function H(aM,aL,aP,aO){aP=b(aP).addClass("jspActive");var aN,aK,aJ=true,s=function(){if(aM!==0){Q.scrollByX(aM*az.arrowButtonSpeed)}if(aL!==0){Q.scrollByY(aL*az.arrowButtonSpeed)}aK=setTimeout(s,aJ?az.initialDelay:az.arrowRepeatFreq);aJ=false};s();aN=aO?"mouseout.jsp":"mouseup.jsp";aO=aO||b("html");aO.bind(aN,function(){aP.removeClass("jspActive");aK&&clearTimeout(aK);aK=null;aO.unbind(aN)})}function p(){w();if(aA){aq.bind("mousedown.jsp",function(aO){if(aO.originalTarget===c||aO.originalTarget==aO.currentTarget){var aM=b(this),aP=aM.offset(),aN=aO.pageY-aP.top-I,aK,aJ=true,s=function(){var aS=aM.offset(),aT=aO.pageY-aS.top-A/2,aQ=v*az.scrollPagePercent,aR=i*aQ/(Z-v);if(aN<0){if(I-aR>aT){Q.scrollByY(-aQ)}else{V(aT)}}else{if(aN>0){if(I+aR<aT){Q.scrollByY(aQ)}else{V(aT)}}else{aL();return}}aK=setTimeout(s,aJ?az.initialDelay:az.trackClickRepeatFreq);aJ=false},aL=function(){aK&&clearTimeout(aK);aK=null;b(document).unbind("mouseup.jsp",aL)};s();b(document).bind("mouseup.jsp",aL);return false}})}if(aF){G.bind("mousedown.jsp",function(aO){if(aO.originalTarget===c||aO.originalTarget==aO.currentTarget){var aM=b(this),aP=aM.offset(),aN=aO.pageX-aP.left-aa,aK,aJ=true,s=function(){var aS=aM.offset(),aT=aO.pageX-aS.left-au/2,aQ=ak*az.scrollPagePercent,aR=j*aQ/(T-ak);if(aN<0){if(aa-aR>aT){Q.scrollByX(-aQ)}else{W(aT)}}else{if(aN>0){if(aa+aR<aT){Q.scrollByX(aQ)}else{W(aT)}}else{aL();return}}aK=setTimeout(s,aJ?az.initialDelay:az.trackClickRepeatFreq);aJ=false},aL=function(){aK&&clearTimeout(aK);aK=null;b(document).unbind("mouseup.jsp",aL)};s();b(document).bind("mouseup.jsp",aL);return false}})}}function w(){if(G){G.unbind("mousedown.jsp")}if(aq){aq.unbind("mousedown.jsp")}}function ax(){b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");if(av){av.removeClass("jspActive")}if(h){h.removeClass("jspActive")}}function V(s,aJ){if(!aA){return}if(s<0){s=0}else{if(s>i){s=i}}if(aJ===c){aJ=az.animateScroll}if(aJ){Q.animate(av,"top",s,ad)}else{av.css("top",s);ad(s)}}function ad(aJ){if(aJ===c){aJ=av.position().top}am.scrollTop(0);I=aJ;var aM=I===0,aK=I==i,aL=aJ/i,s=-aL*(Z-v);if(aj!=aM||aH!=aK){aj=aM;aH=aK;D.trigger("jsp-arrow-change",[aj,aH,P,k])}u(aM,aK);Y.css("top",s);D.trigger("jsp-scroll-y",[-s,aM,aK]).trigger("scroll")}function W(aJ,s){if(!aF){return}if(aJ<0){aJ=0}else{if(aJ>j){aJ=j}}if(s===c){s=az.animateScroll}if(s){Q.animate(h,"left",aJ,ae)
}else{h.css("left",aJ);ae(aJ)}}function ae(aJ){if(aJ===c){aJ=h.position().left}am.scrollTop(0);aa=aJ;var aM=aa===0,aL=aa==j,aK=aJ/j,s=-aK*(T-ak);if(P!=aM||k!=aL){P=aM;k=aL;D.trigger("jsp-arrow-change",[aj,aH,P,k])}r(aM,aL);Y.css("left",s);D.trigger("jsp-scroll-x",[-s,aM,aL]).trigger("scroll")}function u(aJ,s){if(az.showArrows){ar[aJ?"addClass":"removeClass"]("jspDisabled");af[s?"addClass":"removeClass"]("jspDisabled")}}function r(aJ,s){if(az.showArrows){ay[aJ?"addClass":"removeClass"]("jspDisabled");x[s?"addClass":"removeClass"]("jspDisabled")}}function M(s,aJ){var aK=s/(Z-v);V(aK*i,aJ)}function N(aJ,s){var aK=aJ/(T-ak);W(aK*j,s)}function ab(aW,aR,aK){var aO,aL,aM,s=0,aV=0,aJ,aQ,aP,aT,aS,aU;try{aO=b(aW)}catch(aN){return}aL=aO.outerHeight();aM=aO.outerWidth();am.scrollTop(0);am.scrollLeft(0);while(!aO.is(".jspPane")){s+=aO.position().top;aV+=aO.position().left;aO=aO.offsetParent();if(/^body|html$/i.test(aO[0].nodeName)){return}}aJ=aB();aP=aJ+v;if(s<aJ||aR){aS=s-az.verticalGutter}else{if(s+aL>aP){aS=s-v+aL+az.verticalGutter}}if(aS){M(aS,aK)}aQ=aD();aT=aQ+ak;if(aV<aQ||aR){aU=aV-az.horizontalGutter}else{if(aV+aM>aT){aU=aV-ak+aM+az.horizontalGutter}}if(aU){N(aU,aK)}}function aD(){return -Y.position().left}function aB(){return -Y.position().top}function K(){var s=Z-v;return(s>20)&&(s-aB()<10)}function B(){var s=T-ak;return(s>20)&&(s-aD()<10)}function ag(){am.unbind(ac).bind(ac,function(aM,aN,aL,aJ){var aK=aa,s=I;Q.scrollBy(aL*az.mouseWheelSpeed,-aJ*az.mouseWheelSpeed,false);return aK==aa&&s==I})}function n(){am.unbind(ac)}function aC(){return false}function J(){Y.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(s){ab(s.target,false)})}function E(){Y.find(":input,a").unbind("focus.jsp")}function S(){var s,aJ,aL=[];aF&&aL.push(an[0]);aA&&aL.push(U[0]);Y.focus(function(){D.focus()});D.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aO){if(aO.target!==this&&!(aL.length&&b(aO.target).closest(aL).length)){return}var aN=aa,aM=I;switch(aO.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aO.keyCode;aK();break;case 35:M(Z-v);s=null;break;case 36:M(0);s=null;break}aJ=aO.keyCode==s&&aN!=aa||aM!=I;return !aJ}).bind("keypress.jsp",function(aM){if(aM.keyCode==s){aK()}return !aJ});if(az.hideFocus){D.css("outline","none");if("hideFocus" in am[0]){D.attr("hideFocus",true)}}else{D.css("outline","");if("hideFocus" in am[0]){D.attr("hideFocus",false)}}function aK(){var aN=aa,aM=I;switch(s){case 40:Q.scrollByY(az.keyboardSpeed,false);break;case 38:Q.scrollByY(-az.keyboardSpeed,false);break;case 34:case 32:Q.scrollByY(v*az.scrollPagePercent,false);break;case 33:Q.scrollByY(-v*az.scrollPagePercent,false);break;case 39:Q.scrollByX(az.keyboardSpeed,false);break;case 37:Q.scrollByX(-az.keyboardSpeed,false);break}aJ=aN!=aa||aM!=I;return aJ}}function R(){D.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function C(){if(location.hash&&location.hash.length>1){var aL,aJ,aK=escape(location.hash);try{aL=b(aK)}catch(s){return}if(aL.length&&Y.find(aK)){if(am.scrollTop()===0){aJ=setInterval(function(){if(am.scrollTop()>0){ab(aK,true);b(document).scrollTop(am.position().top);clearInterval(aJ)}},50)}else{ab(aK,true);b(document).scrollTop(am.position().top)}}}}function ai(){b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function m(){ai();b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var s=this.href.split("#"),aJ;if(s.length>1){aJ=s[1];if(aJ.length>0&&Y.find("#"+aJ).length>0){ab("#"+aJ,true);return false}}})}function ao(){var aK,aJ,aM,aL,aN,s=false;am.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aO){var aP=aO.originalEvent.touches[0];aK=aD();aJ=aB();aM=aP.pageX;aL=aP.pageY;aN=false;s=true}).bind("touchmove.jsp",function(aR){if(!s){return}var aQ=aR.originalEvent.touches[0],aP=aa,aO=I;Q.scrollTo(aK+aM-aQ.pageX,aJ+aL-aQ.pageY);aN=aN||Math.abs(aM-aQ.pageX)>5||Math.abs(aL-aQ.pageY)>5;
return aP==aa&&aO==I}).bind("touchend.jsp",function(aO){s=false}).bind("click.jsp-touchclick",function(aO){if(aN){aN=false;return false}})}function g(){var s=aB(),aJ=aD();D.removeClass("jspScrollable").unbind(".jsp");D.replaceWith(ap.append(Y.children()));ap.scrollTop(s);ap.scrollLeft(aJ)}b.extend(Q,{reinitialise:function(aJ){aJ=b.extend({},az,aJ);at(aJ)},scrollToElement:function(aK,aJ,s){ab(aK,aJ,s)},scrollTo:function(aK,s,aJ){N(aK,aJ);M(s,aJ)},scrollToX:function(aJ,s){N(aJ,s)},scrollToY:function(s,aJ){M(s,aJ)},scrollToPercentX:function(aJ,s){N(aJ*(T-ak),s)},scrollToPercentY:function(aJ,s){M(aJ*(Z-v),s)},scrollBy:function(aJ,s,aK){Q.scrollByX(aJ,aK);Q.scrollByY(s,aK)},scrollByX:function(s,aK){var aJ=aD()+Math[s<0?"floor":"ceil"](s),aL=aJ/(T-ak);W(aL*j,aK)},scrollByY:function(s,aK){var aJ=aB()+Math[s<0?"floor":"ceil"](s),aL=aJ/(Z-v);V(aL*i,aK)},positionDragX:function(s,aJ){W(s,aJ)},positionDragY:function(aJ,s){V(aJ,s)},animate:function(aJ,aM,s,aL){var aK={};aK[aM]=s;aJ.animate(aK,{duration:az.animateDuration,easing:az.animateEase,queue:false,step:aL})},getContentPositionX:function(){return aD()},getContentPositionY:function(){return aB()},getContentWidth:function(){return T},getContentHeight:function(){return Z},getPercentScrolledX:function(){return aD()/(T-ak)},getPercentScrolledY:function(){return aB()/(Z-v)},getIsScrollableH:function(){return aF},getIsScrollableV:function(){return aA},getContentPane:function(){return Y},scrollToBottom:function(s){V(i,s)},hijackInternalLinks:function(){m()},destroy:function(){g()}});at(O)}e=b.extend({},b.fn.jScrollPane.defaults,e);b.each(["mouseWheelSpeed","arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){e[this]=e[this]||e.speed});return this.each(function(){var f=b(this),g=f.data("jsp");if(g){g.reinitialise(e)}else{g=new d(f,e);f.data("jsp",g)}})};b.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,stickToBottom:false,stickToRight:false,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:c,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:0,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:0.8}})(jQuery,this);;
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 * Thanks to: Seamus Leahy for adding deltaX and deltaY
 *
 * Version: 3.0.4
 * 
 * Requires: 1.2.2+
 */

(function($) {

var types = ['DOMMouseScroll', 'mousewheel'];

$.event.special.mousewheel = {
    setup: function() {
        if ( this.addEventListener ) {
            for ( var i=types.length; i; ) {
                this.addEventListener( types[--i], handler, false );
            }
        } else {
            this.onmousewheel = handler;
        }
    },
    
    teardown: function() {
        if ( this.removeEventListener ) {
            for ( var i=types.length; i; ) {
                this.removeEventListener( types[--i], handler, false );
            }
        } else {
            this.onmousewheel = null;
        }
    }
};

$.fn.extend({
    mousewheel: function(fn) {
        return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
    },
    
    unmousewheel: function(fn) {
        return this.unbind("mousewheel", fn);
    }
});


function handler(event) {
    var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
    event = $.event.fix(orgEvent);
    event.type = "mousewheel";
    
    // Old school scrollwheel delta
    if ( event.wheelDelta ) { delta = event.wheelDelta/120; }
    if ( event.detail     ) { delta = -event.detail/3; }
    
    // New school multidimensional scroll (touchpads) deltas
    deltaY = delta;
    
    // Gecko
    if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
        deltaY = 0;
        deltaX = -1*delta;
    }
    
    // Webkit
    if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
    if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
    
    // Add event and delta to the front of the arguments
    args.unshift(event, delta, deltaX, deltaY);
    
    return $.event.handle.apply(this, args);
}

})(jQuery);;
jQuery(window).load( function() {

  /* Attach a nice fade effect to the home browser */

  jQuery(".view-my-home-finder").before("<div class='quicksand-destination'><ul class='cols-3-list'></ul></div>");
  jQuery(".quicksand-destination ul").html(jQuery(".quicksand-source li"));


  jQuery("body").ajaxComplete(function(){

    jQuery(".quicksand-destination ul").quicksand(jQuery(".quicksand-source li"), {
	  attribute:function(v){
		return jQuery(v).find('a').attr("href");
      },
	  useScaling: true,
	  duration: 300
	},function(){

		//Quicksand Callback

	});
  });
});;
function getTransformElementSelectors() {
  return [
    '.bef-checkboxes',
    '.bef-select-as-radios'
  ];
}

function decorateJqTextboxLabels() {

  /* Make sure checked items have active labels */
  jQuery(".bef-checkboxes .form-item input:checked")
    .parent().parent().find('label')
    .addClass("active-label");

  /* Make sure unchecked items don't have active labels */
  jQuery(".bef-checkboxes .form-item input:not(:checked)")
    .parent().parent().find('label')
    .removeClass("active-label");
}

jQuery(document).ready( function() {

  /* Transform the selected elements */
  jQuery( getTransformElementSelectors().join(',') ).jqTransform();

  /**
   * Fix the behavior when clicking on a checkbox label.
   * Out of the box jqTransform alters the value but not
   * the display of the checkbox so that needed fixing...
   */

  /* Initial label decoration */
  decorateJqTextboxLabels();

  /**
   * Periodic label decoration, because fast clicking in IE can
   * break the sync between label state and actual checkbox values
   */
   setInterval(function() {decorateJqTextboxLabels();}, 500);

});

jQuery(window).load(function(){

  jQuery(".bef-checkboxes label").click(function() {
	jQuery(this).toggleClass("active-label");
    jQuery(this).parent().children().find(".jqTransformCheckbox")
	  .trigger("click");
  });

  jQuery(".bef-checkboxes .form-item a").click( function() {
    jQuery(this).parent().parent().find('label')
	  .toggleClass("active-label");
  });

});;
var fbPageOptions = new Object();
fbPageOptions.installBase = '/sites/default/themes/celebration/js/floatbox/';
fbPageOptions.graphicsPath = '/sites/default/themes/celebration/js/floatbox/graphics/';
fbPageOptions.languagesPath = '/sites/default/themes/celebration/js/floatbox/languages/';
fbPageOptions.modulesPath = '/sites/default/themes/celebration/js/floatbox/modules/';

(function($){



	$(document).ready(function(){

		//Make text box placeholders
		$(
			"#block-views-contact-block-block .form-text,\
			#block-celebration-newsletter-sign-up-news .form-text")

			.each(function(index,element) {

			var item = $(element);
			var text = $(element).attr('value');
			var form = item.parents("form:first");

			if(item.val() === "") {
				item.val(text);
			}

			item.bind("focus.placeholder", function(event) {
				if (item.val() === text)
				item.val("");
			});
			 item.bind("blur.placeholder", function(event) {
				 if (item.val() === "")
				 item.val(text);
			 });
			 form.bind("submit.placeholder", function(event) {
				 if (item.val() === text)
				 item.val("");
			 });
		});


		//Make text box placeholders
		$("#edit-submitted-message")
			.each(function(index,element) {

			var item = $(element);
			var text = $(element).html();
			var form = item.parents("form:first");

			if(item.val() === "") {
				item.val(text);
			}

			item.bind("focus.placeholder", function(event) {
				if (item.val() === text)
				item.val("");
			});
			 item.bind("blur.placeholder", function(event) {
				 if (item.val() === "")
				 item.val(text);
			 });
		});


		//Allow some buttons to send users back
		$(".go-back").click(function(){
			history.go(-1);
			return false;
		});


		//We want to be able to hide and show various home features
		if ($(".views-widget-filter-field_features_tid .views-widget").length != 0){

			var featuresWidget = $(".views-widget-filter-field_features_tid .views-widget");

			$(".views-widget-filter-field_features_tid .views-widget .bef-checkboxes .form-item").slice(5,100).hide();

			$('<a href="#" class="show-more-features">show more features</a>').insertAfter(featuresWidget);
			$('<a href="#" class="show-less-features">show less features</a>').insertAfter(featuresWidget);

			$(".show-less-features").hide();

			$(".show-more-features").click(function(){
				$(".views-widget-filter-field_features_tid .views-widget .bef-checkboxes .form-item").slideDown();
				$(".show-less-features").show();
				$(this).hide();
				return false;
			});

			$(".show-less-features").click(function(){
				$(".views-widget-filter-field_features_tid .views-widget .bef-checkboxes .form-item").show();
				$(".show-more-features").show();
				$(".views-widget-filter-field_features_tid .views-widget .bef-checkboxes .form-item").slice(5,100).slideUp();
				$(this).hide();
				return false;
			});

		}


		$.each($('.views-slideshow-controls-bottom .views-slideshow-pager-field-item'),function(index,element){
			$(element).find('.views-content-nothing').html(index+1);
		});

		//Bypass the need to confirm a users password
		$('.password-field').change(function(){
			$('.password-confirm').val($(this).val());
		});


		//new win rather than target
		$('a[rel="external"]').click(function(){ window.open(this.href); return false; });


		function active_menu_fixes(){

			//Trust me, I'm a doctor, context module doesn't add all active classes
			$('.region-tabs a.active').parent().addClass('active');

			if($('.package-type-packages').length != 0){
				var li = $('.menu-mlid-2125');

				li.addClass('active');
				li.find('a').addClass('active');
			}

			if($('.package-type-display').length != 0){
				var li = $('.menu-mlid-2126');

				li.addClass('active');
				li.find('a').addClass('active');
			}

			if($('.package-type-investments').length != 0){
				var li = $('.menu-mlid-2398');

				li.addClass('active');
				li.find('a').addClass('active');
			}

			if($('.package-type-display-for-sale').length != 0){
				var li = $('.menu-mlid-2941');

				li.addClass('active');
				li.find('a').addClass('active');
			}
		}

		active_menu_fixes();


		//Facebook new window stuff
		if($('.page-facebook-homefinder').length != 0){

			$('.read-more, .node-list-thumbnail a').live('click',function(){
				window.open($(this).attr('href'));
				return false;
			});

		}

	});

	window.___gcfg = {lang: 'en-GB'};
	(function() {
		var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
		po.src = 'https://apis.google.com/js/plusone.js';
		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
	})();

})(jQuery);;
jQuery(document).ready(function(){

	/*
	 * STANDARD SELECTORS
	 */

	//bold
	var bold_selectors = '#block-celebration-search-block-search-block h2, ' +
	                     '#block-celebration-search-block-search-block-house-and-land h2, ' +
						 '#block-celebration-home-comparison-sidebar-block h2 span:not(.regular), ' +
						 '.region-tabs .menu a.active, ' +
						 '#block-celebration-newsletter-sign-up-news h3 strong, ' +
						 'h2.bold, ' +
						 '.view-homepage-slideshow h2 span:not(.light), ' +
						 'h1 span.bold, ' +
						 '.node-offer h2 a, ' +
						 '.view-contact-us .views-field-titleslides, ' +
						 '.view-staff-members .views-field-title, ' +
						 '.view-staff-members .views-field-field-staff-title, ' +
						 '.view-latest-home .views-field-title .field-content, ' +
						 '.view-latest-home .views-field-title-1 .field-content, ' +
						 '.node-type-home-design h1.title, ' +
						 '.region-content-bottom #block-views-latest-home-block .views-field-title .field-content, ' +
						 '.bold:not(.dropdown-title span.bold), ' +
						 '.features-bar .item-list li, ' +
						 '.strong, .views-exposed-widget > label, ' +
						 '#block-views-contact-block-block h2 span, ' +
						 '.mba-table th, ' +
						 //'.home-features-legend .title, ' +
						 '.region-tabs .menu li.active a.active, ' +
						 '.bold';
	//light
	var light_selectors = '#block-celebration-newsletter-sign-up-news h3 span, ' +
						  '.view-homepage-slideshow h2 span.light, ' +
						  '#block-views-contact-block-block h2.block-title, ' +
						  '.light:not(.dropdown-title span.light), ' +
						  '.cols-3-list .node-content h4 a,' +
						  'h1 span.light, ' +
						  '.light';
	//reg
	var regular_selectors = '.region-tabs .menu a, ' +
							'.home-or-land .links-bar .return-to-search, ' +
							'.home-or-land #top-bar .return-to-search, ' +
							'.regular, ' +
							'h2.reg-cufon, ' +
							'strong.ph, .content-enquire-button, ' +
							'.purple, ' +
							'#main-menu > li > a, ' +
							'.region-content-bottom #block-views-latest-home-block .views-field-title .views-label-title,' +
							'.view-latest-home .views-field-title .views-label, ' +
							'.region-underh1 p, ' +
							'div.view-mode-full h2, ' +
							'.account-operations p, ' +
							'body.section-newsletter h2, ' +
							'body.section-newsletter legend, ' +
							'#pulldown h2, ' +
							'#block-views-taxonomy-block .block-title, '+
							'#main-menu .dropdown-link .right-image .link-title, ' +
							'#main-menu li .custom-dropdown .dropdown-link a, ' +
							'.price';


	//apply std selectors
	Cufon.replace(light_selectors ,{fontFamily: 'myriad-light'	});
	Cufon.replace(regular_selectors ,{fontFamily: 'myriad'	});
	Cufon.replace(bold_selectors ,{fontFamily: 'myriad-bold'	});

	//alert(bold_selectors);

	/*
	 * OTHER VARIATIONS
	 */


	//bold with drop light shadow
	Cufon.replace(
			'.now-viewing-title',{
				fontFamily: 'myriad-bold',
				textShadow: '1px 1px #ddd'
			}
	);

	//light with dark drop shadow
	Cufon.replace(
			'h1:not( .node-type-home-design h1.title, .front h1)',{
				fontFamily: 'myriad-light',
				textShadow: '#333 1px 1px'
			}
	);

	//light with dark drop shadow
	Cufon.replace(
			'h1.title span:not(.front h1 span)',{
				fontFamily: 'myriad-bold',
				textShadow: '#333 1px 1px'
			}
	);

	//reg with reg drop shadow
	Cufon.replace(
			'.dropdown-title span.light',{
				fontFamily: 'myriad',
				textShadow: '#a9763e 1px 1px'
			}
	);

	//bold with reg shadow
	Cufon.replace(
			'.dropdown-title span.bold',{
				fontFamily: 'myriad-bold',
				textShadow: '#a9763e 1px 1px'
			}
	);

});;
/********************************************************************************
* Floatbox 5.1.0
* Dec 27, 2011
*
* Copyright (c) 2008-2011 Byron McGregor
* Website: http://floatboxjs.com/
* This software and all associated files are protected by copyright.
* Redistribution and/or modification of the executable portions is prohibited.
* Use on any commercial site requires registration and purchase of a license key.
* See http://floatboxjs.com/license for details.
* This comment block must be retained in all deployments.
*********************************************************************************/

(function(k,t,w,bB){if(self.fb&&self.fb.data)return;var ea='canvas',eb='hidden',ec='fbVideoThumb',dk='display',ed='object',ee='window',ef='function',eg='relative',eh='paddingLeft',ei='paddingTop',ej='corner',ek='getBoundingClientRect',el='offsetHeight',em='contentDocument',en='hasAttribute',eo='compareDocumentPosition',dl='insertBefore',ep='currentStyle',eq='getComputedStyle',er='getElementsByClassName',es='preventDefault',et='stopPropagation',eu='removeEventListener',ev='indexThumbSource',ew='floatboxClass',ex='fbPageOptions',dm='inline',dn='pdf',o0='once',dp='script',dq='rev',dr='visible',ds='fixed',dt='offsetParent',du='offsetTop',dv='setRequestHeader',dw='readyState',dx='onreadystatechange',dy='preload',dz='parentWindow',ce='defaultView',dA='topInstance',dB='showThis',cy='clientWidth',dC='offsetWidth',dD='enableQueryStringOptions',dE='domReady',cz='bl',cA='no',cB='data-fb-options',cC='media',cD='null',cE='area',cF='absolute',cG='borderLeftWidth',cH='borderTopWidth',cI='none',cJ='scrollTop',cK='scrollLeft',cL='setTimeout',cM='value',cN='addEventListener',cO='concat',cP='position',cf='px',cg='on',ch='img',ci='div',cj='cursor',ck='autoTypes',cl='mobile',cm='substring',cn='options',co='core',bQ='auto',bR='image',bC='height',bD='width',bS='proto',bT='indexOf',bE='?',bF='zoomSource',bG='source',bu='ready',bH='firstChild',bI='split',bk='appendChild',bc='createElement',bv='iframe',bw='group',bx='html',bl='className',Y='left',bm='documentElement',bn='node',bo='parentNode',bp='getElementsByTagName',bd=' ',be='ieVersion',U='nodeType',R='body',V='exec',S='toLowerCase',N='document',T='ownerDocument',O='getAttribute',I='style',G='type',E='push',y='replace',s='length',r='',i={U:[],W:[],X0:[],ZF:{F:[],U:[],W:[],ZL:{}},ZS:{F:[],U:[],W:[]},ZR:{F:[],U:[],W:[]},YS:[]},K,u,P,L,dF,ey,ez,v,dG,B=document,cp=self.navigator,bq=cp.userAgent,eA=eB().src,fd=i.UC=(bJ(4)+'//'+bJ(1))[S](),eC=i.SF=(v=/js(\?.+)$/i[V](eA))&&v[1]||r,cQ=i.UI=(v=/(.*\/)\S+\.js(?:\?|$)/i[V](eA))&&v[1]||'./',cR=self[ex]||{},fe=cR.modulesPath||cQ+'modules/',fJ=i.SS=cR.languagesPath||cQ+'languages/',cS=i.UT=cR.graphicsPath||cQ+'graphics/',ff=i.TO=cS+'blank.gif',fg=i.R9=cS+'magnify_plus.cur',bf=self===top||/\bframed\b/.test(eC)||cR.framed,cq=[],n={},br=Math,fK=i.SQ=br.abs,fL=i.SP=br.ceil,fM=i.VY=br.floor,fN=i.SO=br.log,fO=i.VX=br.max,fP=i.XN=br.min,fQ=i.SN=br.pow,fR=i.UB=br.random,cr=i.VW=br.round,cT=i.S0=Infinity,fS=i.U5=String.fromCharCode,W=i.SV=function(a){return typeof a==='string'},fh=i.V4=function(a){return typeof a==='number'},fT=i.UG=function(a){return typeof a==='boolean'},by=i.SW=function(a){return bK(a)===ed},cs=i.W0=function(a){return bK(a)===ef},bz=i.UH=function(a){return bK(a)==='array'},bs=i.SY=function(a){return bK(a)===bn},bL=i.SU=function(a){return bK(a)===ee},cU=i.SX=function(a){return bK(a)===cD},M=i.VI=function(a,b){return a[bT](b)!==-1},fi=i.VA=function(a,b){return a.charCodeAt(b)},Z=i.YX=function(a){return(a&&a.nodeName||r)[S]()},eD=i.WU=function(){return(new Date).getTime()},fj=i.UW=function(a,b){return parseInt(a,b||10)},eE=i.TC=function(a){return parseFloat(a)},cV=i.S9=function(a,b){return Object.hasOwnProperty.call(a,b)},Q=i.U3=function(a,b){return setTimeout(a,b)},fk=i.T2=function(a){alert(a)},cW=i.T4=function(a,b){delete a[b]},fl=i.SJ=function(){};function eB(){var a=B[bp](dp);return a[a[s]-1]||{}}i.SK=eF;function eF(a){return u.M&&u.M[a]&&u.M[a].X}function bg(a,b,c,d,g,h){if(!eF(co)){Q(function(){bg(a,b,c,d,g,h)},100)}else{u.M[co][a].call(self,b,c,d,g,h)}}i.XV=ct;function ct(a,b){var c=a[b];return(c===bB||c===r)?L[b]:c}i.SR=bJ;function bJ(a,b){var c=(b||self).location,d=[w,'host','hostname','href','protocol','search'];return a&&c?c[d[a]]:c}i.WM=bU;function bU(a,b){if(bz(a)){var c=a[s];while(c--)bU(a[c],b)}else if(a&&a[I]){a[I][dk]=W(b)?b:cI}}i.TZ=fm;function fm(a,b){if(a&&a[I]){a[I].visibility=W(b)?b:b?dr:eb}}function cX(a){fb[dE]=k;while((a=cq.shift()))a()}i.R5=dH;function dH(a){var b=a+r,c=0,d=b[s];while(d--){c=fi(b,d)+(c<<6)+(c<<16)-c}return c}i.WZ=dI;function dI(a){if(!W(a))return k;if(a&&a[bT]('//')===0)a=bJ(4)+a;return/^https?:\/\/\w/i.test(a)&&a[S]()[bT](fd)!==0}i.SC=cY;function cY(a){if(!a)return;if(Z(a)===dp){a[bo].removeChild(a);return}var b=a[T]||B,c=F('fbBin',b);if(!c){c=b[bc](ci);c.id='fbBin';bU(c);b[R][bk](c)}c[bk](a);bM(a);bV(c)}i.UV=bh;function bh(a,b){var c=u.M,d=c[a]||(c[a]={}),g;if(d.X){if(d.ZC)d.ZC(b)}else if(d.SA&&!d.X||a!==co&&!((g=c[co])&&g.X)){Q(function(){bh(a,b)},99)}else{K.fb.executeJS(fe+a+'.js'+eC,function(){bh(a,b)});d.SA=k}}function fn(){function g(c){var d={};if(!c)return d;bi(c,function(a,b){d[a===ch?bR:a]=bj(b)});return d}var h=fb[cn]||fb[bS].globalOptions,f=bj(h.globalOptions),j=bj(h.childOptions||{}),m=g(h.typeOptions),p=g(h.classOptions),l=bj(self[ex]),C=bj(self.fbChildOptions),A=g(self.fbTypeOptions),q=g(self.fbClassOptions),o=bj(bJ(5)[cm](1)),x=f[dD]||l[dD]||o[dD]?o:{};var X={};if(l.RO)H(X,P.YW);H(P.YW,f,l,X);P.TL=H(j,C);P.VE=H(m,A);P.TJ=H(p,q);P.U1=x}function fo(d){var g={},h=d.Y;function f(){var a={},b=((d.WI||r)+bd+(h[bl]||r)+bd+(h.TK||r))[y](/\s+/g,bd)[y](/^\s+|\s+$/g,r)[bI](bd),c=b[s];while(c--){H(a,P.TJ[b[c]])}return a}H(g,P.VE[d[G]]);if(d.V)H(g,P.VE[d.V]);H(g,f());H(g,P.U1);H(g,h);H(h,g)}function fp(){var c=cp.appVersion,d;function g(a,b){return eE(a[bI](b)[1])}n.UD=M(c,'Macintosh');if(fb[be]){n.ie=k;n.S4=fb[be]<10;n.J=fb[be]<9;n.YA=fb[be]<8;n.P=fb[be]<7;n.S3=(d=g(c,'Windows NT '))&&d<6;n.UL=M(c,' x64;')}else if(self.opera){n.op=k;if(/Opera M(ob|in)i/.test(bq)){n[cl]=k}else{n.YP=opera.version()<9.5;n.SI=opera.version()>=10.5}}else if((d=g(bq,'Firefox/'))){n.ff=k;n.XX=d<3;n.U0=n.UD}else if((d=g(bq,'AppleWebKit/'))){n.TS=k;n.RQ=d<530;n.WE=g(bq,'Chrome/')||bB;n[cl]=fb[cl];n.SD=M(bq,'rekonq')}else if((d=g(bq,'SeaMonkey'))){n.seaMonkey=k;n.R4=d<2}if(/Kindle|nook brow/.test(bq))n.TH=k;var h=B[bc](ci),f=h[I],j;f[cP]=cF;f.top='-9999px';f[bD]=f[bC]='100px';f.padding=f.margin=f.borderWidth='0';f.overflow='scroll';B[R][bk](h);n.X2=n[cl]?0:(h[dC]-h[cy])||17;n.TA=!!B[bc](ea).getContext;bV(h,'<v:shape />');j=h[bH];j[I].behavior='url(#default#VML)';n.S8=by(j.adj);f.borderRadius=f.MozBorderRadius=f.WebkitBorderRadius=f.KhtmlBorderRadius='9px';n.ZH=(z(h,'borderTopLeftRadius')||z(h,'MozBorderRadiusTopleft')||z(h,'WebkitBorderTopLeftRadius')||z(h,'KhtmlBorderTopLeftRadius'))?'css':n.TA?ea:n.S8?'vml':cI;cY(h);n.U7=(cp.userLanguage||cp.language||cp.systemLanguage||'en')[cm](0,2);i.YI=n}function fq(){K=i.ZZ=bf?self:parent.fb.data.ZZ;if(!(bL(K)&&bL(self)&&K.fb&&self.fb))return;u=K.fb.data;i.X=k;if(bf){P=i.Y={};L=P.YW={roundCorners:'all',cornerRadius:12,shadowType:'drop',shadowSize:12,outerBorder:1,innerBorder:1,padding:24,panelPadding:8,overlayOpacity:55,controlsOpacity:60,doAnimations:k,resizeDuration:3.5,imageFadeDuration:3,overlayFadeDuration:4,startAtClick:k,zoomBorder:1,splitResize:cA,colorTheme:bQ,autoFitImages:k,autoFitHTML:k,autoFitMedia:k,stickyAutoFit:t,autoFitSpace:5,measureHTML:bQ,resizeImages:k,inFrameResize:k,resizeTool:cj,enableDragResize:t,stickyDragResize:k,draggerLocation:'frame',minContentWidth:140,minContentHeight:100,maxContentWidth:0,maxContentHeight:0,boxLeft:bQ,boxTop:bQ,captionPos:cz,caption2Pos:'tc',infoLinkPos:cz,printLinkPos:cz,newWindowLinkPos:'tr',itemNumberPos:cz,indexLinksPos:'br',controlsPos:'br',outerClosePos:'tr',centerNav:t,enableDragMove:k,stickyDragMove:t,showClose:k,showOuterClose:t,showItemNumber:k,showPrint:t,showNewWindow:t,showNewWindowIcon:k,closeOnNewWindow:t,controlsType:bQ,strongControls:t,showHints:o0,outsideClickCloses:k,imageClickCloses:t,enableKeyboardNav:k,navType:'both',navOverlayWidth:30,navOverlayPos:30,showNavOverlay:cA,enableWrap:k,numIndexLinks:0,showIndexThumbs:k,pipIndexThumbs:k,maxIndexThumbSize:0,randomOrder:t,slideInterval:4.5,endTask:'exit',showPlayPause:k,startPaused:t,pauseOnPrev:k,pauseOnNext:t,pauseOnResize:k,cycleInterval:5,cycleFadeDuration:4.5,cyclePauseOnHover:t,cycleResumeOnHover:t,titleAsCaption:k,hideObjects:k,hideJava:k,showIE6EndOfLife:t,showMagCursor:cA,modal:k,centerOnResize:k,disableScroll:t,removeScrollbars:t,autoEndVideo:k,zIndex:90000,preloadAll:k,language:bQ,floatboxClass:'floatbox',cyclerClass:'fbCycler',tooltipClass:'fbTooltip'};i.X1=[];i.ZQ=[];i.M={};i.WS={F:[],YU:{},ZL:{}};fp();fn();bh(co)}else{P=u.Y;L=P.YW;n=u.YI;u.X1[E](self)}dF=fb.instances=u.ZQ;ey=i.R8=z(B[R],'direction')==='rtl';ez=new RegExp('\\b'+L[ew]+'(\\S*)','i');cW(fb,cn);cW(fb,bS);v=/\bautoStart=(.+?)(?:&|$)/i[V](bJ(5));i.U9=v?v[1]:w;fb[bu]=k}i.YN=bj;function bj(c){var d={},g=[],h=/`([^`]*)`/g;function f(a){if((v=/^(['"])(.+)\1$/.exec(a)))a=v[2];var b=a==='true'?k:a==='false'?t:a===cD?w:a==='``'?(g.pop()||r):(v=/^(\d+)px$/.exec(a))?v[1]:a;if(/\d/.test(b)&&!isNaN(b))b=+b;return b}if(!c)return d;if(by(c)){bi(c,function(a,b){d[a]=f(b)})}else{h.lastIndex=0;while((v=h[V](c)))g[E](v[1]);if(g[s])c=c[y](h,'``');c=c[y](/[\r\n]/g,bd)[y](/\s{2,}/g,bd)[y](/\s*[:=]\s*/g,':')[y](/\s*[;&,]\s*/g,bd)[y](/^\s+|\s+$/g,r);var j=c[bI](bd),m=j[s],p;while(m--){p=j[m][bI](':');if(p[0])d[p[0]]=f(p[1])}}return d}function fr(c){var d=r;bi(c,function(a,b){if(b!==r){if(/[:=&;,\s]/.test(b))b='`'+b+'`';d+=a+':'+b+bd}});return d}function fs(a,b){if(!(b&&W(b)))return;var c=b.search(/[\?#]/),d=(c!==-1)?b[cm](0,c):b,c=b[bT](bE)+1,g=c?b[cm](c):r,c=d.lastIndexOf('.')+1,h=c?d[cm](c)[S]():r,f=a[G];if(!f){if(/^(jpe?g|png|gif|bmp)$/.test(h))f=bR;else if(!h||/^(html?|php\d?|aspx?)$/.test(h))f=bv;else if(h==='swf'&&!M(d,'moogaloop.swf'))f='flash';else if(h===dn)f=dn;else if(h==='xap')f='silverlight';else if(/^(mpe?g|movi?e?|3gp|3g2|m4v|mp4|m1v|mpe|qt)$/.test(h))f='quicktime';else if(/^(wmv?|avi|asf)$/.test(h))f='wmp'}if(!f||/media|video|flash/.test(f)){var j,m,p,l;if((v=/youtu(?:be\.com\/(?:embed\/|watch\?v=|v\/)|\.be\/)([\w\-]+)/i[V](b))){j='youtube';m='//www.youtube.com/';p='v/';l='embed/';g=g[y](/\bv=[\w\-]+(&(amp;)?)?/,r)}else if((v=/vimeo.com\/(?:video\/|moogaloop.swf\?clip_id=)?(\w+)/i[V](b))){j='vimeo';m='//';p='vimeo.com/moogaloop.swf?clip_id=';l='player.vimeo.com/video/';g=g[y](/clip_id=\w+(&(amp;)?)?/,r)}else if((v=/dailymotion\.com\/(?:(?:embed\/|swf\/)?video|swf)\/([a-z\d]+)/i[V](b))){j='dailymotion';m='//www.dailymotion.com/';p='swf/video/';l='embed/video/'}if(v){a.Y3={vid:v[1],VD:j};if(f==='flash'){a.Z=m+p}else{f='video';a.Z=m+l}a.Z+=v[1]+(g?(M(a.Z,bE)?'&':bE)+g:r)}}if(!f)f=bv;if(f===ch)f=bR;if(/^(iframe|inline|ajax|direct)$/.test(f)){a.V=f;f=bx}if(/^(video|flash|quicktime|wmp|silverlight|pdf)$/.test(f)){if(f==='video'){a.Z+=(M(a.Z,bE)?'&':bE)+'autoplay=1'}a.V=f;f=cC}a[G]=f}i.RP=dJ;function dJ(a,b,c){var d=a[bo],g;c=c||'fbWrapper';if(d[bl]===c){return d}else{g=a[T][bc](b||ci);g[bl]=c;d.replaceChild(g,a);g[bk](a);if(!b){var h=z(a,dk),f=z(a,'visibility');bU(g,h);g[I].visibility=f;if(h===cI)bU(a,'block');if(f===eb)a[I].visibility=dr}return g}}i.TR=eG;function eG(c,d,g,h){var f={Y:H(d)},j=f.Y,m,p;c=c||j[bG]||j[bx]||j.href;if(!c&&j[dB]!==t)return;if(g)f.YJ=k;if(bs(c)){var l=Z(c),C=bj(c[O](cB)||c[O](dq));if(/^a(rea)?$/.test(l)){H(j,C,d);f.Y2=c.href||r;try{f.Y2=decodeURI(f.Y2)}catch(e){}m=(l===cE?c:c[bp](ch)[0])||w;H(f,{WI:c[bl]||r,R:c,Z3:m});if((v=ez[V](f.WI))){f.YJ=k;if(v[1])f[bw]=v[1]}else{if((p=c[O]('rel'))&&(v=/^(?:floatbox|gallery|iframe|slideshow|lytebox|lyteshow|lyteframe)(.*)/i[V](p))){f.YJ=k;f[bw]=v[1];if(/^(slide|lyte)show/i.test(p)){j.doSlideshow=k}else if(/^(i|lyte)frame/i.test(p)){f[G]=bx;f.V=bv}}}if(m&&((v=/\bfbPop(up|down|left|right|center|pip)\b/i[V](f.WI)))){f.VQ=v[1];f.I=cZ(f.R);i.ZS.F[E](f)}}else{f[G]=bx;f.V=dm}}f.Z=j[bG]||j.href||f.Y2||c;if(!f[G]){f.Z=eH(f.Z);if(/<.+>/.test(f.Z)){f[G]=bx;f.V='direct'}else if((v=/#([a-z][^\s=]*)$/i[V](f.Z))){var A=F(v[1]);if(A){H(f,{Z:A,type:bx,V:dm})}}}f[G]=f[G]||j[G]||L[G];if(!f.V)fs(f,f.Z);if(!f.YJ&&j[ck]&&(M(j[ck],f[G])||f.V&&M(j[ck],f.V))){f.YJ=k}if(!f.YJ)return;fo(f);if(!ct(j,'caption')&&bs(c)&&ct(j,'titleAsCaption')){j.caption=c[O]('title')||m&&m[O]('title')||bB}f[bw]=j[bw]||f[bw]||!g&&L[bw]||r;if(L.singleInstanceGroups&&f[bw]){f[bw]+=da(f.W5||f.R,k)}if(f.V===dm){f.W5=dJ(f.Z)}if(f.V===dn&&(n.XX||n.J&&dI(f.Z))){f[G]=bx;f.V=bv}if(f[G]===bR&&j[bF]===bB){j[bF]=L[bF]===bB?f.Z:L[bF]}if(j[ev]){dK(j[ev],function(a){f.S1=a})}if(g)return f;if(f[G]===bR&&f.Z!==j[bF])u.WS.F[E](f.Z);if(j[bF])u.WS.F[E](j[bF]);eI(m,ct(j,'addPlayButton'));if(f[G]===cC)i.YS[E](f);h=h||dL();f.I=f.I||cZ(f.W5||f.R);var q=f.I.fb&&f.I.fb.data||f.I,o=h[s],x;f.W2=(bs(f.R)?db(f.R):bs(f.Z)?db(f.Z):f.Z)+dc(j);while(o--){if((x=h[o])&&x.W2===f.W2&&x.I===f.I){h[o]=f;break}}if(o>=0){o=q.U[s];while(o--){if(q.U[o].W2===f.W2){q.U[o]=f;break}}}else{q.U[E](f)}var X=ct(j,'showMagCursor'),ba=m&&m[I];if(ba){if(ba.YO===bB){ba.YO=z(m,cj)}else{ba[cj]=ba.YO}if(X!==cA){ba[cj]='url('+fg+'), pointer';if(X===o0){m.RW=bW(m,'mouseout',function(){var a=this,b=a[I];b[cj]=b.YO||r;bX(a.RW)},i.X0)}}}if(f.Y2&&!i.ZO){if(i.U9){if(j[dB]!==t&&M(f.Y2[y](location,r),i.U9)){i.ZO=f}}else if(j.autoStart===k){i.ZO=f}else if(j.autoStart===o0){v=/fbAutoShown=(.+?)(?:;|$)/.exec(B.cookie);var cu=v?v[1]:r,bY=escape(f.Y2);if(!M(cu,bY)){i.ZO=f;B.cookie='fbAutoShown='+cu+bY+'; path=/'}}}if(f.R){if(n.P)f.R.hideFocus='true';bW(f.R,'onclick',function(a){var b=a||self.event;if(!(fb[dA]&&fb[dA].YC)&&(!(b&&(b.ctrlKey||b.metaKey||b.shiftKey||b.altKey))||f[G]!==bR&&f.V!==bv||f.Y[dB]===t)){dd(this);return eJ(b)}},q.W)}}function cZ(a){var b=a&&a[T]||B,c=b[ce]||b[dz];if(bs(a)&&c===K){c=da(a)||c}return c}i.UX=de;function de(a){if(a&&!cU(a)){if(a[U]==9)a=a[ce]||a[dz];if(a&&a!==top){var b=a.parent[N][bp](bv),c=b[s];while(c--){var d=b[c];if(a===dM(d))return d}}}return w}i.TG=bZ;function bZ(a,b){var c=[K][cO](u.X1),d=c[s];if(!bz(a))a=[a];while(d--){var g=c[d],h=bL(g)&&g.fb,f=a[s],j;if(h&&h.data.X){while(f--){j=a[f];if(cs(j)){j(g)}else{h[j]=b}}}}}function dN(a){if(u&&u.ZQ){var b=u.ZQ[s],c;while(b--){c=u.ZQ[b];if(c)a(c)}}}i.ZD=dL;function dL(b){df();var c=[];dN(function(a){c=c[cO]((b?a[b]:a).U)});bZ(function(a){c=c[cO]((b?a.fb.data[b]:a.fb.data).U)});return c}i.UE=df;function df(c){var d=u.X1,g=d[s],h;if(c){while(g--){h=d[g];if(cU(h)||!cU(c)&&h===c){try{cv(h.fb.data);h.fb.data.X=t}catch(e){}d[g]=w;d.splice(g,1)}}}else{function f(a){var b;try{if(a===K||bL(a)&&(b=a.parent)&&b!==a&&de(a)&&f(b))return true}catch(e){}return false}while(g--){h=d[g];if(!f(h))df(h)}g=d[s];while(g--){var j=g;while(j--){h=d[j];if(h===d[g]){df(h);g=j=0}}}}}i.R3=eK;function eK(c,d,g,h){if(!(c=F(c)))return;var f=[],j=/<script[^>]*>([\s\S]+?)<\/script>/gi,m=/^<script[^>]+src\s*=\s*["']/i,p=d||'<p style="color:#000; background:#fff; padding:2em; margin:0;">404 - Requested content not found.</p>',l;j.lastIndex=0;while((l=j[V](d))){if(!M(l[1],'document.write')&&!m.test(l[0])){p=p[y](l[0],r);f[E](l[1])}}bV(c,p);if(g){Q(function(){for(var a=0,b=f[s];a<b;a++)dg(f[a],w,k)},40)}if(h)ca(c)}i.TP=eI;function eI(p,l,C){if(!(p&&l)||p[bo][bl]===ec)return;var A=cS+'videoPlay.png';fb[dy](A,function(m){fb[dy](p&&p.src,function(a){if(!(m&&a))return;var b=p[bD]||a[bD],c=p[bC]||a[bC],d=p[T][bc](ch),g=dJ(p,'span',ec),h=865,f=0.197,j;d.src=m.src;d.alt=r;if(l==='large'){h=607;f=0.21}else if(l==='small'){h=1515;f=0.184}j=u.XN(1,b/h+f);d[bD]=m[bD]*j;d[bC]=m[bC]*j;d[bl]='fbVideoPlay';d[I][Y]=(b-d[bD])/2+cf;d[I].top=(c-d[bC])/2+cf;if(C){g[I][bD]=b+cf;g[I][bC]=c+cf}g[bk](d);if(!M(z(g,dk),'block'))bU(d)})})}i.RZ=dh;function dh(a,b,c,d,g){var h={left:a,top:b,width:c,height:d};if(g)h[bn]=g;return h}i.XM=bM;function bM(b){if(bz(b)){var c=b[s];while(c--)b[c]=w;b[s]=0}else if(by(b)){bi(b,function(a){b[a]=w;cW(b,a)})}}i.Y1=cv;function cv(c){if(!fb[bu])return;if(c==='*'){dN(function(a){a.W7();bM(a)});bZ(function(a){cv(a.fb.data);bM(a.fb.data)})}else{bi(u.M,function(a,b){if(b&&b.Y1)b.Y1(c)});var d;while((d=c.W.pop()))bX(d);bM(c.U)}if(K.CollectGarbage)Q(K.CollectGarbage,10)}function F(a,b){var c,d='getElementById';if(!W(a))return a;if(b&&b[U]==9)return b[d](a);c=B[d](a);if(!c&&fb[bu]){var g=u.X1[s],h;while(g--&&!c){if((h=u.X1[g])&&bL(h)&&h[N])c=h[N][d](a)}}return c||bL(K)&&K[N][d](a)||w}function eL(a){if(!cs(a))return;if(fb[dE])return a();cq[E](a)}function bW(b,c,d,g,h){var f={a:b,b:c,c:d,d:h};if((b=F(b))){if(b[U]==9&&/^DOMContentLoaded$/i.test(c)){var j=cq[s];while(j--){if(cq[j]===d)break}if(j===-1)cq[E](d)}else if(c[bT](cg)===0){b[c]=d;f.c=w}else if(b[cN]){b[cN](c,d,t)}else if(b.attachEvent){if(!h)h=f.hash=dH(d);bX(b,c,d,h);var m=cg+c,p=c+h,l=m+h;b[p]=d;b[l]=function(a){if(!a)a=this.event;if(a&&!a.target)a.target=a.srcElement;try{if(b&&b[p])return b[p](a)}catch(err){}};b.attachEvent(m,b[l])}}if(g&&g[E])g[E](f);return f}function bX(a,b,c,d){if(by(a)&&a.a){bX(a.a,a.b,a.c,a.d);bM(a);return}a=F(a);if(!a||cU(a))return;if(b[bT](cg)===0){a[b]=w;return}if(cs(c)){if(a[eu]){a[eu](b,c,t)}else if(a.detachEvent){if(!d)d=dH(c);var g=cg+b,h=b+d,f=g+d;if(a[f])a.detachEvent(g,a[f]);a[f]=a[h]=w}}}function eJ(a){if(a){if(a[et])a[et]();try{a.cancelBubble=k}catch(err){}if(a[es])a[es]();try{a.returnValue=t}catch(err){}}return t}function bV(a,b){if(!(a=F(a)))return t;try{a.innerHTML=b||r;return k}catch(e){}try{var c=a[T],d=c.createRange();d.selectNodeContents(a);d.deleteContents();if(b){var g=(new DOMParser).parseFromString('<div xmlns="http://www.w3.org/1999/xhtml">'+b+'</div>','application/xhtml+xml'),h=g[bm].childNodes,f=h[s],j=0;while(j<f){a[bk](c.importNode(h[j++],k))}}return k}catch(e){}return t}function db(a){if(!(a=F(a)))return r;if(a.outerHTML)return a.outerHTML;var b=(a[T]||a[N])[bc](ci);b[bk](a.cloneNode(k));return b.innerHTML}function ft(a){if(!W(a))return a;return a[y](/&/g,'&amp;')[y](/</g,'&lt;')[y](/>/g,'&gt;')[y](/"/g,'&quot;')}function eH(a){if(!W(a))return a;return a[y](/&lt;/g,'<')[y](/&gt;/g,'>')[y](/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,'&')}function H(){var c=arguments,d=c[s],g=c[0]||{},h=1,f;if(d===1)return H({},c[0]);while(h<d){if(by(f=c[h++])){bi(f,function(a,b){if(b!==bB)g[a]=b})}}return g}function bi(a,b){for(var c in a){if(cV(a,c))b(c,a[c])}}function cb(a,b){var c=[],d,g,h,f,j;if(bz(a)){d=a.pop();if(a[s]){return cb(a,b)[cO](cb(d,b))}else{a=d}}b=b||B[bm];if(/\[native code\]/.test(b[er])){g=b[er](a);h=g[s];while(h--)c[h]=g[h]}else if(b[bp]){j=new RegExp('(^|\\s)'+a+'(\\s|$)');g=b[bp]('*');h=0;f=g[s];while(h<f){if(j.test(g[h][bl]))c[E](g[h]);h++}}return c}function z(c,d,g){var h;function f(a){return g?cr(eE(a)||0):a||r}if(!(c=F(c)))return w;if(window[eq]){var j=c[T]&&c[T][ce];if(!(h=j&&j[eq](c,r)))return w;if(d){d=d[y](/[A-Z]/g,'-$&')[S]();return f(h.getPropertyValue(d))}}d=d&&d[y](/-(\w)/g,function(a,b){return b.toUpperCase()});if(c[ep]){h=c[ep];if(d){var m=h[d]||r;if(/^[\.\d]+[^\.\d]/.test(m)&&!/^\d+px/i.test(m)){var p=c[T],l=p[bc]('xxx'),C,A;if(/html|body/.test(Z(c))){C=c;A=c[bH]}else{C=c[bo];A=c}C[dl](l,A);l[I][Y]=m;m=l[I].pixelLeft+cf;cY(l)}return f(m)}}if(h&&!d){var q=r;if(h.cssText){q=h.cssText}else{bi(h,function(a,b){if(isNaN(a)&&b&&W(b)){q+=a[y](/[A-Z]/g,'-$&')[S]()+': '+b+'; '}})}return q}return f(c[I]&&d&&c[I][d]||r)}function dg(b,c,d){var g=B[bc](dp);function h(){var a=B[bp]('head')[0];if(n.P){a[dl](g,a[bH])}else{a[bk](g)}}function f(a){if(!n.P)cY(g);g=w;if(cs(c))c(a)}g[G]='text/javascript';if(d){fb.cbk=function(a){fb.cbk=w;cW(fb,'cbk');f(a)};b=b[y](/\\/g,'\\\\')[y](/"/g,'\\"')[y](/[\n\r]+/g,'\\n');b='fb.cbk(eval("'+b+'"));';try{g[bk](B.createTextNode(b))}catch(e){g.text=b}}else{g.onload=g[dx]=function(){if(/^$|complete|loaded/.test(this[dw]||r)){this.onload=this[dx]=w;f()}};g.src=b}h()}function fu(C){var A='XMLHttpRequest',q='Msxml2.XMLHTTP',o;if(self[A]){o=new self[A]}else{try{o=new ActiveXObject(q+'.6.0')}catch(e){try{o=new ActiveXObject(q)}catch(e){}}}(function(d,g){if(!(g&&d&&(d[bG]=d[bG]||d.url||d.uri||d.href)))return;var h=d[bG],f=d.postData,j=d.headers,m=F(d.updateNode),p=d.timeout,l=d.finish||d.callback;if(d.cacheable===t)h+=(M(h,bE)?'&':bE)+'no_cache='+eD();g.open(f?'POST':'GET',h,d.async!==t);g[dv]('X-Requested-With',A);if(f){f=dc(f)||f;g[dv]('Content-Type','application/x-www-form-urlencoded')}if(by(j)){bi(j,function(a,b){g[dv](a,b)})}if(/\d/.test(p)&&!isNaN(p)){d.VH=Q(function(){g.abort()},+p)}g[dx]=function(){if(g[dw]===4){var b=g.status;function c(a){if(cs(a)){a(g)}else if(W(a)){dg(a,w,k)}}clearTimeout(d.VH);if(b>=200&&b<300||b===304||b===1223){if(m)eK(m,g.responseText||r,k,k);c(d.success)}else if(b){c(d.failure)}c(l);bM(d);g=m=l=d=w}};g.send(f||w)})(C,o);return o}function eM(a){var b=a;if(W(a))b=B.forms[a]||F(a);if(Z(b)!=='form')return rtn;var c=b.elements,d={},g={};for(var h=0,f=c[s];h<f;h++){var j=c[h],m=Z(j),p=j[G][S](),l=j.name,C=j[cM];if(l&&!j.disabled){if(m==='input'){if(!/file|image|reset|submit|button/.test(p)){if(p==='radio'){if(g[l]){l=w}else{g[l]=k;var A=b[l],q=A[s],o;while(q--){o=A[q];if(o.checked){C=o[cM];break}}if(q===-1)l=w}}else if(p==='checkbox'){if(j.checked){C=C||cg}else{l=w}}if(l){if(cV(d,l)){if(!bz(d[l]))d[l]=[d[l]];d[l][E](C)}else{d[l]=C}}}}else if(m==='select'){var x=j[cn];for(var q=0,X=x[s];q<X;q++){if(x[q].selected){C=eN(x[q],cM)?x[q][cM]:x[q].text;if(cV(d,l)){if(!bz(d[l]))d[l]=[d[l]];d[l][E](C)}else{d[l]=C}}}}else if(m==='textarea'){d[l]=C}}}return d}function dc(g){if(W(g))g=B.forms[g]||F(g);if(!g)return r;if(Z(g)==='form')return dc(eM(g));if(!by(g))return r;var h=[];bi(g,function(a,b){if(!bz(b))b=[b];var c=0,d=b[s];while(c<d){h[E](encodeURIComponent(a)+'='+encodeURIComponent(b[c++]))}});return h.join('&')[y](/%20/g,'+')}function fv(a){var b={};if(!(a&&W(a)))return b;var c=a[y](/\+/g,'%20')[bI]('&');for(var d=0;d<c[s];d++){var g=c[d][bI]('='),h=decodeURIComponent(g[0]),f=decodeURIComponent(g[1])||r;if(cV(b,h)){if(!bz(b[h]))b[h]=[b[h]];b[h][E](f)}else{b[h]=f}}return b}function fw(){var a=arguments,b=a[0],c;if(!by(b)){b={source:a[0],width:a[1],height:a[2],params:a[3],node:a[4],id:a[5],altContent:a[6],minVersion:a[7]}}if(!(b[bG]=b[bG]||b.url||b.uri||b.href))return;b.V8=k;b[bn]=F(b[bn]);if(!(b[bn]&&b[bn][U]==1)){if(!(c=eB()))return;b[bn]=c[T][bc]('span');c[bo][dl](b[bn],c);c=w}i.YS[E](b);(function d(){if(fb[bu]){bh(cC,i.YS)}else{Q(d,99)}})()}function ca(m){if(!fb[bu])return Q(function(){ca(m)},80);m=F(m);if(!bs(m)){dN(function(a){a.XZ()});bZ(function(a){cv(a.fb.data)});bZ(function(a){try{if(a[N][R])a.fb.activate(a[N][R])}catch(e){}});return}function p(a){var b=m[bp](a),c=0,d=b[s];for(;c<d;c++){eG(b[c],w,t,C)}}function l(a,b){var c=bj(a[O](cB)||a[O](dq)||r),d=a[bp](b),g=d[s],h,f,j;if(!c[ck])c[ck]='image|media|html';c.TK=a[bl];while(g--){h=d[g];if(!/\bnofloatbox\b/i.test(h[bl]+bd+h[O]('rel'))){f=bj(h[O](cB)||h[O](dq)||r);j=H({},c,f);h.setAttribute(cB,fr(j))}}}var C=dL(),A=cb(L[ew],m[bo]||m),q=A[s],o;while(q--){o=A[q];if(!/^a(rea)?$/.test(Z(o))){l(o,'a');l(o,cE)}}p('a');p(cE);if(i.ZS.F[s])bh('popup',i.ZS.F);A=cb(L.cyclerClass,m);q=A[s];if(q){while(q--){o=A[q];o.I=cZ(o);i.ZF.F[E](o)}bh('cycler',i.ZF.F)}A=cb(L.tooltipClass,m);q=A[s];if(q){while(q--){o=A[q];o.I=cZ(o);i.ZR.F[E](o)}bh('tooltip',i.ZR.F)}if(i.YS[s])bh(cC,i.YS)}function da(a,b){var c=dF[s],d,g;while(c--){if((d=dF[c])&&(g=d.fbBox)&&di(g,a))return b?c:d}return w}function di(a,b){if(!((a=F(a))&&bs(a)&&(b=F(b))&&bs(b)))return;if(b[U]==3)b=b[bo];if(a[U]==9)a=a[bm];if(b[U]==9)b=b[bm];if(!(a[U]&&b[U]))return t;if(a===b)return k;var c=a[T],d=b[T];if(d&&c!==d){var g=de(d);if(g)return di(a,g)}if(a.contains)return a.contains(b);if(a[eo])return!!(a[eo](b)&16)}function eN(a,b){if(!(a=F(a)))return;if(a[en])return a[en](b);return(new RegExp('<[^>]+[^>\\w-="\']'+b+'[^\\w\\-]','i')).test(db(a))}function bK(a){var b=typeof a;if(b===ed){try{if(!(a&&(a[cL]||a.toString)))return a?b:cD}catch(e){return cD}var c=Object.prototype.toString.call(a)[S]();if((v=/array|string/.exec(c))){b=v[0]}else if(a[cL]&&a.navigator){b=ee}else if(a[U]&&a.cloneNode){b=bn}}else if(b==='unknown'){b=ef}return b}function dM(a){var b,c;a=F(a);b=Z(a)===bv;if(!b){if((c=da(u.ZP)||fb[dA])&&Z(c.fbContent)===bv){a=c.fbContent;b=k}}if(b){if(!a.WZ){try{var d=a.contentWindow||a[em]&&a[em][ce];if(bL(d)&&fh(d[cL](fl,1)))return d}catch(e){}}}return w}function fx(a){var b=dM(a);return(b&&b[N])||w}function eO(){return{width:dO(),height:dP()}}function dO(){var a=fb.data.ZZ,b=a[N],c=b[bm],d=c[cy]||b[R][cy],g=a.innerWidth;return g&&(g-d!==n.X2)?g:d}function dP(){var a=fb.data.ZZ,b=a[N],c=b[bm],d=c.clientHeight,g=a.innerHeight;if(!d||n.YP)d=b[R].clientHeight;return g&&(g-d!==n.X2)?g:d}function eP(a){return{left:eQ(a),top:eR(a)}}function eQ(a){if(!(a&&a[N]))a=fb.data.ZZ;var b=a[N],c=b[bm],d=b[R],g=a.pageXOffset||d&&d[cK]||c[cK]||0;if(ey&&n.J){if(n.YA){g-=c.scrollWidth-c[cy]}else{g=-g}}return g}function eR(a){if(!(a&&a[N]))a=fb.data.ZZ;var b=a[N],c=b[bm],d=b[R];return a.pageYOffset||d&&d[cJ]||c[cJ]||0}function dQ(a,b){var c=dh(0,0,0,0);if(!(a=F(a))||a[U]!=1)return c;var d=a[T],g=d[R],h=d[bm],f=d[ce]||d[dz],j=eP(f),m=z(a,cP)[S](),p=m===ds,l=!(p||m===cF),C=l&&m!==eg,A=Z(a),q,o,x,X,ba;if(!di(h,a))return c;if(A===cE){var cu=('#'+a[bo].name)[S](),bY=d[bp](ch),bN=null,bb=bY[s];while(bb--){if((bY[bb][O]('usemap')||r)[S]()===cu){bN=bY[bb];break}}if(!(cu&&bN))return c;var bt=[0,0,0,0],eS=dQ(bN),dR=a[O]('shape')[S](),J=a[O]('coords')[y](/\s+/g,r)[bI](','),bb=J[s];while(bb--)J[bb]=+J[bb];if(dR==='rect'){bt=[J[0],J[1],J[2],J[3]]}else if(dR==='circle'){bt=[J[0]-J[2],J[1]-J[2],J[0]+J[2],J[1]+J[2]]}else if(dR==='poly'){var cw=cT,cx=cT,dS=0,dT=0,bb=J[s];while(bb--){var bA=J[bb];if(bb%2){if(bA<cx)cx=bA;if(bA>dT)dT=bA}else{if(bA<cw)cw=bA;if(bA>dS)dS=bA}}if(cw===cT)cw=0;if(cx===cT)cx=0;bt=[cw,cx,dS,dT]}return dh(eS[Y]+z(bN,eh,true)+z(bN,cG,true)+bt[0],eS.top+z(bN,ei,true)+z(bN,cH,true)+bt[1],bt[2]-bt[0],bt[3]-bt[1])}else if(A===bx){o=x=0;X=a[dC];ba=a[el]}else if((q=/\[native code\]/.test(a[ek])&&a[ek]())){o=q[Y];x=q.top;X=q.right-q[Y];ba=q.bottom-q.top;if(!p){o+=j[Y];x+=j.top}if(n.YA){o-=h.clientLeft||g.clientLeft;x-=h.clientTop||g.clientTop}var dU=z(g,'top',k);if(dU&&dU!==g[du])x-=dU}else{o=a.offsetLeft;x=a[du];X=a[dC];ba=a[el];var D=a,eT=k,cc=k,dj=p;if(p){o+=j[Y];x+=j.top}while(!dj&&(D=D[dt])){var dV=0,dW=0,eU=cc,bO=z(D,cP)[S](),dj=bO===ds,cc=!(dj||bO===cF),dX=cc&&bO!==eg,fy=D===a[dt];if(!n.op){if((n.ff||D!==g)&&z(D,'MozBoxSizing')!=='border-box'){dV=z(D,cG,k);dW=z(D,cH,k)}if(n.ff&&(l&&dX||!l&&dX!==fy)&&(cc&&!l&&eU||!cc||eU&&l)&&(!(Z(D)==='td'||!dX&&z(D,'overflow')===dr))){o+=dV;x+=dW}}o+=D.offsetLeft+dV;x+=D[du]+dW;if(dj){o+=j[Y];x+=j.top}if(!cc)eT=t}var D=a,bO=r;while(bO!==cF&&bO!==ds&&(D=D[bo])&&D[U]==1){if(D!==g&&D!==h&&!(n.YP&&D[cK]===o&&D[cJ]===x)){o-=D[cK]||0;x-=D[cJ]||0}bO=z(D,cP)}if(!n.op&&eT&&a[dt]!==g&&!(n.TS&&p)){o+=z(h,'marginLeft',k);x+=z(h,'marginTop',k)}if(n.XX){o-=z(h,cG,k);x-=z(h,cH,k)}}if(f!==K&&!b){var bP=de(f);if(bP){var eV=dQ(bP);o+=eV[Y]-j[Y];x+=eV.top-j.top;if(n.J){var eW=fj(bP[O]('frameBorder'))?2:0;o+=eW;x+=eW}if(!n.YA){o+=z(bP,eh,k);x+=z(bP,ei,k)}o+=z(bP,cG,k);x+=z(bP,cH,k)}}return dh(cr(o),cr(x),cr(X),cr(ba))}function eX(a){if(!a)return eY(eX);var b=u.M.cycler;dY(a);a.VH=K[cL](function(){b.XG(a)},b.TB(a)*600)}function dY(a){if(!a)return eY(dY);K.clearTimeout(a.VH)}function eY(b){var c,d,g;bZ(function(a){if(c=a.fb.data.ZF)b(c)});g=u.ZQ[s];while(g--){if((d=u.ZQ[g])&&(c=d.ZF))b(c)}}function dd(a,b){bg('start',a,b)}function fz(a,b,c){dd(bs(a)?a:{href:a,rev:b,title:c})}function fA(a){bg('end',a)}function fB(a,b,c){bg('resize',a,b,c)}function fC(a,b){bg('reload',a,b)}function fD(a){bg('goBack',a)}function fE(a,b){bg('pause',a,b)}function fF(a,b){bg('showItem',a,b)}function dK(a,b,c){bg(dy,a,b,c)}function fG(a,b){bg('printNode',a,b)}self.fb={version:'5.1.0',build:'2011-12-27',data:i,proto:{},$:F,DOMReady:eL,addEvent:bW,removeEvent:bX,stopEvent:eJ,setInnerHTML:bV,getOuterHTML:db,encodeHTML:ft,decodeHTML:eH,extend:H,forEach:bi,executeJS:dg,ajax:fu,getFormValues:eM,serialize:dc,deserialize:fv,flashObject:fw,getElementsByClassName:cb,getStyle:z,activate:ca,tagAnchors:ca,activateElements:ca,ownerInstance:da,nodeContains:di,hasAttribute:eN,typeOf:bK,getIframeWindow:dM,getIframeDocument:fx,getViewport:eO,getViewportWidth:dO,getViewportHeight:dP,getDisplaySize:eO,getDisplayWidth:dO,getDisplayHeight:dP,getScroll:eP,getScrollLeft:eQ,getScrollTop:eR,getLayout:dQ,cycleGo:eX,cycleStop:dY,start:dd,loadAnchor:fz,end:fA,resize:fB,reload:fC,goBack:fD,pause:fE,showItem:fF,printNode:fG,preload:dK};if(!bf){bf=k;try{bf=dI(bJ(3,parent))}catch(e){}}if(bf){dG=B.compatMode==='BackCompat';i.XA='start';Q(function(){if(!(fb[bu]||fb[cn]||fb[bS]&&fb[bS].globalOptions)){dg(cQ+'options.js?'+eD())}},10)}fb[cl]=M(bq,'AppleWebKit')&&M(bq,'Mobile');fb[be]=B.documentMode||0;if(!fb[be]){var cd=B[bc](ci),eZ='<!--[if IE]><div id="',fa='"></div><![endif]-->',dZ='fb_ie',fc=dZ+6;bV(cd,eZ+dZ+fa);if(cd[bH]&&cd[bH].id===dZ){bV(cd,eZ[y]('IE','lt IE 7')+fc+fa);fb[be]=cd[bH]&&cd[bH].id===fc?6:7}}if(fb[be]&&fb[be]<9){B.write('<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v" />')}eL(function fH(){if(dG){fk('Floatbox does not support quirks mode.\nThis page needs a valid doctype.');return}if(bf&&!(fb[cn]||fb[bS]&&fb[bS].globalOptions)||!bf&&!(parent.fb&&parent.fb[bu])){return Q(fH,50)}fq();ca(B[R]);bW(B,'mousedown',function(a){try{if(u){u.XY=a.clientX;u.W6=a.clientY;u.ZP=a.target;Q(function(){try{u.XY=u.W6=u.ZP=w}catch(a){}},600)}}catch(a){}},i.X0);if(i.ZO)Q(function(){dd(i.ZO);i.ZO=k},60);if(n.P)bh('ie6')});bW(window,'load',function fI(){cX();if(dG)return;if(!(B[R]&&fb[bu])){return Q(fI,50)}if(bf){var a=L.shadowSize,b=L.cornerRadius;if(L.shadowType!==cI&&a){var c=cS+'s'+a+'_r'+b+'_',d='.png',g=[ff,c+'top'+d,c+'right'+d,c+ej+d,c[y]('_r'+b,'_r0')+ej+d,c+'bottom'+d,c+Y+d];Q(function(){dK(g,null,true)},200)}}},i.X0);bW(window,'unload',function(){var a;try{while(a=i.X0.pop())bX(a)}catch(e){}if(bf)cv('*');B=w},i.X0);self.fb$=F;if(B[cN])B[cN]('DOMContentLoaded',cX,t);(function(){/*@cc_on try{B[R].doScroll('up');return cX()}catch(e){}/*@if(false)@*/ if (/loaded|complete/.test(B[dw]))return cX();/*@end @*/if(!fb[dE])Q(arguments.callee,30)})()})(true,false,null);;

