﻿//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 } ('6.H={1H:7(C){d f.18(7(){4 3=f;3.5={p:6(C.p,f),S:6(C.S,f),W:6.G.1q(f),g:C.g,19:C.19,T:C.T,1B:C.1B,B:C.B,1l:C.1l};6.H.1g(3,0);6(1x).1b(\'2t\',7(){3.5.W=6.G.1q(3);6.H.1g(3,0);6.H.1v(3)});6.H.1v(3);3.5.p.1b(\'2s\',7(){6(3.5.19,f).V(0).o.F=\'1m\'}).1b(\'2N\',7(){6(3.5.19,f).V(0).o.F=\'Z\'});6(8).1b(\'23\',7(e){4 15=6.G.1T(e);4 E=0;9(3.5.B&&3.5.B==\'1C\')4 1j=15.x-3.5.W.x-(3.I-3.5.g*3.5.p.Y())/2-3.5.g/2;q 9(3.5.B&&3.5.B==\'1N\')4 1j=15.x-3.5.W.x-3.I+3.5.g*3.5.p.Y();q 4 1j=15.x-3.5.W.x;4 1L=13.1P(15.y-3.5.W.y-3.17/2,2);3.5.p.18(7(12){s=13.2D(13.1P(1j-12*3.5.g,2)+1L);s-=3.5.g/2;s=s<0?0:s;s=s>3.5.T?3.5.T:s;s=3.5.T-s;1o=3.5.1l*s/3.5.T;f.o.1a=3.5.g+1o+\'z\';f.o.K=3.5.g*12+E+\'z\';E+=1o});6.H.1g(3,E)})})},1g:7(3,E){9(3.5.B)9(3.5.B==\'1C\')3.5.S.V(0).o.K=(3.I-3.5.g*3.5.p.Y())/2-E/2+\'z\';q 9(3.5.B==\'K\')3.5.S.V(0).o.K=-E/3.5.p.Y()+\'z\';q 9(3.5.B==\'1N\')3.5.S.V(0).o.K=(3.I-3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.11||8.k.11||0;O=1k.1n||8.u.14||8.k.14||0}d{t:t,l:l,w:w,h:h,Q:Q,O:O}},2q:7(e,X){4 3=6(e);4 t=3.a(\'24\')||\'\';4 r=3.a(\'2j\')||\'\';4 b=3.a(\'2i\')||\'\';4 l=3.a(\'2n\')||\'\';9(X)d{t:j(t)||0,r:j(r)||0,b:j(b)||0,l:j(l)};q d{t:t,r:r,b:b,l:l}},2m:7(e,X){4 3=6(e);4 t=3.a(\'21\')||\'\';4 r=3.a(\'29\')||\'\';4 b=3.a(\'2u\')||\'\';4 l=3.a(\'2c\')||\'\';9(X)d{t:j(t)||0,r:j(r)||0,b:j(b)||0,l:j(l)};q d{t:t,r:r,b:b,l:l}},2z:7(e,X){4 3=6(e);4 t=3.a(\'1Q\')||\'\';4 r=3.a(\'2C\')||\'\';4 b=3.a(\'2y\')||\'\';4 l=3.a(\'1Z\')||\'\';9(X)d{t:j(t)||0,r:j(r)||0,b:j(b)||0,l:j(l)||0};q d{t:t,r:r,b:b,l:l}},1T:7(10){4 x=10.2v||(10.2w+(8.u.M||8.k.M))||0;4 y=10.2E||(10.2K+(8.u.R||8.k.R))||0;d{x:x,y:y}},1s:7(A,1z){1z(A);A=A.2M;1h(A){6.G.1s(A,1z);A=A.2L}},2F:7(A){6.G.1s(A,7(3){1W(4 1p 2H 3){9(2J 3[1p]===\'7\'){3[1p]=1X}}})},2r:7(3,16){4 D=6.G.20();4 1w=6.G.1S(3);9(!16||16==\'2a\')6(3).a({2b:D.t+((13.1R(D.h,D.O)-D.t-1w.L)/2)+\'z\'});9(!16||16==\'22\')6(3).a({K:D.l+((13.1R(D.w,D.Q)-D.l-1w.J)/2)+\'z\'})},2d:7(3,1V){4 1U=6(\'2e[@1e*="1d"]\',3||8),1d;1U.18(7(){1d=f.1e;f.1e=1V;f.o.2o="2p:2l.2k.2g(1e=\'"+1d+"\')"})}};[].1Y||(2f.2h.1Y=7(v,n){n=(n==1X)?0:n;4 m=f.25;1W(4 i=n;i<m;i++)9(f[i]==v)d i;d-1});', 62, 175, '|||el|var|fisheyeCfg|jQuery|function|document|if|css||es|return||this|itemWidth|||parseInt|body||||style|items|else||distance||documentElement|||||px|nodeEl|halign|options|clientScroll|toAdd|display|iUtil|iFisheye|offsetWidth|wb|left|hb|scrollLeft|de|ih|visibility|iw|scrollTop|container|proximity|position|get|pos|toInteger|size|none|event|clientWidth|nr|Math|clientHeight|pointer|axis|offsetHeight|each|itemsText|width|bind|oldPosition|png|src|oldVisibility|positionContainer|while|currentStyle|posx|self|maxWidth|block|innerHeight|extraWidth|attr|getPosition|innerWidth|traverseDOM|scrollHeight|scrollWidth|positionItems|windowSize|window|restoreStyles|func|toLowerCase|valign|center|tagName|true|opera|browser|build|offsetLeft|offsetTop|absolute|posy|hidden|right|offsetParent|pow|borderTopWidth|max|getSize|getPointer|images|emptyGIF|for|null|indexOf|borderLeftWidth|getScroll|paddingTop|horizontally|mousemove|marginTop|length|fn|Fisheye|false|paddingRight|vertically|top|paddingLeft|fixPNG|img|Array|AlphaImageLoader|prototype|marginBottom|marginRight|Microsoft|DXImageTransform|getPadding|marginLeft|filter|progid|getMargins|centerEl|mouseover|resize|paddingBottom|pageX|clientX|nodeName|borderBottomWidth|getBorder|getClient|getSizeLite|borderRightWidth|sqrt|pageY|purgeEvents|getPositionLite|in|parentNode|typeof|clientY|nextSibling|firstChild|mouseout|height'.split('|'), 0, {}))

