/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-06-22 04:38:37 +0200 (Fr, 22 Jun 2007) $
 * $Rev: 2141 $
 *
 * Version: 1.0b2
 */

(function($){

// store a copy of the core height and width methods
var height = $.fn.height,
    width  = $.fn.width;

$.fn.extend({
	/**
	 * If used on document, returns the document's height (innerHeight)
	 * If used on window, returns the viewport's (window) height
	 * See core docs on height() to see what happens when used on an element.
	 *
	 * @example $("#testdiv").height()
	 * @result 200
	 *
	 * @example $(document).height()
	 * @result 800
	 *
	 * @example $(window).height()
	 * @result 400
	 *
	 * @name height
	 * @type Object
	 * @cat Plugins/Dimensions
	 */
	height: function() {
		if ( this[0] == window )
			return self.innerHeight ||
				$.boxModel && document.documentElement.clientHeight || 
				document.body.clientHeight;
		
		if ( this[0] == document )
			return Math.max( document.body.scrollHeight, document.body.offsetHeight );
		
		return height.apply(this, arguments);
	},
	
	/**
	 * If used on document, returns the document's width (innerWidth)
	 * If used on window, returns the viewport's (window) width
	 * See core docs on height() to see what happens when used on an element.
	 *
	 * @example $("#testdiv").width()
	 * @result 200
	 *
	 * @example $(document).width()
	 * @result 800
	 *
	 * @example $(window).width()
	 * @result 400
	 *
	 * @name width
	 * @type Object
	 * @cat Plugins/Dimensions
	 */
	width: function() {
		if ( this[0] == window )
			return self.innerWidth ||
				$.boxModel && document.documentElement.clientWidth ||
				document.body.clientWidth;

		if ( this[0] == document )
			return Math.max( document.body.scrollWidth, document.body.offsetWidth );

		return width.apply(this, arguments);
	},
	
	/**
	 * Returns the inner height value (without border) for the first matched element.
	 * If used on document, returns the document's height (innerHeight)
	 * If used on window, returns the viewport's (window) height
	 *
	 * @example $("#testdiv").innerHeight()
	 * @result 800
	 *
	 * @name innerHeight
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	innerHeight: function() {
		return this[0] == window || this[0] == document ?
			this.height() :
			this.is(':visible') ?
				this[0].offsetHeight - num(this, 'borderTopWidth') - num(this, 'borderBottomWidth') :
				this.height() + num(this, 'paddingTop') + num(this, 'paddingBottom');
	},
	
	/**
	 * Returns the inner width value (without border) for the first matched element.
	 * If used on document, returns the document's Width (innerWidth)
	 * If used on window, returns the viewport's (window) width
	 *
	 * @example $("#testdiv").innerWidth()
	 * @result 1000
	 *
	 * @name innerWidth
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	innerWidth: function() {
		return this[0] == window || this[0] == document ?
			this.width() :
			this.is(':visible') ?
				this[0].offsetWidth - num(this, 'borderLeftWidth') - num(this, 'borderRightWidth') :
				this.width() + num(this, 'paddingLeft') + num(this, 'paddingRight');
	},
	
	/**
	 * Returns the outer height value (including border) for the first matched element.
	 * Cannot be used on document or window.
	 *
	 * @example $("#testdiv").outerHeight()
	 * @result 1000
	 *
	 * @name outerHeight
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	outerHeight: function() {
		return this[0] == window || this[0] == document ?
			this.height() :
			this.is(':visible') ?
				this[0].offsetHeight :
				this.height() + num(this,'borderTopWidth') + num(this, 'borderBottomWidth') + num(this, 'paddingTop') + num(this, 'paddingBottom');
	},
	
	/**
	 * Returns the outer width value (including border) for the first matched element.
	 * Cannot be used on document or window.
	 *
	 * @example $("#testdiv").outerHeight()
	 * @result 1000
	 *
	 * @name outerHeight
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	outerWidth: function() {
		return this[0] == window || this[0] == document ?
			this.width() :
			this.is(':visible') ?
				this[0].offsetWidth :
				this.width() + num(this, 'borderLeftWidth') + num(this, 'borderRightWidth') + num(this, 'paddingLeft') + num(this, 'paddingRight');
	},
	
	/**
	 * Returns how many pixels the user has scrolled to the right (scrollLeft).
	 * Works on containers with overflow: auto and window/document.
	 *
	 * @example $("#testdiv").scrollLeft()
	 * @result 100
	 *
	 * @name scrollLeft
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	/**
	 * Sets the scrollLeft property and continues the chain.
	 * Works on containers with overflow: auto and window/document.
	 *
	 * @example $("#testdiv").scrollLeft(10).scrollLeft()
	 * @result 10
	 *
	 * @name scrollLeft
	 * @param Number value A positive number representing the desired scrollLeft.
	 * @type jQuery
	 * @cat Plugins/Dimensions
	 */
	scrollLeft: function(val) {
		if ( val != undefined )
			// set the scroll left
			return this.each(function() {
				if (this == window || this == document)
					window.scrollTo( val, $(window).scrollTop() );
				else
					this.scrollLeft = val;
			});
		
		// return the scroll left offest in pixels
		if ( this[0] == window || this[0] == document )
			return self.pageXOffset ||
				$.boxModel && document.documentElement.scrollLeft ||
				document.body.scrollLeft;
				
		return this[0].scrollLeft;
	},
	
	/**
	 * Returns how many pixels the user has scrolled to the bottom (scrollTop).
	 * Works on containers with overflow: auto and window/document.
	 *
	 * @example $("#testdiv").scrollTop()
	 * @result 100
	 *
	 * @name scrollTop
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	/**
	 * Sets the scrollTop property and continues the chain.
	 * Works on containers with overflow: auto and window/document.
	 *
	 * @example $("#testdiv").scrollTop(10).scrollTop()
	 * @result 10
	 *
	 * @name scrollTop
	 * @param Number value A positive number representing the desired scrollTop.
	 * @type jQuery
	 * @cat Plugins/Dimensions
	 */
	scrollTop: function(val) {
		if ( val != undefined )
			// set the scroll top
			return this.each(function() {
				if (this == window || this == document)
					window.scrollTo( $(window).scrollLeft(), val );
				else
					this.scrollTop = val;
			});
		
		// return the scroll top offset in pixels
		if ( this[0] == window || this[0] == document )
			return self.pageYOffset ||
				$.boxModel && document.documentElement.scrollTop ||
				document.body.scrollTop;

		return this[0].scrollTop;
	},
	
	/** 
	 * Returns the top and left positioned offset in pixels.
	 * The positioned offset is the offset between a positioned
	 * parent and the element itself.
	 *
	 * @example $("#testdiv").position()
	 * @result { top: 100, left: 100 }
	 * 
	 * @name position
	 * @param Map options Optional settings to configure the way the offset is calculated.
	 * @option Boolean margin Should the margin of the element be included in the calculations? False by default.
	 * @option Boolean border Should the border of the element be included in the calculations? False by default.
	 * @option Boolean padding Should the padding of the element be included in the calculations? False by default.
	 * @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the
	 *                            chain will not be broken and the result will be assigned to this object.
	 * @type Object
	 * @cat Plugins/Dimensions
	 */
	position: function(options, returnObject) {
		var elem = this[0], parent = elem.parentNode, op = elem.offsetParent,
		    options = $.extend({ margin: false, border: false, padding: false, scroll: false }, options || {}),
			x = elem.offsetLeft,
			y = elem.offsetTop, 
			sl = elem.scrollLeft, 
			st = elem.scrollTop;
			
		// Mozilla and IE do not add the border
		if ($.browser.mozilla || $.browser.msie) {
			// add borders to offset
			x += num(elem, 'borderLeftWidth');
			y += num(elem, 'borderTopWidth');
		}

		if ($.browser.mozilla) {
			do {
				// Mozilla does not add the border for a parent that has overflow set to anything but visible
				if ($.browser.mozilla && parent != elem && $.css(parent, 'overflow') != 'visible') {
					x += num(parent, 'borderLeftWidth');
					y += num(parent, 'borderTopWidth');
				}

				if (parent == op) break; // break if we are already at the offestParent
			} while ((parent = parent.parentNode) && (parent.tagName.toLowerCase() != 'body' || parent.tagName.toLowerCase() != 'html'));
		}
		
		var returnValue = handleOffsetReturn(elem, options, x, y, sl, st);
		
		if (returnObject) { $.extend(returnObject, returnValue); return this; }
		else              { return returnValue; }
	},
	
	/**
	 * Returns the location of the element in pixels from the top left corner of the viewport.
	 *
	 * For accurate readings make sure to use pixel values for margins, borders and padding.
	 * 
	 * Known issues:
	 *  - Issue: A div positioned relative or static without any content before it and its parent will report an offsetTop of 0 in Safari
	 *    Workaround: Place content before the relative div ... and set height and width to 0 and overflow to hidden
	 *
	 * @example $("#testdiv").offset()
	 * @result { top: 100, left: 100, scrollTop: 10, scrollLeft: 10 }
	 *
	 * @example $("#testdiv").offset({ scroll: false })
	 * @result { top: 90, left: 90 }
	 *
	 * @example var offset = {}
	 * $("#testdiv").offset({ scroll: false }, offset)
	 * @result offset = { top: 90, left: 90 }
	 *
	 * @name offset
	 * @param Map options Optional settings to configure the way the offset is calculated.
	 * @option Boolean margin Should the margin of the element be included in the calculations? True by default.
	 * @option Boolean border Should the border of the element be included in the calculations? False by default.
	 * @option Boolean padding Should the padding of the element be included in the calculations? False by default.
	 * @option Boolean scroll Should the scroll offsets of the parent elements be included in the calculations? True by default.
	 *                        When true it adds the totla scroll offets of all parents to the total offset and also adds two properties
	 *                        to the returned object, scrollTop and scrollLeft. 
	 * @options Boolean lite Will use offsetLite instead of offset when set to true. False by default.
	 * @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the
	 *                            chain will not be broken and the result will be assigned to this object.
	 * @type Object
	 * @cat Plugins/Dimensions
	 */
	offset: function(options, returnObject) {
		var x = 0, y = 0, sl = 0, st = 0,
		    elem = this[0], parent = this[0], op, parPos, elemPos = $.css(elem, 'position'),
		    mo = $.browser.mozilla, ie = $.browser.msie, sf = $.browser.safari, oa = $.browser.opera,
		    absparent = false, relparent = false, 
		    options = $.extend({ margin: true, border: false, padding: false, scroll: true, lite: false }, options || {});
		
		// Use offsetLite if lite option is true
		if (options.lite) return this.offsetLite(options, returnObject);
		
		if (elem.tagName.toLowerCase() == 'body') {
			// Safari is the only one to get offsetLeft and offsetTop properties of the body "correct"
			// Except they all mess up when the body is positioned absolute or relative
			x = elem.offsetLeft;
			y = elem.offsetTop;
			// Mozilla ignores margin and subtracts border from body element
			if (mo) {
				x += num(elem, 'marginLeft') + (num(elem, 'borderLeftWidth')*2);
				y += num(elem, 'marginTop')  + (num(elem, 'borderTopWidth') *2);
			} else
			// Opera ignores margin
			if (oa) {
				x += num(elem, 'marginLeft');
				y += num(elem, 'marginTop');
			} else
			// IE does not add the border in Standards Mode
			if (ie && jQuery.boxModel) {
				x += num(elem, 'borderLeftWidth');
				y += num(elem, 'borderTopWidth');
			}
		} else {
			do {
				parPos = $.css(parent, 'position');
			
				x += parent.offsetLeft;
				y += parent.offsetTop;

				// Mozilla and IE do not add the border
				if (mo || ie) {
					// add borders to offset
					x += num(parent, 'borderLeftWidth');
					y += num(parent, 'borderTopWidth');

					// Mozilla does not include the border on body if an element isn't positioned absolute and is without an absolute parent
					if (mo && parPos == 'absolute') absparent = true;
					// IE does not include the border on the body if an element is position static and without an absolute or relative parent
					if (ie && parPos == 'relative') relparent = true;
				}

				op = parent.offsetParent;
				if (options.scroll || mo) {
					do {
						if (options.scroll) {
							// get scroll offsets
							sl += parent.scrollLeft;
							st += parent.scrollTop;
						}
				
						// Mozilla does not add the border for a parent that has overflow set to anything but visible
						if (mo && parent != elem && $.css(parent, 'overflow') != 'visible') {
							x += num(parent, 'borderLeftWidth');
							y += num(parent, 'borderTopWidth');
						}
				
						parent = parent.parentNode;
					} while (parent != op);
				}
				parent = op;

				if (parent.tagName.toLowerCase() == 'body' || parent.tagName.toLowerCase() == 'html') {
					// Safari and IE Standards Mode doesn't add the body margin for elments positioned with static or relative
					if ((sf || (ie && $.boxModel)) && elemPos != 'absolute' && elemPos != 'fixed') {
						x += num(parent, 'marginLeft');
						y += num(parent, 'marginTop');
					}
					// Mozilla does not include the border on body if an element isn't positioned absolute and is without an absolute parent
					// IE does not include the border on the body if an element is positioned static and without an absolute or relative parent
					if ( (mo && !absparent && elemPos != 'fixed') || 
					     (ie && elemPos == 'static' && !relparent) ) {
						x += num(parent, 'borderLeftWidth');
						y += num(parent, 'borderTopWidth');
					}
					break; // Exit the loop
				}
			} while (parent);
		}

		var returnValue = handleOffsetReturn(elem, options, x, y, sl, st);

		if (returnObject) { $.extend(returnObject, returnValue); return this; }
		else              { return returnValue; }
	},
	
	/**
	 * Returns the location of the element in pixels from the top left corner of the viewport.
	 * This method is much faster than offset but not as accurate. This method can be invoked
	 * by setting the lite option to true in the offset method.
	 *
	 * @name offsetLite
	 * @param Map options Optional settings to configure the way the offset is calculated.
	 * @option Boolean margin Should the margin of the element be included in the calculations? True by default.
	 * @option Boolean border Should the border of the element be included in the calculations? False by default.
	 * @option Boolean padding Should the padding of the element be included in the calculations? False by default.
	 * @option Boolean scroll Should the scroll offsets of the parent elements be included in the calculations? True by default.
	 *                        When true it adds the totla scroll offets of all parents to the total offset and also adds two properties
	 *                        to the returned object, scrollTop and scrollLeft. 
	 * @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the
	 *                            chain will not be broken and the result will be assigned to this object.
	 * @type Object
	 * @cat Plugins/Dimensions
	 */
	offsetLite: function(options, returnObject) {
		var x = 0, y = 0, sl = 0, st = 0, parent = this[0], op, 
		    options = $.extend({ margin: true, border: false, padding: false, scroll: true }, options || {});
				
		do {
			x += parent.offsetLeft;
			y += parent.offsetTop;

			op = parent.offsetParent;
			if (options.scroll) {
				// get scroll offsets
				do {
					sl += parent.scrollLeft;
					st += parent.scrollTop;
					parent = parent.parentNode;
				} while(parent != op);
			}
			parent = op;
		} while (parent && parent.tagName.toLowerCase() != 'body' && parent.tagName.toLowerCase() != 'html');

		var returnValue = handleOffsetReturn(this[0], options, x, y, sl, st);

		if (returnObject) { $.extend(returnObject, returnValue); return this; }
		else              { return returnValue; }
	}
});

/**
 * Handles converting a CSS Style into an Integer.
 * @private
 */
var num = function(el, prop) {
	return parseInt($.css(el.jquery?el[0]:el,prop))||0;
};

/**
 * Handles the return value of the offset and offsetLite methods.
 * @private
 */
var handleOffsetReturn = function(elem, options, x, y, sl, st) {
	if ( !options.margin ) {
		x -= num(elem, 'marginLeft');
		y -= num(elem, 'marginTop');
	}

	// Safari and Opera do not add the border for the element
	if ( options.border && ($.browser.safari || $.browser.opera) ) {
		x += num(elem, 'borderLeftWidth');
		y += num(elem, 'borderTopWidth');
	} else if ( !options.border && !($.browser.safari || $.browser.opera) ) {
		x -= num(elem, 'borderLeftWidth');
		y -= num(elem, 'borderTopWidth');
	}

	if ( options.padding ) {
		x += num(elem, 'paddingLeft');
		y += num(elem, 'paddingTop');
	}
	
	// do not include scroll offset on the element
	if ( options.scroll ) {
		sl -= elem.scrollLeft;
		st -= elem.scrollTop;
	}

	return options.scroll ? { top: y - st, left: x - sl, scrollTop:  st, scrollLeft: sl }
	                      : { top: y, left: x };
};

})(jQuery);
/*
 * jQuery Tooltip plugin 1.3
 *
 * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
 * http://docs.jquery.com/Plugins/Tooltip
 *
 * Copyright (c) 2006 - 2008 Jörn Zaefferer
 *
 * $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $
 * 
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */;(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked;}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt="";}).mouseover(save).mouseout(hide).click(hide);},fixPNG:IE?function(){return this.each(function(){var image=$(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css('position');if(position!='absolute'&&position!='relative')$(this).css('position','relative');});}});}:function(){return this;},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]();});},url:function(){return this.attr('href')||this.attr('src');}});function createHelper(settings){if(helper.parent)return;helper.parent=$('<div id="'+settings.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)helper.parent.bgiframe();helper.title=$('h3',helper.parent);helper.body=$('div.body',helper.parent);helper.url=$('div.url',helper.parent);}function settings(element){return $.data(element,"tooltip");}function handle(event){if(settings(this).delay)tID=setTimeout(show,settings(this).delay);else
show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(event);}function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent);}helper.body.show();}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)helper.body.append("<br/>");helper.body.append(part);}helper.body.hideWhenEmpty();}else{helper.title.html(title).show();helper.body.hide();}if(settings(this).showURL&&$(this).url())helper.url.html($(this).url().replace('http://','')).show();else
helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)helper.parent.fixPNG();handle.apply(this,arguments);}function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else
helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}update();}function update(event){if($.tooltip.blocked)return;if(event&&event.target.tagName=="OPTION"){return;}if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}if(current==null){$(document.body).unbind('mousemove',update);return;}helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto';}helper.parent.css({left:left,right:right,top:top});}var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()};}function hide(event){if($.tooltip.blocked)return;if(tID)clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}if((!IE||!$.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))helper.parent.stop().fadeTo(tsettings.fade,0,complete);else
helper.parent.stop().fadeOut(tsettings.fade,complete);}else
complete();if(settings(this).fixPNG)helper.parent.unfixPNG();}})(jQuery);
/**
 * jQuery lightBox plugin
 * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
 * and adapted to me for use like a plugin from jQuery.
 * @name jquery-lightbox-0.4.pack.js
 * @author Leandro Vieira Pinho - http://leandrovieira.com
 * @version 0.4
 * @date November 17, 2007
 * @category jQuery plugin
 * @copyright (c) 2007 Leandro Vieira Pinho (leandrovieira.com)
 * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US
 * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.2L.3f=6(4){4=1W.2F({2x:\'#32\',2e:0.8,1O:\'V/5-3e-T.Z\',2i:\'V/5-1t-2S.Z\',23:\'V/5-1t-2O.Z\',1V:\'V/5-1t-2I.Z\',19:\'V/5-2G.Z\',17:10,1I:2B,2z:\'1f\',2p:\'33\',2m:\'c\',2h:\'p\',2c:\'n\',h:[],9:0},4);f E=C;6 20(){1Z(C,E);D 1g}6 1Z(1a,E){$(\'1R, 1Q, 1N\').k({\'1M\':\'2D\'});1K();4.h.y=0;4.9=0;7(E.y==1){4.h.1F(u 1h(1a.16(\'H\'),1a.16(\'2v\')))}m{36(f i=0;i<E.y;i++){4.h.1F(u 1h(E[i].16(\'H\'),E[i].16(\'2v\')))}}2n(4.h[4.9][0]!=1a.16(\'H\')){4.9++}J()}6 1K(){$(\'l\').31(\'<e g="r-N"></e><e g="r-5"><e g="5-t-d-v"><e g="5-t-d"><1s g="5-d"><e 2V="" g="5-j"><a H="#" g="5-j-13"></a><a H="#" g="5-j-X"></a></e><e g="5-T"><a H="#" g="5-T-25"><1s P="\'+4.1O+\'"></a></e></e></e><e g="5-t-d-Y-v"><e g="5-t-d-Y"><e g="5-d-F"><1c g="5-d-F-1p"></1c><1c g="5-d-F-1o"></1c></e><e g="5-1B"><a H="#" g="5-1B-1Y"><1s P="\'+4.1V+\'"></a></e></e></e></e>\');f w=1m();$(\'#r-N\').k({2J:4.2x,2H:4.2e,Q:w[0],I:w[1]}).1S();f L=1l();$(\'#r-5\').k({1P:L[1]+(w[3]/10),1k:L[0]}).B();$(\'#r-N,#r-5\').K(6(){18()});$(\'#5-T-25,#5-1B-1Y\').K(6(){18();D 1g});$(A).2E(6(){f w=1m();$(\'#r-N\').k({Q:w[0],I:w[1]});f L=1l();$(\'#r-5\').k({1P:L[1]+(w[3]/10),1k:L[0]})})}6 J(){$(\'#5-T\').B();$(\'#5-d,#5-j,#5-j-13,#5-j-X,#5-t-d-Y-v,#5-d-F-1o\').1j();f M=u 1f();M.1L=6(){$(\'#5-d\').2C(\'P\',4.h[4.9][0]);1J(M.Q,M.I);M.1L=6(){}};M.P=4.h[4.9][0]};6 1J(1n,1i){f 1H=$(\'#5-t-d-v\').Q();f 1G=$(\'#5-t-d-v\').I();f 1q=(1n+(4.17*2));f 1r=(1i+(4.17*2));f 1E=1H-1q;f 26=1G-1r;$(\'#5-t-d-v\').3d({Q:1q,I:1r},4.1I,6(){2y()});7((1E==0)&&(26==0)){7($.3c.3b){1C(3a)}m{1C(38)}}$(\'#5-j-13,#5-j-X\').k({I:1i+(4.17*2)});$(\'#5-t-d-Y-v\').k({Q:1n})};6 2y(){$(\'#5-T\').1j();$(\'#5-d\').1S(6(){2u();2s()});2r()};6 2u(){$(\'#5-t-d-Y-v\').35(\'34\');$(\'#5-d-F-1p\').1j();7(4.h[4.9][1]){$(\'#5-d-F-1p\').2o(4.h[4.9][1]).B()}7(4.h.y>1){$(\'#5-d-F-1o\').2o(4.2z+\' \'+(4.9+1)+\' \'+4.2p+\' \'+4.h.y).B()}}6 2s(){$(\'#5-j\').B();$(\'#5-j-13,#5-j-X\').k({\'11\':\'1y U(\'+4.19+\') 12-14\'});7(4.9!=0){$(\'#5-j-13\').1d().2l(6(){$(C).k({\'11\':\'U(\'+4.2i+\') 1k 15% 12-14\'})},6(){$(C).k({\'11\':\'1y U(\'+4.19+\') 12-14\'})}).B().2k(\'K\',6(){4.9=4.9-1;J();D 1g})}7(4.9!=(4.h.y-1)){$(\'#5-j-X\').1d().2l(6(){$(C).k({\'11\':\'U(\'+4.23+\') 30 15% 12-14\'})},6(){$(C).k({\'11\':\'1y U(\'+4.19+\') 12-14\'})}).B().2k(\'K\',6(){4.9=4.9+1;J();D 1g})}2j()}6 2j(){$(b).2Z(6(O){2g(O)})}6 1w(){$(b).1d()}6 2g(O){7(O==2f){S=2Y.2d;1u=27}m{S=O.2d;1u=O.2X}W=2W.2U(S).2T();7((W==4.2m)||(W==\'x\')||(S==1u)){18()}7((W==4.2h)||(S==37)){7(4.9!=0){4.9=4.9-1;J();1w()}}7((W==4.2c)||(S==39)){7(4.9!=(4.h.y-1)){4.9=4.9+1;J();1w()}}}6 2r(){7((4.h.y-1)>4.9){2a=u 1f();2a.P=4.h[4.9+1][0]}7(4.9>0){29=u 1f();29.P=4.h[4.9-1][0]}}6 18(){$(\'#r-5\').28();$(\'#r-N\').2R(6(){$(\'#r-N\').28()});$(\'1R, 1Q, 1N\').k({\'1M\':\'2Q\'})}6 1m(){f q,o;7(A.1b&&A.24){q=A.22+A.2P;o=A.1b+A.24}m 7(b.l.21>b.l.2b){q=b.l.2N;o=b.l.21}m{q=b.l.2M;o=b.l.2b}f z,G;7(R.1b){7(b.s.1e){z=b.s.1e}m{z=R.22}G=R.1b}m 7(b.s&&b.s.1v){z=b.s.1e;G=b.s.1v}m 7(b.l){z=b.l.1e;G=b.l.1v}7(o<G){1x=G}m{1x=o}7(q<z){1A=q}m{1A=z}1X=u 1h(1A,1x,z,G);D 1X};6 1l(){f q,o;7(R.2A){o=R.2A;q=R.2K}m 7(b.s&&b.s.1z){o=b.s.1z;q=b.s.2t}m 7(b.l){o=b.l.1z;q=b.l.2t}2q=u 1h(q,o);D 2q};6 1C(1U){f 2w=u 1T();1D=2f;3g{f 1D=u 1T()}2n(1D-2w<1U)};D C.1d(\'K\').K(20)}})(1W);',62,203,'||||settings|lightbox|function|if||activeImage||document||image|div|var|id|imageArray||nav|css|body|else||yScroll||xScroll|jquery|documentElement|container|new|box|arrPageSizes||length|windowWidth|window|show|this|return|jQueryMatchedObj|details|windowHeight|href|height|_set_image_to_view|click|arrPageScroll|objImagePreloader|overlay|objEvent|src|width|self|keycode|loading|url|images|key|btnNext|data|gif||background|no|btnPrev|repeat||getAttribute|containerBorderSize|_finish|imageBlank|objClicked|innerHeight|span|unbind|clientWidth|Image|false|Array|intImageHeight|hide|left|___getPageScroll|___getPageSize|intImageWidth|currentNumber|caption|intWidth|intHeight|img|btn|escapeKey|clientHeight|_disable_keyboard_navigation|pageHeight|transparent|scrollTop|pageWidth|secNav|___pause|curDate|intDiffW|push|intCurrentHeight|intCurrentWidth|containerResizeSpeed|_resize_container_image_box|_set_interface|onload|visibility|select|imageLoading|top|object|embed|fadeIn|Date|ms|imageBtnClose|jQuery|arrayPageSize|btnClose|_start|_initialize|scrollHeight|innerWidth|imageBtnNext|scrollMaxY|link|intDiffH||remove|objPrev|objNext|offsetHeight|keyToNext|keyCode|overlayOpacity|null|_keyboard_action|keyToPrev|imageBtnPrev|_enable_keyboard_navigation|bind|hover|keyToClose|while|html|txtOf|arrayPageScroll|_preload_neighbor_images|_set_navigation|scrollLeft|_show_image_data|title|date|overlayBgColor|_show_image|txtImage|pageYOffset|400|attr|hidden|resize|extend|blank|opacity|close|backgroundColor|pageXOffset|fn|offsetWidth|scrollWidth|next|scrollMaxX|visible|fadeOut|prev|toLowerCase|fromCharCode|style|String|DOM_VK_ESCAPE|event|keydown|right|append|000|of|fast|slideDown|for||100||250|msie|browser|animate|ico|lightBox|do'.split('|'),0,{}));
/*
 * FancyBox - simple jQuery plugin for fancy image zooming
 * Examples and documentation at: http://fancy.klade.lv/
 * Version: 1.0.0 (29/04/2008)
 * Copyright (c) 2008 Janis Skarnelis
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
 * Requires: jQuery v1.2.1 or later
*/
(function($) {
	var opts = {}, 
		imgPreloader = new Image, imgTypes = ['png', 'jpg', 'jpeg', 'gif'], 
		loadingTimer, loadingFrame = 1;

   $.fn.fancybox = function(settings) {
		opts.settings = $.extend({}, $.fn.fancybox.defaults, settings);

		$.fn.fancybox.init();

		return this.each(function() {
			var $this = $(this);
			var o = $.metadata ? $.extend({}, opts.settings, $this.metadata()) : opts.settings;

			$this.unbind('click').click(function() {
				$.fn.fancybox.start(this, o); return false;
			});
		});
	};

	$.fn.fancybox.start = function(el, o) {
		if (opts.animating) return false;

		if (o.overlayShow) {
			$("#fancy_wrap").prepend('<div id="fancy_overlay"></div>');
			$("#fancy_overlay").css({'width': $(window).width(), 'height': $(document).height(), 'opacity': o.overlayOpacity});

			if ($.browser.msie) {
				$("#fancy_wrap").prepend('<iframe id="fancy_bigIframe" scrolling="no" frameborder="0"></iframe>');
				$("#fancy_bigIframe").css({'width': $(window).width(), 'height': $(document).height(), 'opacity': 0});
			}

			$("#fancy_overlay").click($.fn.fancybox.close);
		}

		opts.itemArray	= [];
		opts.itemNum	= 0;

		if (jQuery.isFunction(o.itemLoadCallback)) {
		   o.itemLoadCallback.apply(this, [opts]);

			var c	= $(el).children("img:first").length ? $(el).children("img:first") : $(el);
			var tmp	= {'width': c.width(), 'height': c.height(), 'pos': $.fn.fancybox.getPosition(c)}

		   for (var i = 0; i < opts.itemArray.length; i++) {
				opts.itemArray[i].o = $.extend({}, o, opts.itemArray[i].o);
				
				if (o.zoomSpeedIn > 0 || o.zoomSpeedOut > 0) {
					opts.itemArray[i].orig = tmp;
				}
		   }

		} else {
			if (!el.rel || el.rel == '') {
				var item = {url: el.href, title: el.title, o: o};

				if (o.zoomSpeedIn > 0 || o.zoomSpeedOut > 0) {
					var c = $(el).children("img:first").length ? $(el).children("img:first") : $(el);
					item.orig = {'width': c.width(), 'height': c.height(), 'pos': $.fn.fancybox.getPosition(c)}
				}

				opts.itemArray.push(item);

			} else {
				var arr	= $("a[@rel=" + el.rel + "]").get();

				for (var i = 0; i < arr.length; i++) {
					var tmp		= $.metadata ? $.extend({}, o, $(arr[i]).metadata()) : o;
   					var item	= {url: arr[i].href, title: arr[i].title, o: tmp};

   					if (o.zoomSpeedIn > 0 || o.zoomSpeedOut > 0) {
						var c = $(arr[i]).children("img:first").length ? $(arr[i]).children("img:first") : $(el);

						item.orig = {'width': c.width(), 'height': c.height(), 'pos': $.fn.fancybox.getPosition(c)}
					}

					if (arr[i].href == el.href) opts.itemNum = i;

					opts.itemArray.push(item);
				}
			}
		}

		$.fn.fancybox.changeItem(opts.itemNum);
	};

	$.fn.fancybox.changeItem = function(n) {
		$.fn.fancybox.showLoading();

		opts.itemNum = n;

		$("#fancy_nav").empty();
		$("#fancy_outer").stop();
		$("#fancy_title").hide();
		$(document).unbind("keydown");

		imgRegExp = imgTypes.join('|');
    	imgRegExp = new RegExp('\.' + imgRegExp + '$', 'i');

		var url = opts.itemArray[n].url;

		if (url.match(/#/)) {
			var target = window.location.href.split('#')[0]; target = url.replace(target,'');

	        $.fn.fancybox.showItem('<div id="fancy_div">' + $(target).html() + '</div>');

	        $("#fancy_loading").hide();

		} else if (url.match(imgRegExp)) {
			$(imgPreloader).unbind('load').bind('load', function() {
				$("#fancy_loading").hide();

				opts.itemArray[n].o.frameWidth	= imgPreloader.width;
				opts.itemArray[n].o.frameHeight	= imgPreloader.height;

				$.fn.fancybox.showItem('<img id="fancy_img" src="' + imgPreloader.src + '" />');

			}).attr('src', url + '?rand=' + Math.floor(Math.random() * 999999999) );

		} else {
			$.fn.fancybox.showItem('<iframe id="fancy_frame" onload="$.fn.fancybox.showIframe()" name="fancy_iframe' + Math.round(Math.random()*1000) + '" frameborder="0" hspace="0" src="' + url + '"></iframe>');
		}
	};

	$.fn.fancybox.showIframe = function() {
		$("#fancy_loading").hide();
		$("#fancy_frame").show();
	};

	$.fn.fancybox.showItem = function(val) {
		$.fn.fancybox.preloadNeighborImages();

		var viewportPos	= $.fn.fancybox.getViewport();
		var itemSize	= $.fn.fancybox.getMaxSize(viewportPos[0] - 50, viewportPos[1] - 100, opts.itemArray[opts.itemNum].o.frameWidth, opts.itemArray[opts.itemNum].o.frameHeight);

		var itemLeft	= viewportPos[2] + Math.round((viewportPos[0] - itemSize[0]) / 2) - 20;
		var itemTop		= viewportPos[3] + Math.round((viewportPos[1] - itemSize[1]) / 2) - 40;

		var itemOpts = {
			'left':		itemLeft, 
			'top':		itemTop, 
			'width':	itemSize[0] + 'px', 
			'height':	itemSize[1] + 'px'	
		}

		if (opts.active) {
			$('#fancy_content').fadeOut("normal", function() {
				$("#fancy_content").empty();
				
				$("#fancy_outer").animate(itemOpts, "normal", function() {
					$("#fancy_content").append($(val)).fadeIn("normal");
					$.fn.fancybox.updateDetails();
				});
			});

		} else {
			opts.active = true;

			$("#fancy_content").empty();

			if ($("#fancy_content").is(":animated")) {
				console.info('animated!');
			}

			if (opts.itemArray[opts.itemNum].o.zoomSpeedIn > 0) {
				opts.animating		= true;
				itemOpts.opacity	= "show";

				$("#fancy_outer").css({
					'top':		opts.itemArray[opts.itemNum].orig.pos.top - 18,
					'left':		opts.itemArray[opts.itemNum].orig.pos.left - 18,
					'height':	opts.itemArray[opts.itemNum].orig.height,
					'width':	opts.itemArray[opts.itemNum].orig.width
				});

				$("#fancy_content").append($(val)).show();

				$("#fancy_outer").animate(itemOpts, opts.itemArray[opts.itemNum].o.zoomSpeedIn, function() {
					opts.animating = false;
					$.fn.fancybox.updateDetails();
				});

			} else {
				$("#fancy_content").append($(val)).show();
				$("#fancy_outer").css(itemOpts).show();
				$.fn.fancybox.updateDetails();
			}
		 }
	};

	$.fn.fancybox.updateDetails = function() {
		$("#fancy_bg,#fancy_close").show();

		if (opts.itemArray[opts.itemNum].title !== undefined && opts.itemArray[opts.itemNum].title !== '') {
			$('#fancy_title div').html(opts.itemArray[opts.itemNum].title);
			$('#fancy_title').show();
		}

		if (opts.itemArray[opts.itemNum].o.hideOnContentClick) {
			$("#fancy_content").click($.fn.fancybox.close);
		} else {
			$("#fancy_content").unbind('click');
		}

		if (opts.itemNum != 0) {
			$("#fancy_nav").append('<a id="fancy_left" href="javascript:;"></a>');

			$('#fancy_left').click(function() {
				$.fn.fancybox.changeItem(opts.itemNum - 1); return false;
			});
		}

		if (opts.itemNum != (opts.itemArray.length - 1)) {
			$("#fancy_nav").append('<a id="fancy_right" href="javascript:;"></a>');
			
			$('#fancy_right').click(function(){
				$.fn.fancybox.changeItem(opts.itemNum + 1); return false;
			});
		}

		$(document).keydown(function(event) {
			if (event.keyCode == 27) {
            	$.fn.fancybox.close();

			} else if(event.keyCode == 37 && opts.itemNum != 0) {
            	$.fn.fancybox.changeItem(opts.itemNum - 1);

			} else if(event.keyCode == 39 && opts.itemNum != (opts.itemArray.length - 1)) {
            	$.fn.fancybox.changeItem(opts.itemNum + 1);
			}
		});
	};

	$.fn.fancybox.preloadNeighborImages = function() {
		if ((opts.itemArray.length - 1) > opts.itemNum) {
			preloadNextImage = new Image();
			preloadNextImage.src = opts.itemArray[opts.itemNum + 1].url;
		}

		if (opts.itemNum > 0) {
			preloadPrevImage = new Image();
			preloadPrevImage.src = opts.itemArray[opts.itemNum - 1].url;
		}
	};

	$.fn.fancybox.close = function() {
		if (opts.animating) return false;

		$(imgPreloader).unbind('load');
		$(document).unbind("keydown");

		$("#fancy_loading,#fancy_title,#fancy_close,#fancy_bg").hide();

		$("#fancy_nav").empty();

		opts.active	= false;

		if (opts.itemArray[opts.itemNum].o.zoomSpeedOut > 0) {
			var itemOpts = {
				'top':		opts.itemArray[opts.itemNum].orig.pos.top - 18,
				'left':		opts.itemArray[opts.itemNum].orig.pos.left - 18,
				'height':	opts.itemArray[opts.itemNum].orig.height,
				'width':	opts.itemArray[opts.itemNum].orig.width,
				'opacity':	'hide'
			};

			opts.animating = true;

			$("#fancy_outer").animate(itemOpts, opts.itemArray[opts.itemNum].o.zoomSpeedOut, function() {
				$("#fancy_content").hide().empty();
				$("#fancy_overlay,#fancy_bigIframe").remove();
				opts.animating = false;
			});

		} else {
			$("#fancy_outer").hide();
			$("#fancy_content").hide().empty();
			$("#fancy_overlay,#fancy_bigIframe").fadeOut("fast").remove();
		}
	};

	$.fn.fancybox.showLoading = function() {
		clearInterval(loadingTimer);

		var pos = $.fn.fancybox.getViewport();

		$("#fancy_loading").css({'left': ((pos[0] - 40) / 2 + pos[2]), 'top': ((pos[1] - 40) / 2 + pos[3])}).show();
		$("#fancy_loading").bind('click', $.fn.fancybox.close);
		
		loadingTimer = setInterval($.fn.fancybox.animateLoading, 66);
	};

	$.fn.fancybox.animateLoading = function(el, o) {
		if (!$("#fancy_loading").is(':visible')){
			clearInterval(loadingTimer);
			return;
		}

		$("#fancy_loading > div").css('top', (loadingFrame * -40) + 'px');

		loadingFrame = (loadingFrame + 1) % 12;
	};

	$.fn.fancybox.init = function() {
		if (!$('#fancy_wrap').length) {
			$('<div id="fancy_wrap"><div id="fancy_loading"><div></div></div><div id="fancy_outer"><div id="fancy_inner"><div id="fancy_nav"></div><div id="fancy_close"></div><div id="fancy_content"></div><div id="fancy_title"></div></div></div></div>').appendTo("body");
			$('<div id="fancy_bg"><div class="fancy_bg fancy_bg_n"></div><div class="fancy_bg fancy_bg_ne"></div><div class="fancy_bg fancy_bg_e"></div><div class="fancy_bg fancy_bg_se"></div><div class="fancy_bg fancy_bg_s"></div><div class="fancy_bg fancy_bg_sw"></div><div class="fancy_bg fancy_bg_w"></div><div class="fancy_bg fancy_bg_nw"></div></div>').prependTo("#fancy_inner");
			
			$('<table cellspacing="0" cellpadding="0" border="0"><tr><td id="fancy_title_left"></td><td id="fancy_title_main"><div></div></td><td id="fancy_title_right"></td></tr></table>').appendTo('#fancy_title');
		}

		if ($.browser.msie) {
			$("#fancy_inner").prepend('<iframe id="fancy_freeIframe" scrolling="no" frameborder="0"></iframe>');
		}

		if (jQuery.fn.pngFix) $(document).pngFix();

    	$("#fancy_close").click($.fn.fancybox.close);
	};

	$.fn.fancybox.getPosition = function(el) {
		var pos = el.offset();

		pos.top	+= $.fn.fancybox.num(el, 'paddingTop');
		pos.top	+= $.fn.fancybox.num(el, 'borderTopWidth');

 		pos.left += $.fn.fancybox.num(el, 'paddingLeft');
		pos.left += $.fn.fancybox.num(el, 'borderLeftWidth');

		return pos;
	};

	$.fn.fancybox.num = function (el, prop) {
		return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;
	};

	$.fn.fancybox.getPageScroll = function() {
		var xScroll, yScroll;

		if (self.pageYOffset) {
			yScroll = self.pageYOffset;
			xScroll = self.pageXOffset;
		} else if (document.documentElement && document.documentElement.scrollTop) {
			yScroll = document.documentElement.scrollTop;
			xScroll = document.documentElement.scrollLeft;
		} else if (document.body) {
			yScroll = document.body.scrollTop;
			xScroll = document.body.scrollLeft;	
		}

		return [xScroll, yScroll]; 
	};

	$.fn.fancybox.getViewport = function() {
		var scroll = $.fn.fancybox.getPageScroll();

		return [$(window).width(), $(window).height(), scroll[0], scroll[1]];
	};

	$.fn.fancybox.getMaxSize = function(maxWidth, maxHeight, imageWidth, imageHeight) {
		var r = Math.min(Math.min(maxWidth, imageWidth) / imageWidth, Math.min(maxHeight, imageHeight) / imageHeight);

		return [Math.round(r * imageWidth), Math.round(r * imageHeight)];
	};

	$.fn.fancybox.defaults = {
		hideOnContentClick:	false,
		zoomSpeedIn:		500,
		zoomSpeedOut:		500,
		frameWidth:			600,
		frameHeight:		400,
		overlayShow:		false,
		overlayOpacity:		0.8,
		itemLoadCallback:	null
	};
})(jQuery);
(function($){$.browserTest=function(a,z){var u='unknown',x='X',m=function(r,h){for(var i=0;i<h.length;i=i+1){r=r.replace(h[i][0],h[i][1]);}return r;},c=function(i,a,b,c){var r={name:m((a.exec(i)||[u,u])[1],b)};r[r.name]=true;r.version=(c.exec(i)||[x,x,x,x])[3];if(r.name.match(/safari/)&&r.version>400){r.version='2.0';}if(r.name==='presto'){r.version=($.browser.version>9.27)?'futhark':'linear_b';}r.versionNumber=parseFloat(r.version,10)||0;r.versionX=(r.version!==x)?(r.version+'').substr(0,1):x;r.className=r.name+r.versionX;return r;};a=(a.match(/Opera|Navigator|Minefield|KHTML|Chrome/)?m(a,[[/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/,''],['Chrome Safari','Chrome'],['KHTML','Konqueror'],['Minefield','Firefox'],['Navigator','Netscape']]):a).toLowerCase();$.browser=$.extend((!z)?$.browser:{},c(a,/(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari)/,[],/(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari)(\/|\s)([a-z0-9\.\+]*?)(\;|dev|rel|\s|$)/));$.layout=c(a,/(gecko|konqueror|msie|opera|webkit)/,[['konqueror','khtml'],['msie','trident'],['opera','presto']],/(applewebkit|rv|konqueror|msie)(\:|\/|\s)([a-z0-9\.]*?)(\;|\)|\s)/);$.os={name:(/(win|mac|linux|sunos|solaris|iphone)/.exec(navigator.platform.toLowerCase())||[u])[0].replace('sunos','solaris')};if(!z){$('html').addClass([$.os.name,$.browser.name,$.browser.className,$.layout.name,$.layout.className].join(' '));}};$.browserTest(navigator.userAgent);})(jQuery);
var geocoder;
var map;
var address = "burgschmietstr 10 910419 nuernberg";
var icon; 


  
function googleLoad()
{
	map = new GMap2(document.getElementById("map"));
	map.addControl(new GSmallMapControl());
	geocoder = new GClientGeocoder();
	geocoder.getLocations(address, addToMap);
	$("#map > div").css("height","440px");
}
     
