// INCLUDES
// tooltip.js
// interface.js
// jquery.jcarousel.js
// custom.js
// jquery.validationEngine.js
// highslide-with-gallery.packed.js
// highslide_gallery.js

$(document).ready(function() {
 
	//Default Action
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
 
});

<!--
// TOOLTIP
// original code by Stuart Langridge 2003-11
// with additions to the code by other good people
// http://www.kryogenix.org/code/browser/nicetitle/
// thank you, sir

// modified by Peter Janes 2003-03-25
// http://peterjanes.ca/blog/archives/2003/03/25/nicetitles-for-ins-and-del
// added in ins and del tags

// modified by Dunstan Orchard 2003-11-18
// http://1976design.com/blog/
// added in accesskey information
// tried ever-so-hard, but couldn't work out how to do what Ethan did

// final genius touch by by Ethan Marcotte 2003-11-18
// http://www.sidesh0w.com/
// worked out how to delay showing the popups to make them more like the browser's own


// set the namespace
var XHTMLNS = 'http://www.w3.org/1999/xhtml';
var CURRENT_NICE_TITLE;

// browser sniff
var browser = new Browser();



// determine browser and version.
function Browser()
	{
	var ua, s, i;

	this.isIE = false;
	this.isNS = false;
	this.version = null;

	ua = navigator.userAgent;

	s = 'MSIE';
	if ((i = ua.indexOf(s)) >= 0)
		{
		this.isIE = true;
		this.version = parseFloat(ua.substr(i + s.length));
		return;
		}

	s = 'Netscape6/';
	if ((i = ua.indexOf(s)) >= 0)
		{
		this.isNS = true;
		this.version = parseFloat(ua.substr(i + s.length));
		return;
		}

	// treat any other 'Gecko' browser as NS 6.1.
	s = 'Gecko';
	if ((i = ua.indexOf(s)) >= 0)
		{
		this.isNS = true;
		this.version = 6.1;
		return;
		}
	}



// 2003-11-19 sidesh0w
// set delay vars to emulate normal hover delay
var delay;
var interval = 0.60;



// this function runs on window load
// it runs through all the links on the page as starts listening for actions
function makeNiceTitles()
	{
	if (!document.createElement || !document.getElementsByTagName) return;
	if (!document.createElementNS)
		{
		document.createElementNS = function(ns, elt)
			{
			return document.createElement(elt);
			}
		}

	// do regular links
	if (!document.links)
		{
		document.links = document.getElementsByTagName('a');
		}
	for (var ti=0; ti<document.links.length; ti++)
		{
		var lnk = document.links[ti];
		if (lnk.title)
			{
			lnk.setAttribute('nicetitle', lnk.title);
			lnk.removeAttribute('title');
			addEvent(lnk, 'mouseover', showDelay);
			addEvent(lnk, 'mouseout', hideNiceTitle);
			addEvent(lnk, 'focus', showDelay);
			addEvent(lnk, 'blur', hideNiceTitle);
			}
		}

	// 2003-03-25 Peter Janes
	// do ins and del tags
	var tags = new Array(2);
	tags[0] = document.getElementsByTagName('ins');
	tags[1] = document.getElementsByTagName('del');
	for (var tt=0; tt<tags.length; tt++)
		{
		if (tags[tt])
			{
			for (var ti=0; ti<tags[tt].length; ti++)
				{
				var tag = tags[tt][ti];
				if (tag.dateTime)
					{
					var strDate = tag.dateTime;
					// HTML/ISO8601 date: yyyy-mm-ddThh:mm:ssTZD (Z, -hh:mm, +hh:mm)
					var month = strDate.substring(5,7);
					var day = strDate.substring(8,10);
					if (month[0] == '0')
						{
						month = month[1];
						}
					if (day[0] == '0')
						{
						day = day[1];
						}
					var dtIns = new Date(strDate.substring(0,4), month-1, day, strDate.substring(11,13), strDate.substring(14,16), strDate.substring(17,19));
					tag.setAttribute('nicetitle', (tt == 0 ? 'Added' : 'Deleted') + ' on ' + dtIns.toString());
					addEvent(tag, 'mouseover', showDelay);
					addEvent(tag, 'mouseout', hideNiceTitle);
					addEvent(tag, 'focus', showDelay);
					addEvent(tag, 'blur', hideNiceTitle);
					}
				}
			}
		}
	}



// by Scott Andrew
// add an eventlistener to browsers that can do it somehow.
function addEvent(obj, evType, fn)
	{
	if (obj.addEventListener)
		{
		obj.addEventListener(evType, fn, true);
		return true;
		}
	else if (obj.attachEvent)
		{
		var r = obj.attachEvent('on'+evType, fn);
		return r;
		}
	else
		{
		return false;
		}
	}



function findPosition(oLink)
	{
	if (oLink.offsetParent)
		{
		for (var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent)
			{
			posX += oLink.offsetLeft;
			posY += oLink.offsetTop;
			}
		return [posX, posY];
		}
	else
		{
		return [oLink.x, oLink.y];
		}
	}



function getParent(el, pTagName)
	{
	if (el == null)
		{
		return null;
		}
	// gecko bug, supposed to be uppercase
	else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase())
		{
		return el;
		}
	else
		{
		return getParent(el.parentNode, pTagName);
		}
	}



// 2003-11-19 sidesh0w
// trailerpark wrapper function
function showDelay(e)
	{
    if (window.event && window.event.srcElement)
		{
        lnk = window.event.srcElement
		}
	else if (e && e.target)
		{
        lnk = e.target
		}
    if (!lnk) return;

	// lnk is a textnode or an elementnode that's not ins/del
    if (lnk.nodeType == 3 || (lnk.nodeType == 1 && lnk.tagName.toLowerCase() != 'ins' && lnk.tagName.toLowerCase() != 'del'))
		{
		// ascend parents until we hit a link
		lnk = getParent(lnk, 'a');
		}
	
	delay = setTimeout("showNiceTitle(lnk)", interval * 1000);
	}



// build and show the nice titles
function showNiceTitle(link)
	{
    if (CURRENT_NICE_TITLE) hideNiceTitle(CURRENT_NICE_TITLE);
    if (!document.getElementsByTagName) return;

    nicetitle = lnk.getAttribute('nicetitle');
    
    var d = document.createElementNS(XHTMLNS, 'div');
    d.className = 'nicetitle';
    tnt = document.createTextNode(nicetitle);
    pat = document.createElementNS(XHTMLNS, 'p');
    pat.className = 'titletext';
    pat.appendChild(tnt);

	// 2003-11-18 Dunstan Orchard
	// added in accesskey info
	if (lnk.accessKey)
		{
        axs = document.createTextNode(' [' + lnk.accessKey + ']');
		axsk = document.createElementNS(XHTMLNS, 'span');
        axsk.className = 'accesskey';
        axsk.appendChild(axs);
		pat.appendChild(axsk);
		}
    d.appendChild(pat);

    if (lnk.href)
		{
        tnd = document.createTextNode(lnk.href);
        pad = document.createElementNS(XHTMLNS, 'p');
        pad.className = 'destination';
        pad.appendChild(tnd);
        d.appendChild(pad);
		}
    
    STD_WIDTH = 300;

	if (lnk.href)
		{
        h = lnk.href.length;
		}
	else
		{
		h = nicetitle.length;
		}
	
    if (nicetitle.length)
		{
		t = nicetitle.length;
		}
	
    h_pixels = h*6;
	t_pixels = t*10;
    
    if (h_pixels > STD_WIDTH)
		{
        w = h_pixels;
		}
	else if ((STD_WIDTH>t_pixels) && (t_pixels>h_pixels))
		{
        w = t_pixels;
		}
	else if ((STD_WIDTH>t_pixels) && (h_pixels>t_pixels))
		{
        w = h_pixels;
		}
	else
		{
        w = STD_WIDTH;
		}
        
    d.style.width = w + 'px';    

    mpos = findPosition(lnk);
    mx = mpos[0];
    my = mpos[1];
    
    d.style.left = (mx+15) + 'px';
    d.style.top = (my+35) + 'px';

    if (window.innerWidth && ((mx+w) > window.innerWidth))
		{
        d.style.left = (window.innerWidth - w - 25) + 'px';
		}
    if (document.body.scrollWidth && ((mx+w) > document.body.scrollWidth))
		{
        d.style.left = (document.body.scrollWidth - w - 25) + 'px';
		}
    
    document.getElementsByTagName('body')[0].appendChild(d);

    CURRENT_NICE_TITLE = d;
	}




function hideNiceTitle(e)
	{
	// 2003-11-19 sidesh0w
	// clearTimeout 
	if (delay) clearTimeout(delay);
	if (!document.getElementsByTagName) return;
	if (CURRENT_NICE_TITLE)
		{
		document.getElementsByTagName('body')[0].removeChild(CURRENT_NICE_TITLE);
		CURRENT_NICE_TITLE = null;
		}
	}

window.onload = function(e) {
makeNiceTitles();
}

<!--
// Text Size + -
var max_font_size = 14;
var min_font_size = 9;
var def_font_size = 11;
var fontSizeContainerId = 'custom-size';

function font_size(new_size)
{
	var momentFontSize = parseInt(document.getElementById(fontSizeContainerId).style.fontSize);

	if(!momentFontSize)
	{
		momentFontSize = def_font_size;
	}

	setSize = momentFontSize + new_size;

	if(setSize > max_font_size || setSize < min_font_size)
	{
		return;
	}

	document.getElementById(fontSizeContainerId).style.fontSize = setSize + 'px';
}

<!--
// Auto resize
function resize(which, max) {
  var elem = document.getElementById(which);
  if (elem == undefined || elem == null) return false;
  if (max == undefined) max = 155;
  if (elem.width > elem.height) {
    if (elem.width > max) elem.width = max;
  } else {
    if (elem.height > max) elem.height = max;
  }
}

function resizes(which, max) {
  var elem = document.getElementById(which);
  if (elem == undefined || elem == null) return false;
  if (max == undefined) max = 60;
  if (elem.width > elem.height) {
    if (elem.width > max) elem.width = max;
  } else {
    if (elem.height > max) elem.height = max;
  }
}

<!--
// Confirm del
function confirmDelete(id, ask, url)
	{
		temp = window.confirm(ask);
		if (temp) //delete
		{
			window.location=url+id;
		}
	}
	
/**
 * Vizia Ltd.
 * @custom js scripts
**/

jQuery.preloadImages = function()
{
  var sources = new Array();
  
  sources = arguments[0];
  
  var completed = 0;
  
  for(var i = 0; i < sources.length; i++)
  {
    img = jQuery("<img>").attr("src", sources[i]);
  }
}

function preloadCarouselImages(container){
	 
	container = $(container);
	
	var images = container.find('img');
	var images_src = new Array();

	for(i = 0; i < images.length; i++){
		images_src[i] = $(images[i]).attr('alt');
		
	}
	
	$.preloadImages(images_src);
	
	 $('#blockPicture .itemImageArea a').click(function(e){
	    	
	 		hs.expand(null, {
				src: $('#'+$(this).attr('class')).attr('href'),
				slideshowGroup: 'carousel_slider'
			});

	    	e.preventDefault();
	    })
	
	$('#product_carousel a').hover(function(){
		alt_var = $(this).find("img").attr("alt");
		href_var = $(this).attr("href");
		var thisId = $(this).attr('id');
		if (href_var != $('#blockPicture .itemImageArea').find("img").attr("src")){
			if ($('#blockPicture .itemImageArea img').is(':animated')) {
				$('#blockPicture .itemImageArea img').stop().animate({opacity: 0}, 200, function(){
					$(this).attr("src", alt_var).animate({opacity: 1}, 400	);
					$('#blockPicture .itemImageArea a').attr("href", href_var);
					$("#blockPicture .itemManufacturer .zoom_in").attr("href", href_var);
					$("#blockPicture .itemImageArea a").removeClass();
					$("#blockPicture .itemImageArea a").addClass(thisId)
					
				});
			}
			else {
				$('#blockPicture .itemImageArea img').animate({opacity: 0}, 200, function(){
					$(this).attr("src", alt_var).animate({opacity: 1}, 400	);
					$('#blockPicture .itemImageArea a').attr("href", href_var);
					$("#blockPicture .itemManufacturer .zoom_in").attr("href", href_var);
					$("#blockPicture .itemImageArea a").removeClass();
					$("#blockPicture .itemImageArea a").addClass(thisId)
				});
			}
		}
	 		
	},function(){
		return false;
	});
	
	
}

/**********************************/
/* JQuery document ready function */
/**********************************/

jQuery(document).ready(function() {

	jQuery('#product_carousel').jcarousel({
		// Configuration goes here
		scroll: 1
	});
 	
	preloadCarouselImages('#product_carousel');
});

/**
 * jCarousel - Riding carousels with jQuery
 *   http://sorgalla.com/jcarousel/
 *
 * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * Built on top of the jQuery library
 *   http://jquery.com
 *
 * Inspired by the "Carousel Component" by Bill Scott
 *   http://billwscott.com/carousel/
 */