/**
* Interface Elements for jQuery
* utility function
*
* http://interface.eyecon.ro
*
* Copyright (c) 2006 Stefan Petre
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
*
*/

jQuery.iUtil = {
    getPosition: function (e) {
        var x = 0;
        var y = 0;
        var es = e.style;
        var restoreStyles = false;
        if (jQuery(e).css('display') == 'none') {
            var oldVisibility = es.visibility;
            var oldPosition = es.position;
            restoreStyles = true;
            es.visibility = 'hidden';
            es.display = 'block';
            es.position = 'absolute';
        }
        var el = e;
        while (el) {
            x += el.offsetLeft + (el.currentStyle && !jQuery.browser.opera ? parseInt(el.currentStyle.borderLeftWidth) || 0 : 0);
            y += el.offsetTop + (el.currentStyle && !jQuery.browser.opera ? parseInt(el.currentStyle.borderTopWidth) || 0 : 0);
            el = el.offsetParent;
        }
        el = e;
        while (el && el.tagName && el.tagName.toLowerCase() != 'body') {
            x -= el.scrollLeft || 0;
            y -= el.scrollTop || 0;
            el = el.parentNode;
        }
        if (restoreStyles == true) {
            es.display = 'none';
            es.position = oldPosition;
            es.visibility = oldVisibility;
        }
        return { x: x, y: y };
    },
    getPositionLite: function (el) {
        var x = 0, y = 0;
        while (el) {
            x += el.offsetLeft || 0;
            y += el.offsetTop || 0;
            el = el.offsetParent;
        }
        return { x: x, y: y };
    },
    getSize: function (e) {
        var w = jQuery.css(e, 'width');
        var h = jQuery.css(e, 'height');
        var wb = 0;
        var hb = 0;
        var es = e.style;
        if (jQuery(e).css('display') != 'none') {
            wb = e.offsetWidth;
            hb = e.offsetHeight;
        } else {
            var oldVisibility = es.visibility;
            var oldPosition = es.position;
            es.visibility = 'hidden';
            es.display = 'block';
            es.position = 'absolute';
            wb = e.offsetWidth;
            hb = e.offsetHeight;
            es.display = 'none';
            es.position = oldPosition;
            es.visibility = oldVisibility;
        }
        return { w: w, h: h, wb: wb, hb: hb };
    },
    getSizeLite: function (el) {
        return {
            wb: el.offsetWidth || 0,
            hb: el.offsetHeight || 0
        };
    },
    getClient: function (e) {
        var h, w, de;
        if (e) {
            w = e.clientWidth;
            h = e.clientHeight;
        } else {
            de = document.documentElement;
            w = window.innerWidth || self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
            h = window.innerHeight || self.innerHeight || (de && de.clientHeight) || document.body.clientHeight;
        }
        return { w: w, h: h };
    },
    getScroll: function (e) {
        var t = 0, l = 0, w = 0, h = 0, iw = 0, ih = 0;
        if (e && e.nodeName.toLowerCase() != 'body') {
            t = e.scrollTop;
            l = e.scrollLeft;
            w = e.scrollWidth;
            h = e.scrollHeight;
            iw = 0;
            ih = 0;
        } else {
            if (document.documentElement) {
                t = document.documentElement.scrollTop;
                l = document.documentElement.scrollLeft;
                w = document.documentElement.scrollWidth;
                h = document.documentElement.scrollHeight;
            } else if (document.body) {
                t = document.body.scrollTop;
                l = document.body.scrollLeft;
                w = document.body.scrollWidth;
                h = document.body.scrollHeight;
            }
            iw = self.innerWidth || document.documentElement.clientWidth || document.body.clientWidth || 0;
            ih = self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0;
        }
        return { t: t, l: l, w: w, h: h, iw: iw, ih: ih };
    },
    getMargins: function (e, toInteger) {
        var el = jQuery(e);
        var t = el.css('marginTop') || '';
        var r = el.css('marginRight') || '';
        var b = el.css('marginBottom') || '';
        var l = el.css('marginLeft') || '';
        if (toInteger)
            return {
                t: parseInt(t) || 0,
                r: parseInt(r) || 0,
                b: parseInt(b) || 0,
                l: parseInt(l)
            };
        else
            return { t: t, r: r, b: b, l: l };
    },
    getPadding: function (e, toInteger) {
        var el = jQuery(e);
        var t = el.css('paddingTop') || '';
        var r = el.css('paddingRight') || '';
        var b = el.css('paddingBottom') || '';
        var l = el.css('paddingLeft') || '';
        if (toInteger)
            return {
                t: parseInt(t) || 0,
                r: parseInt(r) || 0,
                b: parseInt(b) || 0,
                l: parseInt(l)
            };
        else
            return { t: t, r: r, b: b, l: l };
    },
    getBorder: function (e, toInteger) {
        var el = jQuery(e);
        var t = el.css('borderTopWidth') || '';
        var r = el.css('borderRightWidth') || '';
        var b = el.css('borderBottomWidth') || '';
        var l = el.css('borderLeftWidth') || '';
        if (toInteger)
            return {
                t: parseInt(t) || 0,
                r: parseInt(r) || 0,
                b: parseInt(b) || 0,
                l: parseInt(l) || 0
            };
        else
            return { t: t, r: r, b: b, l: l };
    },
    getPointer: function (event) {
        var x = event.pageX || (event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)) || 0;
        var y = event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop)) || 0;
        return { x: x, y: y };
    },
    traverseDOM: function (nodeEl, func) {
        func(nodeEl);
        nodeEl = nodeEl.firstChild;
        while (nodeEl) {
            jQuery.iUtil.traverseDOM(nodeEl, func);
            nodeEl = nodeEl.nextSibling;
        }
    },
    purgeEvents: function (nodeEl) {
        jQuery.iUtil.traverseDOM(
			nodeEl,
			function (el) {
			    for (var attr in el) {
			        if (typeof el[attr] === 'function') {
			            el[attr] = null;
			        }
			    }
			}
		);
    },
    centerEl: function (el, axis) {
        var clientScroll = jQuery.iUtil.getScroll();
        var windowSize = jQuery.iUtil.getSize(el);
        if (!axis || axis == 'vertically')
            jQuery(el).css(
				{
				    top: clientScroll.t + ((Math.max(clientScroll.h, clientScroll.ih) - clientScroll.t - windowSize.hb) / 2) + 'px'
				}
			);
        if (!axis || axis == 'horizontally')
            jQuery(el).css(
				{
				    left: clientScroll.l + ((Math.max(clientScroll.w, clientScroll.iw) - clientScroll.l - windowSize.wb) / 2) + 'px'
				}
			);
    },
    fixPNG: function (el, emptyGIF) {
        var images = jQuery('img[@src*="png"]', el || document), png;
        images.each(function () {
            png = this.src;
            this.src = emptyGIF;
            this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + png + "')";
        });
    }
};