function addToMap(response)
{
	place = response.Placemark[0];
	point = new GLatLng(place.Point.coordinates[1],
	place.Point.coordinates[0]);     
	map.setCenter(point, 13);     
	marker = new GMarker(point);     
	map.addOverlay(new GMarker(point, icon));
	$("#mtgt_unnamed_0").css("border-left","2px solid #1b4c98").css("padding-bottom","60px");

}
String.prototype["r"] = function()
{
	var txt = this;
	for (var i=0;i<arguments.length;i++)
	{
		var re = new RegExp("%"+ i,"gi");
		txt = txt.replace(re,arguments[i]);
	}
	return txt;
};
	


String.prototype["htmlEncode"] = function()
{
	var txt = this.replace(/</gi,"&lt;").replace(/>/gi,"&gt;");
	return txt;
};
	


/*
 * Form Validation: jQuery form validation plug-in v1.1.1
 *
 * http://bassistance.de/jquery-plugins/jquery-plugin-validation/
 *
 * Copyright (c) 2006 J�rn Zaefferer
 *
 * $Id: jquery.validate.js 3675 2007-10-18 09:32:44Z joern.zaefferer $
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('8.I(8.2u,{4E:6(c){k b=1t 8.B(c,5[0]);j(b.h.28){5.24("1r.4e:1T").2M(6(){b.1N=x});5.1T(6(a){j(b.h.1H)a.3I();6 1B(){j(b.h.2h){b.h.2h.E(b,b.W);7 Q}7 x}j(b.1N){b.1N=Q;7 1B()}j(b.1d()){7 1B()}1X{b.1a();7 Q}})}7 b},F:6(t){7 5.4b(8.48(5.47(),t))}});8.I(8.45[":"],{42:"!8.1h(a.u)",40:"!!8.1h(a.u)",3Y:"!a.2y"});C.L=6(c,b){j(19.q==1)7 6(){k a=8.2p(19);a.3z(c);7 C.L.3w(5,a)};j(19.q>2&&b.1x!=2v){b=8.2p(19).3n(1)}j(b.1x!=2v){b=[b]}8.1F(b,6(i,n){c=c.27(1t 25("\\\\{"+i+"\\\\}","g"),n)});7 c};8.B=6(b,a){5.h=8.I({},8.B.23,b);5.W=a;5.1p=5.h.1Z;5.31=5.1p.q&&5.1p||8(a);5.1Y=5.h.32.4h(5.h.1Z);5.T={};5.X={};5.13();5.2R()};8.I(8.B,{23:{15:{},K:"1S",1I:"44",1a:x,32:8([]),1Z:8([]),28:x,2L:[],1Q:6(a){j(!5.P(a)&&(a.l N 5.T||!5.p(a))){5.z(a)}},1K:6(a){j(a.l N 5.T||a==5.2E){5.z(a)}},1J:6(a){j(a.l N 5.T)5.z(a)}},3X:6(a){8.I(8.B.23,a)},15:{p:"3W 3T 3S p.",21:"s r a G 21 3K.",2t:"s r a G 3H.",16:"s r a G 16.",2r:"s r a G 16 (3F).",2o:"2n 2l 2i 1R 3u 3s 1R.",1y:"s r a G 1y.",2f:"2n 2l 2i 3q 3o 1R.",1E:"s r 3m 1E",2b:"s r a G 3j 3i.",2a:"s r 2x 3f u 3e.",26:"s r a u 3c a G 3b.",37:C.L("s r a u 35 4y 22 {0} 20."),33:C.L("s r a u 4q 4p 4o {0} 20."),30:C.L("s r a u 2Y {0} 2X {1} 20 4k."),34:C.L("s r a u 2Y {0} 2X {1}."),38:C.L("s r a u 4f 22 2W 2V 2U {0}."),2T:C.L("s r a u 4a 22 2W 2V 2U {0}.")},49:{1d:6(){5.1V();y(k i=0;5.J[i];i++){5.1n(5.J[i])}8.I(5.T,5.S);5.X=8.I({},5.S);5.h.2Q&&5.h.2Q.E(5);5.11();7 5.G()},z:6(a){a=5.1l(a);5.2E=a;5.2P(a);k b=5.1n(a);j(b){46 5.X[a.l]}1X{5.X[a.l]=x}5.11();7 b},11:6(b){j(b){8.I(5.S,b);y(l N b){5.v.F({1j:b[l],z:8("[@l=\'"+l+"\']:43",5.W)[0]})}5.R=8.2J(5.R,6(a){7!(a.l N b)})}5.h.11?5.h.11.E(5,5.S,5.v):5.2I()},1P:6(){j(8.2u.1P)8(5.W).1P();5.1V();5.1O();5.J.1g(5.h.K)},41:6(){k a=0;y(i N 5.X)a++;7 a},1O:6(){5.1M(5.U).1L()},G:6(){7 5.2G()==0},2G:6(){7 5.v.q},1a:6(){j(5.h.1a){2F{8(5.2S()||5.v.q&&5.v[0].z||[]).1m(":3Z").2D()}2C(e){}}},2S:6(){k a=5.2B;7 a&&8.2J(5.v,6(n){7 n.z.l==a.l}).q==1&&a},2R:6(){k a=5;a.1o={};6 2Z(){a.2B=5;j(a.h.3V&&!a.3U){8(5).1g(a.h.K);a.1e(5).1L()}}5.J=8(5.W).24("1r, 1q, 3R").1u(":1T, :13").1u("[@3P]").1u(5.h.2L).1m(6(){!5.l&&a.h.1H&&2w.1b&&1b.1S("%o 3N 35 l 3M",5);j(5.l N a.1o||!a.Z(5).q)7 Q;a.1o[5.l]=a.Z(5);7 x});5.J.2D(2Z);a.h.1Q&&a.J.3L(6(){a.h.1Q.E(a,5)});a.h.1K&&a.J.3J(6(){a.h.1K.E(a,5)});j(a.h.1J){k b=8([]);a.J.1F(6(){j(a.P(5))b.F(a.1v(5))});b.2M(6(){a.h.1J.E(a,5)})}},1l:6(a){7 8(a)[0]},1D:6(){7 8(5.h.1I+"."+5.h.K,5.31)},13:6(a){5.R=[];5.v=[];5.S={};5.V=8([]);5.U=8([])},1V:6(){5.13();5.U=5.1D().F(5.1Y)},2P:6(a){5.13();5.U=5.1e(5.1l(a))},1n:6(c){c=5.1l(c);8(c).1g(5.h.K);k a=5.1o[c.l];y(k i=0;a[i];i++){k b=a[i];2F{k d=8.B.1k[b.14].E(5,8.1h(c.u),c,b.1C);j(d===-1)3G;j(!d){8(c).18(5.h.K);5.2q(b,c);7 Q}}2C(e){5.h.1H&&2w.1b&&1b.1S("3E 3D 3A 3y z "+c.2m+", 1n 2x \'"+b.14+"\' 14");3x e;}}j(a.q&&5.h.Y)5.R.F(c);7 x},2k:6(a,b){k m=5.h.15[a];7 m&&(m.1x==C?m:m[b])},2g:6(a,b){7 5.2k(a.l,b)||a.3v||8.B.15[b]||"<2j>3t: 3B 1j 3C y "+a.l+"</2j>"},2q:6(a,b){k c=5.2g(b,a.14);j(O c=="6")c=c.E(5,a.1C,b);5.v.F({1j:c,z:b});5.S[b.l]=c;5.T[b.l]=c},1M:6(a){j(5.h.1c)a.F(a.3r(5.h.1c));7 a},2I:6(){y(k i=0;5.v[i];i++){k a=5.v[i];5.1w(a.z,a.1j)}j(5.v.q){5.V.F(5.1Y)}y(k i=0;5.R[i];i++){5.1w(5.R[i])}5.U=5.U.1u(5.V);5.1O();5.1M(5.V).2e()},1w:6(a,c){k b=5.1e(a);j(b.q){b.1g().18(5.h.K);j(5.h.3p||b.2d("2s")){b.2c(c)}}1X{b=8("<"+5.h.1I+"/>").2d({"y":5.1G(a),2s:x}).18(5.h.K).2c(c||"");j(5.h.1c){b=b.1L().2e().3l("<"+5.h.1c+">").3O()}j(!5.1p.3k(b).q)5.h.3a?5.h.3a(b,8(a)):b.3Q(a)}j(!c&&5.h.Y){b.2O("");O 5.h.Y=="17"?b.18(5.h.Y):5.h.Y(b)}5.V.F(b)},1e:6(a){7 5.1D().1m("[@y=\'"+5.1G(a)+"\']")},1G:6(a){7 5.P(a)?a.l:a.2m||a.l},Z:6(e){k d=5.1f(e);j(!d)7[];k c=[];j(O d=="17"){k f={};f[d]=x;d=f}8.1F(d,6(b,a){c[c.q]={14:b,1C:a}});7 c},1f:6(a){7 5.h.Z?5.h.Z[a.l]:5.h.29?8(a).1f()[5.h.29]:8(a).1f()},P:6(a){7/3h|3g/i.H(a.2z)},1v:6(a){7 8(a.1d||3d).24(\'[@l="\'+a.l+\'"]\')},12:6(a,b){2A(b.2N.2H()){1i\'1q\':7 8("2K:39",b).q;1i\'1r\':j(5.P(b))7 5.1v(b).1m(\':2y\').q}7 a.q},36:6(b,a){7 5.1U[O b]?5.1U[O b](b,a):x},1U:{"4D":6(b,a){7 b},"17":6(b,a){7!!8(b,a.1d).q},"6":6(b,a){7 b(a)}},p:6(a){7!8.B.1k.p.E(5,8.1h(a.u),a)}},1k:{p:6(b,c,a){j(!5.36(a,c))7-1;2A(c.2N.2H()){1i\'1q\':k d=8("2K:39",c);7 d.q>0&&(c.2z=="1q-4C"||(8.4x.4w&&!(d[0].4v[\'u\'].4u)?d[0].2O:d[0].u).q>0);1i\'1r\':j(5.P(c))7 5.12(b,c)>0;4t:7 b.q>0}},33:6(b,c,a){7 5.p(c)||5.12(b,c)>=a},37:6(b,c,a){7 5.p(c)||5.12(b,c)<=a},30:6(b,d,a){k c=5.12(b,d);7 5.p(d)||(c>=a[0]&&c<=a[1])},2T:6(b,c,a){7 5.p(c)||b>=a},38:6(b,c,a){7 5.p(c)||b<=a},34:6(b,c,a){7 5.p(c)||(b>=a[0]&&b<=a[1])},21:6(a,b){7 5.p(b)||/^[\\w-+\\.]+@([\\w-]+\\.)+[\\w-]{2,}$/i.H(a)},2t:6(a,b){7 5.p(b)||/^(4s?|4r):\\/\\/[A-M-9](\\.?[A-M-1W][A-M-1z\\-1A]*)*(\\/([A-M-1W][A-M-1z\\-\\.1A]*)?)*(\\?([A-M-1W][A-M-1z\\-\\.%\\+=&1A]*)?)?$/i.H(a)},16:6(a,b){7 5.p(b)||!/4n|4m/.H(1t 4l(a))},2r:6(a,b){7 5.p(b)||/^\\d{4}[\\/-]\\d{1,2}[\\/-]\\d{1,2}$/.H(a)},2o:6(a,b){7 5.p(b)||/^\\d\\d?\\.\\d\\d?\\.\\d\\d\\d?\\d?$/.H(a)},1y:6(a,b){7 5.p(b)||/^-?(?:\\d+|\\d{1,3}(?:,\\d{3})+)(?:\\.\\d+)?$/.H(a)},2f:6(a,b){7 5.p(b)||/^-?(?:\\d+|\\d{1,3}(?:\\.\\d{3})+)(?:,\\d+)?$/.H(a)},1E:6(a,b){7 5.p(b)||/^\\d+$/.H(a)},2b:6(b,e){j(5.p(e))7 x;k a=0,d=0,1s=Q;b=b.27(/\\D/g,"");y(n=b.q-1;n>=0;n--){k c=b.4j(n);k d=4i(c,10);j(1s){j((d*=2)>9)d-=9}a+=d;1s=!1s}7(a%10)==0},26:6(b,c,a){a=O a=="17"?a:"4g|4z?g|4A";7 5.p(c)||b.4B(1t 25(".("+a+")$"))},2a:6(b,c,a){7 b==8(a).4d()}},4c:6(c,a,b){8.B.1k[c]=a;8.B.15[c]=b}});',62,289,'|||||this|function|return|jQuery|||||||||settings||if|var|name||||required|length|enter|Please||value|errorList||true|for|element||validator|String||call|push|valid|test|extend|elements|errorClass|format|Z0|in|typeof|checkable|false|successList|errorMap|submitted|toHide|toShow|currentForm|invalid|success|rules||showErrors|getLength|reset|method|messages|date|string|addClass|arguments|focusInvalid|console|wrapper|form|errorsFor|data|removeClass|trim|case|message|methods|clean|filter|check|rulesCache|labelContainer|select|input|bEven|new|not|checkableGroup|showLabel|constructor|number|9_|���|handle|parameters|errors|digits|each|idOrName|debug|errorElement|onclick|onkeyup|hide|addWrapper|cancelSubmit|hideErrors|resetForm|onblur|ein|error|submit|dependTypes|prepareForm|9���|else|containers|errorLabelContainer|characters|email|than|defaults|find|RegExp|accept|replace|onsubmit|meta|equalTo|creditcard|html|attr|show|numberDE|defaultMessage|submitHandler|Sie|strong|configuredMessage|geben|id|Bitte|dateDE|makeArray|formatAndAdd|dateISO|generated|url|fn|Array|window|the|checked|type|switch|lastActive|catch|focus|lastElement|try|size|toLowerCase|defaultShowErrors|grep|option|ignore|click|nodeName|text|prepareElement|invalidHandler|refresh|findLastActive|minValue|to|equal|or|and|between|focused|rangeLength|errorContext|errorContainer|minLength|rangeValue|no|depend|maxLength|maxValue|selected|errorPlacement|extension|with|document|again|same|checkbox|radio|card|credit|append|wrap|only|slice|Nummer|overrideErrors|eine|parents|Datum|Warning|g�ltiges|title|apply|throw|checking|unshift|when|No|defined|occured|exception|ISO|break|URL|preventDefault|keyup|address|blur|assigned|has|parent|disabled|insertAfter|textarea|is|field|blockFocusCleanup|focusCleanup|This|setDefaults|unchecked|visible|filled|numberOfInvalids|blank|first|label|expr|delete|get|merge|prototype|greater|setArray|addMethod|val|cancel|less|png|add|parseInt|charAt|long|Date|NaN|Invalid|least|at|of|ftp|https|default|specified|attributes|msie|browser|longer|jpe|gif|match|multiple|boolean|validate'.split('|'),0,{}));
/*
 * JTip
 * By Cody Lindley (http://www.codylindley.com)
 * Under an Attribution, Share Alike License
 * JTip is built on top of the very light weight jquery library.
 */

