/*Alberto Quispe Cuzcano, Mayo 2009*/
// JavaScript Document
/* // JCARRUSEL 0.2.3// */
(function($) {$.fn.jcarousel = function(o) {return this.each(function() {new $jc(this, o);});};var defaults = {vertical: false,start: 1,offset: 1,size: null,scroll: 3,visible: null,animation: 'normal',easing: 'swing',auto: 0,wrap: null,initCallback: null,reloadCallback: null,itemLoadCallback: null,itemFirstInCallback: null,itemFirstOutCallback: null,itemLastInCallback: null,itemLastOutCallback: null,itemVisibleInCallback: null,itemVisibleOutCallback: null,buttonNextHTML: '<div></div>',buttonPrevHTML: '<div></div>',buttonNextEvent: 'click',buttonPrevEvent: 'click',buttonNextCallback: null,buttonPrevCallback: null};$.jcarousel = function(e, o) {this.options    = $.extend({}, defaults, o || {});this.locked     = false;this.container  = null;this.clip       = null;this.list       = null;this.buttonNext = null;this.buttonPrev = null;this.wh = !this.options.vertical ? 'width' : 'height';this.lt = !this.options.vertical ? 'left' : 'top';var skin = '', split = e.className.split(' ');for (var i = 0; i < split.length; i++) {if (split[i].indexOf('jcarousel-skin') != -1) {$(e).removeClass(split[i]);var skin = split[i];break;}}if (e.nodeName == 'UL' || e.nodeName == 'OL') {this.list = $(e);this.container = this.list.parent();if (this.container.hasClass('jcarousel-clip')) {if (!this.container.parent().hasClass('jcarousel-container'))this.container = this.container.wrap('<div></div>');this.container = this.container.parent();} else if (!this.container.hasClass('jcarousel-container'))this.container = this.list.wrap('<div></div>').parent();} else {this.container = $(e);this.list = $(e).find('>ul,>ol,div>ul,div>ol');}if (skin != '' && this.container.parent()[0].className.indexOf('jcarousel-skin') == -1)this.container.wrap('<div class=" '+ skin + '"></div>');this.clip = this.list.parent();if (!this.clip.length || !this.clip.hasClass('jcarousel-clip'))this.clip = this.list.wrap('<div></div>').parent();this.buttonPrev = $('.jcarousel-prev', this.container);if (this.buttonPrev.size() == 0 && this.options.buttonPrevHTML != null)this.buttonPrev = this.clip.before(this.options.buttonPrevHTML).prev();this.buttonPrev.addClass(this.className('jcarousel-prev'));this.buttonNext = $('.jcarousel-next', this.container);if (this.buttonNext.size() == 0 && this.options.buttonNextHTML != null)this.buttonNext = this.clip.before(this.options.buttonNextHTML).prev();this.buttonNext.addClass(this.className('jcarousel-next'));this.clip.addClass(this.className('jcarousel-clip'));this.list.addClass(this.className('jcarousel-list'));this.container.addClass(this.className('jcarousel-container'));var di = this.options.visible != null ? Math.ceil(this.clipping() / this.options.visible) : null;var li = this.list.children('li');var self = this;if (li.size() > 0) {var wh = 0, i = this.options.offset;li.each(function() {self.format(this, i++);wh += self.dimension(this, di);});this.list.css(this.wh, wh + 'px');if (!o || o.size === undefined)this.options.size = li.size();}this.container.css('display', 'block');this.buttonNext.css('display', 'block');this.buttonPrev.css('display', 'block');this.funcNext   = function() { self.next(); };this.funcPrev   = function() { self.prev(); };this.funcResize = function() { self.reload(); };if (this.options.initCallback != null)this.options.initCallback(this, 'init');if ($.browser.safari) {this.buttons(false, false);$(window).bind('load', function() { self.setup(); });} else
this.setup();};var $jc = $.jcarousel;$jc.fn = $jc.prototype = {jcarousel: '0.2.3'};$jc.fn.extend = $jc.extend = $.extend;$jc.fn.extend({setup: function() {this.first     = null;this.last      = null;this.prevFirst = null;this.prevLast  = null;this.animating = false;this.timer     = null;this.tail      = null;this.inTail    = false;if (this.locked)return;this.list.css(this.lt, this.pos(this.options.offset) + 'px');var p = this.pos(this.options.start);this.prevFirst = this.prevLast = null;this.animate(p, false);$(window).unbind('resize', this.funcResize).bind('resize', this.funcResize);},reset: function() {this.list.empty();this.list.css(this.lt, '0px');this.list.css(this.wh, '10px');if (this.options.initCallback != null)this.options.initCallback(this, 'reset');this.setup();},reload: function() {if (this.tail != null && this.inTail)this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + this.tail);this.tail   = null;this.inTail = false;if (this.options.reloadCallback != null)this.options.reloadCallback(this);if (this.options.visible != null) {var self = this;var di = Math.ceil(this.clipping() / this.options.visible), wh = 0, lt = 0;$('li', this.list).each(function(i) {wh += self.dimension(this, di);if (i + 1 < self.first)lt = wh;});this.list.css(this.wh, wh + 'px');this.list.css(this.lt, -lt + 'px');}this.scroll(this.first, false);},lock: function() {this.locked = true;this.buttons();},unlock: function() {this.locked = false;this.buttons();},size: function(s) {if (s != undefined) {this.options.size = s;if (!this.locked)this.buttons();}return this.options.size;},has: function(i, i2) {if (i2 == undefined || !i2)i2 = i;if (this.options.size !== null && i2 > this.options.size)i2 = this.options.size;for (var j = i; j <= i2; j++) {var e = this.get(j);if (!e.length || e.hasClass('jcarousel-item-placeholder'))return false;}return true;},get: function(i) {return $('.jcarousel-item-' + i, this.list);},add: function(i, s) {var e = this.get(i), old = 0, add = 0;if (e.length == 0) {var c, e = this.create(i), j = $jc.intval(i);while (c = this.get(--j)) {if (j <= 0 || c.length) {j <= 0 ? this.list.prepend(e) : c.after(e);break;}}} else old = this.dimension(e);e.removeClass(this.className('jcarousel-item-placeholder'));typeof s == 'string' ? e.html(s) : e.empty().append(s);var di = this.options.visible != null ? Math.ceil(this.clipping() / this.options.visible) : null;var wh = this.dimension(e, di) - old;if (i > 0 && i < this.first)this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) - wh + 'px');this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) + wh + 'px');return e;},remove: function(i) {var e = this.get(i);if (!e.length || (i >= this.first && i <= this.last))return;var d = this.dimension(e);if (i < this.first)this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + d + 'px');e.remove();this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) - d + 'px');},next: function() {this.stopAuto();if (this.tail != null && !this.inTail)this.scrollTail(false);else this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'last') && this.options.size != null && this.last == this.options.size) ? 1 : this.first + this.options.scroll);},prev: function() {this.stopAuto();if (this.tail != null && this.inTail)this.scrollTail(true);else this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'first') && this.options.size != null && this.first == 1) ? this.options.size : this.first - this.options.scroll);},scrollTail: function(b) {if (this.locked || this.animating || !this.tail)return;var pos  = $jc.intval(this.list.css(this.lt));!b ? pos -= this.tail : pos += this.tail;this.inTail = !b;this.prevFirst = this.first;this.prevLast  = this.last;this.animate(pos);},scroll: function(i, a) {if (this.locked || this.animating)return;this.animate(this.pos(i), a);},pos: function(i) {if (this.locked || this.animating)return;if (this.options.wrap != 'circular')i = i < 1 ? 1 : (this.options.size && i > this.options.size ? this.options.size : i);var back = this.first > i;var pos  = $jc.intval(this.list.css(this.lt));var f = this.options.wrap != 'circular' && this.first <= 1 ? 1 : this.first;var c = back ? this.get(f) : this.get(this.last);var j = back ? f : f - 1;var e = null, l = 0, p = false, d = 0;while (back ? --j >= i : ++j < i) {e = this.get(j);p = !e.length;if (e.length == 0) {e = this.create(j).addClass(this.className('jcarousel-item-placeholder'));c[back ? 'before' : 'after' ](e);}c = e;d = this.dimension(e);if (p) l += d;if (this.first != null && (this.options.wrap == 'circular' || (j >= 1 && (this.options.size == null || j <= this.options.size))))pos = back ? pos + d : pos - d;}var clipping = this.clipping();var cache = [];var visible = 0, j = i, v = 0;var c = this.get(i - 1);while (++visible) {e = this.get(j);p = !e.length;if (e.length == 0) {e = this.create(j).addClass(this.className('jcarousel-item-placeholder'));c.length == 0 ? this.list.prepend(e) : c[back ? 'before' : 'after' ](e);}c = e;var d = this.dimension(e);if (d == 0) {alert('jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...');return 0;}if (this.options.wrap != 'circular' && this.options.size !== null && j > this.options.size)cache.push(e);else if (p)l += d;v += d;if (v >= clipping)break;j++;}for (var x = 0; x < cache.length; x++)cache[x].remove();if (l > 0) {this.list.css(this.wh, this.dimension(this.list) + l + 'px');if (back) {pos -= l;this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) - l + 'px');}}var last = i + visible - 1;if (this.options.wrap != 'circular' && this.options.size && last > this.options.size)last = this.options.size;if (j > last) {visible = 0, j = last, v = 0;while (++visible) {var e = this.get(j--);if (!e.length)break;v += this.dimension(e);if (v >= clipping)break;}}var first = last - visible + 1;if (this.options.wrap != 'circular' && first < 1)first = 1;if (this.inTail && back) {pos += this.tail;this.inTail = false;}this.tail = null;if (this.options.wrap != 'circular' && last == this.options.size && (last - visible + 1) >= 1) {var m = $jc.margin(this.get(last), !this.options.vertical ? 'marginRight' : 'marginBottom');if ((v - m) > clipping)this.tail = v - clipping - m;}while (i-- > first)pos += this.dimension(this.get(i));this.prevFirst = this.first;this.prevLast  = this.last;this.first     = first;this.last      = last;return pos;},animate: function(p, a) {if (this.locked || this.animating)return;this.animating = true;var self = this;var scrolled = function() {self.animating = false;if (p == 0)self.list.css(self.lt,  0);if (self.options.wrap == 'both' || self.options.wrap == 'last' || self.options.size == null || self.last < self.options.size)self.startAuto();self.buttons();self.notify('onAfterAnimation');};this.notify('onBeforeAnimation');if (!this.options.animation || a == false) {this.list.css(this.lt, p + 'px');scrolled();} else {var o = !this.options.vertical ? {'left': p} : {'top': p};this.list.animate(o, this.options.animation, this.options.easing, scrolled);}},startAuto: function(s) {if (s != undefined)this.options.auto = s;if (this.options.auto == 0)return this.stopAuto();if (this.timer != null)return;var self = this;this.timer = setTimeout(function() { self.next(); }, this.options.auto * 1000);},stopAuto: function() {if (this.timer == null)return;clearTimeout(this.timer);this.timer = null;},buttons: function(n, p) {if (n == undefined || n == null) {var n = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'first') || this.options.size == null || this.last < this.options.size);if (!this.locked && (!this.options.wrap || this.options.wrap == 'first') && this.options.size != null && this.last >= this.options.size)n = this.tail != null && !this.inTail;}if (p == undefined || p == null) {var p = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'last') || this.first > 1);if (!this.locked && (!this.options.wrap || this.options.wrap == 'last') && this.options.size != null && this.first == 1)p = this.tail != null && this.inTail;}var self = this;this.buttonNext[n ? 'bind' : 'unbind'](this.options.buttonNextEvent, this.funcNext)[n ? 'removeClass' : 'addClass'](this.className('jcarousel-next-disabled')).attr('disabled', n ? false : true);this.buttonPrev[p ? 'bind' : 'unbind'](this.options.buttonPrevEvent, this.funcPrev)[p ? 'removeClass' : 'addClass'](this.className('jcarousel-prev-disabled')).attr('disabled', p ? false : true);if (this.buttonNext.length > 0 && (this.buttonNext[0].jcarouselstate == undefined || this.buttonNext[0].jcarouselstate != n) && this.options.buttonNextCallback != null) {this.buttonNext.each(function() { self.options.buttonNextCallback(self, this, n); });this.buttonNext[0].jcarouselstate = n;}if (this.buttonPrev.length > 0 && (this.buttonPrev[0].jcarouselstate == undefined || this.buttonPrev[0].jcarouselstate != p) && this.options.buttonPrevCallback != null) {this.buttonPrev.each(function() { self.options.buttonPrevCallback(self, this, p); });this.buttonPrev[0].jcarouselstate = p;}},notify: function(evt) {var state = this.prevFirst == null ? 'init' : (this.prevFirst < this.first ? 'next' : 'prev');this.callback('itemLoadCallback', evt, state);if (this.prevFirst !== this.first) {this.callback('itemFirstInCallback', evt, state, this.first);this.callback('itemFirstOutCallback', evt, state, this.prevFirst);}if (this.prevLast !== this.last) {this.callback('itemLastInCallback', evt, state, this.last);this.callback('itemLastOutCallback', evt, state, this.prevLast);}this.callback('itemVisibleInCallback', evt, state, this.first, this.last, this.prevFirst, this.prevLast);this.callback('itemVisibleOutCallback', evt, state, this.prevFirst, this.prevLast, this.first, this.last);},callback: function(cb, evt, state, i1, i2, i3, i4) {if (this.options[cb] == undefined || (typeof this.options[cb] != 'object' && evt != 'onAfterAnimation'))return;var callback = typeof this.options[cb] == 'object' ? this.options[cb][evt] : this.options[cb];if (!$.isFunction(callback))return;var self = this;if (i1 === undefined)callback(self, state, evt);else if (i2 === undefined)this.get(i1).each(function() { callback(self, this, i1, state, evt); });else {for (var i = i1; i <= i2; i++)if (i !== null && !(i >= i3 && i <= i4))this.get(i).each(function() { callback(self, this, i, state, evt); });}},create: function(i) {return this.format('<li></li>', i);},format: function(e, i) {var $e = $(e).addClass(this.className('jcarousel-item')).addClass(this.className('jcarousel-item-' + i));$e.attr('jcarouselindex', i);return $e;},className: function(c) {return c + ' ' + c + (!this.options.vertical ? '-horizontal' : '-vertical');},dimension: function(e, d) {var el = e.jquery != undefined ? e[0] : e;var old = !this.options.vertical ? el.offsetWidth + $jc.margin(el, 'marginLeft') + $jc.margin(el, 'marginRight') : el.offsetHeight + $jc.margin(el, 'marginTop') + $jc.margin(el, 'marginBottom');if (d == undefined || old == d)return old;var w = !this.options.vertical ? d - $jc.margin(el, 'marginLeft') - $jc.margin(el, 'marginRight') : d - $jc.margin(el, 'marginTop') - $jc.margin(el, 'marginBottom');$(el).css(this.wh, w + 'px');return this.dimension(el);},clipping: function() {return !this.options.vertical ? this.clip[0].offsetWidth - $jc.intval(this.clip.css('borderLeftWidth')) - $jc.intval(this.clip.css('borderRightWidth')) : this.clip[0].offsetHeight - $jc.intval(this.clip.css('borderTopWidth')) - $jc.intval(this.clip.css('borderBottomWidth'));},index: function(i, s) {if (s == undefined)s = this.options.size;return Math.round((((i-1) / s) - Math.floor((i-1) / s)) * s) + 1;}});$jc.extend({defaults: function(d) {return $.extend(defaults, d || {});},margin: function(e, p) {if (!e)return 0;var el = e.jquery != undefined ? e[0] : e;if (p == 'marginRight' && $.browser.safari) {var old = {'display': 'block', 'float': 'none', 'width': 'auto'}, oWidth, oWidth2;$.swap(el, old, function() { oWidth = el.offsetWidth; });old['marginRight'] = 0;$.swap(el, old, function() { oWidth2 = el.offsetWidth; });return oWidth2 - oWidth;}return $jc.intval($.css(el, p));},intval: function(v) {v = parseInt(v);return isNaN(v) ? 0 : v;}});})(jQuery);