// Helper function to support older browsers!
[ ].indexOf || (Array.prototype.indexOf = function (v, n) {
    n = (n == null) ? 0 : n;
    var m = this.length;
    for (var i = n; i < m; i++)
        if (this[i] == v)
            return i;
    return -1;
});

/**
* Interface Elements for jQuery
* Fisheye menu
* 
* http://interface.eyecon.ro
* 
* Copyright (c) 2006 Stefan Petre
* Dual licensed under the MIT (MIT-LICENSE.txt) 
* and GPL (GPL-LICENSE.txt) licenses.
*
*/

/**
* Build a Fisheye menu from a list of links
*
* @name Fisheye
* @description Build a Fisheye menu from a list of links
* @param Hash hash A hash of parameters
* @option String items items selection
* @option String container container element
* @option Integer itemWidth the minimum width for each item
* @option Integer maxWidth the maximum width for each item
* @option String itemsText selection of element that contains the text for each item
* @option Integer proximity the distance from element that make item to interact
* @option String valign vertical alignment
* @option String halign horizontal alignment
*
* @type jQuery
* @cat Plugins/Interface
* @author Stefan Petre
*/
jQuery.iFisheye = {

    build: function (options) {

        return this.each(
			function () {
			    var el = this;
			    el.fisheyeCfg = {
			        items: jQuery(options.items, this),
			        container: jQuery(options.container, this),
			        pos: jQuery.iUtil.getPosition(this),
			        itemWidth: options.itemWidth,
			        itemsText: options.itemsText,
			        proximity: options.proximity,
			        valign: options.valign,
			        halign: options.halign,
			        maxWidth: options.maxWidth
			    };
			    jQuery.iFisheye.positionContainer(el, 0);
			    jQuery(window).bind(
					'resize',
					function () {
					    el.fisheyeCfg.pos = jQuery.iUtil.getPosition(el);
					    jQuery.iFisheye.positionContainer(el, 0);
					    jQuery.iFisheye.positionItems(el);
					}
				);
			    jQuery.iFisheye.positionItems(el);
			    el.fisheyeCfg.items
					.bind(
						'mouseover',
						function () {
						    jQuery(el.fisheyeCfg.itemsText, this).get(0).style.display = 'block';
						}
					)
					.bind(
						'mouseout',
						function () {
						    jQuery(el.fisheyeCfg.itemsText, this).get(0).style.display = 'none';
						}
					);
			    jQuery(document).bind(
					'mousemove',
					function (e) {
					    var pointer = jQuery.iUtil.getPointer(e);
					    var toAdd = 0;
					    if (el.fisheyeCfg.halign && el.fisheyeCfg.halign == 'center')
					        var posx = pointer.x - el.fisheyeCfg.pos.x - (el.offsetWidth - el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size()) / 2 - el.fisheyeCfg.itemWidth / 2;
					    else if (el.fisheyeCfg.halign && el.fisheyeCfg.halign == 'right')
					        var posx = pointer.x - el.fisheyeCfg.pos.x - el.offsetWidth + el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size();
					    else
					        var posx = pointer.x - el.fisheyeCfg.pos.x;
					    var posy = Math.pow(pointer.y - el.fisheyeCfg.pos.y - el.offsetHeight / 2, 2);
					    el.fisheyeCfg.items.each(
							function (nr) {
							    distance = Math.sqrt(
									Math.pow(posx - nr * el.fisheyeCfg.itemWidth, 2)
									+ posy
								);
							    distance -= el.fisheyeCfg.itemWidth / 2;

							    distance = distance < 0 ? 0 : distance;
							    distance = distance > el.fisheyeCfg.proximity ? el.fisheyeCfg.proximity : distance;
							    distance = el.fisheyeCfg.proximity - distance;

							    extraWidth = el.fisheyeCfg.maxWidth * distance / el.fisheyeCfg.proximity;

							    this.style.width = el.fisheyeCfg.itemWidth + extraWidth + 'px';
							    this.style.left = el.fisheyeCfg.itemWidth * nr + toAdd + 'px';
							    toAdd += extraWidth;
							}
						);
					    jQuery.iFisheye.positionContainer(el, toAdd);
					}
				);
			}
		)
    },

    positionContainer: function (el, toAdd) {
        if (el.fisheyeCfg.halign)
            if (el.fisheyeCfg.halign == 'center')
                el.fisheyeCfg.container.get(0).style.left = (el.offsetWidth - el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size()) / 2 - toAdd / 2 + 'px';
            else if (el.fisheyeCfg.halign == 'left')
                el.fisheyeCfg.container.get(0).style.left = -toAdd / el.fisheyeCfg.items.size() + 'px';
            else if (el.fisheyeCfg.halign == 'right')
                el.fisheyeCfg.container.get(0).style.left = (el.offsetWidth - el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size()) - toAdd / 2 + 'px';
        el.fisheyeCfg.container.get(0).style.width = el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size() + toAdd + 'px';
    },

    positionItems: function (el) {
        el.fisheyeCfg.items.each(
			function (nr) {
			    this.style.width = el.fisheyeCfg.itemWidth + 'px';
			    this.style.left = el.fisheyeCfg.itemWidth * nr + 'px';
			}
		);
    }
};

jQuery.fn.Fisheye = jQuery.iFisheye.build;