//on page load (as soon as its ready) call JT_init
$(document).ready(JT_init);

function JT_init(){
	       $("a.jTip")
		   .hover(function(){JT_show(this.href,this.id,this.name)},function(){$('#JT').remove()})
           .click(function(){return false});	   
}

function JT_show(url,linkId,title){
	if(title == false)title="&nbsp;";
	var de = document.documentElement;
	var w = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var hasArea = w - getAbsoluteLeft(linkId);
	var clickElementy = getAbsoluteTop(linkId) - 3; //set y position
	
	var queryString = url.replace(/^[^\?]+\??/,'');
	var params = parseQuery( queryString );
	if(params['width'] === undefined){params['width'] = 250};
	if(params['link'] !== undefined){
	$('#' + linkId).bind('click',function(){window.location = params['link']});
	$('#' + linkId).css('cursor','pointer');
	}
	
	if(hasArea>((params['width']*1)+75)){
		$("body").append("<div id='JT' style='width:"+params['width']*1+"px'><div id='JT_arrow_left'></div><div id='JT_close_left'>"+title+"</div><div id='JT_copy'><div class='JT_loader'><div></div></div>");//right side
		var arrowOffset = getElementWidth(linkId) + 11;
		var clickElementx = getAbsoluteLeft(linkId) + arrowOffset; //set x position
	}else{
		$("body").append("<div id='JT' style='width:"+params['width']*1+"px'><div id='JT_arrow_right' style='left:"+((params['width']*1)+1)+"px'></div><div id='JT_close_right'>"+title+"</div><div id='JT_copy'><div class='JT_loader'><div></div></div>");//left side
		var clickElementx = getAbsoluteLeft(linkId) - ((params['width']*1) + 15); //set x position
	}
	
	$('#JT').css({left: clickElementx+"px", top: clickElementy+"px"});
	$('#JT').show();
	$('#JT_copy').load(url);

}