(function($) {
    /**
     * Creates a carousel for all matched elements.
     *
     * @example $("#mycarousel").jcarousel();
     * @before <ul id="mycarousel" class="jcarousel-skin-name"><li>First item</li><li>Second item</li></ul>
     * @result
     *
     * <div class="jcarousel-skin-name">
     *   <div class="jcarousel-container">
     *     <div disabled="disabled" class="jcarousel-prev jcarousel-prev-disabled"></div>
     *     <div class="jcarousel-next"></div>
     *     <div class="jcarousel-clip">
     *       <ul class="jcarousel-list">
     *         <li class="jcarousel-item-1">First item</li>
     *         <li class="jcarousel-item-2">Second item</li>
     *       </ul>
     *     </div>
     *   </div>
     * </div>
     *
     * @name jcarousel
     * @type jQuery
     * @param Hash o A set of key/value pairs to set as configuration properties.
     * @cat Plugins/jCarousel
     */
    $.fn.jcarousel = function(o) {
        return this.each(function() {
            new $jc(this, o);
        });
    };

    // Default configuration properties.
    var defaults = {
        vertical: false,
        start: 1,
        offset: 1,
        size: null,
        scroll: 3,
        visible: null,
        animation: 'normal',
        easing: 'swing',
        auto: 0,
        wrap: null,
        initCallback: null,
        reloadCallback: null,
        itemLoadCallback: null,
        itemFirstInCallback: null,
        itemFirstOutCallback: null,
        itemLastInCallback: null,
        itemLastOutCallback: null,
        itemVisibleInCallback: null,
        itemVisibleOutCallback: null,
        buttonNextHTML: '<div></div>',
        buttonPrevHTML: '<div></div>',
        buttonNextEvent: 'click',
        buttonPrevEvent: 'click',
        buttonNextCallback: null,
        buttonPrevCallback: null
    };

    /**
     * The jCarousel object.
     *
     * @constructor
     * @name $.jcarousel
     * @param Object e The element to create the carousel for.
     * @param Hash o A set of key/value pairs to set as configuration properties.
     * @cat Plugins/jCarousel
     */
    $.jcarousel = function(e, o) {
        this.options    = $.extend({}, defaults, o || {});

        this.locked     = false;

        this.container  = null;
        this.clip       = null;
        this.list       = null;
        this.buttonNext = null;
        this.buttonPrev = null;

        this.wh = !this.options.vertical ? 'width' : 'height';
        this.lt = !this.options.vertical ? 'left' : 'top';

        // Extract skin class
        var skin = '', split = e.className.split(' ');

        for (var i = 0; i < split.length; i++) {
            if (split[i].indexOf('jcarousel-skin') != -1) {
                $(e).removeClass(split[i]);
                var skin = split[i];
                break;
            }
        }

        if (e.nodeName == 'UL' || e.nodeName == 'OL') {
            this.list = $(e);
            this.container = this.list.parent();

            if (this.container.hasClass('jcarousel-clip')) {
                if (!this.container.parent().hasClass('jcarousel-container'))
                    this.container = this.container.wrap('<div></div>');

                this.container = this.container.parent();
            } else if (!this.container.hasClass('jcarousel-container'))
                this.container = this.list.wrap('<div></div>').parent();
        } else {
            this.container = $(e);
            this.list = $(e).find('>ul,>ol,div>ul,div>ol');
        }

        if (skin != '' && this.container.parent()[0].className.indexOf('jcarousel-skin') == -1)
        	this.container.wrap('<div class=" '+ skin + '"></div>');

        this.clip = this.list.parent();

        if (!this.clip.length || !this.clip.hasClass('jcarousel-clip'))
            this.clip = this.list.wrap('<div></div>').parent();

        this.buttonPrev = $('.jcarousel-prev', this.container);

        if (this.buttonPrev.size() == 0 && this.options.buttonPrevHTML != null)
            this.buttonPrev = this.clip.before(this.options.buttonPrevHTML).prev();

        this.buttonPrev.addClass(this.className('jcarousel-prev'));

        this.buttonNext = $('.jcarousel-next', this.container);

        if (this.buttonNext.size() == 0 && this.options.buttonNextHTML != null)
            this.buttonNext = this.clip.before(this.options.buttonNextHTML).prev();

        this.buttonNext.addClass(this.className('jcarousel-next'));

        this.clip.addClass(this.className('jcarousel-clip'));
        this.list.addClass(this.className('jcarousel-list'));
        this.container.addClass(this.className('jcarousel-container'));

        var di = this.options.visible != null ? Math.ceil(this.clipping() / this.options.visible) : null;
        var li = this.list.children('li');

        var self = this;

        if (li.size() > 0) {
            var wh = 0, i = this.options.offset;
            li.each(function() {
                self.format(this, i++);
                wh += self.dimension(this, di);
            });

            this.list.css(this.wh, wh + 'px');

            // Only set if not explicitly passed as option
            if (!o || o.size === undefined)
                this.options.size = li.size();
        }

        // For whatever reason, .show() does not work in Safari...
        this.container.css('display', 'block');
        this.buttonNext.css('display', 'block');
        this.buttonPrev.css('display', 'block');

        this.funcNext   = function() { self.next(); };
        this.funcPrev   = function() { self.prev(); };
        this.funcResize = function() { self.reload(); };

        if (this.options.initCallback != null)
            this.options.initCallback(this, 'init');

        if ($.browser.safari) {
            this.buttons(false, false);
            $(window).bind('load', function() { self.setup(); });
        } else
            this.setup();
    };

    // Create shortcut for internal use
    var $jc = $.jcarousel;

    $jc.fn = $jc.prototype = {
        jcarousel: '0.2.3'
    };

    $jc.fn.extend = $jc.extend = $.extend;

    $jc.fn.extend({
        /**
         * Setups the carousel.
         *
         * @name setup
         * @type undefined
         * @cat Plugins/jCarousel
         */
        setup: function() {
            this.first     = null;
            this.last      = null;
            this.prevFirst = null;
            this.prevLast  = null;
            this.animating = false;
            this.timer     = null;
            this.tail      = null;
            this.inTail    = false;

            if (this.locked)
                return;

            this.list.css(this.lt, this.pos(this.options.offset) + 'px');
            var p = this.pos(this.options.start);
            this.prevFirst = this.prevLast = null;
            this.animate(p, false);

            $(window).unbind('resize', this.funcResize).bind('resize', this.funcResize);
        },

        /**
         * Clears the list and resets the carousel.
         *
         * @name reset
         * @type undefined
         * @cat Plugins/jCarousel
         */
        reset: function() {
            this.list.empty();

            this.list.css(this.lt, '0px');
            this.list.css(this.wh, '10px');

            if (this.options.initCallback != null)
                this.options.initCallback(this, 'reset');

            this.setup();
        },

        /**
         * Reloads the carousel and adjusts positions.
         *
         * @name reload
         * @type undefined
         * @cat Plugins/jCarousel
         */
        reload: function() {
            if (this.tail != null && this.inTail)
                this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + this.tail);

            this.tail   = null;
            this.inTail = false;

            if (this.options.reloadCallback != null)
                this.options.reloadCallback(this);

            if (this.options.visible != null) {
                var self = this;
                var di = Math.ceil(this.clipping() / this.options.visible), wh = 0, lt = 0;
                $('li', this.list).each(function(i) {
                    wh += self.dimension(this, di);
                    if (i + 1 < self.first)
                        lt = wh;
                });

                this.list.css(this.wh, wh + 'px');
                this.list.css(this.lt, -lt + 'px');
            }

            this.scroll(this.first, false);
        },

        /**
         * Locks the carousel.
         *
         * @name lock
         * @type undefined
         * @cat Plugins/jCarousel
         */
        lock: function() {
            this.locked = true;
            this.buttons();
        },

        /**
         * Unlocks the carousel.
         *
         * @name unlock
         * @type undefined
         * @cat Plugins/jCarousel
         */
        unlock: function() {
            this.locked = false;
            this.buttons();
        },

        /**
         * Sets the size of the carousel.
         *
         * @name size
         * @type undefined
         * @param Number s The size of the carousel.
         * @cat Plugins/jCarousel
         */
        size: function(s) {
            if (s != undefined) {
                this.options.size = s;
                if (!this.locked)
                    this.buttons();
            }

            return this.options.size;
        },

        /**
         * Checks whether a list element exists for the given index (or index range).
         *
         * @name get
         * @type bool
         * @param Number i The index of the (first) element.
         * @param Number i2 The index of the last element.
         * @cat Plugins/jCarousel
         */
        has: function(i, i2) {
            if (i2 == undefined || !i2)
                i2 = i;

            if (this.options.size !== null && i2 > this.options.size)
            	i2 = this.options.size;

            for (var j = i; j <= i2; j++) {
                var e = this.get(j);
                if (!e.length || e.hasClass('jcarousel-item-placeholder'))
                    return false;
            }

            return true;
        },

        /**
         * Returns a jQuery object with list element for the given index.
         *
         * @name get
         * @type jQuery
         * @param Number i The index of the element.
         * @cat Plugins/jCarousel
         */
        get: function(i) {
            return $('.jcarousel-item-' + i, this.list);
        },

        /**
         * Adds an element for the given index to the list.
         * If the element already exists, it updates the inner html.
         * Returns the created element as jQuery object.
         *
         * @name add
         * @type jQuery
         * @param Number i The index of the element.
         * @param String s The innerHTML of the element.
         * @cat Plugins/jCarousel
         */
        add: function(i, s) {
            var e = this.get(i), old = 0, add = 0;

            if (e.length == 0) {
                var c, e = this.create(i), j = $jc.intval(i);
                while (c = this.get(--j)) {
                    if (j <= 0 || c.length) {
                        j <= 0 ? this.list.prepend(e) : c.after(e);
                        break;
                    }
                }
            } else
                old = this.dimension(e);

            e.removeClass(this.className('jcarousel-item-placeholder'));
            typeof s == 'string' ? e.html(s) : e.empty().append(s);

            var di = this.options.visible != null ? Math.ceil(this.clipping() / this.options.visible) : null;
            var wh = this.dimension(e, di) - old;

            if (i > 0 && i < this.first)
                this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) - wh + 'px');

            this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) + wh + 'px');

            return e;
        },

        /**
         * Removes an element for the given index from the list.
         *
         * @name remove
         * @type undefined
         * @param Number i The index of the element.
         * @cat Plugins/jCarousel
         */
        remove: function(i) {
            var e = this.get(i);

            // Check if item exists and is not currently visible
            if (!e.length || (i >= this.first && i <= this.last))
                return;

            var d = this.dimension(e);

            if (i < this.first)
                this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + d + 'px');

            e.remove();

            this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) - d + 'px');
        },

        /**
         * Moves the carousel forwards.
         *
         * @name next
         * @type undefined
         * @cat Plugins/jCarousel
         */
        next: function() {
            this.stopAuto();

            if (this.tail != null && !this.inTail)
                this.scrollTail(false);
            else
                this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'last') && this.options.size != null && this.last == this.options.size) ? 1 : this.first + this.options.scroll);
        },

        /**
         * Moves the carousel backwards.
         *
         * @name prev
         * @type undefined
         * @cat Plugins/jCarousel
         */
        prev: function() {
            this.stopAuto();

            if (this.tail != null && this.inTail)
                this.scrollTail(true);
            else
                this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'first') && this.options.size != null && this.first == 1) ? this.options.size : this.first - this.options.scroll);
        },

        /**
         * Scrolls the tail of the carousel.
         *
         * @name scrollTail
         * @type undefined
         * @param Bool b Whether scroll the tail back or forward.
         * @cat Plugins/jCarousel
         */
        scrollTail: function(b) {
            if (this.locked || this.animating || !this.tail)
                return;

            var pos  = $jc.intval(this.list.css(this.lt));

            !b ? pos -= this.tail : pos += this.tail;
            this.inTail = !b;

            // Save for callbacks
            this.prevFirst = this.first;
            this.prevLast  = this.last;

            this.animate(pos);
        },

        /**
         * Scrolls the carousel to a certain position.
         *
         * @name scroll
         * @type undefined
         * @param Number i The index of the element to scoll to.
         * @param Bool a Flag indicating whether to perform animation.
         * @cat Plugins/jCarousel
         */
        scroll: function(i, a) {
            if (this.locked || this.animating)
                return;

            this.animate(this.pos(i), a);
        },

        /**
         * Prepares the carousel and return the position for a certian index.
         *
         * @name pos
         * @type Number
         * @param Number i The index of the element to scoll to.
         * @cat Plugins/jCarousel
         */
        pos: function(i) {
            if (this.locked || this.animating)
                return;

            if (this.options.wrap != 'circular')
                i = i < 1 ? 1 : (this.options.size && i > this.options.size ? this.options.size : i);

            var back = this.first > i;
            var pos  = $jc.intval(this.list.css(this.lt));

            // Create placeholders, new list width/height
            // and new list position
            var f = this.options.wrap != 'circular' && this.first <= 1 ? 1 : this.first;
            var c = back ? this.get(f) : this.get(this.last);
            var j = back ? f : f - 1;
            var e = null, l = 0, p = false, d = 0;

            while (back ? --j >= i : ++j < i) {
                e = this.get(j);
                p = !e.length;
                if (e.length == 0) {
                    e = this.create(j).addClass(this.className('jcarousel-item-placeholder'));
                    c[back ? 'before' : 'after' ](e);
                }

                c = e;
                d = this.dimension(e);

                if (p)
                    l += d;

                if (this.first != null && (this.options.wrap == 'circular' || (j >= 1 && (this.options.size == null || j <= this.options.size))))
                    pos = back ? pos + d : pos - d;
            }

            // Calculate visible items
            var clipping = this.clipping();
            var cache = [];
            var visible = 0, j = i, v = 0;
            var c = this.get(i - 1);

            while (++visible) {
                e = this.get(j);
                p = !e.length;
                if (e.length == 0) {
                    e = this.create(j).addClass(this.className('jcarousel-item-placeholder'));
                    // This should only happen on a next scroll
                    c.length == 0 ? this.list.prepend(e) : c[back ? 'before' : 'after' ](e);
                }

                c = e;
                var d = this.dimension(e);
                if (d == 0) {
                    alert('jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...');
                    return 0;
                }

                if (this.options.wrap != 'circular' && this.options.size !== null && j > this.options.size)
                    cache.push(e);
                else if (p)
                    l += d;

                v += d;

                if (v >= clipping)
                    break;

                j++;
            }

             // Remove out-of-range placeholders
            for (var x = 0; x < cache.length; x++)
                cache[x].remove();

            // Resize list
            if (l > 0) {
                this.list.css(this.wh, this.dimension(this.list) + l + 'px');

                if (back) {
                    pos -= l;
                    this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) - l + 'px');
                }
            }

            // Calculate first and last item
            var last = i + visible - 1;
            if (this.options.wrap != 'circular' && this.options.size && last > this.options.size)
                last = this.options.size;

            if (j > last) {
                visible = 0, j = last, v = 0;
                while (++visible) {
                    var e = this.get(j--);
                    if (!e.length)
                        break;
                    v += this.dimension(e);
                    if (v >= clipping)
                        break;
                }
            }

            var first = last - visible + 1;
            if (this.options.wrap != 'circular' && first < 1)
                first = 1;

            if (this.inTail && back) {
                pos += this.tail;
                this.inTail = false;
            }

            this.tail = null;
            if (this.options.wrap != 'circular' && last == this.options.size && (last - visible + 1) >= 1) {
                var m = $jc.margin(this.get(last), !this.options.vertical ? 'marginRight' : 'marginBottom');
                if ((v - m) > clipping)
                    this.tail = v - clipping - m;
            }

            // Adjust position
            while (i-- > first)
                pos += this.dimension(this.get(i));

            // Save visible item range
            this.prevFirst = this.first;
            this.prevLast  = this.last;
            this.first     = first;
            this.last      = last;

            return pos;
        },

        /**
         * Animates the carousel to a certain position.
         *
         * @name animate
         * @type undefined
         * @param mixed p Position to scroll to.
         * @param Bool a Flag indicating whether to perform animation.
         * @cat Plugins/jCarousel
         */
        animate: function(p, a) {
            if (this.locked || this.animating)
                return;

            this.animating = true;

            var self = this;
            var scrolled = function() {
                self.animating = false;

                if (p == 0)
                    self.list.css(self.lt,  0);

                if (self.options.wrap == 'both' || self.options.wrap == 'last' || self.options.size == null || self.last < self.options.size)
                    self.startAuto();

                self.buttons();
                self.notify('onAfterAnimation');
            };

            this.notify('onBeforeAnimation');

            // Animate
            if (!this.options.animation || a == false) {
                this.list.css(this.lt, p + 'px');
                scrolled();
            } else {
                var o = !this.options.vertical ? {'left': p} : {'top': p};
                this.list.animate(o, this.options.animation, this.options.easing, scrolled);
            }
        },

        /**
         * Starts autoscrolling.
         *
         * @name auto
         * @type undefined
         * @param Number s Seconds to periodically autoscroll the content.
         * @cat Plugins/jCarousel
         */
        startAuto: function(s) {
            if (s != undefined)
                this.options.auto = s;

            if (this.options.auto == 0)
                return this.stopAuto();

            if (this.timer != null)
                return;

            var self = this;
            this.timer = setTimeout(function() { self.next(); }, this.options.auto * 1000);
        },

        /**
         * Stops autoscrolling.
         *
         * @name stopAuto
         * @type undefined
         * @cat Plugins/jCarousel
         */
        stopAuto: function() {
            if (this.timer == null)
                return;

            clearTimeout(this.timer);
            this.timer = null;
        },

        /**
         * Sets the states of the prev/next buttons.
         *
         * @name buttons
         * @type undefined
         * @cat Plugins/jCarousel
         */
        buttons: function(n, p) {
            if (n == undefined || n == null) {
                var n = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'first') || this.options.size == null || this.last < this.options.size);
                if (!this.locked && (!this.options.wrap || this.options.wrap == 'first') && this.options.size != null && this.last >= this.options.size)
                    n = this.tail != null && !this.inTail;
            }

            if (p == undefined || p == null) {
                var p = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'last') || this.first > 1);
                if (!this.locked && (!this.options.wrap || this.options.wrap == 'last') && this.options.size != null && this.first == 1)
                    p = this.tail != null && this.inTail;
            }

            var self = this;

            this.buttonNext[n ? 'bind' : 'unbind'](this.options.buttonNextEvent, this.funcNext)[n ? 'removeClass' : 'addClass'](this.className('jcarousel-next-disabled')).attr('disabled', n ? false : true);
            this.buttonPrev[p ? 'bind' : 'unbind'](this.options.buttonPrevEvent, this.funcPrev)[p ? 'removeClass' : 'addClass'](this.className('jcarousel-prev-disabled')).attr('disabled', p ? false : true);

            if (this.buttonNext.length > 0 && (this.buttonNext[0].jcarouselstate == undefined || this.buttonNext[0].jcarouselstate != n) && this.options.buttonNextCallback != null) {
                this.buttonNext.each(function() { self.options.buttonNextCallback(self, this, n); });
                this.buttonNext[0].jcarouselstate = n;
            }

            if (this.buttonPrev.length > 0 && (this.buttonPrev[0].jcarouselstate == undefined || this.buttonPrev[0].jcarouselstate != p) && this.options.buttonPrevCallback != null) {
                this.buttonPrev.each(function() { self.options.buttonPrevCallback(self, this, p); });
                this.buttonPrev[0].jcarouselstate = p;
            }
        },

        notify: function(evt) {
            var state = this.prevFirst == null ? 'init' : (this.prevFirst < this.first ? 'next' : 'prev');

            // Load items
            this.callback('itemLoadCallback', evt, state);

            if (this.prevFirst !== this.first) {
                this.callback('itemFirstInCallback', evt, state, this.first);
                this.callback('itemFirstOutCallback', evt, state, this.prevFirst);
            }

            if (this.prevLast !== this.last) {
                this.callback('itemLastInCallback', evt, state, this.last);
                this.callback('itemLastOutCallback', evt, state, this.prevLast);
            }

            this.callback('itemVisibleInCallback', evt, state, this.first, this.last, this.prevFirst, this.prevLast);
            this.callback('itemVisibleOutCallback', evt, state, this.prevFirst, this.prevLast, this.first, this.last);
        },

        callback: function(cb, evt, state, i1, i2, i3, i4) {
            if (this.options[cb] == undefined || (typeof this.options[cb] != 'object' && evt != 'onAfterAnimation'))
                return;

            var callback = typeof this.options[cb] == 'object' ? this.options[cb][evt] : this.options[cb];

            if (!$.isFunction(callback))
                return;

            var self = this;

            if (i1 === undefined)
                callback(self, state, evt);
            else if (i2 === undefined)
                this.get(i1).each(function() { callback(self, this, i1, state, evt); });
            else {
                for (var i = i1; i <= i2; i++)
                    if (i !== null && !(i >= i3 && i <= i4))
                        this.get(i).each(function() { callback(self, this, i, state, evt); });
            }
        },

        create: function(i) {
            return this.format('<li></li>', i);
        },

        format: function(e, i) {
            var $e = $(e).addClass(this.className('jcarousel-item')).addClass(this.className('jcarousel-item-' + i));
            $e.attr('jcarouselindex', i);
            return $e;
        },

        className: function(c) {
            return c + ' ' + c + (!this.options.vertical ? '-horizontal' : '-vertical');
        },

        dimension: function(e, d) {
            var el = e.jquery != undefined ? e[0] : e;

            var old = !this.options.vertical ?
                el.offsetWidth + $jc.margin(el, 'marginLeft') + $jc.margin(el, 'marginRight') :
                el.offsetHeight + $jc.margin(el, 'marginTop') + $jc.margin(el, 'marginBottom');

            if (d == undefined || old == d)
                return old;

            var w = !this.options.vertical ?
                d - $jc.margin(el, 'marginLeft') - $jc.margin(el, 'marginRight') :
                d - $jc.margin(el, 'marginTop') - $jc.margin(el, 'marginBottom');

            $(el).css(this.wh, w + 'px');

            return this.dimension(el);
        },

        clipping: function() {
            return !this.options.vertical ?
                this.clip[0].offsetWidth - $jc.intval(this.clip.css('borderLeftWidth')) - $jc.intval(this.clip.css('borderRightWidth')) :
                this.clip[0].offsetHeight - $jc.intval(this.clip.css('borderTopWidth')) - $jc.intval(this.clip.css('borderBottomWidth'));
        },

        index: function(i, s) {
            if (s == undefined)
                s = this.options.size;

            return Math.round((((i-1) / s) - Math.floor((i-1) / s)) * s) + 1;
        }
    });

    $jc.extend({
        /**
         * Gets/Sets the global default configuration properties.
         *
         * @name defaults
         * @descr Gets/Sets the global default configuration properties.
         * @type Hash
         * @param Hash d A set of key/value pairs to set as configuration properties.
         * @cat Plugins/jCarousel
         */
        defaults: function(d) {
            return $.extend(defaults, d || {});
        },

        margin: function(e, p) {
            if (!e)
                return 0;

            var el = e.jquery != undefined ? e[0] : e;

            if (p == 'marginRight' && $.browser.safari) {
                var old = {'display': 'block', 'float': 'none', 'width': 'auto'}, oWidth, oWidth2;

                $.swap(el, old, function() { oWidth = el.offsetWidth; });

                old['marginRight'] = 0;
                $.swap(el, old, function() { oWidth2 = el.offsetWidth; });

                return oWidth2 - oWidth;
            }

            return $jc.intval($.css(el, p));
        },

        intval: function(v) {
            v = parseInt(v);
            return isNaN(v) ? 0 : v;
        }
    });

})(jQuery);


