/*Alberto Quispe Cuzcano, Septiembre 2008*/
/*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;});};

/*ScrollTo 1.3.2*/
;(function($){var o=$.scrollTo=function(a,b,c){o.window().scrollTo(a,b,c)};o.defaults={axis:'y',duration:1};o.window=function(){return $($.browser.safari?'body':'html')};$.fn.scrollTo=function(l,m,n){if(typeof m=='object'){n=m;m=0}n=$.extend({},o.defaults,n);m=m||n.speed||n.duration;n.queue=n.queue&&n.axis.length>1;if(n.queue)m/=2;n.offset=j(n.offset);n.over=j(n.over);return this.each(function(){var a=this,b=$(a),t=l,c,d={},w=b.is('html,body');switch(typeof t){case'number':case'string':if(/^([+-]=)?\d+(px)?$/.test(t)){t=j(t);break}t=$(t,this);case'object':if(t.is||t.style)c=(t=$(t)).offset()}$.each(n.axis.split(''),function(i,f){var P=f=='x'?'Left':'Top',p=P.toLowerCase(),k='scroll'+P,e=a[k],D=f=='x'?'Width':'Height';if(c){d[k]=c[p]+(w?0:e-b.offset()[p]);if(n.margin){d[k]-=parseInt(t.css('margin'+P))||0;d[k]-=parseInt(t.css('border'+P+'Width'))||0}d[k]+=n.offset[p]||0;if(n.over[p])d[k]+=t[D.toLowerCase()]()*n.over[p]}else d[k]=t[p];if(/^\d+$/.test(d[k]))d[k]=d[k]<=0?0:Math.min(d[k],h(D));if(!i&&n.queue){if(e!=d[k])g(n.onAfterFirst);delete d[k]}});g(n.onAfter);function g(a){b.animate(d,m,n.easing,a&&function(){a.call(this,l)})};function h(D){var b=w?$.browser.opera?document.body:document.documentElement:a;return b['scroll'+D]-b['client'+D]}})};function j(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
;(function($){var a='serialScroll',b='.'+a,c='bind',B=$[a]=function(b){$.scrollTo.window()[a](b)};B.defaults={duration:1e3,axis:'x',event:'click',start:0,step:1,lock:1,cycle:1,constant:1};$.fn[a]=function(x){x=$.extend({},B.defaults,x);var y=x.event,z=x.step,A=x.lazy;return this.each(function(){var j=x.target?this:document,k=$(x.target||this,j),l=k[0],m=x.items,n=x.start,o=x.interval,p=x.navigation,q;if(!A)m=v();if(x.force)s({},n);$(x.prev||[],j)[c](y,-z,r);$(x.next||[],j)[c](y,z,r);if(!l.ssbound)k[c]('prev'+b,-z,r)[c]('next'+b,z,r)[c]('goto'+b,s);if(o)k[c]('start'+b,function(e){if(!o){u();o=1;t()}})[c]('stop'+b,function(){u();o=0});k[c]('notify'+b,function(e,a){var i=w(a);if(i>-1)n=i});l.ssbound=1;if(x.jump)(A?k:v())[c](y,function(e){s(e,w(e.target))});if(p)p=$(p,j)[c](y,function(e){e.data=Math.round(v().length/p.length)*p.index(this);s(e,this)});function r(e){e.data+=n;s(e,this)};function s(e,a){if(!isNaN(a)){e.data=a;a=l}var c=e.data,d,f=e.type,g=v(),h=g.length,i=x.duration;if(f)e.preventDefault();c%=h;if(c<0)c+=h;d=g[c];if(o){u();q=setTimeout(t,x.interval)}if(isNaN(c)||f&&n==c||x.lock&&k.is(':animated')||!x.cycle&&!g[e.data]||f&&x.onBefore&&x.onBefore.call(a,e,d,k,g,c)===!1)return;if(x.stop)k.queue('fx',[]).stop();if(x.constant)i=Math.abs(i/z*(n-c));k.scrollTo(d,i,x).trigger('notify'+b,[c])};function t(){k.trigger('next'+b)};function u(){clearTimeout(q)};function v(){return $(m,k)};function w(a){if(!isNaN(a))return a;var b=v(),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);

/*shadownbox 2.0*/
if(typeof jQuery == 'undefined'){throw 'Unable to load Shadowbox, jQuery library not found';}var Shadowbox = {};Shadowbox.lib = {adapter: 'jquery',getStyle: function(el, style){return jQuery(el).css(style);},setStyle: function(el, style, value){if(typeof style != 'object'){var temp = {};temp[style] = value;style = temp;}jQuery(el).css(style);},get: function(el){return (typeof el == 'string') ? document.getElementById(el) : el;},remove: function(el){jQuery(el).remove();},getTarget: function(e){return e.target;},getPageXY: function(e){return [e.pageX, e.pageY];},preventDefault: function(e){e.preventDefault();},keyCode: function(e){return e.keyCode;},addEvent: function(el, name, handler){jQuery(el).bind(name, handler);},removeEvent: function(el, name, handler){jQuery(el).unbind(name, handler);},append: function(el, html){jQuery(el).append(html);}};(function($){$.fn.shadowbox = function(options){return this.each(function(){var $this = $(this);var opts = $.extend({}, options || {}, $.metadata ? $this.metadata() : $.meta ? $this.data() : {});var cls = this.className || '';opts.width  = parseInt((cls.match(/w:(\d+)/)||[])[1]) || opts.width;opts.height = parseInt((cls.match(/h:(\d+)/)||[])[1]) || opts.height;Shadowbox.setup($this, opts);});};})(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);
}