function getElementWidth(objectId) {
	x = document.getElementById(objectId);
	return x.offsetWidth;
}

function getAbsoluteLeft(objectId) {
	// Get an object left position from the upper left viewport corner
	o = document.getElementById(objectId)
	oLeft = o.offsetLeft            // Get left position from the parent object
	while(o.offsetParent!=null) {   // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent    // Get parent object reference
		oLeft += oParent.offsetLeft // Add parent left position
		o = oParent
	}
	return oLeft
}

function getAbsoluteTop(objectId) {
	// Get an object top position from the upper left viewport corner
	o = document.getElementById(objectId)
	oTop = o.offsetTop            // Get top position from the parent object
	while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent  // Get parent object reference
		oTop += oParent.offsetTop // Add parent top position
		o = oParent
	}
	return oTop
}

function parseQuery ( query ) {
   var Params = new Object ();
   if ( ! query ) return Params; // return empty object
   var Pairs = query.split(/[;&]/);
   for ( var i = 0; i < Pairs.length; i++ ) {
      var KeyVal = Pairs[i].split('=');
      if ( ! KeyVal || KeyVal.length != 2 ) continue;
      var key = unescape( KeyVal[0] );
      var val = unescape( KeyVal[1] );
      val = val.replace(/\+/g, ' ');
      Params[key] = val;
   }
   return Params;
}

function blockEvents(evt) {
              if(evt.target){
              evt.preventDefault();
              }else{
              evt.returnValue = false;
              }
};

/*----------------------------------------------------------------------------\
|                               Help Tip 1.12                                 |
|-----------------------------------------------------------------------------|
|                         Created by Erik Arvidsson                           |
|                  (http://webfx.eae.net/contact.html#erik)                   |
|                      For WebFX (http://webfx.eae.net/)                      |
\----------------------------------------------------------------------------*/

function showHelpTip(e, sHtml, bHideSelects) {

	// find anchor element
	var el = e.target || e.srcElement;
	while (el.tagName != "A")
		el = el.parentNode;
	
	// is there already a tooltip? If so, remove it
	if (el._helpTip) {
		helpTipHandler.hideHelpTip(el);
	}

	helpTipHandler.hideSelects = Boolean(bHideSelects);

	// create element and insert last into the body
	helpTipHandler.createHelpTip(el, sHtml);
	
	// position tooltip
	helpTipHandler.positionToolTip(e);

	// add a listener to the blur event.
	// When blurred remove tooltip and restore anchor
	el.onblur = helpTipHandler.anchorBlur;
	el.onkeydown = helpTipHandler.anchorKeyDown;
}

var helpTipHandler = {
	hideSelects:	false,
	
	helpTip:		null,
	
	showSelects:	function (bVisible) {
		if (!this.hideSelects) return;
		// only IE actually do something in here
		var selects = [];
		if (document.all)
			selects = document.all.tags("SELECT");
		var l = selects.length;
		for	(var i = 0; i < l; i++)
			selects[i].runtimeStyle.visibility = bVisible ? "" : "hidden";	
	},
	
	create:	function () {
		var d = document.createElement("DIV");
		d.className = "help-tooltip";
		d.onmousedown = this.helpTipMouseDown;
		d.onmouseup = this.helpTipMouseUp;
		document.body.appendChild(d);		
		this.helpTip = d;
	},
	
	createHelpTip:	function (el, sHtml) {
		if (this.helpTip == null) {
			this.create();
		}

		var d = this.helpTip;
		d.innerHTML = sHtml;
		d._boundAnchor = el;
		el._helpTip = d;
		return d;
	},
	
	// Allow clicks on A elements inside tooltip
	helpTipMouseDown:	function (e) {
		var d = this;
		var el = d._boundAnchor;
		if (!e) e = event;
		var t = e.target || e.srcElement;
		while (t.tagName != "A" && t != d)
			t = t.parentNode;
		if (t == d) return;
		
		el._onblur = el.onblur;
		el.onblur = null;
	},
	
	helpTipMouseUp:	function () {
		var d = this;
		var el = d._boundAnchor;
		el.onblur = el._onblur;
		el._onblur = null;
		el.focus();
	},	
	
	anchorBlur:	function (e) {
		var el = this;
		helpTipHandler.hideHelpTip(el);
	},
	
	anchorKeyDown:	function (e) {
		if (!e) e = window.event
		if (e.keyCode == 27) {	// ESC
			helpTipHandler.hideHelpTip(this);
		}
	},
	
	removeHelpTip:	function (d) {
		d._boundAnchor = null;
		d.style.filter = "none";
		d.innerHTML = "";
		d.onmousedown = null;
		d.onmouseup = null;
		d.parentNode.removeChild(d);
		//d.style.display = "none";
	},
	
	hideHelpTip:	function (el) {
		var d = el._helpTip;
		/*	Mozilla (1.2+) starts a selection session when moved
			and this destroys the mouse events until reloaded
		d.style.top = -el.offsetHeight - 100 + "px";
		*/		
		
		d.style.visibility = "hidden";
		//d._boundAnchor = null;

		el.onblur = null;
		el._onblur = null;
		el._helpTip = null;
		el.onkeydown = null;
		
		this.showSelects(true);
	},
	
	positionToolTip:	function (e) {
		this.showSelects(false);		
		var scroll = this.getScroll();
		var d = this.helpTip;
		
		// width
		if (d.offsetWidth >= scroll.width)
			d.style.width = scroll.width - 10 + "px";
		else
			d.style.width = "";
		
		// left
		if (e.clientX > scroll.width - d.offsetWidth)
			d.style.left = scroll.width - d.offsetWidth + scroll.left + "px";
		else
			d.style.left = e.clientX - 2 + scroll.left + "px";
		
		// top
		if (e.clientY + d.offsetHeight + 18 < scroll.height)
			d.style.top = e.clientY + 18 + scroll.top + "px";
		else if (e.clientY - d.offsetHeight > 0)
			d.style.top = e.clientY + scroll.top - d.offsetHeight + "px";
		else
			d.style.top = scroll.top + 5 + "px";
			
		d.style.visibility = "visible";
	},
	
	// returns the scroll left and top for the browser viewport.
	getScroll:	function () {
		if (document.all && typeof document.body.scrollTop != "undefined") {	// IE model
			var ieBox = document.compatMode != "CSS1Compat";
			var cont = ieBox ? document.body : document.documentElement;
			return {
				left:	cont.scrollLeft,
				top:	cont.scrollTop,
				width:	cont.clientWidth,
				height:	cont.clientHeight
			};
		}
		else {
			return {
				left:	window.pageXOffset,
				top:	window.pageYOffset,
				width:	window.innerWidth,
				height:	window.innerHeight
			};
		}
		
	}

};
/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-07-22 01:45:56 +0200 (Son, 22 Jul 2007) $
 * $Rev: 2447 $
 *
 * Version 2.1.1
 */