//highslide_gallery
/******************************************************************************
Name:    Highslide JS
Version: 4.1.5 (June 26 2009)
Config:  default +slideshow +positioning +transitions +viewport +thumbstrip +packed
Author:  Torstein Hønsi
Support: http://highslide.com/support

Licence:
Highslide JS is licensed under a Creative Commons Attribution-NonCommercial 2.5
License (http://creativecommons.org/licenses/by-nc/2.5/).

You are free:
	* to copy, distribute, display, and perform the work
	* to make derivative works

Under the following conditions:
	* Attribution. You must attribute the work in the manner  specified by  the
	  author or licensor.
	* Noncommercial. You may not use this work for commercial purposes.

* For  any  reuse  or  distribution, you  must make clear to others the license
  terms of this work.
* Any  of  these  conditions  can  be  waived  if  you  get permission from the 
  copyright holder.

Your fair use and other rights are in no way affected by the above.
******************************************************************************/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('u m={17:{9Q:\'9e\',96:\'be...\',95:\'6O 1N bd\',9W:\'6O 1N bc 1N bb\',6u:\'bf 1N bg H (f)\',a5:\'bj by <i>a2 a3</i>\',a6:\'bi 1N bh a2 a3 ba\',9y:\'9A\',8j:\'9z\',8r:\'9u\',8k:\'9Y\',8l:\'9Y (b9)\',b3:\'b2\',8s:\'9B\',9d:\'9B 1f (9E)\',8h:\'9C\',8q:\'9C 1f (9E)\',ap:\'9A (7j T)\',8g:\'9z (7j 2M)\',8t:\'9u\',8p:\'1:1\',3i:\'b1 %1 b0 %2\',7p:\'6O 1N 2c 2B, b4 af b5 1N 3c. b8 7j b7 M 1v af 2V.\'},4v:\'P/b6/\',6A:\'bk.4m\',4J:\'bl.4m\',6P:4H,8f:4H,5k:15,9I:15,7L:15,9J:15,4r:bB,98:0.75,8Z:K,6E:5,3w:2,aZ:3,4U:1g,aD:\'4c 2M\',aA:1,a0:K,aF:\'bA://P.bz/\',ax:\'bx\',au:K,72:[\'a\'],2Y:[],a7:4H,3R:0,7F:50,3y:\'2I\',6z:\'2I\',91:G,92:G,7N:K,4E:am,4M:am,5c:K,1C:\'bC-bD\',aQ:{2p:\'<Y 2n="P-2p"><7P>\'+\'<1W 2n="P-2V">\'+\'<a 23="#" 2j="{m.17.ap}">\'+\'<22>{m.17.9y}</22></a>\'+\'</1W>\'+\'<1W 2n="P-3f">\'+\'<a 23="#" 2j="{m.17.9d}">\'+\'<22>{m.17.8s}</22></a>\'+\'</1W>\'+\'<1W 2n="P-2L">\'+\'<a 23="#" 2j="{m.17.8q}">\'+\'<22>{m.17.8h}</22></a>\'+\'</1W>\'+\'<1W 2n="P-1v">\'+\'<a 23="#" 2j="{m.17.8g}">\'+\'<22>{m.17.8j}</22></a>\'+\'</1W>\'+\'<1W 2n="P-3c">\'+\'<a 23="#" 2j="{m.17.8t}">\'+\'<22>{m.17.8r}</22></a>\'+\'</1W>\'+\'<1W 2n="P-1d-2C">\'+\'<a 23="#" 2j="{m.17.6u}">\'+\'<22>{m.17.8p}</22></a>\'+\'</1W>\'+\'<1W 2n="P-2c">\'+\'<a 23="#" 2j="{m.17.8l}" >\'+\'<22>{m.17.8k}</22></a>\'+\'</1W>\'+\'</7P></Y>\'},59:[],6X:K,U:[],6V:[\'5c\',\'36\',\'3y\',\'6z\',\'91\',\'92\',\'1C\',\'3w\',\'bG\',\'bF\',\'bE\',\'9a\',\'bw\',\'bv\',\'bp\',\'9b\',\'9x\',\'7N\',\'3z\',\'4N\',\'2Y\',\'3R\',\'L\',\'W\',\'7y\',\'4E\',\'4M\',\'8o\',\'bo\',\'2w\',\'2t\',\'at\',\'ak\',\'1K\'],1r:[],5J:0,84:{x:[\'9M\',\'T\',\'3P\',\'2M\',\'9H\'],y:[\'4I\',\'S\',\'7M\',\'4c\',\'63\']},6i:{},9b:{},9a:{},3C:[],4P:[],44:{},7o:{},5y:[],3X:7S((4V.5S.5V().26(/.+(?:97|bn|bm|1A)[\\/: ]([\\d.]+)/)||[0,\'0\'])[1]),1A:(19.58&&!1J.3o),4x:/ah/.1b(4V.5S),5N:/bq.+97:1\\.[0-8].+br/.1b(4V.5S),$:A(24){q(24)C 19.bu(24)},2y:A(2k,3n){2k[2k.R]=3n},1a:A(8C,4e,3q,7Y,8E){u B=19.1a(8C);q(4e)m.3e(B,4e);q(8E)m.V(B,{bt:0,ad:\'1s\',7b:0});q(3q)m.V(B,3q);q(7Y)7Y.2F(B);C B},3e:A(B,4e){M(u x 2W 4e)B[x]=4e[x];C B},V:A(B,3q){M(u x 2W 3q){q(m.1A&&x==\'1k\'){q(3q[x]>0.99)B.E.bs(\'4Z\');I B.E.4Z=\'8G(1k=\'+(3q[x]*2m)+\')\'}I B.E[x]=3q[x]}},1H:A(B,1n,2X){u 49,3E,3W;q(1x 2X!=\'6d\'||2X===G){u 2Z=8w;2X={3F:2Z[2],2t:2Z[3],5F:2Z[4]}}q(1x 2X.3F!=\'3i\')2X.3F=4H;2X.2t=1e[2X.2t]||1e.8z;2X.5Q=m.3e({},1n);M(u 30 2W 1n){u e=2d m.1F(B,2X,30);49=7S(m.6C(B,30))||0;3E=7S(1n[30]);3W=30!=\'1k\'?\'F\':\'\';e.3v(49,3E,3W)}},6C:A(B,1n){q(19.7V){C 19.7V.9m(B,G).9n(1n)}I{q(1n==\'1k\')1n=\'4Z\';u 3n=B.bH[1n.2e(/\\-(\\w)/g,A(a,b){C b.8U()})];q(1n==\'4Z\')3n=3n.2e(/8G\\(1k=([0-9]+)\\)/,A(a,b){C b/2m});C 3n===\'\'?1:3n}},57:A(){u d=19,w=1J,3p=d.88&&d.88!=\'9q\'?d.4w:d.5r;u b=d.5r;u 8F=(w.5u&&w.8P)?w.5u+w.8P:1e.2P(b.8L,b.1V),8A=(w.5o&&1J.8M)?w.5o+w.8M:1e.2P(b.8H,b.31),5z=m.1A?3p.8L:(d.4w.7A||4l.5u),5A=m.1A?1e.2P(3p.8H,3p.73):(d.4w.73||4l.5o);u L=m.1A?3p.7A:(d.4w.7A||4l.5u),W=m.1A?3p.73:4l.5o;m.3I={5z:1e.2P(5z,8F),5A:1e.2P(5A,8A),L:L,W:W,5Z:m.1A?3p.5Z:aX,5q:m.1A?3p.5q:aY}},5K:A(B){u p={x:B.3N,y:B.ao};4g(B.8X){B=B.8X;p.x+=B.3N;p.y+=B.ao;q(B!=19.5r&&B!=19.4w){p.x-=B.5Z;p.y-=B.5q}}C p},2C:A(a,2R,3v,16){q(!a)a=m.1a(\'a\',G,{1o:\'1s\'},m.2a);q(1x a.54==\'A\')C 2R;2g{2d m.51(a,2R,3v);C 1g}2i(e){C K}},aL:A(B,4t,Z){u 1h=B.2N(4t);M(u i=0;i<1h.R;i++){q((2d 5P(Z)).1b(1h[i].Z)){C 1h[i]}}C G},aS:A(s){s=s.2e(/\\s/g,\' \');u 1Y=/{m\\.17\\.([^}]+)\\}/g,55=s.26(1Y),17;q(55)M(u i=0;i<55.R;i++){17=55[i].2e(1Y,"$1");q(1x m.17[17]!=\'1G\')s=s.2e(55[i],m.17[17])}C s},9L:A(){u 81=0,5w=-1,U=m.U,z,1z;M(u i=0;i<U.R;i++){z=U[i];q(z){1z=z.N.E.1z;q(1z&&1z>81){81=1z;5w=i}}}q(5w==-1)m.3r=-1;I U[5w].4a()},4X:A(a,53){a.54=a.2E;u p=a.54?a.54():G;a.54=G;C(p&&1x p[53]!=\'1G\')?p[53]:(1x m[53]!=\'1G\'?m[53]:G)},7n:A(a){u 1K=m.4X(a,\'1K\');q(1K)C 1K;C a.23},8c:A(24){u 3s=m.$(24),3M=m.7o[24],a={};q(!3s&&!3M)C G;q(!3M){3M=3s.5G(K);3M.24=\'\';m.7o[24]=3M;C 3s}I{C 3M.5G(K)}},3Q:A(d){q(d)m.85.2F(d);m.85.2O=\'\'},1p:A(z){q(!m.28){m.28=m.1a(\'Y\',{Z:\'P-aV\',52:\'\',2E:A(){m.2c()}},{1m:\'2l\',1c:\'1I\',T:0,1k:0},m.2a,K);m.21(1J,\'3u\',m.5m)}m.28.E.1o=\'\';m.5m();m.28.52+=\'|\'+z.O;q(m.5N&&m.a1)m.V(m.28,{6R:\'6p(\'+m.4v+\'aU.8B)\',1k:1});I m.1H(m.28,{1k:z.3R},m.7F)},7h:A(O){q(!m.28)C;q(1x O!=\'1G\')m.28.52=m.28.52.2e(\'|\'+O,\'\');q((1x O!=\'1G\'&&m.28.52!=\'\')||(m.1S&&m.4X(m.1S,\'3R\')))C;q(m.5N&&m.a1)m.V(m.28,{6R:\'1s\',L:0,W:0});I m.1H(m.28,{1k:0},m.7F,G,A(){m.V(m.28,{1o:\'1s\',L:0,W:0})})},5m:A(z){m.57();q(!m.28)C;u h=(m.1A&&z&&z.N)?2U(z.N.E.S)+2U(z.N.E.W)+(z.X?z.X.1j:0):0;m.V(m.28,{L:m.3I.5z+\'F\',W:1e.2P(m.3I.5A,h)+\'F\'})},6S:A(4j,z){u 11=z=z||m.2s();q(m.1S)C 1g;I m.11=11;2g{m.1S=4j;4j.2E()}2i(e){m.11=m.1S=G}2g{q(!4j||z.2Y[1]!=\'3O\')z.2c()}2i(e){}C 1g},5C:A(B,1P){u z=m.2s(B);q(z){4j=z.6N(1P);C m.6S(4j,z)}I C 1g},2V:A(B){C m.5C(B,-1)},1v:A(B){C m.5C(B,1)},5B:A(e){q(!e)e=1J.2b;q(!e.2h)e.2h=e.6x;q(1x e.2h.9V!=\'1G\')C K;u z=m.2s();u 1P=G;93(e.aW){1L 70:q(z)z.6g();C K;1L 32:1P=2;5b;1L 34:1L 39:1L 40:1P=1;5b;1L 8:1L 33:1L 37:1L 38:1P=-1;5b;1L 27:1L 13:1P=0}q(1P!==G){q(1P!=2)m.4o(19,1J.3o?\'7G\':\'7K\',m.5B);q(!m.au)C K;q(e.4B)e.4B();I e.8v=1g;q(z){q(1P==0){z.2c()}I q(1P==2){q(z.1f)z.1f.aJ()}I{q(z.1f)z.1f.2L();m.5C(z.O,1P)}C 1g}}C K},cI:A(Q){m.2y(m.1r,m.3e(Q,{1E:\'1E\'+m.5J++}))},cH:A(1i){u 2D=1i.2w;q(1x 2D==\'6d\'){M(u i=0;i<2D.R;i++){u o={};M(u x 2W 1i)o[x]=1i[x];o.2w=2D[i];m.2y(m.4P,o)}}I{m.2y(m.4P,1i)}},8b:A(7C,5n){u B,1Y=/^P-N-([0-9]+)$/;B=7C;4g(B.1Q){q(B.6s!==1G)C B.6s;q(B.24&&1Y.1b(B.24))C B.24.2e(1Y,"$1");B=B.1Q}q(!5n){B=7C;4g(B.1Q){q(B.4t&&m.5U(B)){M(u O=0;O<m.U.R;O++){u z=m.U[O];q(z&&z.a==B)C O}}B=B.1Q}}C G},2s:A(B,5n){q(1x B==\'1G\')C m.U[m.3r]||G;q(1x B==\'3i\')C m.U[B]||G;q(1x B==\'82\')B=m.$(B);C m.U[m.8b(B,5n)]||G},5U:A(a){C(a.2E&&a.2E.aB().2e(/\\s/g,\' \').26(/m.(cG|e)cJ/))},aT:A(){M(u i=0;i<m.U.R;i++)q(m.U[i]&&m.U[i].4C)m.9L()},87:A(e){q(!e)e=1J.2b;q(e.cK>1)C K;q(!e.2h)e.2h=e.6x;u B=e.2h;4g(B.1Q&&!(/P-(2B|3c|5x|3u)/.1b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M(u i=0;i<m.5y.R;i++)m.5y[i]()},7i:A(){u B,1h,58=[],4f=[],2K={},1Y;M(u i=0;i<m.72.R;i++){1h=19.2N(m.72[i]);M(u j=0;j<1h.R;j++){B=1h[j];1Y=m.5U(B);q(1Y){m.2y(58,B);q(1Y[0]==\'m.2C\')m.2y(4f,B);u g=m.4X(B,\'2w\')||\'1s\';q(!2K[g])2K[g]=[];m.2y(2K[g],B)}}}m.42={58:58,2K:2K,4f:4f};C m.42},6b:A(){C m.42||m.7i()},2c:A(B){u z=m.2s(B);q(z)z.2c();C 1g}};m.1F=A(2A,1i,1n){k.1i=1i;k.2A=2A;k.1n=1n;q(!1i.8J)1i.8J={}};m.1F.5g={7z:A(){(m.1F.3k[k.1n]||m.1F.3k.8x)(k);q(k.1i.3k)k.1i.3k.8y(k.2A,k.3V,k)},3v:A(8I,1N,3W){k.7s=(2d 8O()).8N();k.49=8I;k.3E=1N;k.3W=3W;k.3V=k.49;k.D=k.7v=0;u 4l=k;A t(5R){C 4l.3k(5R)}t.2A=k.2A;q(t()&&m.3C.2y(t)==1){m.8Q=cV(A(){u 3C=m.3C;M(u i=0;i<3C.R;i++)q(!3C[i]())3C.cQ(i--,1);q(!3C.R){cP(m.8Q)}},13)}},3k:A(5R){u t=(2d 8O()).8N();q(5R||t>=k.1i.3F+k.7s){k.3V=k.3E;k.D=k.7v=1;k.7z();k.1i.5Q[k.1n]=K;u 7u=K;M(u i 2W k.1i.5Q)q(k.1i.5Q[i]!==K)7u=1g;q(7u){q(k.1i.5F)k.1i.5F.8y(k.2A)}C 1g}I{u n=t-k.7s;k.7v=n/k.1i.3F;k.D=k.1i.2t(n,0,1,k.1i.3F);k.3V=k.49+((k.3E-k.49)*k.D);k.7z()}C K}};m.3e(m.1F,{3k:{1k:A(1F){m.V(1F.2A,{1k:1F.3V})},8x:A(1F){q(1F.2A.E&&1F.2A.E[1F.1n]!=G)1F.2A.E[1F.1n]=1F.3V+1F.3W;I 1F.2A[1F.1n]=1F.3V}}});m.5i=A(1C,4b){k.4b=4b;k.1C=1C;u v=m.3X,3B;k.6F=m.1A&&v>=5.5&&v<7;q(!1C){q(4b)4b();C}m.6U();k.1U=m.1a(\'1U\',{cT:0},{1c:\'1q\',1m:\'2l\',cv:\'bZ\',L:0},m.2a,K);u 47=m.1a(\'47\',G,G,k.1U,1);k.2f=[];M(u i=0;i<=8;i++){q(i%3==0)3B=m.1a(\'3B\',G,{W:\'2I\'},47,K);k.2f[i]=m.1a(\'2f\',G,G,3B,K);u E=i!=4?{bY:0,bX:0}:{1m:\'7H\'};m.V(k.2f[i],E)}k.2f[4].Z=1C+\' P-X\';k.8D()};m.5i.5g={8D:A(){u 1K=m.4v+(m.bW||"c0/")+k.1C+".8B";u 8R=m.4x?m.2a:G;k.3b=m.1a(\'1y\',G,{1m:\'2l\',S:\'-4F\'},8R,K);u 6W=k;k.3b.5W=A(){6W.8S()};k.3b.1K=1K},8S:A(){u o=k.1j=k.3b.L/4,D=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],1p={W:(2*o)+\'F\',L:(2*o)+\'F\'};M(u i=0;i<=8;i++){q(D[i]){q(k.6F){u w=(i==1||i==7)?\'2m%\':k.3b.L+\'F\';u Y=m.1a(\'Y\',G,{L:\'2m%\',W:\'2m%\',1m:\'7H\',2J:\'1q\'},k.2f[i],K);m.1a(\'Y\',G,{4Z:"c1:c5.c4.c3(c2=bV, 1K=\'"+k.3b.1K+"\')",1m:\'2l\',L:w,W:k.3b.W+\'F\',T:(D[i][0]*o)+\'F\',S:(D[i][1]*o)+\'F\'},Y,K)}I{m.V(k.2f[i],{6R:\'6p(\'+k.3b.1K+\') \'+(D[i][0]*o)+\'F \'+(D[i][1]*o)+\'F\'})}q(1J.3o&&(i==3||i==5))m.1a(\'Y\',G,1p,k.2f[i],K);m.V(k.2f[i],1p)}}k.3b=G;q(m.44[k.1C])m.44[k.1C].5h();m.44[k.1C]=k;q(k.4b)k.4b()},3S:A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+m.3I[\'1M\'+k.4S]}},6J:A(){u z=k.z;k.2x=\'2I\';q(z.6z==\'3P\')k.2x=\'3P\';I q(2d 5P(k.5Y).1b(z.3y))k.2x=G;I q(2d 5P(k.8V).1b(z.3y))k.2x=\'2P\';k.D=k.1R-k.cb+k.3l;k.H=1e.3G(k.1d,z[\'2P\'+k.3d]||k.1d);k.2o=z.5c?1e.3G(z[\'3G\'+k.3d],k.1d):k.1d;q(z.3t&&z.36){k.H=z[k.3H];k.1D=k.1d}q(k.1p==\'x\'&&m.4U)k.2o=z.4E;k.2h=z[\'2h\'+k.1p.8U()];k.2S=m[\'7b\'+k.4S];k.1M=m.3I[\'1M\'+k.4S];k.3U=m.3I[k.3H]},7E:A(i){u z=k.z;q(z.3t&&(z.36||m.4U)){k.1D=i;k.H=1e.2P(k.H,k.1D);z.18.E[k.5Y]=k.J(\'1O\')+\'F\'}I k.H=i;z.18.E[k.3H]=i+\'F\';z.N.E[k.3H]=k.J(\'1B\')+\'F\';q(z.X)z.X.3S();q(k.1p==\'x\'&&z.1l)z.4h(K);q(k.1p==\'x\'&&z.1f&&z.3t){q(i==k.1d)z.1f.4y(\'1d-2C\');I z.1f.3T(\'1d-2C\')}},7D:A(i){k.D=i;k.z.N.E[k.5Y]=i+\'F\';q(k.z.X)k.z.X.3S()}};m.51=A(a,2R,3v,35){q(19.bM&&m.1A&&!m.79){m.21(19,\'4d\',A(){2d m.51(a,2R,3v,35)});C}k.a=a;k.3v=3v;k.35=35||\'2B\';k.3t=!k.bL;m.6X=1g;k.1r=[];k.11=m.11;m.11=G;m.6U();u O=k.O=m.U.R;M(u i=0;i<m.6V.R;i++){u 30=m.6V[i];k[30]=2R&&1x 2R[30]!=\'1G\'?2R[30]:m[30]}q(!k.1K)k.1K=a.23;u B=(2R&&2R.7r)?m.$(2R.7r):a;B=k.90=B.2N(\'1y\')[0]||B;k.65=B.24||a.24;M(u i=0;i<m.U.R;i++){q(m.U[i]&&m.U[i].a==a&&!(k.11&&k.2Y[1]==\'3O\')){m.U[i].4a();C 1g}}q(!m.bJ)M(u i=0;i<m.U.R;i++){q(m.U[i]&&m.U[i].90!=B&&!m.U[i].5O){m.U[i].5t()}}m.U[O]=k;q(!m.8Z&&!m.1S){q(m.U[O-1])m.U[O-1].2c();q(1x m.3r!=\'1G\'&&m.U[m.3r])m.U[m.3r].2c()}k.B=B;k.1R=m.5K(B);m.57();u x=k.x=2d m.5X(k,\'x\');x.83();u y=k.y=2d m.5X(k,\'y\');y.83();k.N=m.1a(\'Y\',{24:\'P-N-\'+k.O,Z:\'P-N \'+k.7y},{1c:\'1q\',1m:\'2l\',1z:m.4r+=2},G,K);k.N.bK=k.N.bO=m.8i;q(k.35==\'2B\'&&k.3w==2)k.3w=0;q(!k.1C||(k.11&&k.3t&&k.2Y[1]==\'3O\')){k[k.35+\'6Z\']()}I q(m.44[k.1C]){k.7g();k[k.35+\'6Z\']()}I{k.7R();u z=k;2d m.5i(k.1C,A(){z.7g();z[z.35+\'6Z\']()})}C K};m.51.5g={7c:A(e){1J.bP.23=k.1K},7g:A(){u X=k.X=m.44[k.1C];X.z=k;X.1U.E.1z=k.N.E.1z-1;m.44[k.1C]=G},7R:A(){q(k.5O||k.1Z)C;k.1Z=m.1Z;u z=k;k.1Z.2E=A(){z.5t()};u z=k,l=k.x.J(\'6Q\')+\'F\',t=k.y.J(\'6Q\')+\'F\';q(!2q&&k.11&&k.2Y[1]==\'3O\')u 2q=k.11;q(2q){l=2q.x.J(\'6L\')+\'F\';t=2q.y.J(\'6L\')+\'F\';k.1Z.E.1z=m.4r++}4i(A(){q(z.1Z)m.V(z.1Z,{T:l,S:t,1z:m.4r++})},2m)},bT:A(){u z=k;u 1y=19.1a(\'1y\');k.18=1y;1y.5W=A(){q(m.U[z.O])z.8n()};q(m.bS)1y.bR=A(){C 1g};1y.Z=\'P-2B\';m.V(1y,{1c:\'1q\',1o:\'43\',1m:\'2l\',8o:\'4F\',1z:3});1y.2j=m.17.7p;q(m.4x)m.2a.2F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A(1w,1N){q(!1w)C;u z=k,29=m.a7,11=z.11,x=z.x,y=z.y,1X=11.x,1T=11.y,1l=z.1l,N=k.N,18=k.18;m.4o(19,\'6c\',m.5L);k.X=11.X;q(k.X)k.X.z=z;11.X=G;11.N.E.2J=\'1q\';m.V(N,{T:1X.D+\'F\',S:1T.D+\'F\',L:1X.J(\'1B\')+\'F\',W:1T.J(\'1B\')+\'F\'});m.V(18,{1o:\'1s\',L:(x.1D||x.H)+\'F\',W:(y.1D||y.H)+\'F\',T:(x.14+x.J(\'1O\'))+\'F\',S:(y.14+y.J(\'1O\'))+\'F\'});u 3K=m.1a(\'Y\',{Z:\'P-2B\'},{1m:\'2l\',1z:4,2J:\'1q\',1o:\'1s\',T:(1X.14+1X.J(\'1O\'))+\'F\',S:(1T.14+1T.J(\'1O\'))+\'F\',L:(1X.1D||1X.H)+\'F\',W:(1T.1D||1T.H)+\'F\'});M(u i=0;i<k.1r.R;i++){u o=m.$(\'1E\'+k.1r[i]);q(o.E.1c==\'1q\')o.E.1o=\'1s\'}q(1l)m.V(1l,{2J:\'1I\',T:(1X.14+1X.cb)+\'F\',S:(1T.14+1T.cb)+\'F\',L:1X.H+\'F\',W:1T.H+\'F\'});u 78={74:11,77:k};M(u n 2W 78){k[n]=78[n].18.5G(1);m.V(k[n],{1m:\'2l\',ad:0,1c:\'1I\'});3K.2F(k[n])}m.V(k.74,{T:0,S:0});m.V(k.77,{1o:\'43\',1k:0,T:(x.D-1X.D+x.14-1X.14+x.J(\'1O\')-1X.J(\'1O\'))+\'F\',S:(y.D-1T.D+y.14-1T.14+y.J(\'1O\')-1T.J(\'1O\'))+\'F\'});N.2F(3K);q(1l){1l.Z=\'\';N.2F(1l)}3K.E.1o=\'\';11.18.E.1o=\'1s\';q(m.4x){u 26=4V.5S.26(/ah\\/([0-9]{3})/);q(26&&2U(26[1])<9g)N.E.1c=\'1I\'}A 3E(){N.E.1c=18.E.1c=\'1I\';18.E.1o=\'43\';3K.E.1o=\'1s\';z.a.Z+=\' P-3Z-3y\';z.5D();11.5f();z.11=G}m.1H(11.N,{T:x.D,S:y.D,L:x.J(\'1B\'),W:y.J(\'1B\')},29);m.1H(3K,{L:x.1D||x.H,W:y.1D||y.H,T:x.14+x.J(\'1O\'),S:y.14+y.J(\'1O\')},29);m.1H(k.74,{T:(1X.D-x.D+1X.14-x.14+1X.J(\'1O\')-x.J(\'1O\')),S:(1T.D-y.D+1T.14-y.14+1T.J(\'1O\')-y.J(\'1O\'))},29);m.1H(k.77,{1k:1,T:0,S:0},29);q(1l)m.1H(1l,{T:x.14+x.cb,S:y.14+y.cb,L:x.H,W:y.H},29);q(k.X)u aP=A(3n,2Z){q(2Z.1n==\'S\'){u 4z=z.N.E;u D={w:2U(4z.L),h:2U(4z.W),x:2U(4z.T),y:2U(4z.S)};z.X.3S(D)}};m.1H(N,1N.N,{3F:29,5F:3E,3k:aP});3K.E.1c=\'1I\'},9N:A(o,B){q(!k.11)C 1g;M(u i=0;i<k.11.1r.R;i++){u 5H=m.$(\'1E\'+k.11.1r[i]);q(5H&&5H.1E==o.1E){k.7x();5H.cr=k.O;m.2y(k.1r,k.11.1r[i]);C K}}C 1g},5D:A(){k.4C=K;k.4a();q(k.3R)m.1p(k);q(m.1S&&m.1S==k.a)m.1S=G;k.aK();u p=m.3I,7l=m.6i.x+p.5Z,7m=m.6i.y+p.5q;k.6I=k.x.D<7l&&7l<k.x.D+k.x.J(\'1B\')&&k.y.D<7m&&7m<k.y.D+k.y.J(\'1B\');q(k.1l)k.9h()},aK:A(){u O=k.O;u 1C=k.1C;2d m.5i(1C,A(){2g{m.U[O].aC()}2i(e){}})},aC:A(){u 1v=k.6N(1);q(1v&&1v.2E.aB().26(/m\\.2C/))u 1y=m.1a(\'1y\',{1K:m.7n(1v)})},6N:A(1P){u 6B=k.6e(),as=m.42.2K[k.2w||\'1s\'];q(!as[6B+1P]&&k.1f&&k.1f.aN){q(1P==1)C as[0];I q(1P==-1)C as[as.R-1]}C as[6B+1P]||G},6e:A(){u 2k=m.6b().2K[k.2w||\'1s\'];q(2k)M(u i=0;i<2k.R;i++){q(2k[i]==k.a)C i}C G},a4:A(){q(k[k.4N]){u 2k=m.42.2K[k.2w||\'1s\'];q(2k){u s=m.17.3i.2e(\'%1\',k.6e()+1).2e(\'%2\',2k.R);k[k.4N].2O=\'<Y 2n="P-3i">\'+s+\'</Y>\'+k[k.4N].2O}}},az:A(){q(!k.11){M(u i=0;i<m.4P.R;i++){u 1u=m.4P[i],2D=1u.2w;q(1x 2D==\'1G\'||2D===G||2D===k.2w)k.1f=2d m.7a(k.O,1u)}}I{k.1f=k.11.1f}u 1u=k.1f;q(!1u)C;u O=1u.3J=k.O;1u.aM();1u.4y(\'1d-2C\');q(1u.2p){u o=1u.aE||{};o.48=1u.2p;o.1E=\'2p\';k.46(o)}q(1u.2r)1u.2r.62(k);q(!k.11&&k.3z)1u.3f(K);q(1u.3z){1u.3z=4i(A(){m.1v(O)},(1u.cc||ca))}},5t:A(){m.3Q(k.N);m.U[k.O]=G;q(m.1S==k.a)m.1S=G;m.7h(k.O);q(k.1Z)m.1Z.E.T=\'-4F\'},9U:A(){q(k.4G)C;k.4G=m.1a(\'a\',{23:m.aF,2h:m.ax,Z:\'P-4G\',2O:m.17.a5,2j:m.17.a6});k.46({48:k.4G,1m:k.9x||\'S T\',1E:\'4G\'})},9T:A(6M,9s){M(u i=0;i<6M.R;i++){u 16=6M[i],s=G;q(!k[16+\'5v\']&&k.65)k[16+\'5v\']=16+\'-M-\'+k.65;q(k[16+\'5v\'])k[16]=m.8c(k[16+\'5v\']);q(!k[16]&&!k[16+\'6H\']&&k[16+\'9v\'])2g{s=c8(k[16+\'9v\'])}2i(e){}q(!k[16]&&k[16+\'6H\']){s=k[16+\'6H\']}q(!k[16]&&!s){u 1v=k.a.9D;4g(1v&&!m.5U(1v)){q((2d 5P(\'P-\'+16)).1b(1v.Z||G)){k[16]=1v.5G(1);5b}1v=1v.9D}}q(!k[16]&&!s&&k.4N==16)s=\'\\n\';q(!k[16]&&s)k[16]=m.1a(\'Y\',{Z:\'P-\'+16,2O:s});q(9s&&k[16]){u o={1m:(16==\'6a\')?\'4I\':\'63\'};M(u x 2W k[16+\'9l\'])o[x]=k[16+\'9l\'][x];o.48=k[16];k.46(o)}}},5j:A(1c){q(m.9k)k.60(\'cd\',1c);q(m.9j)k.60(\'ce\',1c);q(m.5N)k.60(\'*\',1c)},60:A(4t,1c){u 1h=19.2N(4t);u 1n=4t==\'*\'?\'2J\':\'1c\';M(u i=0;i<1h.R;i++){q(1n==\'1c\'||(19.7V.9m(1h[i],"").9n(\'2J\')==\'2I\'||1h[i].9r(\'1q-by\')!=G)){u 2z=1h[i].9r(\'1q-by\');q(1c==\'1I\'&&2z){2z=2z.2e(\'[\'+k.O+\']\',\'\');1h[i].4L(\'1q-by\',2z);q(!2z)1h[i].E[1n]=1h[i].7T}I q(1c==\'1q\'){u 3m=m.5K(1h[i]);3m.w=1h[i].1V;3m.h=1h[i].31;q(!k.3R){u 9p=(3m.x+3m.w<k.x.J(\'4K\')||3m.x>k.x.J(\'4K\')+k.x.J(\'8a\'));u 9o=(3m.y+3m.h<k.y.J(\'4K\')||3m.y>k.y.J(\'4K\')+k.y.J(\'8a\'))}u 5I=m.8b(1h[i]);q(!9p&&!9o&&5I!=k.O){q(!2z){1h[i].4L(\'1q-by\',\'[\'+k.O+\']\');1h[i].7T=1h[i].E[1n];1h[i].E[1n]=\'1q\'}I q(2z.9G(\'[\'+k.O+\']\')==-1){1h[i].4L(\'1q-by\',2z+\'[\'+k.O+\']\')}}I q((2z==\'[\'+k.O+\']\'||m.3r==5I)&&5I!=k.O){1h[i].4L(\'1q-by\',\'\');1h[i].E[1n]=1h[i].7T||\'\'}I q(2z&&2z.9G(\'[\'+k.O+\']\')>-1){1h[i].4L(\'1q-by\',2z.2e(\'[\'+k.O+\']\',\'\'))}}}}},4a:A(){k.N.E.1z=m.4r+=2;M(u i=0;i<m.U.R;i++){q(m.U[i]&&i==m.3r){u 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.1b(p)){m.V(Q,{1m:\'7H\',T:(-k.x.14-k.x.cb)+\'F\',2M:(-k.x.2T-k.x.cb)+\'F\',S:\'2m%\',7L:k.y.cb+\'F\',L:\'2I\'});k.y.2T=Q.31;Q.E.1m=\'2l\'}},9S:A(){k.9T([\'6a\',\'ci\'],K);k.a4();q(k.6a&&k.7N)k.6a.Z+=\' P-3c\';q(m.a0)k.9U();M(u i=0;i<m.1r.R;i++){u o=m.1r[i],66=o.7r,2D=o.2w;q((!66&&!2D)||(66&&66==k.65)||(2D&&2D===k.2w)){k.46(o)}}u 61=[];M(u i=0;i<k.1r.R;i++){u o=m.$(\'1E\'+k.1r[i]);q(/64$/.1b(o.1m))k.56(o);I m.2y(61,o)}M(u i=0;i<61.R;i++)k.56(61[i]);k.9X=K},7x:A(){q(!k.1l)k.1l=m.1a(\'Y\',{Z:k.7y},{1m:\'2l\',L:(k.x.H||(k.36?k.L:G)||k.x.1d)+\'F\',W:(k.y.H||k.y.1d)+\'F\',1c:\'1q\',2J:\'1q\',1z:m.1A?4:G},m.2a,K)},4h:A(7U,9F){u 1l=k.1l,x=k.x,y=k.y;m.V(1l,{L:x.H+\'F\',W:y.H+\'F\'});q(7U||9F){M(u i=0;i<k.1r.R;i++){u o=m.$(\'1E\'+k.1r[i]);u 8e=(m.5e||19.88==\'9q\');q(o&&/^(4I|63)$/.1b(o.1m)){q(8e){o.E.L=(1l.1V+2*x.cb+x.14+x.2T)+\'F\'}y[o.1m==\'4I\'?\'14\':\'2T\']=o.31}q(o&&8e&&/^(T|2M)64$/.1b(o.1m)){o.E.W=(1l.31+2*y.cb)+\'F\'}}}q(7U){m.V(k.18,{S:y.14+\'F\'});m.V(1l,{S:(y.14+y.cb)+\'F\'})}},9h:A(){u b=k.1l;b.Z=\'\';m.V(b,{S:(k.y.14+k.y.cb)+\'F\',T:(k.x.14+k.x.cb)+\'F\',2J:\'1I\'});q(m.4x)b.E.1c=\'1I\';k.N.2F(b);M(u i=0;i<k.1r.R;i++){u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z.6e(),1Y=/6f$/;q(4m==0)k.4y(\'2V\');I q(1Y.1b(k.1t.2V.2N(\'a\')[0].Z))k.3T(\'2V\');q(4m+1==m.42.2K[z.2w||\'1s\'].R){k.4y(\'1v\');k.4y(\'3f\')}I q(1Y.1b(k.1t.1v.2N(\'a\')[0].Z)){k.3T(\'1v\');k.3T(\'3f\')}},3T:A(1t){q(!k.1t)C;u aO=k,a=k.1t[1t].2N(\'a\')[0],1Y=/6f$/;a.2E=A(){aO[1t]();C 1g};q(1Y.1b(a.Z))a.Z=a.Z.2e(1Y,\'\')},4y:A(1t){q(!k.1t)C;u a=k.1t[1t].2N(\'a\')[0];a.2E=A(){C 1g};q(!/6f$/.1b(a.Z))a.Z+=\' 6f\'},aJ:A(){q(k.3z)k.2L();I k.3f()},3f:A(ay){q(k.1t){k.1t.3f.E.1o=\'1s\';k.1t.2L.E.1o=\'\'}k.3z=K;q(!ay)m.1v(k.3J)},2L:A(){q(k.1t){k.1t.2L.E.1o=\'1s\';k.1t.3f.E.1o=\'\'}cs(k.3z);k.3z=G},2V:A(){k.2L();m.2V(k.1t.2V)},1v:A(){k.2L();m.1v(k.1t.1v)},3c:A(){},\'1d-2C\':A(){m.2s().6g()},2c:A(){m.2c(k.1t.2c)}};m.ae=A(1f){A 62(z){m.3e(1i||{},{48:41,1E:\'2r\'});q(m.5e)1i.5l=0;z.46(1i);m.V(41.1Q,{2J:\'1q\'})};A 1M(3g){4n(1G,1e.4s(3g*41[3j?\'1V\':\'31\']*0.7))};A 4n(i,7f){q(i===1G)M(u j=0;j<4R.R;j++){q(4R[j]==m.U[1f.3J].a){i=j;5b}}q(i===1G)C;u as=41.2N(\'a\'),3Z=as[i],3A=3Z.1Q,T=3j?\'ai\':\'ac\',2M=3j?\'a8\':\'a9\',L=3j?\'ab\':\'aj\',3N=\'1j\'+T,1V=\'1j\'+L,6o=Y.1Q.1Q[1V],69=6o-1U[1V],4Y=2U(1U.E[3j?\'T\':\'S\'])||0,2u=4Y,cu=20;q(7f!==1G){2u=4Y-7f;q(2u>0)2u=0;q(2u<69)2u=69}I{M(u j=0;j<as.R;j++)as[j].Z=\'\';3Z.Z=\'P-3Z-3y\';u 8d=i>0?as[i-1].1Q[3N]:3A[3N],7X=3A[3N]+3A[1V]+(as[i+1]?as[i+1].1Q[1V]:0);q(7X>6o-4Y)2u=6o-7X;I q(8d<-4Y)2u=-8d}u 89=3A[3N]+(3A[1V]-6t[1V])/2+2u;m.1H(1U,3j?{T:2u}:{S:2u},G,\'7t\');m.1H(6t,3j?{T:89}:{S:89},G,\'7t\');6Y.E.1o=2u<0?\'43\':\'1s\';7k.E.1o=(2u>69)?\'43\':\'1s\'};u 4R=m.42.2K[m.U[1f.3J].2w||\'1s\'],1i=1f.2r,4T=1i.4T||\'an\',71=(4T==\'cq\'),3D=71?[\'Y\',\'7P\',\'1W\',\'22\']:[\'1U\',\'47\',\'3B\',\'2f\'],3j=(4T==\'an\'),41=m.1a(\'Y\',{Z:\'P-2r P-2r-\'+4T,2O:\'<Y 2n="P-2r-cl">\'+\'<\'+3D[0]+\'><\'+3D[1]+\'></\'+3D[1]+\'></\'+3D[0]+\'></Y>\'+\'<Y 2n="P-1M-1w"><Y></Y></Y>\'+\'<Y 2n="P-1M-cm"><Y></Y></Y>\'+\'<Y 2n="P-6t"><Y></Y></Y>\'},{1o:\'1s\'},m.2a),4Q=41.67,Y=4Q[0],6Y=4Q[1],7k=4Q[2],6t=4Q[3],1U=Y.c7,47=41.2N(3D[1])[0],3B;M(u i=0;i<4R.R;i++){q(i==0||!3j)3B=m.1a(3D[2],G,G,47);(A(){u a=4R[i],3A=m.1a(3D[3],G,G,3B),c6=i;m.1a(\'a\',{23:a.23,2E:A(){m.2s(k).4a();C m.6S(a)},2O:m.9f?m.9f(a):a.2O},G,3A)})()}q(!71){6Y.2E=A(){1M(-1)};7k.2E=A(){1M(1)};m.21(47,19.bN!==1G?\'bI\':\'bU\',A(e){u 3g=0;e=e||1J.2b;q(e.8W){3g=e.8W/cw;q(m.3o)3g=-3g}I q(e.8u){3g=-e.8u/3}q(3g)1M(-3g*0.2);q(e.4B)e.4B();e.8v=1g})}C{62:62,4n:4n}};q(m.1A){(A(){2g{19.4w.cU(\'T\')}2i(e){4i(8w.cS,50);C}m.4d()})()}m.21(19,\'cW\',m.4d);m.21(1J,\'7W\',m.4d);m.68=m.17;u cX=m.51;m.21(1J,\'7W\',A(){q(m.6A){u 7d=\'.P 1y\',86=\'45: 6p(\'+m.4v+m.6A+\'), 6r !cD;\';u E=m.1a(\'E\',{16:\'cB/6C\'},G,19.2N(\'cA\')[0]);q(!m.1A){E.2F(19.cO(7d+" {"+86+"}"))}I{u 11=19.al[19.al.R-1];q(1x(11.9K)=="6d")11.9K(7d,86)}}});m.21(1J,\'3u\',A(){m.57();q(m.2G)M(u i=0;i<m.2G.67.R;i++){u 3s=m.2G.67[i],z=m.2s(3s);z.56(3s);q(3s.1E==\'2r\')z.1f.2r.4n()}});m.21(19,\'6c\',A(e){m.6i={x:e.6j,y:e.6k}});m.21(19,\'ag\',m.87);m.21(19,\'8K\',m.87);m.21(19,\'4d\',m.6b);m.21(1J,\'7W\',m.9i);',62,804,'||||||||||||||||||||this||hs||||if||||var|||||exp|function|el|return|pos|style|px|null|size|else|get|true|width|for|wrapper|key|highslide|overlay|length|top|left|expanders|setStyles|height|outline|div|className||last|||p1||type|lang|content|document|createElement|test|visibility|full|Math|slideshow|false|els|options|offset|opacity|overlayBox|position|prop|display|dim|hidden|overlays|none|btn|ss|next|up|typeof|img|zIndex|ie|wsize|outlineType|imgSize|hsId|fx|undefined|animate|visible|window|src|case|scroll|to|imgPad|op|parentNode|tpos|upcoming|lastY|table|offsetWidth|li|lastX|re|loading||addEventListener|span|href|id||match||dimmer|dur|container|event|close|new|replace|td|try|target|catch|title|arr|absolute|100|class|minSize|controls|tgt|thumbstrip|getExpander|easing|tblPos|ratio|slideshowGroup|justify|push|hiddenBy|elem|image|expand|sg|onclick|appendChild|viewport|xSize|auto|overflow|groups|pause|right|getElementsByTagName|innerHTML|max|dragArgs|params|marginMin|p2|parseInt|previous|in|opt|transitions|args|name|offsetHeight||||contentType|useBox||||hasDragged|graphic|move|ucwh|extend|play|delta|func|number|isX|step|tb|elPos|val|opera|iebody|styles|focusKey|node|isImage|resize|custom|outlineWhileAnimating|ySize|anchor|autoplay|cell|tr|timers|tree|end|duration|min|wh|page|expKey|fadeBox|tgtArr|clone|offsetLeft|crossfade|center|discardElement|dimmingOpacity|setPosition|enable|clientSize|now|unit|uaVersion|marginMax|active||dom|anchors|block|pendingOutlines|cursor|createOverlay|tbody|overlayId|start|focus|onLoad|bottom|ready|attribs|images|while|sizeOverlayBox|setTimeout|adj|styleRestoreCursor|self|cur|selectThumb|removeEventListener|fitsize|allowReduce|zIndexCounter|round|tagName|relToVP|graphicsDir|documentElement|safari|disable|stl|moveOnly|preventDefault|isExpanded|blurExp|minWidth|9999px|credits|250|above|restoreCursor|opos|setAttribute|minHeight|numberPosition|trans|slideshows|domCh|group|uclt|mode|padToMinWidth|navigator|fac|getParam|curTblPos|filter||Expander|owner|param|getParams|matches|positionOverlay|getPageSize|all|preloadTheseImages|on|break|allowSizeReduction|buttons|ieLt7|afterClose|prototype|destroy|Outline|doShowHide|marginLeft|fade|setDimmerSize|expOnly|innerHeight|over|scrollTop|body|preloadFullImage|cancelLoading|innerWidth|Id|topmostKey|html|onReady|pageWidth|pageHeight|keyHandler|previousOrNext|afterExpand|changed|complete|cloneNode|oDiv|wrapperKey|idCounter|getPosition|dragHandler|dir|geckoMac|onLoadStarted|RegExp|curAnim|gotoEnd|userAgent|dX|isHsAnchor|toLowerCase|onload|Dimension|lt|scrollLeft|showHideElements|os|add|below|panel|thumbsUserSetId|tId|childNodes|langDefaults|minTblPos|heading|getAnchors|mousemove|object|getAnchorIndex|disabled|doFullExpand|xpos|mouse|clientX|clientY|hideOnMouseOut|fullExpandLabel|offY|overlayWidth|url|offX|pointer|hsKey|marker|fullExpandTitle|distance|endOff|srcElement|ucrb|align|expandCursor|current|css|startOff|numberOfImagesToPreload|hasAlphaImageLoader|destroyOverlays|Text|mouseIsOver|calcExpanded|other|loadingPosXfade|types|getAdjacentAnchor|Click|expandDuration|loadingPos|background|transit|resizeTo|init|overrides|pThis|continuePreloading|scrollUp|Create||floatMode|openerTagNames|clientHeight|oldImg||dY|newImg|names|isReady|Slideshow|margin|error|sel|moveTo|scrollBy|connectOutline|undim|updateAnchors|arrow|scrollDown|mX|mY|getSrc|clones|restoreTitle|changeSize|thumbnailId|startTime|easeOutQuad|done|state|parOff|genOverlayBox|wrapperClassName|update|clientWidth|blur|element|setPos|setSize|dimmingDuration|keypress|relative|isClosing|hasMovedMin|keydown|marginTop|middle|dragByHeading|maxsize|ul|calcBorders|showLoading|parseFloat|origProp|doWrapper|defaultView|load|activeRight|parent|relatedTarget|hasFocused|topZ|string|calcThumb|oPos|garbageBin|dec|mouseClickHandler|compatMode|markerPos|osize|getWrapperKey|getNode|activeLeft|ie6|restoreDuration|nextTitle|pauseText|wrapperMouseHandler|nextText|closeText|closeTitle|fixedControls|contentLoaded|maxWidth|fullExpandText|pauseTitle|moveText|playText|moveTitle|detail|returnValue|arguments|_default|call|easeInQuad|yScroll|png|tag|preloadGraphic|nopad|xScroll|alpha|scrollHeight|from|orig|mouseup|scrollWidth|scrollMaxY|getTime|Date|scrollMaxX|timerId|appendTo|onGraphicLoad|relativeTo|toUpperCase|rb|wheelDelta|offsetParent|detachEvent|allowMultipleInstances|thumb|targetX|targetY|switch|hide|loadingTitle|loadingText|rv|loadingOpacity||captionOverlay|headingOverlay|vis|playTitle|ltr|stripItemFormatter|525|showOverlays|preloadImages|hideIframes|hideSelects|Overlay|getComputedStyle|getPropertyValue|clearsY|clearsX|BackCompat|getAttribute|addOverlay|clickX|Move|Eval|clickY|creditsPosition|previousText|Next|Previous|Play|Pause|nextSibling|spacebar|doPanels|indexOf|rightpanel|marginRight|marginBottom|addRule|focusTopmost|leftpanel|reuseOverlay|offsetX|offsetY|cssDirection|direction|getOverlays|getInline|writeCredits|form|focusTitle|gotOverlays|Close|hand|showCredits|dimmingGeckoFix|Highslide|JS|getNumber|creditsText|creditsTitle|transitionDuration|Right|Bottom|after|Width|Top|border|Thumbstrip|and|mousedown|Safari|Left|Height|fadeInOut|styleSheets|200|horizontal|offsetTop|previousTitle|tmpMin|correctRatio||easingClose|enableKeyListener|show|fitOverlayBox|creditsTarget|wait|initSlideshow|fullExpandOpacity|toString|preloadNext|fullExpandPosition|overlayOptions|creditsHref|createFullExpand|javascript|pow|hitSpace|prepareNextOutline|getElementByClass|checkFirstAndLast|repeat|sls|wrapStep|skin|getControls|replaceLang|reOrder|geckodimmer|dimming|keyCode|pageXOffset|pageYOffset|outlineStartOffset|of|Image|Resize|resizeTitle|click|drag|graphics|keys|Use|esc|homepage|front|bring|cancel|Loading|Expand|actual|the|Go|Powered|zoomin|zoomout|ra|it|maxHeight|headingEval|Macintosh|Gecko|removeAttribute|padding|getElementById|headingText|headingId|_self||com|http|1001|drop|shadow|captionEval|captionText|captionId|currentStyle|mousewheel|allowSimultaneousLoading|onmouseover|isHtml|readyState|onmousewheel|onmouseout|location|flushImgSize|oncontextmenu|blockRightClick|imageCreate|DOMMouseScroll|scale|outlinesDir|fontSize|lineHeight|collapse|outlines|progid|sizingMethod|AlphaImageLoader|Microsoft|DXImageTransform|pI|firstChild|eval|removeChild|500||interval|SELECT|IFRAME|200px|default|abs|caption|dynamicallyUpdateAnchors|useControls|inner|down|split|fit|floor|float|reuse|clearTimeout|preserveContent|mgnRight|borderCollapse|120|attachEvent|toElement|fromElement|HEAD|text|linearTween|important|mouseover|dragSensitivity|htmlE|addSlideshow|registerOverlay|xpand|button|sqrt|hasHtmlExpanders|vendor|createTextNode|clearInterval|splice|KDE|callee|cellSpacing|doScroll|setInterval|DOMContentLoaded|HsExpander'.split('|'),0,{}))

