﻿/* Pager */
$.fn.pager = function(C, A) { var B = { height:null,navId: "nav", navClass: "nav", navAttach: "append", buildNav: false, highlightClass: "highlight", prevText: "&laquo;", nextText: "&raquo;", onChange: function(p) { } }; if (A) { $.extend(B, A) } $.extend({ B: { onChange: function(p) { } } }); return this.each(function() { var J = $(this); var O; var G = 0; var L = "#" + B.navId; function N() { O = $(C, J).not(L).size(); if (B.height == null) { B.height = D() } if (O > 1) { if (B.buildNav) { F(); } K(); E() } M(); } function F() { var R = '<div id="' + B.navId + '" class="' + B.navClass + '">'; R += '<a href="#" rel="prev">' + B.prevText + "</a>"; for (var Q = 0; Q < O; Q++) { var P = Q + 1; R += ' <a href="#" rel="' + P + '">'; R += (B.linkText == null) ? P : B.linkText[P - 1]; R += "</a>" } R += ' <a href="#" rel="next">' + B.nextText + "</a>"; R += "</div>"; switch (B.navAttach) { case "before": $(J).before(R); break; case "after": $(J).after(R); break; case "prepend": $(J).prepend(R); break; default: $(J).append(R); break } } function K() { $(J).find(C).not(L).hide(); var P = $(J).find(C).not(L).get(G); $(P).show() } function E() { $(J).find(L).find("a").removeClass(B.highlightClass); var P = $(J).find(L).find("a").get(G + 1); $(P).addClass(B.highlightClass) } function M() { if ($.browser.msie) { $(J).find(C).not(L).css({ height: B.height }) } else { $(J).find(C).not(L).css({ minHeight: B.height }) } } function D() { var P = 0; $(J).find(C).not(L).each(function() { if (this.offsetHeight > P) { P = this.offsetHeight } }); P = P + "px"; return P } function I() { var P = $(L).get(0); return P.offsetHeight } N(); $(this).find(L).find("a").click(function() { if ($(this).attr("rel") == "next") { if (G + 1 < O) { G = G + 1 } } else { if ($(this).attr("rel") == "prev") { if (G > 0) { G = G - 1 } } else { var P = $(this).attr("rel"); G = P - 1 } } B.onChange(G); K(); E(); jQuery(window).scrollTop(20); return false; }) }) };
/* gSearch */
function URLEncode(clearString) { var output = ''; var x = 0; clearString = clearString.toString(); var regex = /(^[a-zA-Z0-9_.]*)/; while (x < clearString.length) { var match = regex.exec(clearString.substr(x)); if (match != null && match.length > 1 && match[1] != '') { output += match[1]; x += match[1].length } else { if (clearString[x] == ' ') output += '+'; else { var charCode = clearString.charCodeAt(x); var hexVal = charCode.toString(16); output += '%' + (hexVal.length < 2 ? '0' : '') + hexVal.toUpperCase() } x++ } } return output } function SubmitOnEnter(myfield, e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode == 13) { SearchSite(); return false } else return true } function SearchSite() { var q = document.getElementById('q'); var s = document.getElementById('ctl00_s'); if ((q && q.value.length > 0) && (s && s.value.length > 0)) { document.location.href = s.value + '?q=' + encodeURIComponent(q.value) } }
/* Inter */
var isFirefox = navigator.userAgent.indexOf("Firefox") != -1; var videos = false; var d = undefined; function POpened(sender, args) { d = jQuery("#interContainer"); if (d.css("display") != 'none') { sender.stop(); } } function cierra() { d = jQuery("#interContainer"); if (d == undefined) return; if (d.css("display") != 'none') { var elmtSelect = document.getElementsByTagName('SELECT'); for (var i = 0; i < elmtSelect.length; i++) { elmtSelect[i].style.visibility = ''; } d.css("display", "none"); jQuery('.silver').show(); if (!videos) { jQuery("html").css("overflow", "auto"); } else if (!isFirefox) { jQuery("html").css("overflow", "auto"); } var video = jQuery.find('ctl00_CPH_Banner1Silverlight'); if (video.length == 1) { video[0].play(); } } } function abre() { videos = jQuery('.silver').length > 0; d = jQuery("#interContainer"); if (d.find("img").length > 0) { d.css("display", "block"); window.scrollTo(0, 0); if (!videos) { jQuery("html").css("overflow", "hidden"); } else {jQuery('.silver').hide(); if (!isFirefox) { jQuery("html").css("overflow", "hidden"); } } setTimeout("cierra()", 14000); } else { var elmtSelect = document.getElementsByTagName('SELECT'); for (var i = 0; i < elmtSelect.length; i++) { elmtSelect[i].style.visibility = ''; } } }