(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};})(jQuery);
/*
 * Autocomplete - jQuery plugin 1.1pre
 *
 * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.autocomplete.js 5785 2008-07-12 10:37:33Z joern.zaefferer $
 *
 */

;(function($) {
	
$.fn.extend({
	autocomplete: function(urlOrData, options) {
		var isUrl = typeof urlOrData == "string";
		options = $.extend({}, $.Autocompleter.defaults, {
			url: isUrl ? urlOrData : null,
			data: isUrl ? null : urlOrData,
			delay: isUrl ? $.Autocompleter.defaults.delay : 10,
			max: options && !options.scroll ? 10 : 150
		}, options);
		
		// if highlight is set to false, replace it with a do-nothing function
		options.highlight = options.highlight || function(value) { return value; };
		
		// if the formatMatch option is not specified, then use formatItem for backwards compatibility
		options.formatMatch = options.formatMatch || options.formatItem;
		
		return this.each(function() {
			new $.Autocompleter(this, options);
		});
	},
	result: function(handler) {
		return this.bind("result", handler);
	},
	search: function(handler) {
		return this.trigger("search", [handler]);
	},
	flushCache: function() {
		return this.trigger("flushCache");
	},
	setOptions: function(options){
		return this.trigger("setOptions", [options]);
	},
	unautocomplete: function() {
		return this.trigger("unautocomplete");
	}
});

$.Autocompleter = function(input, options) {

	var KEY = {
		UP: 38,
		DOWN: 40,
		DEL: 46,
		TAB: 9,
		RETURN: 13,
		ESC: 27,
		COMMA: 188,
		PAGEUP: 33,
		PAGEDOWN: 34,
		BACKSPACE: 8
	};

	// Create $ object for input element
	var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);

	var timeout;
	var previousValue = "";
	var cache = $.Autocompleter.Cache(options);
	var hasFocus = 0;
	var lastKeyPressCode;
	var config = {
		mouseDownOnSelect: false
	};
	var select = $.Autocompleter.Select(options, input, selectCurrent, config);
	
	var blockSubmit;
	
	// prevent form submit in opera when selecting with return key
	$.browser.opera && $(input.form).bind("submit.autocomplete", function() {
		if (blockSubmit) {
			blockSubmit = false;
			return false;
		}
	});
	
	// only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
	$input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
		// track last key pressed
		lastKeyPressCode = event.keyCode;
		switch(event.keyCode) {
		
			case KEY.UP:
				event.preventDefault();
				if ( select.visible() ) {
					select.prev();
				} else {
					onChange(0, true);
				}
				break;
				
			case KEY.DOWN:
				event.preventDefault();
				if ( select.visible() ) {
					select.next();
				} else {
					onChange(0, true);
				}
				break;
				
			case KEY.PAGEUP:
				event.preventDefault();
				if ( select.visible() ) {
					select.pageUp();
				} else {
					onChange(0, true);
				}
				break;
				
			case KEY.PAGEDOWN:
				event.preventDefault();
				if ( select.visible() ) {
					select.pageDown();
				} else {
					onChange(0, true);
				}
				break;
			
			// matches also semicolon
			case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
			case KEY.TAB:
			case KEY.RETURN:
				if( selectCurrent() ) {
					// stop default to prevent a form submit, Opera needs special handling
					event.preventDefault();
					blockSubmit = true;
					return false;
				}
				break;
				
			case KEY.ESC:
				select.hide();
				break;
				
			default:
				clearTimeout(timeout);
				timeout = setTimeout(onChange, options.delay);
				break;
		}
	}).focus(function(){
		// track whether the field has focus, we shouldn't process any
		// results if the field no longer has focus
		hasFocus++;
	}).blur(function() {
		hasFocus = 0;
		if (!config.mouseDownOnSelect) {
			hideResults();
		}
	}).click(function() {
		// show select when clicking in a focused field
		if ( hasFocus++ > 1 && !select.visible() ) {
			onChange(0, true);
		}
	}).bind("search", function() {
		// TODO why not just specifying both arguments?
		var fn = (arguments.length > 1) ? arguments[1] : null;
		function findValueCallback(q, data) {
			var result;
			if( data && data.length ) {
				for (var i=0; i < data.length; i++) {
					if( data[i].result.toLowerCase() == q.toLowerCase() ) {
						result = data[i];
						break;
					}
				}
			}
			if( typeof fn == "function" ) fn(result);
			else $input.trigger("result", result && [result.data, result.value]);
		}
		$.each(trimWords($input.val()), function(i, value) {
			request(value, findValueCallback, findValueCallback);
		});
	}).bind("flushCache", function() {
		cache.flush();
	}).bind("setOptions", function() {
		$.extend(options, arguments[1]);
		// if we've updated the data, repopulate
		if ( "data" in arguments[1] )
			cache.populate();
	}).bind("unautocomplete", function() {
		select.unbind();
		$input.unbind();
		$(input.form).unbind(".autocomplete");
	});
	
	
	function selectCurrent() {
		var selected = select.selected();
		if( !selected )
			return false;
		
		var v = selected.result;
		previousValue = v;
		
		if ( options.multiple ) {
			var words = trimWords($input.val());
			if ( words.length > 1 ) {
				v = words.slice(0, words.length - 1).join( options.multipleSeparator ) + options.multipleSeparator + v;
			}
			v += options.multipleSeparator;
		}
		
		$input.val(v);
		hideResultsNow();
		$input.trigger("result", [selected.data, selected.value]);
		return true;
	}
	
	function onChange(crap, skipPrevCheck) {
		if( lastKeyPressCode == KEY.DEL ) {
			select.hide();
			return;
		}
		
		var currentValue = $input.val();
		
		if ( !skipPrevCheck && currentValue == previousValue )
			return;
		
		previousValue = currentValue;
		
		currentValue = lastWord(currentValue);
		if ( currentValue.length >= options.minChars) {
			$input.addClass(options.loadingClass);
			if (!options.matchCase)
				currentValue = currentValue.toLowerCase();
			request(currentValue, receiveData, hideResultsNow);
		} else {
			stopLoading();
			select.hide();
		}
	};
	
	function trimWords(value) {
		if ( !value ) {
			return [""];
		}
		var words = value.split( options.multipleSeparator );
		var result = [];
		$.each(words, function(i, value) {
			if ( $.trim(value) )
				result[i] = $.trim(value);
		});
		return result;
	}
	
	function lastWord(value) {
		if ( !options.multiple )
			return value;
		var words = trimWords(value);
		return words[words.length - 1];
	}
	
	// fills in the input box w/the first match (assumed to be the best match)
	// q: the term entered
	// sValue: the first matching result
	function autoFill(q, sValue){
		// autofill in the complete box w/the first match as long as the user hasn't entered in more data
		// if the last user key pressed was backspace, don't autofill
		if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
			// fill in the value (keep the case the user has typed)
			$input.val($input.val() + sValue.substring(lastWord(previousValue).length));
			// select the portion of the value not typed by the user (so the next character will erase)
			$.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length);
		}
	};

	function hideResults() {
		clearTimeout(timeout);
		timeout = setTimeout(hideResultsNow, 200);
	};

	function hideResultsNow() {
		var wasVisible = select.visible();
		select.hide();
		clearTimeout(timeout);
		stopLoading();
		if (options.mustMatch) {
			// call search and run callback
			$input.search(
				function (result){
					// if no value found, clear the input box
					if( !result ) {
						if (options.multiple) {
							var words = trimWords($input.val()).slice(0, -1);
							$input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") );
						}
						else
							$input.val( "" );
					}
				}
			);
		}
		if (wasVisible)
			// position cursor at end of input field
			$.Autocompleter.Selection(input, input.value.length, input.value.length);
	};

	function receiveData(q, data) {
		if ( data && data.length && hasFocus ) {
			stopLoading();
			select.display(data, q);
			autoFill(q, data[0].value);
			select.show();
		} else {
			hideResultsNow();
		}
	};

	function request(term, success, failure) {
		if (!options.matchCase)
			term = term.toLowerCase();
		var data = cache.load(term);
		// recieve the cached data
		if (data && data.length) {
			success(term, data);
		// if an AJAX url has been supplied, try loading the data now
		} else if( (typeof options.url == "string") && (options.url.length > 0) ){
			
			var extraParams = {
				timestamp: +new Date()
			};
			$.each(options.extraParams, function(key, param) {
				extraParams[key] = typeof param == "function" ? param() : param;
			});
			
			$.ajax({
				// try to leverage ajaxQueue plugin to abort previous requests
				mode: "abort",
				// limit abortion to this input
				port: "autocomplete" + input.name,
				dataType: options.dataType,
				url: options.url,
				data: $.extend({
					q: lastWord(term),
					limit: options.max
				}, extraParams),
				success: function(data) {
					var parsed = options.parse && options.parse(data) || parse(data);
					cache.add(term, parsed);
					success(term, parsed);
				}
			});
		} else {
			// if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
			select.emptyList();
			failure(term);
		}
	};
	
	function parse(data) {
		var parsed = [];
		var rows = data.split("\n");
		for (var i=0; i < rows.length; i++) {
			var row = $.trim(rows[i]);
			if (row) {
				row = row.split("|");
				parsed[parsed.length] = {
					data: row,
					value: row[0],
					result: options.formatResult && options.formatResult(row, row[0]) || row[0]
				};
			}
		}
		return parsed;
	};

	function stopLoading() {
		$input.removeClass(options.loadingClass);
	};

};

$.Autocompleter.defaults = {
	inputClass: "ac_input",
	resultsClass: "ac_results",
	loadingClass: "ac_loading",
	minChars: 1,
	delay: 400,
	matchCase: false,
	matchSubset: true,
	matchContains: false,
	cacheLength: 10,
	max: 100,
	mustMatch: false,
	extraParams: {},
	selectFirst: true,
	formatItem: function(row) { return row[0]; },
	formatMatch: null,
	autoFill: false,
	width: 0,
	multiple: false,
	multipleSeparator: ", ",
	highlight: function(value, term) {
		return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
	},
    scroll: true,
    scrollHeight: 180
};

$.Autocompleter.Cache = function(options) {

	var data = {};
	var length = 0;
	
	function matchSubset(s, sub) {
		if (!options.matchCase) 
			s = s.toLowerCase();
		var i = s.indexOf(sub);
		if (options.matchContains == "word"){
			i = s.toLowerCase().search("\\b" + sub.toLowerCase());
		}
		if (i == -1) return false;
		return i == 0 || options.matchContains;
	};
	
	function add(q, value) {
		if (length > options.cacheLength){
			flush();
		}
		if (!data[q]){ 
			length++;
		}
		data[q] = value;
	}
	
	function populate(){
		if( !options.data ) return false;
		// track the matches
		var stMatchSets = {},
			nullData = 0;

		// no url was specified, we need to adjust the cache length to make sure it fits the local data store
		if( !options.url ) options.cacheLength = 1;
		
		// track all options for minChars = 0
		stMatchSets[""] = [];
		
		// loop through the array and create a lookup structure
		for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
			var rawValue = options.data[i];
			// if rawValue is a string, make an array otherwise just reference the array
			rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
			
			var value = options.formatMatch(rawValue, i+1, options.data.length);
			if ( value === false )
				continue;
				
			var firstChar = value.charAt(0).toLowerCase();
			// if no lookup array for this character exists, look it up now
			if( !stMatchSets[firstChar] ) 
				stMatchSets[firstChar] = [];

			// if the match is a string
			var row = {
				value: value,
				data: rawValue,
				result: options.formatResult && options.formatResult(rawValue) || value
			};
			
			// push the current match into the set list
			stMatchSets[firstChar].push(row);

			// keep track of minChars zero items
			if ( nullData++ < options.max ) {
				stMatchSets[""].push(row);
			}
		};

		// add the data items to the cache
		$.each(stMatchSets, function(i, value) {
			// increase the cache size
			options.cacheLength++;
			// add to the cache
			add(i, value);
		});
	}
	
	// populate any existing data
	setTimeout(populate, 25);
	
	function flush(){
		data = {};
		length = 0;
	}
	
	return {
		flush: flush,
		add: add,
		populate: populate,
		load: function(q) {
			if (!options.cacheLength || !length)
				return null;
			/* 
			 * if dealing w/local data and matchContains than we must make sure
			 * to loop through all the data collections looking for matches
			 */
			if( !options.url && options.matchContains ){
				// track all matches
				var csub = [];
				// loop through all the data grids for matches
				for( var k in data ){
					// don't search through the stMatchSets[""] (minChars: 0) cache
					// this prevents duplicates
					if( k.length > 0 ){
						var c = data[k];
						$.each(c, function(i, x) {
							// if we've got a match, add it to the array
							if (matchSubset(x.value, q)) {
								csub.push(x);
							}
						});
					}
				}				
				return csub;
			} else 
			// if the exact item exists, use it
			if (data[q]){
				return data[q];
			} else
			if (options.matchSubset) {
				for (var i = q.length - 1; i >= options.minChars; i--) {
					var c = data[q.substr(0, i)];
					if (c) {
						var csub = [];
						$.each(c, function(i, x) {
							if (matchSubset(x.value, q)) {
								csub[csub.length] = x;
							}
						});
						return csub;
					}
				}
			}
			return null;
		}
	};
};

$.Autocompleter.Select = function (options, input, select, config) {
	var CLASSES = {
		ACTIVE: "ac_over"
	};
	
	var listItems,
		active = -1,
		data,
		term = "",
		needsInit = true,
		element,
		list;
	
	// Create results
	function init() {
		if (!needsInit)
			return;
		element = $("<div/>")
		.hide()
		.addClass(options.resultsClass)
		.css("position", "absolute")
		.appendTo(document.body);
	
		list = $("<ul/>").appendTo(element).mouseover( function(event) {
			if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
	            active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
			    $(target(event)).addClass(CLASSES.ACTIVE);            
	        }
		}).click(function(event) {
			$(target(event)).addClass(CLASSES.ACTIVE);
			select();
			// TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
			input.focus();
			return false;
		}).mousedown(function() {
			config.mouseDownOnSelect = true;
		}).mouseup(function() {
			config.mouseDownOnSelect = false;
		});
		
		if( options.width > 0 )
			element.css("width", options.width);
			
		needsInit = false;
	} 
	
	function target(event) {
		var element = event.target;
		while(element && element.tagName != "LI")
			element = element.parentNode;
		// more fun with IE, sometimes event.target is empty, just ignore it then
		if(!element)
			return [];
		return element;
	}

	function moveSelect(step) {
		listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
		movePosition(step);
        var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
        if(options.scroll) {
            var offset = 0;
            listItems.slice(0, active).each(function() {
				offset += this.offsetHeight;
			});
            if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
                list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
            } else if(offset < list.scrollTop()) {
                list.scrollTop(offset);
            }
        }
	};
	
	function movePosition(step) {
		active += step;
		if (active < 0) {
			active = listItems.size() - 1;
		} else if (active >= listItems.size()) {
			active = 0;
		}
	}
	
	function limitNumberOfItems(available) {
		return options.max && options.max < available
			? options.max
			: available;
	}
	
	function fillList() {
		list.empty();
		var max = limitNumberOfItems(data.length);
		for (var i=0; i < max; i++) {
			if (!data[i])
				continue;
			var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
			if ( formatted === false )
				continue;
			var li = $("<li/>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
			$.data(li, "ac_data", data[i]);
		}
		listItems = list.find("li");
		if ( options.selectFirst ) {
			listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
			active = 0;
		}
		// apply bgiframe if available
		if ( $.fn.bgiframe )
			list.bgiframe();
	}
	
	return {
		display: function(d, q) {
			init();
			data = d;
			term = q;
			fillList();
		},
		next: function() {
			moveSelect(1);
		},
		prev: function() {
			moveSelect(-1);
		},
		pageUp: function() {
			if (active != 0 && active - 8 < 0) {
				moveSelect( -active );
			} else {
				moveSelect(-8);
			}
		},
		pageDown: function() {
			if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
				moveSelect( listItems.size() - 1 - active );
			} else {
				moveSelect(8);
			}
		},
		hide: function() {
			element && element.hide();
			listItems && listItems.removeClass(CLASSES.ACTIVE);
			active = -1;
		},
		visible : function() {
			return element && element.is(":visible");
		},
		current: function() {
			return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
		},
		show: function() {
			var offset = $(input).offset();
			element.css({
				width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
				top: offset.top + input.offsetHeight,
				left: offset.left
			}).show();
            if(options.scroll) {
                list.scrollTop(0);
                list.css({
					maxHeight: options.scrollHeight,
					overflow: 'auto'
				});
				
                if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
					var listHeight = 0;
					listItems.each(function() {
						listHeight += this.offsetHeight;
					});
					var scrollbarsVisible = listHeight > options.scrollHeight;
                    list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
					if (!scrollbarsVisible) {
						// IE doesn't recalculate width when scrollbar disappears
						listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
					}
                }
                
            }
		},
		selected: function() {
			var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
			return selected && selected.length && $.data(selected[0], "ac_data");
		},
		emptyList: function (){
			list && list.empty();
		},
		unbind: function() {
			element && element.remove();
		}
	};
};