/*tab*/
$.tabs = function(containerId, start) {var ON_CLASS = 'on';var id = '#' + containerId;var i = (typeof start == "number") ? start - 1 : 0;$(id + '>div:lt(' + i + ')').add(id + '>div:gt(' + i + ')').hide();$(id + '>ul>li:nth-child(' + (i+1) + ')').addClass(ON_CLASS);$(id + '>ul>li>a').click(function() {$(this).load( function() { alert("Hello"); } );if (!$(this.parentNode).is('.' + ON_CLASS)) {var re = /([_\-\w]+$)/i;var target = $('#' + re.exec(this.href)[1]);if (target.size() > 0) {$(id + '>div:visible').hide();target.show();$(id + '>ul>li').removeClass(ON_CLASS);$(this.parentNode).addClass(ON_CLASS);} else {alert('There is no such container.');}}return false;});};

$.tabsmenu = function(containerId, start) {var ON_CLASS = 'on';var id = '#' + containerId;var i = (typeof start == "number") ? start - 1 : 0;$(id + '>div:lt(' + i + ')').add(id + '>div:gt(' + i + ')').hide();$(id + '>ul>li:nth-child(' + (i+1) + ')').addClass(ON_CLASS);$(id + '>ul>li>a').click(function() {$(this).load( function() { alert("Hello");} );if (!$(this.parentNode).is('.' + ON_CLASS)) {var re = /([_\-\w]+$)/i;var target = $('#' + re.exec(this.href)[1]);if (target.size() > 0) {$(id + '>div:visible').slideUp();target.slideDown("slow");$(id + '>ul>li').removeClass(ON_CLASS);$(this.parentNode).addClass(ON_CLASS);} else {alert('There is no such container.');}}return false;});};