jQuery(document).ready(function() {

	hs.graphicsDir = '/images/';
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
	hs.fadeInOut = true;
	hs.dimmingOpacity = 0.8;
	hs.outlineType = 'rounded-white';
	/* hs.captionEval = 'this.thumb.alt'; */
	hs.marginBottom = 105 // make room for the thumbstrip and the controls
	/* hs.numberPosition = 'caption'; */
	
	// Add the simple close button
	hs.registerOverlay({
		html: '<div class="closebutton" onclick="return hs.close(this)" title="Close"></div>',
		position: 'top right',
		fade: 2 // fading the semi-transparent overlay looks bad in IE
	});
	
	// Add the slideshow providing the controlbar and the thumbstrip
	hs.addSlideshow({
		slideshowGroup: 'carousel_slider',
		interval: 5000,
		repeat: false,
		useControls: false,
		overlayOptions: {
			className: 'text-controls',
			position: 'bottom center',
			relativeTo: 'viewport',
			offsetY: -60
		},
		thumbstrip: {
			position: 'bottom center',
			mode: 'horizontal',
			relativeTo: 'viewport'
		}
	});
	
	hs.addSlideshow({
		slideshowGroup: 'zoom_in',
		interval: 5000,
		repeat: false,
		useControls: false,
		overlayOptions: {
			className: 'text-controls',
			position: 'bottom center',
			relativeTo: 'viewport',
			offsetY: -60
		}
	});
	
	hs.addSlideshow({
		slideshowGroup: 'big_image_zoom',
		interval: 5000,
		repeat: false,
		useControls: false,
		overlayOptions: {
			className: 'text-controls',
			position: 'bottom center',
			relativeTo: 'viewport',
			offsetY: -60
		}
	});
	
	hs.lang = {
	cssDirection: 'ltr',
	loadingText : '?????????...',
	loadingTitle : '???? ?? ??????',
	focusTitle : '???? ?? ?? ?? ???????? ??????',
	fullExpandTitle : '??????????? ?? ??????????? ?????? (f)',
	creditsText : '',
	creditsTitle : '',
	previousText : 'Previous',
	nextText : 'Next', 
	moveText : 'Move',
	closeText : 'Close', 
	closeTitle : 'Close (esc)', 
	resizeTitle : 'Resize',
	playText : 'Play',
	playTitle : 'Play slideshow (spacebar)',
	pauseText : 'Pause',
	pauseTitle : 'Pause slideshow (spacebar)',
	previousTitle : 'Previous (arrow left)',
	nextTitle : 'Next (arrow right)',
	moveTitle : 'Move',
	fullExpandText : '1:1',
	number: 'Image %1 of %2',
	restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.'
};

	
});