$.Autocompleter.Selection = function(field, start, end) {
	if( field.createTextRange ){
		var selRange = field.createTextRange();
		selRange.collapse(true);
		selRange.moveStart("character", start);
		selRange.moveEnd("character", end);
		selRange.select();
	} else if( field.setSelectionRange ){
		field.setSelectionRange(start, end);
	} else {
		if( field.selectionStart ){
			field.selectionStart = start;
			field.selectionEnd = end;
		}
	}
	field.focus();
};

})(jQuery);
/*
 * Superfish v1.4.1 - jQuery menu widget
 * Copyright (c) 2007 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 */

(function($){
	$.superfish = {};
	$.superfish.o = [];
	$.superfish.op = {};
	$.superfish.defaults = {
		hoverClass	: 'sfHover',
		pathClass	: 'overideThisToUse',
		delay		: 800,
		animation	: {opacity:'show'},
		speed		: 'normal',
		oldJquery	: false, /* set to true if using jQuery version below 1.2 */
		disableHI	: false, /* set to true to disable hoverIntent usage */
		// callback functions:
		onInit		: function(){},
		onBeforeShow: function(){},
		onShow		: function(){}, /* note this name changed ('onshow' to 'onShow') from version 1.4 onward */
		onHide		: function(){}
	};
	$.fn.superfish = function(op){
		var bcClass = 'sfbreadcrumb',
			over = function(){
				var $$ = $(this), menu = getMenu($$);
				getOpts(menu,true);
				clearTimeout(menu.sfTimer);
				$$.showSuperfishUl().siblings().hideSuperfishUl();
			},
			out = function(){
				var $$ = $(this), menu = getMenu($$);
				var o = getOpts(menu,true);
				clearTimeout(menu.sfTimer);
				if ( !$$.is('.'+bcClass) ) {
					menu.sfTimer=setTimeout(function(){
						$$.hideSuperfishUl();
						if (o.$path.length){over.call(o.$path);}
					},o.delay);
				}		
			},
			getMenu = function($el){ return $el.parents('ul.superfish:first')[0]; },
			getOpts = function(el,menuFound){ el = menuFound ? el : getMenu(el); return $.superfish.op = $.superfish.o[el.serial]; },
			hasUl = function(){ return $.superfish.op.oldJquery ? 'li[ul]' : 'li:has(ul)'; };

		return this.each(function() {
			var s = this.serial = $.superfish.o.length;
			var o = $.extend({},$.superfish.defaults,op);
			o.$path = $('li.'+o.pathClass,this).each(function(){
				$(this).addClass(o.hoverClass+' '+bcClass)
					.filter(hasUl()).removeClass(o.pathClass);
			});
			$.superfish.o[s] = $.superfish.op = o;
			
			$(hasUl(),this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out)
			.not('.'+bcClass)
				.hideSuperfishUl();
			
			var $a = $('a',this);
			$a.each(function(i){
				var $li = $a.eq(i).parents('li');
				$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
			});
			
			o.onInit.call(this);
			
		}).addClass('superfish');
	};
	
	$.fn.extend({
		hideSuperfishUl : function(){
			var o = $.superfish.op,
				$ul = $('li.'+o.hoverClass,this).add(this).removeClass(o.hoverClass)
					.find('>ul').hide().css('visibility','hidden');
			o.onHide.call($ul);
			return this;
		},
		showSuperfishUl : function(){
			var o = $.superfish.op,
				$ul = this.addClass(o.hoverClass)
					.find('>ul:hidden').css('visibility','visible');
			o.onBeforeShow.call($ul);
			$ul.animate(o.animation,o.speed,function(){ o.onShow.call(this); });
			return this;
		}
	});
	
	$(window).unload(function(){
		$('ul.superfish').each(function(){
			$('li',this).unbind('mouseover','mouseout','mouseenter','mouseleave');
		});
	});
})(jQuery);
/*	SWFObject v2.0 rc3 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){var U="undefined",N="object",X="visibility:visible",a="visibility:hidden",B="Shockwave Flash",c="ShockwaveFlash.ShockwaveFlash",T="application/x-shockwave-flash",J="SWFObjectExprInst",b=[],G=[],O=null,K=null,Q=false,C=false;var V=function(){var k=typeof document.getElementById!=U&&typeof document.getElementsByTagName!=U&&typeof document.createElement!=U&&typeof document.appendChild!=U&&typeof document.replaceChild!=U&&typeof document.removeChild!=U&&typeof document.cloneNode!=U,r=[0,0,0],m=null;if(typeof navigator.plugins!=U&&typeof navigator.plugins[B]==N){m=navigator.plugins[B].description;if(m){m=m.replace(/^.*\s+(\S+\s+\S+$)/,"$1");r[0]=parseInt(m.replace(/^(.*)\..*$/,"$1"),10);r[1]=parseInt(m.replace(/^.*\.(.*)\s.*$/,"$1"),10);r[2]=/r/.test(m)?parseInt(m.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof window.ActiveXObject!=U){var n=null,q=false;try{n=new ActiveXObject(c+".7")}catch(j){try{n=new ActiveXObject(c+".6");r=[6,0,21];n.AllowScriptAccess="always"}catch(j){if(r[0]==6){q=true}}if(!q){try{n=new ActiveXObject(c)}catch(j){}}}if(!q&&n){try{m=n.GetVariable("$version");if(m){m=m.split(" ")[1].split(",");r=[parseInt(m[0],10),parseInt(m[1],10),parseInt(m[2],10)]}}catch(j){}}}}var s=navigator.userAgent.toLowerCase(),h=navigator.platform.toLowerCase(),o=/webkit/.test(s),g=o?parseFloat(s.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):0,f=false,i=h?/win/.test(h):/win/.test(s),l=h?/mac/.test(h):/mac/.test(s);/*@cc_on f=true;@if(@_win32)i=true;@elif(@_mac)l=true;@end@*/return{w3cdom:k,playerVersion:r,webkit:o,webkitVersion:g,ie:f,win:i,mac:l}}();var Z=function(){if(!V.w3cdom){return }I(H);if(V.ie&&V.win){try{document.write("<script id=__ie_ondomload defer=true src=//:><\/script>");var d=document.getElementById("__ie_ondomload");if(d){d.onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);S()}}}}catch(f){}}if(V.webkit&&typeof document.readyState!=U){O=setInterval(function(){if(/loaded|complete/.test(document.readyState)){S()}},10)}if(typeof document.addEventListener!=U){document.addEventListener("DOMContentLoaded",S,null)}L(S)}();function S(){if(Q){return }if(V.ie&&V.win){var h=document.createElement("span");try{var g=document.getElementsByTagName("body")[0].appendChild(h);g.parentNode.removeChild(g)}catch(j){return }}Q=true;if(O){clearInterval(O);O=null}var d=b.length;for(var f=0;f<d;f++){b[f]()}}function I(d){if(Q){d()}else{b[b.length]=d}}function L(e){if(typeof window.addEventListener!=U){window.addEventListener("load",e,false)}else{if(typeof document.addEventListener!=U){document.addEventListener("load",e,false)}else{if(typeof window.attachEvent!=U){window.attachEvent("onload",e)}else{if(typeof window.onload=="function"){var d=window.onload;window.onload=function(){d();e()}}else{window.onload=e}}}}}function H(){var f=G.length;for(var d=0;d<f;d++){var g=G[d].id;if(V.playerVersion[0]>0){var e=document.getElementById(g);if(e){G[d].width=e.getAttribute("width")?e.getAttribute("width"):"0";G[d].height=e.getAttribute("height")?e.getAttribute("height"):"0";if(M(G[d].swfVersion)){if(V.webkit&&V.webkitVersion<312){R(e)}}else{if(G[d].expressInstall&&!C&&M([6,0,65])&&(V.win||V.mac)){D(G[d])}else{Y(e)}}}}A("#"+g,X)}}function R(g){var d=g.getElementsByTagName(N)[0];if(d){var l=document.createElement("embed"),n=d.attributes;if(n){var k=n.length;for(var h=0;h<k;h++){if(n[h].nodeName.toLowerCase()=="data"){l.setAttribute("src",n[h].nodeValue)}else{l.setAttribute(n[h].nodeName,n[h].nodeValue)}}}var m=d.childNodes;if(m){var o=m.length;for(var f=0;f<o;f++){if(m[f].nodeType==1&&m[f].nodeName.toLowerCase()=="param"){l.setAttribute(m[f].getAttribute("name"),m[f].getAttribute("value"))}}}g.parentNode.replaceChild(l,g)}}function F(d){if(V.ie&&V.win&&M([8,0,0])){window.attachEvent("onunload",function(){var f=document.getElementById(d);for(var e in f){if(typeof f[e]=="function"){f[e]=function(){}}}f.parentNode.removeChild(f)})}}function D(e){C=true;var j=document.getElementById(e.id);if(j){if(e.altContentId){var g=document.getElementById(e.altContentId);if(g){K=g}}else{K=W(j)}if(!(/%$/.test(e.width))&&parseInt(e.width,10)<310){e.width="310"}if(!(/%$/.test(e.height))&&parseInt(e.height,10)<137){e.height="137"}document.title=document.title.slice(0,47)+" - Flash Player Installation";var i=V.ie&&V.win?"ActiveX":"PlugIn",f=document.title,h="MMredirectURL="+window.location+"&MMplayerType="+i+"&MMdoctitle="+f,k=e.id;if(V.ie&&V.win&&j.readyState!=4){var d=document.createElement("div");k+="SWFObjectNew";d.setAttribute("id",k);j.parentNode.insertBefore(d,j);j.style.display="none";window.attachEvent("onload",function(){j.parentNode.removeChild(j)})}P({data:e.expressInstall,id:J,width:e.width,height:e.height},{flashvars:h},k)}}function Y(e){if(V.ie&&V.win&&e.readyState!=4){var d=document.createElement("div");e.parentNode.insertBefore(d,e);d.parentNode.replaceChild(W(e),d);e.style.display="none";window.attachEvent("onload",function(){e.parentNode.removeChild(e)})}else{e.parentNode.replaceChild(W(e),e)}}function W(h){var g=document.createElement("div");if(V.win&&V.ie){g.innerHTML=h.innerHTML}else{var e=h.getElementsByTagName(N)[0];if(e){var j=e.childNodes;if(j){var d=j.length;for(var f=0;f<d;f++){if(!(j[f].nodeType==1&&j[f].nodeName.toLowerCase()=="param")&&!(j[f].nodeType==8)){g.appendChild(j[f].cloneNode(true))}}}}}return g}function P(AA,y,f){var d,h=document.getElementById(f);if(typeof AA.id==U){AA.id=f}if(V.ie&&V.win){var z="";for(var v in AA){if(AA[v]!=Object.prototype[v]){if(v=="data"){y.movie=AA[v]}else{if(v.toLowerCase()=="styleclass"){z+=' class="'+AA[v]+'"'}else{if(v!="classid"){z+=" "+v+'="'+AA[v]+'"'}}}}}var x="";for(var u in y){if(y[u]!=Object.prototype[u]){x+='<param name="'+u+'" value="'+y[u]+'" />'}}h.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+z+">"+x+"</object>";F(AA.id);d=document.getElementById(AA.id)}else{if(V.webkit&&V.webkitVersion<312){var w=document.createElement("embed");w.setAttribute("type",T);for(var t in AA){if(AA[t]!=Object.prototype[t]){if(t=="data"){w.setAttribute("src",AA[t])}else{if(t.toLowerCase()=="styleclass"){w.setAttribute("class",AA[t])}else{if(t!="classid"){w.setAttribute(t,AA[t])}}}}}for(var s in y){if(y[s]!=Object.prototype[s]){if(s!="movie"){w.setAttribute(s,y[s])}}}h.parentNode.replaceChild(w,h);d=w}else{var g=document.createElement(N);g.setAttribute("type",T);for(var q in AA){if(AA[q]!=Object.prototype[q]){if(q.toLowerCase()=="styleclass"){g.setAttribute("class",AA[q])}else{if(q!="classid"){g.setAttribute(q,AA[q])}}}}for(var p in y){if(y[p]!=Object.prototype[p]&&p!="movie"){E(g,p,y[p])}}h.parentNode.replaceChild(g,h);d=g}}return d}function E(f,d,e){var g=document.createElement("param");g.setAttribute("name",d);g.setAttribute("value",e);f.appendChild(g)}function M(d){return(V.playerVersion[0]>d[0]||(V.playerVersion[0]==d[0]&&V.playerVersion[1]>d[1])||(V.playerVersion[0]==d[0]&&V.playerVersion[1]==d[1]&&V.playerVersion[2]>=d[2]))?true:false}function A(i,e){if(V.ie&&V.mac){return }var g=document.getElementsByTagName("head")[0],f=document.createElement("style");f.setAttribute("type","text/css");f.setAttribute("media","screen");if(!(V.ie&&V.win)&&typeof document.createTextNode!=U){f.appendChild(document.createTextNode(i+" {"+e+"}"))}g.appendChild(f);if(V.ie&&V.win&&typeof document.styleSheets!=U&&document.styleSheets.length>0){var d=document.styleSheets[document.styleSheets.length-1];if(typeof d.addRule==N){d.addRule(i,e)}}}return{registerObject:function(h,d,g){if(!V.w3cdom||!h||!d){return }var f={};f.id=h;var e=d.split(".");f.swfVersion=[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10)];f.expressInstall=g?g:false;G[G.length]=f;A("#"+h,a)},getObjectById:function(g){var d=null;if(V.w3cdom&&Q){var e=document.getElementById(g);if(e){var f=e.getElementsByTagName(N)[0];if(!f||(f&&typeof e.SetVariable!=U)){d=e}else{if(typeof f.SetVariable!=U){d=f}}}}return d},embedSWF:function(h,p,m,o,d,g,e,k,n){if(!V.w3cdom||!h||!p||!m||!o||!d){return }m+="";o+="";if(M(d.split("."))){A("#"+p,a);var l=(typeof n==N)?n:{};l.data=h;l.width=m;l.height=o;var j=(typeof k==N)?k:{};if(typeof e==N){for(var f in e){if(e[f]!=Object.prototype[f]){if(typeof j.flashvars!=U){j.flashvars+="&"+f+"="+e[f]}else{j.flashvars=f+"="+e[f]}}}}I(function(){P(l,j,p);A("#"+p,X)})}else{if(g&&!C&&M([6,0,65])&&(V.win||V.mac)){A("#"+p,a);I(function(){var i={};i.id=i.altContentId=p;i.width=m;i.height=o;i.expressInstall=g;D(i);A("#"+p,X)})}}},getFlashPlayerVersion:function(){return{major:V.playerVersion[0],minor:V.playerVersion[1],release:V.playerVersion[2]}},hasFlashPlayerVersion:function(d){return M(d.split("."))},createSWF:function(f,e,d){if(V.w3cdom&&Q){return P(f,e,d)}else{return undefined}},createCSS:function(e,d){if(V.w3cdom){A(e,d)}},addDomLoadEvent:I,addLoadEvent:L,getQueryParamValue:function(g){var f=document.location.search||document.location.hash;if(g==null){return f}if(f){var e=f.substring(1).split("&");for(var d=0;d<e.length;d++){if(e[d].substring(0,e[d].indexOf("="))==g){return e[d].substring((e[d].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(C&&K){var d=document.getElementById(J);if(d){d.parentNode.replaceChild(K,d);K=null;C=false}}}}}();
var form_data = '';

function urlDecode( encoded )
{
	var HEXCHARS = "0123456789ABCDEFabcdef";
	var plaintext = "";
	var i = 0;
	while (i < encoded.length) {
		var ch = encoded.charAt(i);
		if (ch == "+") {
			plaintext += " ";
			i++;
		} else if (ch == "%") {
			if (i < (encoded.length-2) && HEXCHARS.indexOf(encoded.charAt(i+1)) != -1 && HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) {
				plaintext += unescape( encoded.substr(i,3) );
				i += 3;
			} else {
				//ignore errors, normal %-tag
				plaintext += "%";
				i++;
			}
		} else {
			plaintext += ch;
			i++;
		}
	}
	return plaintext;
}


function arrayDecode( encoded )
{
	var row = encoded.split("~");
	var numRows = row.length ;
	var arr = new Array(numRows);

	for(var x = 0; x < numRows; x++){
		var tmp = row[x].split("|");
		
		//MK - FIX ###plus###
		for(var y = 0; y < tmp.length; y++){
			tmp[y] = decodeSpecialChars(tmp[y]);
		}
		arr[x] = tmp;
	}

	return arr;
}

function decodeSpecialChars(data)
{
	s = new String(data);
	s = s.replace(/\!\!plus\!\!/g,"+");
	s = s.replace(/\!\!backslash\!\!/g,"\\");
	s = s.replace(/\!\!pipe\!\!/g,"|");
	s = s.replace(/\!\!tilde\!\!/g,"~");
	s = s.replace(/\!\!excl\!\!/g,"!");
	s = s.replace(/\!\!hash\!\!/g,"#");
	s = s.replace(/\!\!amp\!\!/g,"&");

	return s;
}

function encodeSpecialChars(data)
{
	s = new String(data);
	s = s.replace(/\!/g,"!!excl!!") ;
	s = s.replace(/\+/g,"!!plus!!") ;
	s = s.replace(/\\/g,"!!backslash!!") ;
	s = s.replace(/\|/g,"!!pipe!!") ;
	s = s.replace(/\~/g,"!!tilde!!") ;
	s = s.replace(/\#/g,"!!hash!!") ;
	s = s.replace(/\&/g,"!!amp!!") ;
	return s;
}	

var numLoading = 0;

function loading_show()
{

	var loading = document.getElementById('loading');
	if (!loading)
	{
		loading = document.createElement('div');
		loading.id = 'loading';
		loading.innerHTML = '<font style="font-family:verdana; font-size:12px; color:white;">Loading...</' + 'font>';
		loading.style.position = 'absolute';
		loading.style.top = '4px';
		loading.style.right = '4px';
		loading.style.backgroundColor = 'red';
		loading.style.width = '65px';
		loading.style.padding = '2px';
		document.getElementsByTagName('body').item(0).appendChild(loading);
	}
	loading.style.display = 'block';
	numLoading++;
}

function loading_hide()
{
	numLoading--;
	if(numLoading < 1) {
		var loading = document.getElementById('loading');
		if (loading) {
			loading.style.display = 'none';
		}
	}
}


var xhrPool = new Array;

function aj_init_object() {

	
	var xmlhttp= false;
	if(xhrPool.length > 0) {
		 xmlhttp = xhrPool.shift();
		 return xmlhttp;
	}
	
	if(xmlhttp) {
		return xmlhttp;
	}
	
	if(use_iframe) {
		xmlhttp = new XMLHttpRequestI();
		return xmlhttp;
	}
	
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	try {
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	try {
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
	xmlhttp = false;
	}
	}
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest !== undefined) {
		xmlhttp = new XMLHttpRequest();
	} else if(!xmlhttp) {
		//IFrame fallback for IE
		xmlhttp = new XMLHttpRequestI();
	}
	
	return xmlhttp;
}


function aj_process(data)
{
	for(var x = 0; x < data.length; x++) {
		aj_process2(data[x]);
	}
}



function aj_call(func_name, args, custom_cb) {
	var i;
	var x;
	var uri;
	var post_data;

	uri = request_uri;

	if (xml_request_type == "GET") {
		if (uri.indexOf("?") == -1) {
			uri = uri + "?rs=" + escape(func_name);
		} else {
			uri = uri + "&rs=" + escape(func_name);
		}
		for (i = 0; i < args.length; i++) {
			if(args[i] == 'post_data') {
				uri += form_data;
				form_data = '';
			} else {
				//MK - TODO: Check if args[i] is a array?!
				//uri = uri + "&rsargs[]=" + args[i];
				uri = uri + "&rsargs[]=" + escape(args[i]);
			}
		}
		
		uri = uri + "&rsrnd=" + new Date().getTime();
		post_data = null;
	} else {
		post_data = "rs=" + escape(func_name);
		for (i = 0; i < args.length; i++) {
			if(args[i] == 'post_data') {
				post_data += form_data;
				form_data = '';
			}
			post_data = post_data + "&rsargs[]=" + args[i];
		}
	}

	x = aj_init_object();
	if(!x) { return true; }

	if(show_loading) { loading_show(); }

	x.open(xml_request_type, uri, true);
	if (xml_request_type == "POST") {
		x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");
		x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	}
	x.onreadystatechange = function() {
		
		try {
			if (x.readyState != 4) {
				return;
			}
	
			loading_hide();
	
			if(x.status != 200)
			{
				alert('Error invalid status: ' + x.responseText + ' status: ' + x.status);
				delete x;
				return;
			}
		} catch ( e ) {
			return;
		}

		var status = x.responseText.charAt(0);
		var data = x.responseText.substring(2);

		if (status == "-")
		{
			//alert("Callback error: " + data);
			delete x;
			return;
		}

		if (custom_cb === undefined ) {
			aj_process(arrayDecode(urlDecode(data)));
		} else if(custom_cb) {
			args[args.length-1]( "" + data);
		} else {
			setValue(args[args.length-1], data);
		}
		xhrPool.push(x);
	};
	
	x.send(post_data);
	//delete x;
	return false;
}

/*
coded by Kae - http://verens.com/
use this code as you wish, but retain this notice

MK - notice retained, but renamed function to XMLHttpRequestI and
modified initial timeout
*/
XMLHttpRequestI = function() {
	var i=0;
	var url='';
	var responseText='';
	this.onreadystatechange=function(){
		return false;
	};
	
	this.open=function(method,url){
		//TODO: POST methods
		this.i=++kXHR_instances; // id number of this request
		this.url=url;
		var iframe = document.createElement('iframe');
		iframe.id= 'kXHR_iframe_'+this.i+'';
		iframe.type = "text/plain";
		iframe.style.display = 'none';
		//alert(iframe.id);
		document.body.appendChild(iframe);
	};
	
	this.send=function(postdata){
		//TODO: use the postdata
		var el=document.getElementById('kXHR_iframe_'+this.i);
		el.src=this.url;
		kXHR_objs[this.i]=this;
		setTimeout('XMLHttpRequestI_checkState('+this.i+')',200);
	};
	
	return true;
};


function XMLHttpRequestI_checkState(inst){
	var el=document.getElementById('kXHR_iframe_'+inst);
	if(el.readyState=='complete'){
		var responseText=window.frames['kXHR_iframe_'+inst].document.body.childNodes[0].data;
		kXHR_objs[inst].responseText=responseText;
		kXHR_objs[inst].readyState=4;
		kXHR_objs[inst].status=200;
		kXHR_objs[inst].onreadystatechange();
		el.parentNode.removeChild(el);
	}else{
		setTimeout('XMLHttpRequestI_checkState('+inst+')',500);
	}
}
var kXHR_instances=0;
var kXHR_objs=[];


function getValue(element) {
	
	var itm = document.getElementById(element);
	var value = "";
	var x;
	
	if(itm === null) {
		itm = document.getElementsByName(element);
		if(itm !== null) {
			itm = itm[0];
		}
	}
	

	if(itm !== null) {
		
		if(itm.value !== undefined) {
			value = encodeSpecialChars(itm.value);
		} else {
			value = encodeSpecialChars(itm.innerHTML);
		}
	}
	
	if(itm === null) {
		return '';
	}
	
	
	if(itm.type !== undefined) {
	
		if(itm.type == 'select-one') {
			value = encodeSpecialChars(encodeSpecialChars(itm[itm.selectedIndex].value));
		} else if(itm.type == 'select-multiple') {
			value = '';
			for (x = 0; x < itm.length; x++) {
				if(itm.options[x].selected) {
					value += encodeSpecialChars(itm.options[x].value) + ',';
				}
			}
			if(value.length > 0) {
				value = value.substr(0, value.length - 1);
			}
		} else if(itm.type == 'checkbox') {
			if(itm.checked) {
				value = encodeSpecialChars(itm.value);
			} else {
				value = '';
			}
		} else if(itm.type == 'radio') {
			if(itm.checked) {
				value = encodeSpecialChars(itm.value);
			} else {
				value = '';
			}
		}
	}
	
	
	if(itm.elements !== undefined) {
		var col = '!COL!';
		var row = '!ROW!';
		var name;
		var first = true;
		
		value = 'post_data';
		form_data = '&rsargs[]=';
		
		for(x = 0; x < itm.elements.length; x++) {
			if(!first) {
				form_data += row;
			}
			first = false;
			
			var y = itm.elements[x];
			name = '';
			if(y.getAttribute('id') !== null && y.id !== '') {
				name = y.id;
			}
			if(y.getAttribute('name') !== null && y.name !== '') {
				name = y.name;
			}

			if(y.type == 'select-one') {
				form_data +=  name + col + encodeSpecialChars(y[y.selectedIndex].value);
			} else if(y.type == 'select-multiple') {
				var sel = false;
				form_data += name + col;
				for (var z = 0; z < y.length; z++) {
					if(y.options[z].selected) {
						form_data += encodeSpecialChars(y.options[z].value) + ',';
						sel = true;
					}
				}
				if(sel) {
					form_data = form_data.substr(0, form_data.length - 1);
				}
			} else if(y.type == 'checkbox') {
				if(y.checked) {
					form_data += name + col + encodeSpecialChars(y.value);
				} else {
					first = true;
				}
			} else if(y.type == 'radio') {
				if(y.checked) {
					form_data += name + col + encodeSpecialChars(y.value);
				} else {
					first = true;
				}
			} else {
				form_data += name + col + encodeSpecialChars(y.value);
			}
		}
	}
	
	return value;
}

function setValue(element, data) {
	
	var itm = document.getElementById(element);
	
	if(itm === null) {
		itm = document.getElementsByName(element);
		if(itm !== null) {
			itm = itm[0];
		}
	}

	if(itm !== null) {
		if(itm.value != undefined) {
			itm.value = data;
		} else {
			itm.innerHTML = data;
		}
	}
}

function appendArr(args, obj) {
	var arr = new Array;
	for (i = 0; i < args.length; i++) {
			arr.push(args[i]);
	}
	arr.push(obj);
	return arr;
}

(function($) {
    var has_VML, create_canvas_for, add_shape_to, clear_canvas, shape_from_area,
        canvas_style, fader, hex_to_decimal, css3color, is_image_loaded;
    has_VML = document.namespaces;
    has_canvas = document.createElement('canvas');
    has_canvas = has_canvas && has_canvas.getContext;
    
    if(!(has_canvas || has_VML)) {
        $.fn.maphilight = function() { return this; };
        return;
    }
    
    if(has_canvas) {
        fader = function(element, opacity, interval) {
            if(opacity <= 1) {
                element.style.opacity = opacity;
                window.setTimeout(fader, 10, element, opacity + 0.1, 10);
            }
        };
        
        hex_to_decimal = function(hex) {
            return Math.max(0, Math.min(parseInt(hex, 16), 255));
        };
        css3color = function(color, opacity) {
            return 'rgba('+hex_to_decimal(color.substr(0,2))+','+hex_to_decimal(color.substr(2,2))+','+hex_to_decimal(color.substr(4,2))+','+opacity+')';
        };
        create_canvas_for = function(img) {
            var c = $('<canvas style="width:'+img.width+'px;height:'+img.height+'px;"></canvas>').get(0);
            c.getContext("2d").clearRect(0, 0, c.width, c.height);
            return c;
        };
        add_shape_to = function(canvas, shape, coords, options) {
            var i, context = canvas.getContext('2d');
            context.beginPath();
            if(shape == 'rect') {
                context.rect(coords[0], coords[1], coords[2] - coords[0], coords[3] - coords[1]);
            } else if(shape == 'poly') {
                context.moveTo(coords[0], coords[1]);
                for(i=2; i < coords.length; i+=2) {
                    context.lineTo(coords[i], coords[i+1]);
                }
            } else if(shape == 'circ') {
                context.arc(coords[0], coords[1], coords[2], 0, Math.PI * 2, false);
            }
            context.closePath();
            if(options.fill) {
                context.fillStyle = css3color(options.fillColor, options.fillOpacity);
                context.fill();
            }
            if(options.stroke) {
                context.strokeStyle = css3color(options.strokeColor, options.strokeOpacity);
                context.lineWidth = options.strokeWidth;
                context.stroke();
            }
            if(options.fade) {
                fader(canvas, 0);
            }
        };
        clear_canvas = function(canvas, area) {
            canvas.getContext('2d').clearRect(0, 0, canvas.width,canvas.height);
        };
    } else {
        document.createStyleSheet().addRule("v\\:*", "behavior: url(#default#VML); antialias: true;"); 
        document.namespaces.add("v", "urn:schemas-microsoft-com:vml"); 
        
        create_canvas_for = function(img) {
            return $('<var style="zoom:1;overflow:hidden;display:block;width:'+img.width+'px;height:'+img.height+'px;"></var>').get(0);
        };
        add_shape_to = function(canvas, shape, coords, options) {
            var fill, stroke, opacity, e;
            fill = '<v:fill color="#'+options.fillColor+'" opacity="'+(options.fill ? options.fillOpacity : 0)+'" />';
            stroke = (options.stroke ? 'strokeweight="'+options.strokeWidth+'" stroked="t" strokecolor="#'+options.strokeColor+'"' : 'stroked="f"');
            opacity = '<v:stroke opacity="'+options.strokeOpacity+'"/>';
            if(shape == 'rect') {
                e = $('<v:rect filled="t" '+stroke+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+coords[0]+'px;top:'+coords[1]+'px;width:'+(coords[2] - coords[0])+'px;height:'+(coords[3] - coords[1])+'px;"></v:rect>');
            } else if(shape == 'poly') {
                e = $('<v:shape filled="t" '+stroke+' coordorigin="0,0" coordsize="'+canvas.width+','+canvas.height+'" path="m '+coords[0]+','+coords[1]+' l '+coords.join(',')+' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:'+canvas.width+'px;height:'+canvas.height+'px;"></v:shape>');
            } else if(shape == 'circ') {
                e = $('<v:oval filled="t" '+stroke+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+(coords[0] - coords[2])+'px;top:'+(coords[1] - coords[2])+'px;width:'+(coords[2]*2)+'px;height:'+(coords[2]*2)+'px;"></v:oval>');
            }
            e.get(0).innerHTML = fill+opacity;
            $(canvas).append(e);
        };
        clear_canvas = function(canvas) {
            $(canvas).empty();
        };
    }
    shape_from_area = function(area) {
        var i, coords = area.getAttribute('coords').split(',');
        for (i=0; i < coords.length; i++) { coords[i] = parseFloat(coords[i]); }
        return [area.getAttribute('shape').toLowerCase().substr(0,4), coords];
    };
    
    is_image_loaded = function(img) {
        if(!img.complete) { return false; } // IE
        if(typeof img.naturalWidth != "undefined" && img.naturalWidth == 0) { return false; } // Others
        return true;
    }

    canvas_style = {
        position: 'absolute',
        left: 0,
        top: 0,
        padding: 0,
        border: 0
    };
    
    $.fn.maphilight = function(opts) {
        opts = $.extend({}, $.fn.maphilight.defaults, opts);
        return this.each(function() {
            var img, wrap, options, map, canvas, mouseover;
            img = $(this);
            if(!is_image_loaded(this)) { return window.setTimeout(function() { img.maphilight(); }, 200); }
            options = $.metadata ? $.extend({}, opts, img.metadata()) : opts;
            map = $('map[name="'+img.attr('usemap').substr(1)+'"]');
            if(!(img.is('img') && img.attr('usemap') && map.size() > 0 && !img.hasClass('maphilighted'))) { return; }
            wrap = $('<div>').css({display:'block',background:'url('+this.src+')',position:'relative',padding:0,width:this.width,height:this.height});
            img.before(wrap).css('opacity', 0).css(canvas_style).remove();
            if($.browser.msie) { img.css('filter', 'Alpha(opacity=0)'); }
            wrap.append(img);
            
            canvas = create_canvas_for(this);
            $(canvas).css(canvas_style);
            canvas.height = this.height;
            canvas.width = this.width;
            
            mouseover = function(e) {
                          var alt = $(this).attr("alt");
                          $("area[@alt="+ alt +"]").each(function()
                          {
                var shape = shape_from_area(this);
                add_shape_to(canvas, shape[0], shape[1], options);
                          });
            };

            if(options.alwaysOn) {
                $(map).find('area[coords]').each(mouseover);
            } else {
                $(map).find('area[coords]').mouseover(mouseover).mouseout(function(e) { clear_canvas(canvas); });
            }
            
            img.before(canvas); // if we put this after, the mouseover events wouldn't fire.
            img.addClass('maphilighted');
        });
    };
    $.fn.maphilight.defaults = {
        fill: true,
        fillColor: '006ab2',
        fillOpacity: 0.6,
        stroke: false,
        strokeColor: '006ab2',
        strokeOpacity: 1,
        strokeWidth: 1,
        fade: true,
        alwaysOn: false
    };
})(jQuery);

/**
 * jQuery.LocalScroll - Animated scrolling navigation, using anchors.
 * Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 6/3/2008
 * @author Ariel Flesler
 * @version 1.2.6
 **/
;(function($){var g=location.href.replace(/#.*/,''),h=$.localScroll=function(a){$('body').localScroll(a)};h.defaults={duration:1e3,axis:'y',event:'click',stop:1};h.hash=function(a){a=$.extend({},h.defaults,a);a.hash=0;if(location.hash)setTimeout(function(){i(0,location,a)},0)};$.fn.localScroll=function(b){b=$.extend({},h.defaults,b);return(b.persistent||b.lazy)?this.bind(b.event,function(e){var a=$([e.target,e.target.parentNode]).filter(c)[0];a&&i(e,a,b)}):this.find('a,area').filter(c).bind(b.event,function(e){i(e,this,b)}).end().end();function c(){var a=this;return!!a.href&&!!a.hash&&a.href.replace(a.hash,'')==g&&(!b.filter||$(a).is(b.filter))}};function i(e,a,b){var c=a.hash.slice(1),d=document.getElementById(c)||document.getElementsByName(c)[0],f;if(d){e&&e.preventDefault();f=$(b.target||$.scrollTo.window());if(b.lock&&f.is(':animated')||b.onBefore&&b.onBefore.call(a,e,d,f)===!1)return;if(b.stop)f.queue('fx',[]).stop();f.scrollTo(d,b).trigger('notify.serialScroll',[d]);if(b.hash)f.queue(function(){location=a.hash;$(this).dequeue()})}}})(jQuery);
/*
 * Metadata - jQuery plugin for parsing metadata from elements
 *
 * Copyright (c) 2006 John Resig, Yehuda Katz, Jï¿½Ã¶rn Zaefferer, Paul McLanahan
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.metadata.js 3620 2007-10-10 20:55:38Z pmclanahan $
 *
 */
(function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({.*})/,single:'metadata'},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length)settings.single='metadata';var data=$.data(elem,settings.single);if(data)return data;data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m)data=m[1];}else if(settings.type=="elem"){if(!elem.getElementsByTagName)return;var e=elem.getElementsByTagName(settings.name);if(e.length)data=$.trim(e[0].innerHTML);}else if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr)data=attr;}if(data.indexOf('{')<0)data="{"+data+"}";data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);
/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 9/11/2008
 * @author Ariel Flesler
 * @version 1.4
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(h){var m=h.scrollTo=function(b,c,g){h(window).scrollTo(b,c,g)};m.defaults={axis:'y',duration:1};m.window=function(b){return h(window).scrollable()};h.fn.scrollable=function(){return this.map(function(){var b=this.parentWindow||this.defaultView,c=this.nodeName=='#document'?b.frameElement||b:this,g=c.contentDocument||(c.contentWindow||c).document,i=c.setInterval;return c.nodeName=='IFRAME'||i&&h.browser.safari?g.body:i?g.documentElement:this})};h.fn.scrollTo=function(r,j,a){if(typeof j=='object'){a=j;j=0}if(typeof a=='function')a={onAfter:a};a=h.extend({},m.defaults,a);j=j||a.speed||a.duration;a.queue=a.queue&&a.axis.length>1;if(a.queue)j/=2;a.offset=n(a.offset);a.over=n(a.over);return this.scrollable().each(function(){var k=this,o=h(k),d=r,l,e={},p=o.is('html,body');switch(typeof d){case'number':case'string':if(/^([+-]=)?\d+(px)?$/.test(d)){d=n(d);break}d=h(d,this);case'object':if(d.is||d.style)l=(d=h(d)).offset()}h.each(a.axis.split(''),function(b,c){var g=c=='x'?'Left':'Top',i=g.toLowerCase(),f='scroll'+g,s=k[f],t=c=='x'?'Width':'Height',v=t.toLowerCase();if(l){e[f]=l[i]+(p?0:s-o.offset()[i]);if(a.margin){e[f]-=parseInt(d.css('margin'+g))||0;e[f]-=parseInt(d.css('border'+g+'Width'))||0}e[f]+=a.offset[i]||0;if(a.over[i])e[f]+=d[v]()*a.over[i]}else e[f]=d[i];if(/^\d+$/.test(e[f]))e[f]=e[f]<=0?0:Math.min(e[f],u(t));if(!b&&a.queue){if(s!=e[f])q(a.onAfterFirst);delete e[f]}});q(a.onAfter);function q(b){o.animate(e,j,a.easing,b&&function(){b.call(this,r,a)})};function u(b){var c='scroll'+b,g=k.ownerDocument;return p?Math.max(g.documentElement[c],g.body[c]):k[c]}}).end()};function n(b){return typeof b=='object'?b:{top:b,left:b}}})(jQuery);
var GACode = "UA-154425-8";
var GADomain = ".paessler.com";
var GAGif = "/static/__utm.gif";