/*Vertical Align 2009-04-29*/
(function($) {$.fn.VerticalAlign = function(opts) {return this.each(function() {var top = (($(this).parent().height() - $(this).height()) / 2);$(this).css('margin-top', top);});};})(jQuery);

/*ScrollTo 1.4.1*/
;(function($){var m=$.scrollTo=function(b,h,f){$(window).scrollTo(b,h,f)};m.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1};m.window=function(b){return $(window).scrollable()};$.fn.scrollable=function(){return this.map(function(){var b=this,h=!b.nodeName||$.inArray(b.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!h)return b;var f=(b.contentWindow||b).document||b.ownerDocument||b;return $.browser.safari||f.compatMode=='BackCompat'?f.body:f.documentElement})};$.fn.scrollTo=function(l,j,a){if(typeof j=='object'){a=j;j=0}if(typeof a=='function')a={onAfter:a};if(l=='max')l=9e9;a=$.extend({},m.defaults,a);j=j||a.speed||a.duration;a.queue=a.queue&&a.axis.length>1;if(a.queue)j/=2;a.offset=n(a.offset);a.over=n(a.over);return this.scrollable().each(function(){var k=this,o=$(k),d=l,p,g={},q=o.is('html,body');switch(typeof d){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px)?$/.test(d)){d=n(d);break}d=$(d,this);case'object':if(d.is||d.style)p=(d=$(d)).offset()}$.each(a.axis.split(''),function(b,h){var f=h=='x'?'Left':'Top',i=f.toLowerCase(),c='scroll'+f,r=k[c],s=h=='x'?'Width':'Height';if(p){g[c]=p[i]+(q?0:r-o.offset()[i]);if(a.margin){g[c]-=parseInt(d.css('margin'+f))||0;g[c]-=parseInt(d.css('border'+f+'Width'))||0}g[c]+=a.offset[i]||0;if(a.over[i])g[c]+=d[s.toLowerCase()]()*a.over[i]}else g[c]=d[i];if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],u(s));if(!b&&a.queue){if(r!=g[c])t(a.onAfterFirst);delete g[c]}});t(a.onAfter);function t(b){o.animate(g,j,a.easing,b&&function(){b.call(this,l,a)})};function u(b){var h='scroll'+b;if(!q)return k[h];var f='client'+b,i=k.ownerDocument.documentElement,c=k.ownerDocument.body;return Math.max(i[h],c[h])-Math.min(i[f],c[f])}}).end()};function n(b){return typeof b=='object'?b:{top:b,left:b}}})(jQuery);
;(function($){var a='serialScroll',b='.'+a,c='bind',C=$[a]=function(b){$.scrollTo.window()[a](b)};C.defaults={duration:1e3,axis:'x',event:'click',start:0,step:1,lock:1,cycle:1,constant:1};$.fn[a]=function(y){y=$.extend({},C.defaults,y);var z=y.event,A=y.step,B=y.lazy;return this.each(function(){var j=y.target?this:document,k=$(y.target||this,j),l=k[0],m=y.items,o=y.start,p=y.interval,q=y.navigation,r;if(!B)m=w();if(y.force)t({},o);$(y.prev||[],j)[c](z,-A,s);$(y.next||[],j)[c](z,A,s);if(!l.ssbound)k[c]('prev'+b,-A,s)[c]('next'+b,A,s)[c]('goto'+b,t);if(p)k[c]('start'+b,function(e){if(!p){v();p=1;u()}})[c]('stop'+b,function(){v();p=0});k[c]('notify'+b,function(e,a){var i=x(a);if(i>-1)o=i});l.ssbound=1;if(y.jump)(B?k:w())[c](z,function(e){t(e,x(e.target))});if(q)q=$(q,j)[c](z,function(e){e.data=Math.round(w().length/q.length)*q.index(this);t(e,this)});function s(e){e.data+=o;t(e,this)};function t(e,a){if(!isNaN(a)){e.data=a;a=l}var c=e.data,n,d=e.type,f=y.exclude?w().slice(0,-y.exclude):w(),g=f.length,h=f[c],i=y.duration;if(d)e.preventDefault();if(p){v();r=setTimeout(u,y.interval)}if(!h){n=c<0?0:n=g-1;if(o!=n)c=n;else if(!y.cycle)return;else c=g-n-1;h=f[c]}if(!h||d&&o==c||y.lock&&k.is(':animated')||d&&y.onBefore&&y.onBefore.call(a,e,h,k,w(),c)===!1)return;if(y.stop)k.queue('fx',[]).stop();if(y.constant)i=Math.abs(i/A*(o-c));k.scrollTo(h,i,y).trigger('notify'+b,[c])};function u(){k.trigger('next'+b)};function v(){clearTimeout(r)};function w(){return $(m,l)};function x(a){if(!isNaN(a))return a;var b=w(),i;while((i=b.index(a))==-1&&a!=l)a=a.parentNode;return i}})}})(jQuery);