/*
 * Inline Form Validation Engine 1.7, jQuery plugin
 * 
 * Copyright(c) 2010, Cedric Dugas
 * http://www.position-relative.net
 *	
 * Form validation engine allowing custom regex rules to be added.
 * Thanks to Francois Duquette and Teddy Limousin 
 * and everyone helping me find bugs on the forum
 * Licenced under the MIT Licence
 */
 
(function($) {
	
	$.fn.validationEngine = function(settings) {
		
	if($.validationEngineLanguage){				// IS THERE A LANGUAGE LOCALISATION ?
		allRules = $.validationEngineLanguage.allRules;
	}else{
		$.validationEngine.debug("Validation engine rules are not loaded check your external file");
	}
 	settings = jQuery.extend({
		allrules:allRules,
		validationEventTriggers:"focusout",					
		inlineValidation: true,	
		returnIsValid:false,
		liveEvent:true,
		unbindEngine:true,
		containerOverflow:false,
		containerOverflowDOM:"",
		ajaxSubmit: false,
		scroll:true,
		promptPosition: "topRight",	// OPENNING BOX POSITION, IMPLEMENTED: topLeft, topRight, bottomLeft, centerRight, bottomRight
		success : false,
		beforeSuccess :  function() {},
		failure : function() {}
	}, settings);	
	$.validationEngine.settings = settings;
	$.validationEngine.ajaxValidArray = new Array();	// ARRAY FOR AJAX: VALIDATION MEMORY 
	
	if(settings.inlineValidation == true){ 		// Validating Inline ?
		if(!settings.returnIsValid){					// NEEDED FOR THE SETTING returnIsValid
			allowReturnIsvalid = false;
			if(settings.liveEvent){						// LIVE event, vast performance improvement over BIND
				$(this).find("[class*=validate][type!=checkbox]").live(settings.validationEventTriggers, function(caller){ _inlinEvent(this);})
				$(this).find("[class*=validate][type=checkbox]").live("click", function(caller){ _inlinEvent(this); })
			}else{
				$(this).find("[class*=validate]").not("[type=checkbox]").bind(settings.validationEventTriggers, function(caller){ _inlinEvent(this); })
				$(this).find("[class*=validate][type=checkbox]").bind("click", function(caller){ _inlinEvent(this); })
			}
			firstvalid = false;
		}
			function _inlinEvent(caller){
				$.validationEngine.settings = settings;
				if($.validationEngine.intercept == false || !$.validationEngine.intercept){		// STOP INLINE VALIDATION THIS TIME ONLY
					$.validationEngine.onSubmitValid=false;
					$.validationEngine.loadValidation(caller); 
				}else{
					$.validationEngine.intercept = false;
				}
			}
	}
	if (settings.returnIsValid){		// Do validation and return true or false, it bypass everything;
		if ($.validationEngine.submitValidation(this,settings)){
			return false;
		}else{
			return true;
		}
	}
	$(this).bind("submit", function(caller){   // ON FORM SUBMIT, CONTROL AJAX FUNCTION IF SPECIFIED ON DOCUMENT READY
		$.validationEngine.onSubmitValid = true;
		$.validationEngine.settings = settings;
		if($.validationEngine.submitValidation(this,settings) == false){
			if($.validationEngine.submitForm(this,settings) == true) return false;
		}else{
			settings.failure && settings.failure(); 
			return false;
		}		
	})
	$(".formError").live("click",function(){	 // REMOVE BOX ON CLICK
		$(this).fadeOut(150,function(){		$(this).remove()	}) 
	})
};	
$.validationEngine = {
	defaultSetting : function(caller) {		// NOT GENERALLY USED, NEEDED FOR THE API, DO NOT TOUCH
		if($.validationEngineLanguage){				
			allRules = $.validationEngineLanguage.allRules;
		}else{
			$.validationEngine.debug("Validation engine rules are not loaded check your external file");
		}	
		settings = {
			allrules:allRules,
			validationEventTriggers:"blur",					
			inlineValidation: true,	
			containerOverflow:false,
			containerOverflowDOM:"",
			returnIsValid:false,
			scroll:true,
			unbindEngine:true,
			ajaxSubmit: false,
			promptPosition: "topRight",	// OPENNING BOX POSITION, IMPLEMENTED: topLeft, topRight, bottomLeft, centerRight, bottomRight
			success : false,
			failure : function() {}
		}	
		$.validationEngine.settings = settings;
	},
	loadValidation : function(caller) {		// GET VALIDATIONS TO BE EXECUTED
		if(!$.validationEngine.settings) $.validationEngine.defaultSetting()
		rulesParsing = $(caller).attr('class');
		rulesRegExp = /\[(.*)\]/;
		getRules = rulesRegExp.exec(rulesParsing);
		str = getRules[1];
		pattern = /\[|,|\]/;
		result= str.split(pattern);	
		var validateCalll = $.validationEngine.validateCall(caller,result)
		return validateCalll;
	},
	validateCall : function(caller,rules) {	// EXECUTE VALIDATION REQUIRED BY THE USER FOR THIS FIELD
		var promptText =""	
		
		if(!$(caller).attr("id")) $.validationEngine.debug("This field have no ID attribut( name & class displayed): "+$(caller).attr("name")+" "+$(caller).attr("class"))

		caller = caller;
		ajaxValidate = false;
		var callerName = $(caller).attr("name");
		$.validationEngine.isError = false;
		$.validationEngine.showTriangle = true;
		callerType = $(caller).attr("type");

		for (i=0; i<rules.length;i++){
			switch (rules[i]){
			case "optional": 
				if(!$(caller).val()){
					$.validationEngine.closePrompt(caller);
					return $.validationEngine.isError;
				}
			break;
			case "required": 
				_required(caller,rules);
			break;
			case "custom": 
				 _customRegex(caller,rules,i);
			break;
			case "exemptString": 
				 _exemptString(caller,rules,i);
			break;
			case "ajax": 
				if(!$.validationEngine.onSubmitValid) _ajax(caller,rules,i);	
			break;
			case "length": 
				 _length(caller,rules,i);
			break;
			case "maxCheckbox": 
				_maxCheckbox(caller,rules,i);
			 	groupname = $(caller).attr("name");
			 	caller = $("input[name='"+groupname+"']");
			break;
			case "minCheckbox": 
				_minCheckbox(caller,rules,i);
				groupname = $(caller).attr("name");
			 	caller = $("input[name='"+groupname+"']");
			break;
			case "confirm": 
				 _confirm(caller,rules,i);
			break;
			case "confirmEmail": 
				 _confirmEmail(caller,rules,i);
			break;
			case "funcCall": 
		     	_funcCall(caller,rules,i);
			break;
			default :;
			};
		};
		radioHack();
		if ($.validationEngine.isError == true){
			var linkTofieldText = "." +$.validationEngine.linkTofield(caller);
			if(linkTofieldText != "."){
				if(!$(linkTofieldText)[0]){
					$.validationEngine.buildPrompt(caller,promptText,"error")
				}else{	
					$.validationEngine.updatePromptText(caller,promptText);
				}	
			}else{
				$.validationEngine.updatePromptText(caller,promptText);
			}
		}else{
			$.validationEngine.closePrompt(caller);
		}			
		/* UNFORTUNATE RADIO AND CHECKBOX GROUP HACKS */
		/* As my validation is looping input with id's we need a hack for my validation to understand to group these inputs */
		function radioHack(){
	      if($("input[name='"+callerName+"']").size()> 1 && (callerType == "radio" || callerType == "checkbox")) {        // Hack for radio/checkbox group button, the validation go the first radio/checkbox of the group
	          caller = $("input[name='"+callerName+"'][type!=hidden]:first");     
	          $.validationEngine.showTriangle = false;
	      }      
	    }
		/* VALIDATION FUNCTIONS */
		function _required(caller,rules){   // VALIDATE BLANK FIELD
			callerType = $(caller).attr("type");
			if (callerType == "text" || callerType == "password" || callerType == "textarea"){
								
				if(!$(caller).val()){
					$.validationEngine.isError = true;
					promptText += $.validationEngine.settings.allrules[rules[i]].alertText+"<br />";
				}	
			}	
			if (callerType == "radio" || callerType == "checkbox" ){
				callerName = $(caller).attr("name");
		
				if($("input[name='"+callerName+"']:checked").size() == 0) {
					$.validationEngine.isError = true;
					if($("input[name='"+callerName+"']").size() ==1) {
						promptText += $.validationEngine.settings.allrules[rules[i]].alertTextCheckboxe+"<br />"; 
					}else{
						 promptText += $.validationEngine.settings.allrules[rules[i]].alertTextCheckboxMultiple+"<br />";
					}	
				}
			}	
			if (callerType == "select-one") { // added by paul@kinetek.net for select boxes, Thank you		
				if(!$(caller).val()) {
					$.validationEngine.isError = true;
					promptText += $.validationEngine.settings.allrules[rules[i]].alertText+"<br />";
				}
			}
			if (callerType == "select-multiple") { // added by paul@kinetek.net for select boxes, Thank you	
				if(!$(caller).find("option:selected").val()) {
					$.validationEngine.isError = true;
					promptText += $.validationEngine.settings.allrules[rules[i]].alertText+"<br />";
				}
			}
		}
		function _customRegex(caller,rules,position){		 // VALIDATE REGEX RULES
			customRule = rules[position+1];
			pattern = eval($.validationEngine.settings.allrules[customRule].regex);
			
			if(!pattern.test($(caller).attr('value'))){
				$.validationEngine.isError = true;
				promptText += $.validationEngine.settings.allrules[customRule].alertText+"<br />";
			}
		}
		function _exemptString(caller,rules,position){		 // VALIDATE REGEX RULES
			customString = rules[position+1];
			if(customString == $(caller).attr('value')){
				$.validationEngine.isError = true;
				promptText += $.validationEngine.settings.allrules['required'].alertText+"<br />";
			}
		}
		
		function _funcCall(caller,rules,position){  		// VALIDATE CUSTOM FUNCTIONS OUTSIDE OF THE ENGINE SCOPE
			customRule = rules[position+1];
			funce = $.validationEngine.settings.allrules[customRule].nname;
			
			var fn = window[funce];
			if (typeof(fn) === 'function'){
				var fn_result = fn();
				if(!fn_result){
					$.validationEngine.isError = true;
				}
				
				promptText += $.validationEngine.settings.allrules[customRule].alertText+"<br />";
			}
		}
		function _ajax(caller,rules,position){				 // VALIDATE AJAX RULES
			
			customAjaxRule = rules[position+1];
			postfile = $.validationEngine.settings.allrules[customAjaxRule].file;
			fieldValue = $(caller).val();
			ajaxCaller = caller;
			fieldId = $(caller).attr("id");
			ajaxValidate = true;
			ajaxisError = $.validationEngine.isError;
			
			if($.validationEngine.settings.allrules[customAjaxRule].extraData){
				extraData = $.validationEngine.settings.allrules[customAjaxRule].extraData;
			}else{
				extraData = "";
			}
			/* AJAX VALIDATION HAS ITS OWN UPDATE AND BUILD UNLIKE OTHER RULES */	
			if(!ajaxisError){
				$.ajax({
				   	type: "POST",
				   	url: postfile,
				   	async: true,
				   	data: "validateValue="+fieldValue+"&validateId="+fieldId+"&validateError="+customAjaxRule+"&extraData="+extraData,
				   	beforeSend: function(){		// BUILD A LOADING PROMPT IF LOAD TEXT EXIST		   			
				   		if($.validationEngine.settings.allrules[customAjaxRule].alertTextLoad){
				   		
				   			if(!$("div."+fieldId+"formError")[0]){				   				
	 			 				return $.validationEngine.buildPrompt(ajaxCaller,$.validationEngine.settings.allrules[customAjaxRule].alertTextLoad,"load");
	 			 			}else{
	 			 				$.validationEngine.updatePromptText(ajaxCaller,$.validationEngine.settings.allrules[customAjaxRule].alertTextLoad,"load");
	 			 			}
			   			}
			  	 	},
			  	 	error: function(data,transport){ $.validationEngine.debug("error in the ajax: "+data.status+" "+transport) },
					success: function(data){					// GET SUCCESS DATA RETURN JSON
						data = eval( "("+data+")");				// GET JSON DATA FROM PHP AND PARSE IT
						ajaxisError = data.jsonValidateReturn[2];
						customAjaxRule = data.jsonValidateReturn[1];
						ajaxCaller = $("#"+data.jsonValidateReturn[0])[0];
						fieldId = ajaxCaller;
						ajaxErrorLength = $.validationEngine.ajaxValidArray.length;
						existInarray = false;
						
			 			 if(ajaxisError == "false"){			// DATA FALSE UPDATE PROMPT WITH ERROR;
			 			 	
			 			 	_checkInArray(false)				// Check if ajax validation alreay used on this field
			 			 	
			 			 	if(!existInarray){		 			// Add ajax error to stop submit		 		
				 			 	$.validationEngine.ajaxValidArray[ajaxErrorLength] =  new Array(2);
				 			 	$.validationEngine.ajaxValidArray[ajaxErrorLength][0] = fieldId;
				 			 	$.validationEngine.ajaxValidArray[ajaxErrorLength][1] = false;
				 			 	existInarray = false;
			 			 	}
				
			 			 	$.validationEngine.ajaxValid = false;
							promptText += $.validationEngine.settings.allrules[customAjaxRule].alertText+"<br />";
							$.validationEngine.updatePromptText(ajaxCaller,promptText,"",true);				
						 }else{	 
						 	_checkInArray(true);
						 	$.validationEngine.ajaxValid = true; 			
						 	if(!customAjaxRule)	{$.validationEngine.debug("wrong ajax response, are you on a server or in xampp? if not delete de ajax[ajaxUser] validating rule from your form ")}		   
						 	if($.validationEngine.settings.allrules[customAjaxRule].alertTextOk){	// NO OK TEXT MEAN CLOSE PROMPT	 			
	 			 				 				$.validationEngine.updatePromptText(ajaxCaller,$.validationEngine.settings.allrules[customAjaxRule].alertTextOk,"pass",true);
 			 				}else{
				 			 	ajaxValidate = false;		 	
				 			 	$.validationEngine.closePrompt(ajaxCaller);
 			 				}		
			 			 }
			 			function  _checkInArray(validate){
			 				for(x=0;x<ajaxErrorLength;x++){
			 			 		if($.validationEngine.ajaxValidArray[x][0] == fieldId){
			 			 			$.validationEngine.ajaxValidArray[x][1] = validate;
			 			 			existInarray = true;
			 			 		
			 			 		}
			 			 	}
			 			}
			 		}				
				});
			}
		}
		function _confirm(caller,rules,position){		 // VALIDATE FIELD MATCH
			confirmField = rules[position+1];
			
			if($(caller).attr('value') != $("#"+confirmField).attr('value')){
				$.validationEngine.isError = true;
				promptText += $.validationEngine.settings.allrules["confirm"].alertText+"<br />";
			}
		}
		function _confirmEmail(caller,rules,position){		 // VALIDATE FIELD MATCH
			confirmField = rules[position+1];
			
			if($(caller).attr('value') != $("#"+confirmField).attr('value')){
				$.validationEngine.isError = true;
				promptText += $.validationEngine.settings.allrules["confirmEmail"].alertText+"<br />";
			}
		}
		function _length(caller,rules,position){    	  // VALIDATE LENGTH
		
			startLength = eval(rules[position+1]);
			endLength = eval(rules[position+2]);
			feildLength = $(caller).attr('value').length;

			if(feildLength<startLength || feildLength>endLength){
				$.validationEngine.isError = true;
				promptText += $.validationEngine.settings.allrules["length"].alertText+startLength+$.validationEngine.settings.allrules["length"].alertText2+endLength+$.validationEngine.settings.allrules["length"].alertText3+"<br />"
			}
		}
		function _maxCheckbox(caller,rules,position){  	  // VALIDATE CHECKBOX NUMBER
		
			nbCheck = eval(rules[position+1]);
			groupname = $(caller).attr("name");
			groupSize = $("input[name='"+groupname+"']:checked").size();
			if(groupSize > nbCheck){	
				$.validationEngine.showTriangle = false;
				$.validationEngine.isError = true;
				promptText += $.validationEngine.settings.allrules["maxCheckbox"].alertText+"<br />";
			}
		}
		function _minCheckbox(caller,rules,position){  	  // VALIDATE CHECKBOX NUMBER
		
			nbCheck = eval(rules[position+1]);
			groupname = $(caller).attr("name");
			groupSize = $("input[name='"+groupname+"']:checked").size();
			if(groupSize < nbCheck){	
			
				$.validationEngine.isError = true;
				$.validationEngine.showTriangle = false;
				promptText += $.validationEngine.settings.allrules["minCheckbox"].alertText+" "+nbCheck+" "+$.validationEngine.settings.allrules["minCheckbox"].alertText2+"<br />";
			}
		}
		return ($.validationEngine.isError) ? $.validationEngine.isError : false;
	},
	submitForm : function(caller){
		if($.validationEngine.settings.ajaxSubmit){		
			if($.validationEngine.settings.ajaxSubmitExtraData){
				extraData = $.validationEngine.settings.ajaxSubmitExtraData;
			}else{
				extraData = "";
			}
			$.ajax({
			   	type: "POST",
			   	url: $.validationEngine.settings.ajaxSubmitFile,
			   	async: true,
			   	data: $(caller).serialize()+"&"+extraData,
			   	error: function(data,transport){ $.validationEngine.debug("error in the ajax: "+data.status+" "+transport) },
			   	success: function(data){
			   		if(data == "true"){			// EVERYTING IS FINE, SHOW SUCCESS MESSAGE
			   			$(caller).css("opacity",1)
			   			$(caller).animate({opacity: 0, height: 0}, function(){
			   				$(caller).css("display","none");
			   				$(caller).before("<div class='ajaxSubmit'>"+$.validationEngine.settings.ajaxSubmitMessage+"</div>");
			   				$.validationEngine.closePrompt(".formError",true); 	
			   				$(".ajaxSubmit").show("slow");
			   				if ($.validationEngine.settings.success){	// AJAX SUCCESS, STOP THE LOCATION UPDATE
								$.validationEngine.settings.success && $.validationEngine.settings.success(); 
								return false;
							}
			   			})
		   			}else{						// HOUSTON WE GOT A PROBLEM (SOMETING IS NOT VALIDATING)
			   			data = eval( "("+data+")");	
			   			if(!data.jsonValidateReturn){
			   				 $.validationEngine.debug("you are not going into the success fonction and jsonValidateReturn return nothing");
			   			}
			   			errorNumber = data.jsonValidateReturn.length	
			   			for(index=0; index<errorNumber; index++){	
			   				fieldId = data.jsonValidateReturn[index][0];
			   				promptError = data.jsonValidateReturn[index][1];
			   				type = data.jsonValidateReturn[index][2];
			   				$.validationEngine.buildPrompt(fieldId,promptError,type);
		   				}
	   				}
   				}
			})	
			return true;
		}
		// LOOK FOR BEFORE SUCCESS METHOD		
			if(!$.validationEngine.settings.beforeSuccess()){
				if ($.validationEngine.settings.success){	// AJAX SUCCESS, STOP THE LOCATION UPDATE
					if($.validationEngine.settings.unbindEngine){ $(caller).unbind("submit") }
					$.validationEngine.settings.success && $.validationEngine.settings.success(); 
					return true;
				}
			}else{
				return true;
			} 
		return false;
	},
	buildPrompt : function(caller,promptText,type,ajaxed) {			// ERROR PROMPT CREATION AND DISPLAY WHEN AN ERROR OCCUR
		if(!$.validationEngine.settings){
			$.validationEngine.defaultSetting()
		}
		deleteItself = "." + $(caller).attr("id") + "formError"
	
		if($(deleteItself)[0]){
			$(deleteItself).stop();
			$(deleteItself).remove();
		}
		var divFormError = document.createElement('div');
		var formErrorContent = document.createElement('div');
		linkTofield = $.validationEngine.linkTofield(caller)
		$(divFormError).addClass("formError")
		
		if(type == "pass") $(divFormError).addClass("greenPopup")
		if(type == "load") $(divFormError).addClass("blackPopup")
		if(ajaxed) $(divFormError).addClass("ajaxed")
		
		$(divFormError).addClass(linkTofield);
		$(formErrorContent).addClass("formErrorContent");
		
		if($.validationEngine.settings.containerOverflow){		// Is the form contained in an overflown container?
			$(caller).before(divFormError);
		}else{
			$("body").append(divFormError);
		}
		
		$(divFormError).append(formErrorContent);
			
		if($.validationEngine.showTriangle != false){		// NO TRIANGLE ON MAX CHECKBOX AND RADIO
			var arrow = document.createElement('div');
			$(arrow).addClass("formErrorArrow");
			$(divFormError).append(arrow);
			if($.validationEngine.settings.promptPosition == "bottomLeft" || $.validationEngine.settings.promptPosition == "bottomRight"){
			$(arrow).addClass("formErrorArrowBottom")
			$(arrow).html('<div class="line1"><!-- --></div><div class="line2"><!-- --></div><div class="line3"><!-- --></div><div class="line4"><!-- --></div><div class="line5"><!-- --></div><div class="line6"><!-- --></div><div class="line7"><!-- --></div><div class="line8"><!-- --></div><div class="line9"><!-- --></div><div class="line10"><!-- --></div>');
		}
			if($.validationEngine.settings.promptPosition == "topLeft" || $.validationEngine.settings.promptPosition == "topRight"){
				$(divFormError).append(arrow);
				$(arrow).html('<div class="line10"><!-- --></div><div class="line9"><!-- --></div><div class="line8"><!-- --></div><div class="line7"><!-- --></div><div class="line6"><!-- --></div><div class="line5"><!-- --></div><div class="line4"><!-- --></div><div class="line3"><!-- --></div><div class="line2"><!-- --></div><div class="line1"><!-- --></div>');
			}
		}
		$(formErrorContent).html(promptText)
		
		var calculatedPosition = $.validationEngine.calculatePosition(caller,promptText,type,ajaxed,divFormError)
		
		calculatedPosition.callerTopPosition +="px";
		calculatedPosition.callerleftPosition +="px";
		calculatedPosition.marginTopSize +="px"
		$(divFormError).css({
			"top":calculatedPosition.callerTopPosition,
			"left":calculatedPosition.callerleftPosition,
			"marginTop":calculatedPosition.marginTopSize,
			"opacity":0
		})
		return $(divFormError).animate({"opacity":0.87},function(){return true;});	
	},
	updatePromptText : function(caller,promptText,type,ajaxed) {	// UPDATE TEXT ERROR IF AN ERROR IS ALREADY DISPLAYED
		
		linkTofield = $.validationEngine.linkTofield(caller);
		var updateThisPrompt =  "."+linkTofield;
		
		if(type == "pass") { $(updateThisPrompt).addClass("greenPopup") }else{ $(updateThisPrompt).removeClass("greenPopup")};
		if(type == "load") { $(updateThisPrompt).addClass("blackPopup") }else{ $(updateThisPrompt).removeClass("blackPopup")};
		if(ajaxed) { $(updateThisPrompt).addClass("ajaxed") }else{ $(updateThisPrompt).removeClass("ajaxed")};
	
		$(updateThisPrompt).find(".formErrorContent").html(promptText);
		
		var calculatedPosition = $.validationEngine.calculatePosition(caller,promptText,type,ajaxed,updateThisPrompt)
		
		calculatedPosition.callerTopPosition +="px";
		calculatedPosition.callerleftPosition +="px";
		calculatedPosition.marginTopSize +="px"
		$(updateThisPrompt).animate({ "top":calculatedPosition.callerTopPosition,"marginTop":calculatedPosition.marginTopSize });
	},
	calculatePosition : function(caller,promptText,type,ajaxed,divFormError){
		
		if($.validationEngine.settings.containerOverflow){		// Is the form contained in an overflown container?
			callerTopPosition = 0;
			callerleftPosition = 0;
			callerWidth =  $(caller).width();
			inputHeight = $(divFormError).height();					// compasation for the triangle
			var marginTopSize = "-"+inputHeight;
		}else{
			callerTopPosition = $(caller).offset().top;
			callerleftPosition = $(caller).offset().left;
			callerWidth =  $(caller).width();
			inputHeight = $(divFormError).height();
			var marginTopSize = 0;
		}
		
		/* POSITIONNING */
		if($.validationEngine.settings.promptPosition == "topRight"){ 
			if($.validationEngine.settings.containerOverflow){		// Is the form contained in an overflown container?
				callerleftPosition += callerWidth -30;
			}else{
				callerleftPosition +=  callerWidth -30; 
				callerTopPosition += -inputHeight; 
			}
		}
		if($.validationEngine.settings.promptPosition == "topLeft"){ callerTopPosition += -inputHeight -10; }
		
		if($.validationEngine.settings.promptPosition == "centerRight"){ callerleftPosition +=  callerWidth +13; }
		
		if($.validationEngine.settings.promptPosition == "bottomLeft"){
			callerHeight =  $(caller).height();
			callerTopPosition = callerTopPosition + callerHeight + 15;
		}
		if($.validationEngine.settings.promptPosition == "bottomRight"){
			callerHeight =  $(caller).height();
			callerleftPosition +=  callerWidth -30;
			callerTopPosition +=  callerHeight +5;
		}
		return {
			"callerTopPosition":callerTopPosition,
			"callerleftPosition":callerleftPosition,
			"marginTopSize":marginTopSize
		}
	},
	linkTofield : function(caller){
		var linkTofield = $(caller).attr("id") + "formError";
		linkTofield = linkTofield.replace(/\[/g,""); 
		linkTofield = linkTofield.replace(/\]/g,"");
		return linkTofield;
	},
	closePrompt : function(caller,outside) {						// CLOSE PROMPT WHEN ERROR CORRECTED
		if(!$.validationEngine.settings){
			$.validationEngine.defaultSetting()
		}
		if(outside){
			$(caller).fadeTo("fast",0,function(){
				$(caller).remove();
			});
			return false;
		}
		if(typeof(ajaxValidate)=='undefined'){ajaxValidate = false}
		if(!ajaxValidate){
			linkTofield = $.validationEngine.linkTofield(caller);
			closingPrompt = "."+linkTofield;
			$(closingPrompt).fadeTo("fast",0,function(){
				$(closingPrompt).remove();
			});
		}
	},
	debug : function(error) {
		if(!$("#debugMode")[0]){
			$("body").append("<div id='debugMode'><div class='debugError'><strong>This is a debug mode, you got a problem with your form, it will try to help you, refresh when you think you nailed down the problem</strong></div></div>");
		}
		$(".debugError").append("<div class='debugerror'>"+error+"</div>");
	},			
	submitValidation : function(caller) {					// FORM SUBMIT VALIDATION LOOPING INLINE VALIDATION
		var stopForm = false;
		$.validationEngine.ajaxValid = true;
		var toValidateSize = $(caller).find("[class*=validate]").size();
		
		$(caller).find("[class*=validate]").each(function(){
			linkTofield = $.validationEngine.linkTofield(this);
			
			if(!$("."+linkTofield).hasClass("ajaxed")){	// DO NOT UPDATE ALREADY AJAXED FIELDS (only happen if no normal errors, don't worry)
				var validationPass = $.validationEngine.loadValidation(this);
				return(validationPass) ? stopForm = true : "";					
			};
		});
		ajaxErrorLength = $.validationEngine.ajaxValidArray.length;		// LOOK IF SOME AJAX IS NOT VALIDATE
		for(x=0;x<ajaxErrorLength;x++){
	 		if($.validationEngine.ajaxValidArray[x][1] == false) $.validationEngine.ajaxValid = false;
 		}
		if(stopForm || !$.validationEngine.ajaxValid){		// GET IF THERE IS AN ERROR OR NOT FROM THIS VALIDATION FUNCTIONS
			if($.validationEngine.settings.scroll){
				if(!$.validationEngine.settings.containerOverflow){
					var destination = $(".formError:not('.greenPopup'):first").offset().top;
					$(".formError:not('.greenPopup')").each(function(){
						testDestination = $(this).offset().top;
						if(destination>testDestination) destination = $(this).offset().top;
					})
					$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1100);
				}else{
					var destination = $(".formError:not('.greenPopup'):first").offset().top;
					var scrollContainerScroll = $($.validationEngine.settings.containerOverflowDOM).scrollTop();
					var scrollContainerPos = - parseInt($($.validationEngine.settings.containerOverflowDOM).offset().top);
					var destination = scrollContainerScroll + destination + scrollContainerPos -5
					var scrollContainer = $.validationEngine.settings.containerOverflowDOM+":not(:animated)"
					
					$(scrollContainer).animate({ scrollTop: destination}, 1100);
				}
			}
			return true;
		}else{
			return false;
		}
	}
}
})(jQuery);