$(document).ready(function(){
    loadGA();
});

function loadGA()
{
    var host = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    var js   = host + "google-analytics.com/ga.js";
    $.getScript(js,initGA);
}

function initGA()
{
    try 
    {
        var pageTracker = _gat._getTracker(GACode);
        pageTracker._setDomainName(GADomain);
        pageTracker._setLocalGifPath(GAGif) ;
        pageTracker._setLocalRemoteServerMode();
        pageTracker._trackPageview();
    } catch(e) 
    {
    }
}
    
$(document).ready(function(){

// Tooltip
  $(".tooltip").tooltip({ 
    bodyHandler: function() { 
        return $($(this).attr("href")).html(); 
    }, 
    showURL: false 
});
	
// Featureueberblendung Home

    iphone();
    
    
    

    
// superfish für IE6
    $("#pnlMainMenu ul").superfish();

// Bildueberblendung Moodarea
    $("#pnlMood").hover(
	    function()
	    {
	        $(this).find("div").fadeIn(500);
	    },
	    function()
	    {
	    }
	).click(
	    function()
	    {
	        $(this).find("div").fadeOut(500);
	    }
	);

// Toggle Listen
    $("ul.toggle .collapsed").toggle(
        function()
        {
            $(this).parent().find("ul").slideDown();
        },
        function()
        {
            $(this).parent().find("ul").slideUp();
        }
    );
	
	$("div.pr-archive-list h3").toggle(
        function()
        {
            var year = $(this).attr("class");
            $(this).parent().find("ul."+ year).slideDown();
        },
        function()
        {
            var year = $(this).attr("class");
            $(this).parent().find("ul."+ year).slideUp();
        }
    );

// FAQs
	faq();
	
// Search Box
    search();

// Partner Filterung
    try
    {
        $('.map').maphilight();
    }
    catch (e) {}


    $("div#continents area").click(
        function()
        {
		    var cc = $(this).attr('alt');
		    $("div#address_complete").addClass('height');
		    $("div#countries ul li").hide();
		    $("div.address").hide();
		    $("div#countries").show();
		    $("div#countries ul li."+cc).show();
		    $("div."+cc).show();
	    }
	);
	    
    try
    {
	    $.localScroll();
    }
    catch (e) {}

// required fields abfangen

    $("#formMailer").validate(
    {
	rules:
	{
	    Name: "required",
	    Surname: "required",
	    Company: "required",
	    "E-mail":{required: true,email: true}
	},
	messages:
	{
	    Name: "Please fill in your name",
	    Surname: "Please fill in your surname",
	    Company: "Please fill in your company",
	    "E-mail":{required: "Please fill in your e-mail-address",email: "Please fill in the correct e-mail-validation"}
	}
    }
    );
    
    $("body.english #login").validate(
    {
	rules:
	{
	    from:{required:true,email:true}
	},
	messages:
	{
	    from:{required:"Please enter your email address",email:"Please enter a valid email address"}
	}
    });
    
    $("body.italiano #login").validate(
    {
	rules:
	{
	    from:{required:true,email:true}
	},
	messages:
	{
	    from:{required:"Please enter your email address",email:"Please enter a valid email address"}
	}
    });
    
    $("body.deutsch #login").validate(
    {
	rules:
	{
	    from:{required:true,email:true}
	},
	messages:
	{
	    from:{required:"Bitte geben Sie ihre E-Mail Adresse ein",email:"Bitte geben Sie eine gültige E-mail Adresse ein"}
	}
    });
    
    $("body.francais #login").validate(
    {
	rules:
	{
	    from:{required:true,email:true}
	},
	messages:
	{
	    from:{required:"Veuillez s'il vous plaît taper votre adresse e-mail",email:"Veuillez s'il vous plaît donner une adresse e-mail actuelle"}
	}
    });
    
    $("body.espagnol #login").validate(
    {
	rules:
	{
	    from:{required:true,email:true}
	},
	messages:
	{
	    from:{required:"Please enter your email address",email:"Please enter a valid email address"}
	}
    });

	
// external Links

    $("a[@href^=http]").not("[@href*='paessler.com']").attr('target', '_blank');
    $('a[@href$=".pdf"]').attr('target', '_blank');

// fix for target=”_blank”

    $("a[@rel~='external']").click(function()
    {
        window.open($(this).attr("href"));
        return false;
    });
	
// case Studies
   
    $('div#filter input[@type=checkbox]').attr("checked",true);

    $('div#filter input[@type=checkbox]').click(
	function()
    {
        $('div.casestudies div.all ul li').hide();
        $('div.casestudies div.all ul').hide();
        $('div#filter li.product input[@type=checkbox][@checked]').each(
			function()
			{
	            var c = $(this).val();
	            $('div.casestudies div.all ul.'+ c).show();
	        }
		);
        $('div#filter li.challenges input[@type=checkbox][@checked]').each(
			function()
	        {
	            var c = $(this).val();
	            $('div.casestudies div.all ul li.'+ c).show();
	        }
		);
		$('div#filter li.country input:not(:checked)').each(
			function()
	        {
	            var c = $(this).val();
	            $('div.casestudies div.all ul li.'+ c).hide();
	        }
		);
        $('div#filter li.company_size input:not(:checked)').each(
			function()
	        {
	            var c = $(this).val();
	            $('div.casestudies div.all ul li.'+ c).hide();
	        }
		);
        $('div#filter li.branch input:not(:checked)').each(
			function()
	        {
	            var c = $(this).val();
	            $('div.casestudies div.all ul li.'+ c).hide();
	        }
		);
    });
	
// collapseItem for Casestudies

    $('div#filter a').toggle(
		function()
		{
			$(this).parent().find("ul").fadeIn("slow");
			$(this).addClass("active");
		},
		function()
		{
			$(this).parent().find("ul").fadeOut("slow");
			$(this).removeClass("active");
		}
	);


// lightbox
    //$("a[href$='.png'],a[href$='.jpg'],a[href$='.gif'],a.lightbox").lightBox(
	//{
		    //imageLoading: '/common/img/lightbox/lightbox-ico-loading.gif',
		    //imageBtnClose: '/common/img/lightbox/lightbox-btn-close.gif',
		    //imageBtnPrev: '/common/img/lightbox/lightbox-btn-prev.gif',
		    //imageBtnNext: '/common/img/lightbox/lightbox-btn-next.gif',
		    //imageBlank: '/common/img/lightbox/lightbox-blank.gif'
		//}
    //);
    
// fancybox
    $("a.iframe").fancybox(
        {'overlayShow':true,'frameWidth':1015,'frameHeight':750}
    );
    
    $("a[href$='.png'],a[href$='.jpg'],a[href$='.gif'],a.lightbox").fancybox(
        {'overlayShow':true,
        'imageScale':false}
    );

// collapseItem
    $('a.collapseItem').click(function()
    {
    var ul = $(this).parent().next();
    if (ul.html() == null) ul = $(this).next();
    if (ul.is(':visible'))
    {
    ul.slideUp();
    $(this).removeClass("expanded");
    }
    else
    {
    ul.slideDown();
    $(this).addClass("expanded");
    }
    return false;
    });
    
    $('ul.hidden:not(:eq(0))').hide();





    // SWFObject
    $("object.swf").each(function()
    {
    var id = $(this).attr("id");
    //swfobject.registerObject(id, "9.0.0");
    }
    );
    
    // Google Maps
    try
    {
    icon = new GIcon();
    icon.image = "/common/img/gmap_logo.png";
    icon.shadow = "/common/img/gmap_shadow.png";
    icon.iconSize = new GSize(146, 65);
    icon.shadowSize = new GSize(173, 75);
    icon.iconAnchor = new GPoint(3, 62);
    googleLoad();
    } catch (e) {}



}); // END: $(document).ready(function(){})