/* innerfade 2008-02-14*/
(function($) {$.fn.innerfade = function(options) {return this.each(function() {   $.innerfade(this, options);});};$.innerfade = function(container, options) {var settings = {'animationtype':    'fade','speed': 'normal','type': 'sequence','timeout': 2000,'containerheight': 'auto','runningclass':  'innerfade','children': null};if (options)$.extend(settings, options);if (settings.children === null)var elements = $(container).children();else var elements = $(container).children(settings.children);if (elements.length > 1) {$(container).css('position', 'relative').css('height', settings.containerheight).addClass(settings.runningclass);for (var i = 0; i < elements.length; i++) {$(elements[i]).css('z-index', String(elements.length-i)).css('position', 'absolute').hide();};if (settings.type == "sequence") {setTimeout(function() {$.innerfade.next(elements, settings, 1, 0);}, settings.timeout);$(elements[0]).show();} else if (settings.type == "random") {var last = Math.floor ( Math.random () * ( elements.length ) );setTimeout(function() {do { current = Math.floor ( Math.random ( ) * ( elements.length ) );} while (last == current ); $.innerfade.next(elements, settings, current, last);}, settings.timeout);
$(elements[last]).show();} else if ( settings.type == 'random_start' ) {settings.type = 'sequence';var current = Math.floor ( Math.random () * ( elements.length ) );setTimeout(function(){$.innerfade.next(elements, settings, (current + 1) %  elements.length, current);}, settings.timeout);$(elements[current]).show();}	else {alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');}}};$.innerfade.next = function(elements, settings, current, last) {if (settings.animationtype == 'slide') {$(elements[last]).slideUp(settings.speed);$(elements[current]).slideDown(settings.speed);} else if (settings.animationtype == 'fade') {$(elements[last]).fadeOut(settings.speed);$(elements[current]).fadeIn(settings.speed, function() {removeFilter($(this)[0]);});} else alert('Innerfade-animationtype must either be \'slide\' or \'fade\'');if (settings.type == "sequence") {if ((current + 1) < elements.length) {current = current + 1;last = current - 1;} else {current = 0;last = elements.length - 1;}} else if (settings.type == "random") {last = current;while (current == last) current = Math.floor(Math.random() * elements.length);} else alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');setTimeout((function() {$.innerfade.next(elements, settings, current, last);}), settings.timeout);};})(jQuery);function removeFilter(element) {if(element.style.removeAttribute){element.style.removeAttribute('filter');}}

/* jQuery (PNG Fix) v1.2 */
(function($) {$.fn.pngfix = function(options) {var elements = this;var settings = $.extend({imageFixSrc: false,sizingMethod: false }, options);if(!$.browser.msie || ($.browser.msie &&  $.browser.version >= 7)) {return(elements);}function setFilter(el, path, mode) {var fs = el.attr("filters");var alpha = "DXImageTransform.Microsoft.AlphaImageLoader";if (fs[alpha]) {fs[alpha].enabled = true;fs[alpha].src = path; fs[alpha].sizingMethod = mode;} else {el.css("filter", 'progid:' + alpha + '(enabled="true", sizingMethod="' + mode + '", src="' + path + '")');	}}function setDOMElementWidth(el) {if(el.css("width") == "auto" & el.css("height") == "auto") {el.css("width", el.attr("offsetWidth") + "px");}}return(elements.each(function() {var el = $(this);if(el.attr("tagName").toUpperCase() == "IMG" && (/\.png/i).test(el.attr("src"))) {if(!settings.imageFixSrc) {el.wrap("<span></span>");var par = el.parent();par.css({height: 	el.height(),width: 		el.width(),display: 	"inline-block"});setFilter(par, el.attr("src"), "scale");el.remove();} else if((/\.gif/i).test(settings.imageFixSrc)) {setDOMElementWidth(el);setFilter(el, el.attr("src"), "image");el.attr("src", settings.imageFixSrc);}} else {var bg = new String(el.css("backgroundImage"));var matches = bg.match(/^url\("(.*)"\)$/);if(matches && matches.length) {setDOMElementWidth(el);el.css("backgroundImage", "none");var sc = "crop";if(settings.sizingMethod) {sc = settings.sizingMethod;} setFilter(el, matches[1], sc);el.find("a").each(function() {$(this).css("position", "relative");});}}}));}})(jQuery);

/* // STYLESWICTH //*/
function setActiveStyleSheet(title) {var i, a, main;for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {a.disabled = true;if(a.getAttribute("title") == title) a.disabled = false;}}}
function getActiveStyleSheet() {var i, a;for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
}return null;}
function getPreferredStyleSheet() {var i, a;for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title")) return a.getAttribute("title");}return null;}

/* // Accordion 1.6 // */
;(function($) {$.ui = $.ui || {};$.fn.extend({accordion: function(options, data) {var args = Array.prototype.slice.call(arguments, 1);return this.each(function() {if (typeof options == "string") {var accordion = $.data(this, "ui-accordion");accordion[options].apply(accordion, args);} else if (!$(this).is(".ui-accordion"))$.data(this, "ui-accordion", new $.ui.accordion(this, options));});},activate: function(index) {return this.accordion("activate", index);}});$.ui.accordion = function(container, options) {this.options = options = $.extend({}, $.ui.accordion.defaults, options);this.element = container;$(container).addClass("ui-accordion");if ( options.navigation ) {var current = $(container).find("a").filter(options.navigationFilter);if ( current.length ) {if ( current.filter(options.header).length ) {options.active = current;} else {options.active = current.parent().parent().prev();current.addClass("current");}}}options.headers = $(container).find(options.header);options.active = findActive(options.headers, options.active);if ( options.fillSpace ) {var maxHeight = $(container).parent().height();options.headers.each(function() {maxHeight -= $(this).outerHeight();});var maxPadding = 0;options.headers.next().each(function() {maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());}).height(maxHeight - maxPadding);} else if ( options.autoheight ) {var maxHeight = 0;options.headers.next().each(function() {maxHeight = Math.max(maxHeight, $(this).outerHeight());}).height(maxHeight);}options.headers.not(options.active || "").next().hide();options.active.parent().andSelf().addClass(options.selectedClass);if (options.event)$(container).bind((options.event) + ".ui-accordion", clickHandler);};$.ui.accordion.prototype = {activate: function(index) {clickHandler.call(this.element, {target: findActive( this.options.headers, index )[0]});},
enable: function() {this.options.disabled = false;},disable: function() {this.options.disabled = true;},destroy: function() {this.options.headers.next().css("display", "");if ( this.options.fillSpace || this.options.autoheight ) {this.options.headers.next().css("height", "");}$.removeData(this.element, "ui-accordion");$(this.element).removeClass("ui-accordion").unbind(".ui-accordion");}}
function scopeCallback(callback, scope) {return function() {return callback.apply(scope, arguments);};}function completed(cancel) {if (!$.data(this, "ui-accordion"))return;var instance = $.data(this, "ui-accordion");var options = instance.options;options.running = cancel ? 0 : --options.running;if ( options.running )return;if ( options.clearStyle ) {options.toShow.add(options.toHide).css({height: "",overflow: ""});}$(this).triggerHandler("change.ui-accordion", [options.data], options.change);}function toggle(toShow, toHide, data, clickedActive, down) {var options = $.data(this, "ui-accordion").options;options.toShow = toShow;options.toHide = toHide;options.data = data;var complete = scopeCallback(completed, this);options.running = toHide.size() == 0 ? toShow.size() : toHide.size();if ( options.animated ) {if ( !options.alwaysOpen && clickedActive ) {$.ui.accordion.animations[options.animated]({toShow: jQuery([]),toHide: toHide,complete: complete,down: down,autoheight: options.autoheight});} else {$.ui.accordion.animations[options.animated]({toShow: toShow,toHide: toHide,complete: complete,down: down,autoheight: options.autoheight});}} else {if ( !options.alwaysOpen && clickedActive ) {toShow.toggle();} else {toHide.hide();toShow.show();}complete(true);}}function clickHandler(event) {var options = $.data(this, "ui-accordion").options;if (options.disabled)return false;if ( !event.target && !options.alwaysOpen ) {options.active.parent().andSelf().toggleClass(options.selectedClass);var toHide = options.active.next(),data = {instance: this,options: options,newHeader: jQuery([]),oldHeader: options.active,newContent: jQuery([]),oldContent: toHide},toShow = options.active = $([]);toggle.call(this, toShow, toHide, data );return false;}var clicked = $(event.target);if ( clicked.parents(options.header).length )while ( !clicked.is(options.header) )clicked = clicked.parent();var clickedActive = clicked[0] == options.active[0];if (options.running || (options.alwaysOpen && clickedActive))return false;if (!clicked.is(options.header))return;options.active.parent().andSelf().toggleClass(options.selectedClass);if ( !clickedActive ) {clicked.parent().andSelf().addClass(options.selectedClass);}var toShow = clicked.next(),toHide = options.active.next(),data = {instance: this,options: options,newHeader: clicked,oldHeader: options.active,newContent: toShow,oldContent: toHide},down = options.headers.index( options.active[0] ) > options.headers.index( clicked[0] );options.active = clickedActive ? $([]) : clicked;toggle.call(this, toShow, toHide, data, clickedActive, down );return false;};function findActive(headers, selector) {return selector != undefined ? typeof selector == "number" ? headers.filter(":eq(" + selector + ")") : headers.not(headers.not(selector)) : selector === false ? $([]) : headers.filter(":eq(0)");}$.extend($.ui.accordion, {defaults: {selectedClass: "selected",alwaysOpen: true,animated: 'slide',event: "click",header: "a",autoheight: true,running: 0,navigationFilter: function() {return this.href.toLowerCase() == location.href.toLowerCase();}},animations: {slide: function(options, additions) {options = $.extend({easing: "swing",duration: 300}, options, additions);if ( !options.toHide.size() ) {options.toShow.animate({height: "show"}, options);return;}var hideHeight = options.toHide.height(),showHeight = options.toShow.height(),difference = showHeight / hideHeight;options.toShow.css({ height: 0, overflow: 'hidden' }).show();options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{step: function(now) {var current = (hideHeight - now) * difference;if ($.browser.msie || $.browser.opera) {current = Math.ceil(current);}options.toShow.height( current );},duration: options.duration,easing: options.easing,complete: function() {if ( !options.autoheight ) {options.toShow.css("height", "auto");}options.complete();}});},bounceslide: function(options) {this.slide(options, {easing: options.down ? "bounceout" : "swing",duration: options.down ? 1000 : 200});},easeslide: function(options) {this.slide(options, {easing: "easeinout",duration: 700})}}});})(jQuery);

/*jHelperTip 1.0*/
(function($) {$.fn.jHelperTip = function(options) {var opts = $.extend({}, $.fn.jHelperTip.defaults, options);if ($(opts.ttC).length == 0)$('<div id="'+opts.ttC.slice(1)+'"></div>').appendTo("body");if ($(opts.dC).length == 0)$('<div id="'+opts.dC.slice(1)+'"></div>').appendTo("body");if ($(opts.aC).length == 0)$('<div id="'+opts.aC.slice(1)+'"></div>').appendTo("body");$(opts.ttC).add(opts.aC).css({position: "absolute",display: "inline"}).hide();$(opts.dC).hide();var closeBox = function(){if (opts.source == "attribute")$(opts.aC).hide().empty();else $(opts.ttC).hide().empty();};$(".jHelperTipClose").bind("click", closeBox);$(opts.ttC).bind("mouseover",function(){$(opts.ttC).show();return false;});var getData = function(obj,e){if (opts.source == "ajax") {getPosition(e);$(opts.ttC).html('<div><img src="'+opts.loadingImg+'"/> '+opts.loadingText+'</div>').show();$.ajax({type: opts.type,url: opts.url,data: opts.data,success: function(msg){$(opts.ttC).html(msg);$(".jHelperTipClose").unbind("click", closeBox); $(".jHelperTipClose").bind("click", closeBox);}});}else if (opts.source == "container"){$(opts.ttC).show().empty();$(opts.dC).clone(true).show().appendTo(opts.ttC);}if (opts.source == "attribute"){$(opts.aC).html($(obj).attr(opts.attrName));}};var getPosition = function (e){var top = e.pageY+opts.topOff;var left = e.pageX+opts.leftOff;if (opts.source == "attribute"){$(opts.aC).css({top: top,left: left,opacity: opts.opacity}).show();}else {$(opts.ttC).css({top: top,left: left,opacity: opts.opacity}).show();}};if (opts.trigger == "hover") {$(this).bind("mouseover", function(e){e.preventDefault();getData(this, e);return false;});$(this).bind("mousemove", function(e){getPosition(e);return false;});$(this).bind("mouseout", function(e){if (opts.source == "attribute")$(opts.aC).hide().empty();else $(opts.ttC).hide().empty();return false;});}else if (opts.trigger == "click") {$(this).bind("click", function(e){getData(this, e);getPosition(e);$(document).bind("click", function(e){if (opts.autoClose) {if (opts.source == "attribute")$(opts.aC).hide().empty();else $(opts.ttC).hide().empty();}});return false;});}};$.fn.jHelperTip.defaults = {trigger: "click",topOff: 3,leftOff: 10,source: "container", attrName: '',ttC: "#jHelperTipContainer", dC: "#jHelperTipDataContainer", aC: "#jHelperTipAttrContainer", opacity:  1.0,loadingImg: "ajax-loader.gif",loadingText: "Loading...",type: "GET",autoClose: true};})(jQuery);

// jquery.event.hover.js - rev 5 
;(function($){ $.fn._hover = $.fn.hover;$.fn.hover = function( fn1, fn2, fn3 ) {if ( fn3 ) this.bind('hoverstart', fn1 ); if ( fn2 ) this.bind('hoverend', fn3 ? fn3 : fn2 ); return !fn1 ? this.trigger('hover') : this.bind('hover', fn3 ? fn2 : fn1 ); };	var hover = $.event.special.hover = {delay: 100,speed: 100, setup: function( data ){data = $.extend({ speed: hover.speed, delay: hover.delay, hovered:0 }, data||{} );$.event.add( this, "mouseenter mouseleave", hoverHandler, data );},teardown: function(){$.event.remove( this, "mouseenter mouseleave", hoverHandler );}};function hoverHandler( event ){var data = event.data || event;switch ( event.type ){case 'mouseenter': data.dist2 = 0; data.event = event; event.type = "hoverstart"; if ( $.event.handle.call( this, event )!==false ){ data.elem = this; $.event.add( this, "mousemove", hoverHandler, data );data.timer = setTimeout( compare, data.delay ); }break;case 'mousemove': data.dist2 += Math.pow( event.pageX-data.event.pageX, 2 ) + Math.pow( event.pageY-data.event.pageY, 2 ); data.event = event; break;case 'mouseleave': clearTimeout( data.timer ); if ( data.hovered ){ event.type = "hoverend"; $.event.handle.call( this, event ); data.hovered--; }else $.event.remove( data.elem, "mousemove", hoverHandler ); break;default: if ( data.dist2  <= Math.pow( data.speed*( data.delay/1e3 ), 2 ) ){ $.event.remove( data.elem, "mousemove", hoverHandler ); data.hovered++; data.event.type = "hover"; if ( $.event.handle.call( data.elem, data.event ) === false ) data.hovered--; }else data.timer = setTimeout( compare, data.delay ); data.dist2 = 0; break;}function compare(){ hoverHandler( data ); }; };})(jQuery);


/*jPrintArea 1.0.0*/
jQuery.jPrintArea=function(el)
{var iframe=document.createElement('IFRAME');var doc=null;$(iframe).attr('style','position:absolute;width:0px;height:0px;left:-500px;top:-500px;');document.body.appendChild(iframe);doc=iframe.contentWindow.document;var links=window.document.getElementsByTagName('link');
for(var i=0;i<links.length;i++)
if(links[i].rel.toLowerCase()=='stylesheet')
doc.write('<link type="text/css" rel="stylesheet" href="'+links[i].href+'"></link>');doc.write('<div class="'+$(el).attr("class")+'">'+$(el).html()+'</div>');doc.close();iframe.contentWindow.focus();iframe.contentWindow.print();
//alert('Printing...');
wait(1);document.body.removeChild(iframe);
}


/*TreeView 1.4*/
; (function($) { $.extend($.fn, { swapClass: function(c1, c2) { var c1Elements = this.filter('.' + c1); this.filter('.' + c2).removeClass(c2).addClass(c1); c1Elements.removeClass(c1).addClass(c2); return this; }, replaceClass: function(c1, c2) { return this.filter('.' + c1).removeClass(c1).addClass(c2).end(); }, hoverClass: function(className) { className = className || "hover"; return this.hover(function() { $(this).addClass(className); }, function() { $(this).removeClass(className); }); }, heightToggle: function(animated, callback) { animated ? this.animate({ height: "toggle" }, animated, callback) : this.each(function() { jQuery(this)[jQuery(this).is(":hidden") ? "show" : "hide"](); if (callback) callback.apply(this, arguments); }); }, heightHide: function(animated, callback) { if (animated) { this.animate({ height: "hide" }, animated, callback); } else { this.hide(); if (callback) this.each(callback); } }, prepareBranches: function(settings) { if (!settings.prerendered) { this.filter(":last-child:not(ul)").addClass(CLASSES.last); this.filter((settings.collapsed ? "" : "." + CLASSES.closed) + ":not(." + CLASSES.open + ")").find(">ul").hide(); } return this.filter(":has(>ul)"); }, applyClasses: function(settings, toggler) { this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event) { toggler.apply($(this).next()); }).add($("a", this)).hoverClass(); if (!settings.prerendered) { this.filter(":has(>ul:hidden)").addClass(CLASSES.expandable).replaceClass(CLASSES.last, CLASSES.lastExpandable); this.not(":has(>ul:hidden)").addClass(CLASSES.collapsable).replaceClass(CLASSES.last, CLASSES.lastCollapsable); this.prepend("<div class=\"" + CLASSES.hitarea + "\"/>").find("div." + CLASSES.hitarea).each(function() { var classes = ""; $.each($(this).parent().attr("class").split(" "), function() { classes += this + "-hitarea "; }); $(this).addClass(classes); }); } this.find("div." + CLASSES.hitarea).click(toggler); }, treeview: function(settings) { settings = $.extend({ cookieId: "treeview" }, settings); if (settings.add) { return this.trigger("add", [settings.add]); } if (settings.toggle) { var callback = settings.toggle; settings.toggle = function() { return callback.apply($(this).parent()[0], arguments); }; } function treeController(tree, control) { function handler(filter) { return function() { toggler.apply($("div." + CLASSES.hitarea, tree).filter(function() { return filter ? $(this).parent("." + filter).length : true; })); return false; }; } $("a:eq(0)", control).click(handler(CLASSES.collapsable)); $("a:eq(1)", control).click(handler(CLASSES.expandable)); $("a:eq(2)", control).click(handler()); } function toggler() { $(this).parent().find(">.hitarea").swapClass(CLASSES.collapsableHitarea, CLASSES.expandableHitarea).swapClass(CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea).end().swapClass(CLASSES.collapsable, CLASSES.expandable).swapClass(CLASSES.lastCollapsable, CLASSES.lastExpandable).find(">ul").heightToggle(settings.animated, settings.toggle); if (settings.unique) { $(this).parent().siblings().find(">.hitarea").replaceClass(CLASSES.collapsableHitarea, CLASSES.expandableHitarea).replaceClass(CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea).end().replaceClass(CLASSES.collapsable, CLASSES.expandable).replaceClass(CLASSES.lastCollapsable, CLASSES.lastExpandable).find(">ul").heightHide(settings.animated, settings.toggle); } } function serialize() { function binary(arg) { return arg ? 1 : 0; } var data = []; branches.each(function(i, e) { data[i] = $(e).is(":has(>ul:visible)") ? 1 : 0; }); $.cookie(settings.cookieId, data.join("")); } function deserialize() { var stored = $.cookie(settings.cookieId); if (stored) { var data = stored.split(""); branches.each(function(i, e) { $(e).find(">ul")[parseInt(data[i]) ? "show" : "hide"](); }); } } this.addClass("treeview"); var branches = this.find("li").prepareBranches(settings); switch (settings.persist) { case "cookie": var toggleCallback = settings.toggle; settings.toggle = function() { serialize(); if (toggleCallback) { toggleCallback.apply(this, arguments); } }; deserialize(); break; case "location": var current = this.find("a").filter(function() { return this.href.toLowerCase() == location.href.toLowerCase(); }); if (current.length) { current.addClass("selected").parents("ul, li").add(current.next()).show(); } break; } branches.applyClasses(settings, toggler); if (settings.control) { treeController(this, settings.control); $(settings.control).show(); } return this.bind("add", function(event, branches) { $(branches).prev().removeClass(CLASSES.last).removeClass(CLASSES.lastCollapsable).removeClass(CLASSES.lastExpandable).find(">.hitarea").removeClass(CLASSES.lastCollapsableHitarea).removeClass(CLASSES.lastExpandableHitarea); $(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings, toggler); }); } }); var CLASSES = $.fn.treeview.classes = { open: "open", closed: "closed", expandable: "expandable", expandableHitarea: "expandable-hitarea", lastExpandableHitarea: "lastExpandable-hitarea", collapsable: "collapsable", collapsableHitarea: "collapsable-hitarea", lastCollapsableHitarea: "lastCollapsable-hitarea", lastCollapsable: "lastCollapsable", lastExpandable: "lastExpandable", last: "last", hitarea: "hitarea" }; $.fn.Treeview = $.fn.treeview; })(jQuery);