//-----------------------------------

// Featureüberblendung Home

var mastercount = 13;
var lifeTime1 = 1500;
var lifeTime2 = 5000;
var fadeTime = 800;
var counter = null;
var feature = null;
var bubble = null;

function iphone(){
    if (navigator.userAgent.match(/iPhone/))
    {
    }
    else
    {
        $("div.opening").addClass("emptymood");
        moodarea();
        aboutprtg();
    }
    return false;
}

function aboutprtg(){
    $("div#feature a").click(function(){
        var link = $(this).attr("href");
        var url = $(this).parent().css("background-image");
        var name = url.split("/").reverse()[0].split("-")[0];
        var urls = "/company/casestudies/" + name;
        
        if (url.indexOf("/casestudies") > -1)
        {
            location.href = urls;
            return false;
        }
    });
}
    
    
function moodarea(){
	if (counter == null) 
	{
		counter = Math.round(Math.random() * (mastercount - 1));
		feature = $('div#feature');
		bubble = $("span", feature);
	}
	if (counter >= mastercount)
		counter = 0;
	feature.hide()
			.removeClass()
			.addClass("member_"+counter)
			.fadeIn(fadeTime,triggerBubbleFadeIn);
	bubble.hide();
	counter += 1;
}

function triggerBubbleFadeIn()
{
	setTimeout(function()
    {
        bubble.fadeIn(fadeTime,triggerFeatureFadeOut);
    }, lifeTime1);
}

function triggerFeatureFadeOut()
{
	setTimeout(function()
    {
		feature.fadeOut(fadeTime,moodarea);
	}, lifeTime2);	
}

function faq()
{
	var h3s = $("div.faq h3");
    if (h3s.length == 0) 
		return;
	h3s.toggle(
        function()
        {
			$(this).parent().addClass("faq_open").find("table,p,ul").show();
        },
        function()
        {
            $(this).parent().removeClass("faq_open").find("table,p,ul").hide();
        }
    );		
	var id = document.location.hash.replace(/#/,"")
    $("a[name='"+id+"']").parent().click();
}


var input = null;
function search()
{
    if (input==null)
        input = $("input.extended_search");
    var search_name = input.attr("title");
    input.focus(function ()
    {
        if (input.val()==search_name) 
            input.val("");
    }).blur(function ()
    {
        if (input.val()=="") 
            input.val(search_name);
    });
    
    input.parent().find("a").click(function ()
    {
        if (input.val() == search_name) 
        {
            input.focus();
            return false;
        }
        else 
        {
            document.forms[0].submit();
            return false;
        }
    });

    input.autocomplete('/extended_search/suggest', {delay : 2000});
}








