; /*! jquery.swfobject.license.txt *//* jQuery SWFObject Plugin v1.0.3 Copyright (c) 2008 Jonathan Neal This software is released under the MIT License This software is released under the GPL License SWFObject v2.1 Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis This software is released under the MIT License jQuery v1.2.6 Copyright (c) 2008 John Resig This software is released under the MIT License This software is released under the GPL License *//*jslint passfail: false, white: true, browser: true, widget: false, sidebar: false, rhino: false, safe: false, adsafe: false, debug: false, evil: false, cap: false, on: false, fragment: false, laxbreak: false, forin: true, sub: false, css: false, undef: true, nomen: false, eqeqeq: true, plusplus: false, bitwise: true, regexp: false, onevar: true, strict: false *//*global jQuery, ActiveXObject */ (function ($) { /* $.flashPlayerVersion */ $.flashPlayerVersion = function () { var flashVersion, activeX = null, fp6Crash = false, shockwaveFlash = 'ShockwaveFlash.ShockwaveFlash'; // If Internet Explorer if (!(flashVersion = navigator.plugins['Shockwave Flash'])) { try { activeX = new ActiveXObject(shockwaveFlash + '.7'); } catch (errorA) { try { activeX = new ActiveXObject(shockwaveFlash + '.6'); flashVersion = [6, 0, 21]; activeX.AllowScriptAccess = 'always'; } catch (errorB) { if (flashVersion && flashVersion[0] === 6) { fp6Crash = true; } } if (!fp6Crash) { try { activeX = new ActiveXObject(shockwaveFlash); } catch (errorC) { flashVersion = 'X 0,0,0'; } } } if (!fp6Crash && activeX) { try { // Will crash fp6.0.21/23/29 flashVersion = activeX.GetVariable('$version'); } catch (errorD) {} } } // If NOT Internet Explorer else { flashVersion = flashVersion.description; } flashVersion = flashVersion.match(/^[A-Za-z\s]*?(\d+)(\.|,)(\d+)(\s+r|,)(\d+)/); return [flashVersion[1] * 1, flashVersion[3] * 1, flashVersion[5] * 1]; }(); /* $.flashExpressInstaller */ $.flashExpressInstaller = 'expressInstall.swf'; /* $.hasFlashPlayer */ $.hasFlashPlayer = ($.flashPlayerVersion[0] !== 0); /* $.hasFlashPlayerVersion */ $.hasFlashPlayerVersion = function (options) { var flashVersion = $.flashPlayerVersion; options = (/string|integer/.test(typeof options)) ? options.toString().split('.') : options; return (options) ? (flashVersion[0] >= (options.major || options[0] || flashVersion[0]) && flashVersion[1] >= (options.minor || options[1] || flashVersion[1]) && flashVersion[2] >= (options.release || options[2] || flashVersion[2])) : (flashVersion[0] !== 0); }; /* $.flash */ $.flash = function (options) { // Check if Flash is installed, return false if isn't if (!$.hasFlashPlayer) { return false; } // Create the swf filename variable, attributes, dom sandbox, 4 array caches, and 4 free caches var movieFilename = options.swf || '', paramAttributes = options.params || {}, buildDOM = document.createElement('body'), aArr, bArr, cArr, dArr, a, b, c, d; // Set the default height and width if not already set options.height = options.height || 180; options.width = options.width || 320; // Inject ExpressInstall if "hasVersion" is requested and the version requirement is not met if (options.hasVersion && !$.hasFlashPlayerVersion(options.hasVersion)) { $.extend(options, { id: 'SWFObjectExprInst', height: Math.max(options.height, 137), width: Math.max(options.width, 214) }); movieFilename = options.expressInstaller || $.flashExpressInstaller; paramAttributes = { flashvars: { MMredirectURL: window.location.href, MMplayerType: ($.browser.msie && $.browser.win) ? 'ActiveX' : 'PlugIn', MMdoctitle: document.title.slice(0, 47) + ' - Flash Player Installation' } }; } // Append flashvars to param if already specified separately if (options.flashvars && typeof paramAttributes === 'object') { $.extend(paramAttributes, { flashvars: options.flashvars }); } // Delete the reformatted constructors for (a in (b = ['swf', 'expressInstall', 'hasVersion', 'params', 'flashvars'])) { delete options[b[a]]; } // Create the OBJECT tag attributes aArr = []; for (a in options) { if (typeof options[a] === 'object') { bArr = []; for (b in options[a]) { bArr.push(b.replace(/([A-Z])/, '-$1').toLowerCase() + ':' + options[a][b] + ';'); } options[a] = bArr.join(''); } aArr.push(a + '="' + options[a] + '"'); } options = aArr.join(' '); // Create the PARAM tags if (typeof paramAttributes === 'object') { aArr = []; for (a in paramAttributes) { if (typeof paramAttributes[a] === 'object') { bArr = []; for (b in paramAttributes[a]) { if (typeof paramAttributes[a][b] === 'object') { cArr = []; for (c in paramAttributes[a][b]) { if (typeof paramAttributes[a][b][c] === 'object') { dArr = []; for (d in paramAttributes[a][b][c]) { dArr.push(d.replace(/([A-Z])/, '-$1').toLowerCase() + ':' + paramAttributes[a][b][c][d] + ';'); } paramAttributes[a][b][c] = dArr.join(''); } cArr.push(c + '{' + paramAttributes[a][b][c] + '}'); } paramAttributes[a][b] = cArr.join(''); } bArr.push(window.escape(b) + '=' + window.escape(paramAttributes[a][b])); } paramAttributes[a] = bArr.join('&'); } aArr.push(''); } paramAttributes = aArr.join(''); } // Unify the visual display between all browsers if (!(/style=/.test(options))) { options += ' style="vertical-align:text-top;"'; } if (!(/style=(.*?)vertical-align/.test(options))) { options = options.replace(/style="/, 'style="vertical-align:text-top;'); } // Specify the object and param tags between browsers if ($.browser.msie) { options += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'; paramAttributes = '' + paramAttributes; } else { options += ' type="application/x-shockwave-flash" data="' + movieFilename + '"'; } // Return the jQuery'd flash OBJECT buildDOM.innerHTML = '' + paramAttributes + ''; return $(buildDOM.firstChild); }; /* $.fn.flash */ $.fn.flash = function (options) { if (!$.hasFlashPlayer) { return this; } var a = 0, each; while ((each = this.eq(a++))[0]) { each.html($.flash($.extend({}, options))); if (each[0].firstChild.getAttribute('id') === 'SWFObjectExprInst') { a = this.length; } } return this; }; }(jQuery)); /** * hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+ * * * @param f onMouseOver function || An object with configuration options * @param g onMouseOut function || Nothing (use configuration options object) * @author Brian Cherne */ (function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY)) MIT-style license. */ (function($) { // Global variables, accessible to Slimbox only var win = $(window), options, images, activeImage = -1, activeURL, prevImage, nextImage, compatibleOverlay, middle, centerWidth, centerHeight, ie6 = !window.XMLHttpRequest, operaFix = window.opera && (document.compatMode == "CSS1Compat") && ($.browser.version >= 9.3), documentElement = document.documentElement, // Preload images preload = {}, preloadPrev = new Image(), preloadNext = new Image(), // DOM elements overlay, center, image, sizer, prevLink, nextLink, bottomContainer, bottom, caption, number; /* Initialization */ $(function() { // Append the Slimbox HTML code at the bottom of the document $("body").append( $([ overlay = $('
')[0], center = $('
')[0], bottomContainer = $('
')[0] ]).css("display", "none") ); image = $('
').appendTo(center).append( sizer = $('
').append([ prevLink = $('').click(previous)[0], nextLink = $('').click(next)[0] ])[0] )[0]; bottom = $('
').appendTo(bottomContainer).append([ $('').add(overlay).click(close)[0], caption = $('
')[0], number = $('
')[0], $('
')[0] ])[0]; }); /* API */ // Open Slimbox with the specified parameters $.slimbox = function(_images, startImage, _options) { //alert(_images); options = $.extend({ loop: false, // Allows to navigate between first and last images overlayOpacity: 0.8, // 1 is opaque, 0 is completely transparent (change the color in the CSS file) overlayFadeDuration: 400, // Duration of the overlay fade-in and fade-out animations (in milliseconds) resizeDuration: 400, // Duration of each of the box resize animations (in milliseconds) resizeEasing: "swing", // "swing" is jQuery's default easing initialWidth: 250, // Initial width of the box (in pixels) initialHeight: 250, // Initial height of the box (in pixels) imageFadeDuration: 400, // Duration of the image fade-in animation (in milliseconds) captionAnimationDuration: 400, // Duration of the caption animation (in milliseconds) counterText: "Image {x} of {y}", // Translate or change as you wish, or set it to false to disable counter text for image groups closeKeys: [27, 88, 67], // Array of keycodes to close Slimbox, default: Esc (27), 'x' (88), 'c' (67) previousKeys: [37, 80], // Array of keycodes to navigate to the previous image, default: Left arrow (37), 'p' (80) nextKeys: [39, 78] // Array of keycodes to navigate to the next image, default: Right arrow (39), 'n' (78) }, _options); // The function is called for a single image, with URL and Title as first two arguments if (typeof _images == "string") { _images = [[_images, startImage]]; startImage = 0; } middle = win.scrollTop() + ((operaFix ? documentElement.clientHeight : win.height()) / 2); centerWidth = options.initialWidth; centerHeight = options.initialHeight; $(center).css({top: Math.max(0, middle - (centerHeight / 2)), width: centerWidth, height: centerHeight, marginLeft: -centerWidth/2}).show(); compatibleOverlay = ie6 || (overlay.currentStyle && (overlay.currentStyle.position != "fixed")); if (compatibleOverlay) overlay.style.position = "absolute"; $(overlay).css("opacity", options.overlayOpacity).fadeIn(options.overlayFadeDuration); position(); setup(1); images = _images; options.loop = options.loop && (images.length > 1); return changeImage(startImage); }; /* options: Optional options object, see jQuery.slimbox() linkMapper: Optional function taking a link DOM element and an index as arguments and returning an array containing 2 elements: the image URL and the image caption (may contain HTML) linksFilter: Optional function taking a link DOM element and an index as arguments and returning true if the element is part of the image collection that will be shown on click, false if not. "this" refers to the element that was clicked. This function must always return true when the DOM element argument is "this". */ $.fn.slimbox = function(_options, linkMapper, linksFilter) { linkMapper = linkMapper || function(el) { //IB added class return [el.href, el.title]; }; linksFilter = linksFilter || function() { return true; }; var links = this; return links.unbind("click").click(function() { // Build the list of images that will be displayed var link = this, startIndex = 0, filteredLinks, i = 0, length; filteredLinks = $.grep(links, function(el, i) { return linksFilter.call(link, el, i); }); // We cannot use jQuery.map() because it flattens the returned array for (length = filteredLinks.length; i < length; ++i) { if (filteredLinks[i] == link) startIndex = i; filteredLinks[i] = linkMapper(filteredLinks[i], i); } return $.slimbox(filteredLinks, startIndex, _options); }); }; /* Internal functions */ function position() { var l = win.scrollLeft(), w = operaFix ? documentElement.clientWidth : win.width(); $([center, bottomContainer]).css("left", l + (w / 2)); if (compatibleOverlay) $(overlay).css({left: l, top: win.scrollTop(), width: w, height: win.height()}); } function setup(open) { $("object").add(ie6 ? "select" : "embed").each(function(index, el) { if (open) $.data(el, "slimbox", el.style.visibility); el.style.visibility = open ? "hidden" : $.data(el, "slimbox"); }); var fn = open ? "bind" : "unbind"; win[fn]("scroll resize", position); $(document)[fn]("keydown", keyDown); } function keyDown(event) { var code = event.keyCode, fn = $.inArray; // Prevent default keyboard action (like navigating inside the page) return (fn(code, options.closeKeys) >= 0) ? close() : (fn(code, options.nextKeys) >= 0) ? next() : (fn(code, options.previousKeys) >= 0) ? previous() : false; } function previous() { return changeImage(prevImage); } function next() { return changeImage(nextImage); } function changeImage(imageIndex) { if (imageIndex >= 0) { activeImage = imageIndex; activeURL = images[activeImage][0]; //alert(activeURL); prevImage = (activeImage || (options.loop ? images.length : 0)) - 1; nextImage = ((activeImage + 1) % images.length) || (options.loop ? 0 : -1); stop(); center.className = "lbLoading"; preload = new Image(); preload.onload = animateBox; preload.src = activeURL; } return false; } function animateBox() { center.className = ""; $(image).css({backgroundImage: "url(" + activeURL + ")", visibility: "hidden", display: ""}); // remove any flash $('#lbFlash',image).remove(); // if the url also has a video, then play over the image if (activeURL.indexOf('?video=') != -1) { /*var urlParts = activeURL.split('?video='); var $flashPlayer = $('
'); //alert(urlParts[0]); $flashPlayer.flash({ swf: '/mediaplayer/player.swf', width: preload.width, height: preload.height, flashvars: { file: urlParts[1] ,image:urlParts[0] }//, skin:'bekle.swf' }); $(image).append($flashPlayer);*/ var urlParts = activeURL.split('?video='); var $flashPlayer = $('
'); //alert(urlParts[0]); var playerSwf = '/mediaplayer/player.swf'; // alert(urlParts); if (urlParts[1].indexOf('youtube.com')!=-1) { //alert(urlParts[1]); var ytCode = urlParts[1].match(/v=[a-z0-9\-\_]+/gi)[0].replace('v=',''); //var ytCode = urlParts[1].split('v=');//http://www.youtube.com/watch?v=QkIbJWNhLsg&feature=popular //ytCode = ytCode[1].split('&');//QkIbJWNhLsg&feature=popular //alert(ytCode); playerSwf = 'http://www.youtube.com/v/'+ytCode; // FUTURE - ADD VIMEO } else if (urlParts[1].indexOf('vimeo.com')!=-1) { // http://vimeo.com/6487566 // http://vimeo.com/moogaloop.swf?clip_id=6487566&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1 var vimeoCode = urlParts[1].match(/[0-9]{5,12}/gi); playerSwf = 'http://vimeo.com/moogaloop.swf?clip_id='+vimeoCode+'&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1'; } //alert(ytCode); //alert(preload.width); $flashPlayer.flash({ swf: playerSwf, width: preload.width, height: preload.height, flashvars: { file: urlParts[1],image:urlParts[0] }//, skin:'bekle.swf' }); $(image).append($flashPlayer); } $(sizer).width(preload.width); //change next prev height to avoid flv play controls $([prevLink, nextLink]).height(preload.height-30); $(sizer).height(preload.height); $(caption).html(images[activeImage][1] || ""); $(number).html((((images.length > 1) && options.counterText) || "").replace(/{x}/, activeImage + 1).replace(/{y}/, images.length)); if (prevImage >= 0) preloadPrev.src = images[prevImage][0]; if (nextImage >= 0) preloadNext.src = images[nextImage][0]; centerWidth = image.offsetWidth; centerHeight = image.offsetHeight; var top = Math.max(0, middle - (centerHeight / 2)); if (center.offsetHeight != centerHeight) { $(center).animate({height: centerHeight, top: top}, options.resizeDuration, options.resizeEasing); } if (center.offsetWidth != centerWidth) { $(center).animate({width: centerWidth, marginLeft: -centerWidth/2}, options.resizeDuration, options.resizeEasing); } $(center).queue(function() { $(bottomContainer).css({width: centerWidth, top: top + centerHeight, marginLeft: -centerWidth/2, visibility: "hidden", display: ""}); $(image).css({display: "none", visibility: "", opacity: ""}).fadeIn(options.imageFadeDuration, animateCaption); }); } function animateCaption() { if (prevImage >= 0) $(prevLink).show(); if (nextImage >= 0) $(nextLink).show(); $(bottom).css("marginTop", -bottom.offsetHeight).animate({marginTop: 0}, options.captionAnimationDuration); bottomContainer.style.visibility = ""; } function stop() { preload.onload = null; preload.src = preloadPrev.src = preloadNext.src = activeURL; $([center, image, bottom]).stop(true); $([prevLink, nextLink, image, bottomContainer]).hide(); } function close() { if (activeImage >= 0) { stop(); activeImage = prevImage = nextImage = -1; $(center).hide(); $(overlay).stop().fadeOut(options.overlayFadeDuration, setup); } return false; } })(jQuery); jQuery(function($) { $("a[rel^='lightbox']").slimbox({/* Put custom options here */}, null, function(el) { return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel)); }); }); // JavaScript Document // this is used to store all parameters from any jsTemplates var allParams = new Object(); function getParams ( paramType, defaults, JSONParameters ) { if (allParams[paramType] == undefined) { // param defaults //alert(allParams[paramType]); allParams[paramType] = new Object(); for (var i in defaults) {allParams[paramType][i]=defaults[i];} allParams[paramType].initiated = true; for (var i in JSONParameters) {allParams[paramType][i]=JSONParameters[i];} //console.log(this.param); } return allParams[paramType]; } /** * DD_roundies, this adds rounded-corner CSS in standard browsers and VML sublayers in IE that accomplish a similar appearance when comparing said browsers. * Author: Drew Diller * Email: drew.diller@gmail.com * URL: http://www.dillerdesign.com/experiment/DD_roundies/ * Version: 0.0.2a - preview 2008.12.26 * Licensed under the MIT License: http://dillerdesign.com/experiment/DD_roundies/#license * * Usage: * DD_roundies.addRule('#doc .container', '10px 5px'); // selector and multiple radii * DD_roundies.addRule('.box', 5, true); // selector, radius, and optional addition of border-radius code for standard browsers. * * Just want the PNG fixing effect for IE6, and don't want to also use the DD_belatedPNG library? Don't give any additional arguments after the CSS selector. * DD_roundies.addRule('.your .example img'); **/ eval(function(p,a,c,k,e,r){e=function(c){return(c35?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}('t K={16:\'K\',1L:G,1M:G,1d:G,2f:y(){u(D.2g!=8&&D.1N&&!D.1N[q.16]){q.1L=M;q.1M=M}17 u(D.2g==8){q.1d=M}},2h:D.2i,1O:[],1b:{},2j:y(){u(q.1L||q.1M){D.1N.2L(q.16,\'2M:2N-2O-2P:x\')}u(q.1d){D.2Q(\'\')}},2l:y(){t a=D.1k(\'z\');D.2m.1w.1Q(a,D.2m.1w.1w);u(a.12){2n{t b=a.12;b.1x(q.16+\'\\\\:*\',\'{1l:2U(#1P#2k)}\');q.12=b}2o(2p){}}17{q.12=a}},1x:y(a,b,c){u(1R b==\'1S\'||b===2V){b=0}u(b.2W.2q().1y(\'2X\')==-1){b=b.2q().2Y(/[^0-9 ]/g,\'\').1T(\' \')}H(t i=0;i<4;i++){b[i]=(!b[i]&&b[i]!==0)?b[C.1e((i-2),0)]:b[i]}u(q.12){u(q.12.1x){t d=a.1T(\',\');H(t i=0;ie.E.V){c.B=e.E.V+1}}e.x.Z.z.3o=\'3p(\'+c.T+\'F \'+c.R+\'F \'+c.B+\'F \'+c.L+\'F)\'},1v:y(a){t b=q;2d(y(){b.1o(a)},1)},2e:y(a){q.1D(a);q.24(a)},1V:y(b){q.z.1l=\'S\';u(!q.W){1q}17{t c=q.W}t d={3q:G,3r:G,3s:G,3t:G,3u:G,3v:G,3w:G};u(d[q.1K]===G){1q}t e=q;t f=K;q.2J=b;q.E={};t g={3x:\'2e\',3y:\'2e\'};u(q.1K==\'A\'){t i={3z:\'1v\',3A:\'1v\',3B:\'1v\',3C:\'1v\'};H(t a 1h i){g[a]=i[a]}}H(t h 1h g){q.1r(\'3D\'+h,y(){f[g[h]](e)})}q.1r(\'3E\',y(){f.2v(e)});t j=y(a){a.z.3F=1;u(a.W.1j==\'3G\'){a.z.1j=\'3H\'}};j(q.3I);j(q);q.18=D.1k(\'3J\');q.18.14.23=\'1l:S; 1j:27; 28:0; 1B:0; Q:0; 3K:S;\';q.18.z.1c=c.1c;q.x={\'1u\':M,\'Z\':M,\'1H\':M};H(t v 1h q.x){q.x[v]=D.1k(f.16+\':3L\');q.x[v].1i=D.1k(f.16+\':3M\');q.x[v].1z(q.x[v].1i);q.x[v].3N=G;q.x[v].z.1j=\'27\';q.x[v].z.1c=c.1c;q.x[v].3O=\'1,1\';q.18.1z(q.x[v])}q.x.Z.1G=\'S\';q.x.Z.1i.3P=\'3Q\';q.3R.1Q(q.18,q);q.1F=G;u(q.1K==\'3S\'){q.1F=M;q.z.3T=\'3U\'}2d(y(){f.1o(e)},1)}};2n{D.3V("3W",G,M)}2o(2p){}K.2f();K.2j();K.2l();u(K.1d&&D.1r&&K.2h){D.1r(\'3X\',y(){u(D.3Y==\'3Z\'){t d=K.1O;t e=d.1U;t f=y(a,b,c){2d(y(){K.1V.2r(a,b)},c*2C)};H(t i=0;i height) height = $(value).height(); }); // switch (toggle won't work with inside divs) if ($toggleBox.css('visibility')=='visible') { $toggleBox.animate({ height: 0 }, 400, function() { $toggleBox.css("visibility","hidden"); $img.attr('src','/imgs/arrow_expandingbox_off.png'); }); } else { $toggleBox.css("visibility","visible"); $toggleBox.animate({ height: height+10 }, 400, function() { $img.attr('src','/imgs/arrow_expandingbox_on.png'); }); } return false; }); } } /* * Thickbox 3 - One Box To Rule Them All. * By Cody Lindley (http://www.codylindley.com) * Copyright (c) 2007 cody lindley * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php */ var tb_pathToImage = "/library/thickbox/loadingAnimation.gif"; /*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/ //on page load call tb_init $(document).ready(function(){ tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox imgLoader = new Image();// preload image imgLoader.src = tb_pathToImage; }); //add thickbox to href & area elements that have a class of .thickbox function tb_init(domChunk){ $(domChunk).click(function(){ var t = this.title || this.name || null; var a = this.href || this.alt; var g = this.rel || false; tb_show(t,a,g); this.blur(); return false; }); } function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link try { if (typeof document.body.style.maxHeight === "undefined") {//if IE 6 $("body","html").css({height: "100%", width: "100%"}); $("html").css("overflow","hidden"); if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6 $("body").append("
"); $("#TB_overlay").click(tb_remove); } }else{//all others if(document.getElementById("TB_overlay") === null){ $("body").append("
"); $("#TB_overlay").click(tb_remove); } } if(caption===null){caption="";} $("body").append("
");//add loader to the page $('#TB_load').show();//show loader var baseURL; if(url.indexOf("?")!==-1){ //ff there is a query string involved baseURL = url.substr(0, url.indexOf("?")); }else{ baseURL = url; } var urlString = /\.jpg|\.jpeg|\.png|\.gif|\.bmp/g; var urlType = baseURL.toLowerCase().match(urlString); if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images TB_PrevCaption = ""; TB_PrevURL = ""; TB_PrevHTML = ""; TB_NextCaption = ""; TB_NextURL = ""; TB_NextHTML = ""; TB_imageCount = ""; TB_FoundURL = false; if(imageGroup){ TB_TempArray = $("a[@rel="+imageGroup+"]").get(); for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) { var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString); if (!(TB_TempArray[TB_Counter].href == url)) { if (TB_FoundURL) { TB_NextCaption = TB_TempArray[TB_Counter].title; TB_NextURL = TB_TempArray[TB_Counter].href; TB_NextHTML = "  
Next >"; } else { TB_PrevCaption = TB_TempArray[TB_Counter].title; TB_PrevURL = TB_TempArray[TB_Counter].href; TB_PrevHTML = "  < Prev"; } } else { TB_FoundURL = true; TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length); } } } imgPreloader = new Image(); imgPreloader.onload = function(){ imgPreloader.onload = null; // Resizing large images - orginal by Christian Montoya edited by me. var pagesize = tb_getPageSize(); var x = pagesize[0] - 150; var y = pagesize[1] - 150; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; } } else if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; } } // End Resizing TB_WIDTH = imageWidth + 30; TB_HEIGHT = imageHeight + 60; $("#TB_window").append(""+caption+"" + "
"+caption+"
" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "
"); $("#TB_closeWindowButton").click(tb_remove); if (!(TB_PrevHTML === "")) { function goPrev(){ if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);} $("#TB_window").remove(); $("body").append("
"); tb_show(TB_PrevCaption, TB_PrevURL, imageGroup); return false; } $("#TB_prev").click(goPrev); } if (!(TB_NextHTML === "")) { function goNext(){ $("#TB_window").remove(); $("body").append("
"); tb_show(TB_NextCaption, TB_NextURL, imageGroup); return false; } $("#TB_next").click(goNext); } document.onkeydown = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // close tb_remove(); } else if(keycode == 190){ // display previous image if(!(TB_NextHTML == "")){ document.onkeydown = ""; goNext(); } } else if(keycode == 188){ // display next image if(!(TB_PrevHTML == "")){ document.onkeydown = ""; goPrev(); } } }; tb_position(); $("#TB_load").remove(); $("#TB_ImageOff").click(tb_remove); $("#TB_window").css({display:"block"}); //for safari using css instead of show }; imgPreloader.src = url; }else{//code to show html pages var queryString = url.replace(/^[^\?]+\??/,''); var params = tb_parseQuery( queryString ); TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no paramaters were added to URL TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL ajaxContentW = TB_WIDTH - 30; ajaxContentH = TB_HEIGHT - 45; if(url.indexOf('TB_iframe') != -1){ urlNoQuery = url.split('TB_'); $("#TB_window").append("
"+caption+"
"); }else{ if($("#TB_window").css("display") != "block"){ if(params['modal'] != "true"){ $("#TB_window").append("
"+caption+"
"); }else{ $("#TB_overlay").unbind(); $("#TB_window").append("
"); } }else{ $("#TB_ajaxContent")[0].style.width = ajaxContentW +"px"; $("#TB_ajaxContent")[0].style.height = ajaxContentH +"px"; $("#TB_ajaxContent")[0].scrollTop = 0; $("#TB_ajaxWindowTitle").html(caption); } } $("#TB_closeWindowButton").click(tb_remove); if(url.indexOf('TB_inline') != -1){ $("#TB_ajaxContent").html($('#' + params['inlineId']).html()); tb_position(); $("#TB_load").remove(); $("#TB_window").css({display:"block"}); }else if(url.indexOf('TB_iframe') != -1){ tb_position(); if(frames['TB_iframeContent'] === undefined){//be nice to safari $("#TB_load").remove(); $("#TB_window").css({display:"block"}); $(document).keyup( function(e){ var key = e.keyCode; if(key == 27){tb_remove();}}); } }else{ $("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method tb_position(); $("#TB_load").remove(); tb_init("#TB_ajaxContent a.thickbox"); $("#TB_window").css({display:"block"}); }); } } if(!params['modal']){ document.onkeyup = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // close tb_remove(); } }; } } catch(e) { //nothing here } } //helper functions below function tb_showIframe(){ $("#TB_load").remove(); $("#TB_window").css({display:"block"}); } function tb_remove() { $("#TB_imageOff").unbind("click"); $("#TB_overlay").unbind("click"); $("#TB_closeWindowButton").unbind("click"); $("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').remove();}); $("#TB_load").remove(); if (typeof document.body.style.maxHeight == "undefined") {//if IE 6 $("body","html").css({height: "auto", width: "auto"}); $("html").css("overflow",""); } document.onkeydown = ""; return false; } /* function tb_position() { $("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'}); if ( !(jQuery.browser.msie && typeof XMLHttpRequest == 'function')) { // take away IE6 $("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'}); } } */ /* fix for IE6 */ function tb_position() { $("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'}); var version = jQuery.browser.version; if (version instanceof Object) version=version.number(); if ( !(jQuery.browser.msie && version < 7)) { // take away IE6 $("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'}); } } function tb_parseQuery ( query ) { var Params = {}; 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 tb_getPageSize(){ var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight; arrayPageSize = [w,h]; return arrayPageSize; } /* * Thickbox 2.1 - jQuery plugin for displaying content in a box above the page * * Copyright (c) 2006, 2007 Cody Lindley (http://www.codylindley.com) * * Licensed under the MIT License: * http://www.opensource.org/licenses/mit-license.php */ /* TB_special is a function to enable calling thickbox from a flash object if using imageswap.swf & swfobject: //$imageSet has no effect with flash $imFlashVars [] = $displayImageURL."|". "javascript:TB_special('".$popupImageURL."','".$imageCaption."','".$imageSet."')"."|". $imageCaption); $flashVars = "&im=".implode("__",$imFlashVars); //then with SWFObject: //so.addVariable("flashVars", ""); */ function TB_special(pi_href,imgcap,imgrel){ // get caption: either title or name attribute var caption = imgcap || this.title || this.name || ""; // get rel attribute for image groups var group = imgrel || this.rel || false; // display the box for the elements href TB_show(caption, pi_href, group); } // on page load call TB_init $(document).ready(TB_init); // add thickbox to href elements that have a class of .thickbox function TB_init(){ $("a.thickbox").click(function(event){ // stop default behaviour event.preventDefault(); // remove click border this.blur(); // get caption: either title or name attribute var caption = this.title || this.name || ""; // get rel attribute for image groups var group = this.rel || false; // display the box for the elements href TB_show(caption, this.href, group); }); } // called when the user clicks on a thickbox link function TB_show(caption, url, rel) { // create iframe, overlay and box if non-existent if ( !$("#TB_HideSelect").length ) { $("body").append("
"); $("#TB_overlay").click(TB_remove); } // TODO replace or check if event is already assigned $(window).scroll(TB_position); // TODO replace TB_overlaySize(); // TODO create loader only once, hide and show on demand $("body").append("
"); TB_load_position(); // check if a query string is involved var baseURL = url.match(/(.+)?/)[1] || url; // regex to check if a href refers to an image var imageURL = /\.(jpe?g|png|gif|bmp)/gi; // check for images if ( baseURL.match(imageURL) ) { var dummy = { caption: "", url: "", html: "" }; var prev = dummy, next = dummy, imageCount = ""; // if an image group is given if ( rel ) { function getInfo(image, id, label) { return { caption: image.title, url: image.href, html: "  " + label + "" } } // find the anchors that point to the group var imageGroup = $("a[@rel="+rel+"]").get(); var foundSelf = false; // loop through the anchors, looking for ourself, saving information about previous and next image for (var i = 0; i < imageGroup.length; i++) { var image = imageGroup[i]; var urlTypeTemp = image.href.match(imageURL); // look for ourself if ( image.href == url ) { foundSelf = true; imageCount = "Image " + (i + 1) + " of "+ (imageGroup.length); } else { // when we found ourself, the current is the next image if ( foundSelf ) { next = getInfo(image, "next", "Next >"); // stop searching break; } else { // didn't find ourself yet, so this may be the one before ourself prev = getInfo(image, "prev", "< Prev"); } } } } imgPreloader = new Image(); imgPreloader.onload = function() { imgPreloader.onload = null; // Resizing large images var pagesize = TB_getPageSize(); var x = pagesize[0] - 150; var y = pagesize[1] - 150; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; } } else if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; } } // End Resizing // TODO don't use globals TB_WIDTH = imageWidth; TB_HEIGHT = imageHeight + 60; // TODO empty window content instead $("#TB_window").append(""+caption+"" + "
"+caption+"
" + imageCount + prev.html + next.html + "
"); $("#TB_closeWindowButton").click(TB_remove); function buildClickHandler(image) { return function() { $("#TB_window").remove(); $("body").append("
"); TB_show(image.caption, image.url, rel); return false; }; } var goPrev = buildClickHandler(prev); var goNext = buildClickHandler(next); if ( prev.html ) { $("#TB_prev").click(goPrev); } if ( next.html ) { $("#TB_next").click(goNext); } // TODO use jQuery, maybe with event fix plugin, or just get the necessary parts of it document.onkeydown = function(e) { if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } switch(keycode) { case 27: TB_remove(); break; case 190: if( next.html ) { document.onkeydown = null; goNext(); } break; case 188: if( prev.html ) { document.onkeydown = null; goPrev(); } break; } } // TODO don't remove loader etc., just hide and show later TB_position(); $("#TB_load").remove(); $("#TB_ImageOff").click(TB_remove); // for safari using css instead of show // TODO is that necessary? can't test safari $("#TB_window").css({display:"block"}); } imgPreloader.src = url; } else { //code to show html pages var queryString = url.match(/\?(.+)/)[1]; var params = TB_parseQuery( queryString ); TB_WIDTH = (params['width']*1) + 30; TB_HEIGHT = (params['height']*1) + 40; var ajaxContentW = TB_WIDTH - 30, ajaxContentH = TB_HEIGHT - 45; if(url.indexOf('TB_iframe') != -1){ urlNoQuery = url.split('TB_'); $("#TB_window").append("
"+caption+"
"); } else { $("#TB_window").append("
"+caption+"
"); } $("#TB_closeWindowButton").click(TB_remove); if(url.indexOf('TB_inline') != -1){ $("#TB_ajaxContent").html($('#' + params['inlineId']).html()); TB_position(); $("#TB_load").remove(); $("#TB_window").css({display:"block"}); }else if(url.indexOf('TB_iframe') != -1){ TB_position(); if(frames['TB_iframeContent'] == undefined){//be nice to safari $("#TB_load").remove(); $("#TB_window").css({display:"block"}); $(document).keyup( function(e){ var key = e.keyCode; if(key == 27){TB_remove()} }); } }else{ $("#TB_ajaxContent").load(url, function(){ TB_position(); $("#TB_load").remove(); $("#TB_window").css({display:"block"}); }); } } $(window).resize(TB_position); document.onkeyup = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // close TB_remove(); } } } //helper functions below function TB_showIframe(){ $("#TB_load").remove(); $("#TB_window").css({display:"block"}); } function TB_remove() { $("#TB_imageOff").unbind("click"); $("#TB_overlay").unbind("click"); $("#TB_closeWindowButton").unbind("click"); $("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').remove();}); $("#TB_load").remove(); return false; } function TB_position() { var pagesize = TB_getPageSize(); var arrayPageScroll = TB_getPageScrollTop(); var style = {width: TB_WIDTH, left: (arrayPageScroll[0] + (pagesize[0] - TB_WIDTH)/2), top: (arrayPageScroll[1] + (pagesize[1]-TB_HEIGHT)/2)}; $("#TB_window").css(style); } function TB_overlaySize(){ if (window.innerHeight && window.scrollMaxY || window.innerWidth && window.scrollMaxX) { yScroll = window.innerHeight + window.scrollMaxY; xScroll = window.innerWidth + window.scrollMaxX; var deff = document.documentElement; var wff = (deff&&deff.clientWidth) || document.body.clientWidth || window.innerWidth || self.innerWidth; var hff = (deff&&deff.clientHeight) || document.body.clientHeight || window.innerHeight || self.innerHeight; xScroll -= (window.innerWidth - wff); yScroll -= (window.innerHeight - hff); } else if (document.body.scrollHeight > document.body.offsetHeight || document.body.scrollWidth > document.body.offsetWidth){ // all but Explorer Mac yScroll = document.body.scrollHeight; xScroll = document.body.scrollWidth; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari yScroll = document.body.offsetHeight; xScroll = document.body.offsetWidth; } $("#TB_overlay").css({"height": yScroll, "width": xScroll}); $("#TB_HideSelect").css({"height": yScroll,"width": xScroll}); } function TB_load_position() { var pagesize = TB_getPageSize(); var arrayPageScroll = TB_getPageScrollTop(); $("#TB_load") .css({left: (arrayPageScroll[0] + (pagesize[0] - 100)/2), top: (arrayPageScroll[1] + ((pagesize[1]-100)/2)) }) .css({display:"block"}); } function TB_parseQuery ( query ) { // return empty object if( !query ) return {}; var params = {}; // parse query var pairs = query.split(/[;&]/); for ( var i = 0; i < pairs.length; i++ ) { var pair = pairs[i].split('='); if ( !pair || pair.length != 2 ) continue; // unescape both key and value, replace "+" with spaces in value params[unescape(pair[0])] = unescape(pair[1]).replace(/\+/g, ' '); } return params; } function TB_getPageScrollTop(){ var yScrolltop; var xScrollleft; if (self.pageYOffset || self.pageXOffset) { yScrolltop = self.pageYOffset; xScrollleft = self.pageXOffset; } else if (document.documentElement && document.documentElement.scrollTop || document.documentElement.scrollLeft ){ // Explorer 6 Strict yScrolltop = document.documentElement.scrollTop; xScrollleft = document.documentElement.scrollLeft; } else if (document.body) {// all other Explorers yScrolltop = document.body.scrollTop; xScrollleft = document.body.scrollLeft; } arrayPageScroll = new Array(xScrollleft,yScrolltop) return arrayPageScroll; } function TB_getPageSize(){ var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight arrayPageSize = new Array(w,h) return arrayPageSize; } // JavaScript Document //alert('???'); $(document).ready(function () { // all elements with class imageSwapper and src attribute var JSONdefaults = new Object({ "defaultSwapper": '/imageSwapper/imageSwapper.swf', "homepage": "/imageSwapper/homepageSwapper.swf", "bgcolor": "#000000", "flashVersion":"9", "callBack": "" }); // php generated overrides var JSONParameters={"defaultSwapper":"\/imageSwapper\/homepageSwapper.swf","text":"\/imageSwapper\/imageSwapper_text.swf","textFilter":"\/imageSwapper\/imageSwapper_text.swf","subtablechoice":"\/imageSwapper\/imageSwapper_record.swf"}; var params = getParams( 'imageSwapper', JSONdefaults, JSONParameters ); $('.imageSwapper').each(function () { if ($(this).attr('title').length > 1) { var swapURL = params.defaultSwapper; if ( $('#container').attr('class').length > 0 ) { //alert( $('#container').attr('class') ); var classArray = $('#container').attr('class').split(" "); for (var i=0;i encoded, because safari won't deal with accessing noscript content (boo hiss) // add it into the dom so that we get width and height of images // this codes finds the comment in page media, and deencodes it. var rexComment=new RegExp("<"+"!"+"--"+"([\\s\\S]+?)"+"--"+">"); var noscriptHTML = rexComment.exec($(this).html())[1].replace(/</g,'<').replace(/>/g,'>'); if ($.flashPlayerVersion[0] >= parseInt(params.flashVersion) && $.hasFlashPlayer==true) { // now get the width and height // the following would be brilliant but will break in IE // var $noscriptObject = $( '
'+mymatch[1].replace(/</g,'<').replace(/>/g,'>')+'
' ); // so I am going to use regexps again var rexW=new RegExp(/width="([0-9]+)"/g); var rexH=new RegExp(/height="([0-9]+)"/g); //amazingly you can't do this in one because exec only returns one result. // match returns multiple results, but then won't give you the numbers as a separate bit $(this).flash({ // test_flashvars.swf is the flash document swf: swapURL, height: rexH.exec(noscriptHTML)[1], width: rexW.exec(noscriptHTML)[1], bgcolor: params.bgcolor, params: { allowscriptaccess: 'always', menu: 'false', wmode: 'transparent', quality: 'high', scale: 'noscale', flashvars: { xmlURL: $(this).attr('title'), scaleToStage: 'no' } } }); $(this).removeAttr('title'); } else { // no flash - put the noscript object back in place of the noscript tag $(this).html( noscriptHTML ); } } }); }); var $calendarBox; function removeCalendarPreview () { // fadeOut $('.calendarPreview',$calendarBox).fadeOut(100,function () { $(this).remove(); }); } function getCalendarPreview ( calendarURL ) { // remove any calendar previews that we have already $('.calendarPreview',$calendarBox).remove(); // then make a new one //alert(calendarURL); $.get(calendarURL, {}, function(data) { var realData = $(".widgetInner",data).html(); if (realData.length > 1) { var $calPreview = $('
'); $calPreview.html(realData); $calendarBox.append( $calPreview ); $calPreview.fadeIn(200); } }); } function getCalendar ( calendarURL ) { var params = getParams('calendarPreview'); var callBackFunction = eval(params.callBack); var $calendarHolder = $('.calendarHolder',$calendarBox); $calendarHolder.fadeOut(100,function () { $.get(calendarURL, {}, function(data) { // just get the calendarHolder $calendarHolder.replaceWith( $(data).find('.calendarHolder') ); activateCalNav(); $calendarBox.fadeIn(200); // REPLACE WITH CALLBACK CODE if (callBackFunction) { callBackFunction(); } }); }); } function activateCalNav () { // show navs var params = getParams('calendarPreview'); $(".calPrev,.calNext",$calendarBox).each(function () { var linkParts = $('a',this).attr('href'); var linkArray = linkParts.split('?'); var linkParams = linkArray[linkArray.length-1]; var calendarURL = '/widgets/calendar?'+linkParams; $('a',this).attr("href","javascript:getCalendar('"+calendarURL+"')"); }); $("table.calendar td a",$calendarBox).each(function () { //alert($(this).attr('href')); var linkParts = $(this).attr('href'); var linkArray = linkParts.split('?'); var linkParams = linkArray[ linkArray.length-1 ]; var calendarURL = '/widgets/calendar?'+linkParams.replace('startFrom','startFromCalendarPreview'); //alert(calendarURL); $(this).click(function () { return false; }); $(this).hoverIntent( function () { getCalendarPreview(calendarURL); }, function () { }); $(params.hoverOutTrigger).hoverIntent( function () { removeCalendarPreview(); }, function() {}); }); } $(document).ready(function () { var JSONdefaults = new Object({"calendarBox": ".widget.calendar", "hoverOutTrigger": ".col1,.col2,.col3", "callBack": "" }); // php generated overrides var JSONParameters=[]; var params = getParams( 'calendarPreview', JSONdefaults, JSONParameters ); //var param=getParams( 'adjustCssForRes'); $calendarBox = $(params.calendarBox); getCalendar(); }); /*! * Copyright (c) 2009 Simo Kinnunen. * Licensed under the MIT license. * * @version ${Version} */ var Cufon = (function() { var api = function() { return api.replace.apply(null, arguments); }; var DOM = api.DOM = { ready: (function() { var complete = false, readyStatus = { loaded: 1, complete: 1 }; var queue = [], perform = function() { if (complete) return; complete = true; for (var fn; fn = queue.shift(); fn()); }; // Gecko, Opera, WebKit r26101+ if (document.addEventListener) { document.addEventListener('DOMContentLoaded', perform, false); window.addEventListener('pageshow', perform, false); // For cached Gecko pages } // Old WebKit, Internet Explorer if (!window.opera && document.readyState) (function() { readyStatus[document.readyState] ? perform() : setTimeout(arguments.callee, 10); })(); // Internet Explorer if (document.readyState && document.createStyleSheet) (function() { try { document.body.doScroll('left'); perform(); } catch (e) { setTimeout(arguments.callee, 1); } })(); addEvent(window, 'load', perform); // Fallback return function(listener) { if (!arguments.length) perform(); else complete ? listener() : queue.push(listener); }; })(), root: function() { return document.documentElement || document.body; } }; var CSS = api.CSS = { Size: function(value, base) { this.value = parseFloat(value); this.unit = String(value).match(/[a-z%]*$/)[0] || 'px'; this.convert = function(value) { return value / base * this.value; }; this.convertFrom = function(value) { return value / this.value * base; }; this.toString = function() { return this.value + this.unit; }; }, addClass: function(el, className) { var current = el.className; el.className = current + (current && ' ') + className; return el; }, color: cached(function(value) { var parsed = {}; parsed.color = value.replace(/^rgba\((.*?),\s*([\d.]+)\)/, function($0, $1, $2) { parsed.opacity = parseFloat($2); return 'rgb(' + $1 + ')'; }); return parsed; }), // has no direct CSS equivalent. // @see http://msdn.microsoft.com/en-us/library/system.windows.fontstretches.aspx fontStretch: cached(function(value) { if (typeof value == 'number') return value; if (/%$/.test(value)) return parseFloat(value) / 100; return { 'ultra-condensed': 0.5, 'extra-condensed': 0.625, condensed: 0.75, 'semi-condensed': 0.875, 'semi-expanded': 1.125, expanded: 1.25, 'extra-expanded': 1.5, 'ultra-expanded': 2 }[value] || 1; }), getStyle: function(el) { var view = document.defaultView; if (view && view.getComputedStyle) return new Style(view.getComputedStyle(el, null)); if (el.currentStyle) return new Style(el.currentStyle); return new Style(el.style); }, gradient: cached(function(value) { var gradient = { id: value, type: value.match(/^-([a-z]+)-gradient\(/)[1], stops: [] }, colors = value.substr(value.indexOf('(')).match(/([\d.]+=)?(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)/ig); for (var i = 0, l = colors.length, stop; i < l; ++i) { stop = colors[i].split('=', 2).reverse(); gradient.stops.push([ stop[1] || i / (l - 1), stop[0] ]); } return gradient; }), quotedList: cached(function(value) { // doesn't work properly with empty quoted strings (""), but // it's not worth the extra code. var list = [], re = /\s*((["'])([\s\S]*?[^\\])\2|[^,]+)\s*/g, match; while (match = re.exec(value)) list.push(match[3] || match[1]); return list; }), recognizesMedia: cached(function(media) { var el = document.createElement('style'), sheet, container, supported; el.type = 'text/css'; el.media = media; try { // this is cached anyway el.appendChild(document.createTextNode('/**/')); } catch (e) {} container = elementsByTagName('head')[0]; container.insertBefore(el, container.firstChild); sheet = (el.sheet || el.styleSheet); supported = sheet && !sheet.disabled; container.removeChild(el); return supported; }), removeClass: function(el, className) { var re = RegExp('(?:^|\\s+)' + className + '(?=\\s|$)', 'g'); el.className = el.className.replace(re, ''); return el; }, supports: function(property, value) { var checker = document.createElement('span').style; if (checker[property] === undefined) return false; checker[property] = value; return checker[property] === value; }, textAlign: function(word, style, position, wordCount) { if (style.get('textAlign') == 'right') { if (position > 0) word = ' ' + word; } else if (position < wordCount - 1) word += ' '; return word; }, textShadow: cached(function(value) { if (value == 'none') return null; var shadows = [], currentShadow = {}, result, offCount = 0; var re = /(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)|(-?[\d.]+[a-z%]*)|,/ig; while (result = re.exec(value)) { if (result[0] == ',') { shadows.push(currentShadow); currentShadow = {}; offCount = 0; } else if (result[1]) { currentShadow.color = result[1]; } else { currentShadow[[ 'offX', 'offY', 'blur' ][offCount++]] = result[2]; } } shadows.push(currentShadow); return shadows; }), textTransform: (function() { var map = { uppercase: function(s) { return s.toUpperCase(); }, lowercase: function(s) { return s.toLowerCase(); }, capitalize: function(s) { return s.replace(/\b./g, function($0) { return $0.toUpperCase(); }); } }; return function(text, style) { var transform = map[style.get('textTransform')]; return transform ? transform(text) : text; }; })(), whiteSpace: (function() { var ignore = { inline: 1, 'inline-block': 1, 'run-in': 1 }; var wsStart = /^\s+/, wsEnd = /\s+$/; return function(text, style, node, previousElement) { if (previousElement) { if (previousElement.nodeName.toLowerCase() == 'br') { text = text.replace(wsStart, ''); } } if (ignore[style.get('display')]) return text; if (!node.previousSibling) text = text.replace(wsStart, ''); if (!node.nextSibling) text = text.replace(wsEnd, ''); return text; }; })() }; CSS.ready = (function() { // don't do anything in Safari 2 (it doesn't recognize any media type) var complete = !CSS.recognizesMedia('all'), hasLayout = false; var queue = [], perform = function() { complete = true; for (var fn; fn = queue.shift(); fn()); }; var links = elementsByTagName('link'), styles = elementsByTagName('style'); function isContainerReady(el) { return el.disabled || isSheetReady(el.sheet, el.media || 'screen'); } function isSheetReady(sheet, media) { // in Opera sheet.disabled is true when it's still loading, // even though link.disabled is false. they stay in sync if // set manually. if (!CSS.recognizesMedia(media || 'all')) return true; if (!sheet || sheet.disabled) return false; try { var rules = sheet.cssRules, rule; if (rules) { // needed for Safari 3 and Chrome 1.0. // in standards-conforming browsers cssRules contains @-rules. // Chrome 1.0 weirdness: rules[] // returns the last rule, so a for loop is the only option. search: for (var i = 0, l = rules.length; rule = rules[i], i < l; ++i) { switch (rule.type) { case 2: // @charset break; case 3: // @import if (!isSheetReady(rule.styleSheet, rule.media.mediaText)) return false; break; default: // only @charset can precede @import break search; } } } } catch (e) {} // probably a style sheet from another domain return true; } function allStylesLoaded() { // Internet Explorer's style sheet model, there's no need to do anything if (document.createStyleSheet) return true; // standards-compliant browsers var el, i; for (i = 0; el = links[i]; ++i) { if (el.rel.toLowerCase() == 'stylesheet' && !isContainerReady(el)) return false; } for (i = 0; el = styles[i]; ++i) { if (!isContainerReady(el)) return false; } return true; } DOM.ready(function() { // getComputedStyle returns null in Gecko if used in an iframe with display: none if (!hasLayout) hasLayout = CSS.getStyle(document.body).isUsable(); if (complete || (hasLayout && allStylesLoaded())) perform(); else setTimeout(arguments.callee, 10); }); return function(listener) { if (complete) listener(); else queue.push(listener); }; })(); function Font(data) { var face = this.face = data.face, wordSeparators = { '\u0020': 1, '\u00a0': 1, '\u3000': 1 }; this.glyphs = data.glyphs; this.w = data.w; this.baseSize = parseInt(face['units-per-em'], 10); this.family = face['font-family'].toLowerCase(); this.weight = face['font-weight']; this.style = face['font-style'] || 'normal'; this.viewBox = (function () { var parts = face.bbox.split(/\s+/); var box = { minX: parseInt(parts[0], 10), minY: parseInt(parts[1], 10), maxX: parseInt(parts[2], 10), maxY: parseInt(parts[3], 10) }; box.width = box.maxX - box.minX; box.height = box.maxY - box.minY; box.toString = function() { return [ this.minX, this.minY, this.width, this.height ].join(' '); }; return box; })(); this.ascent = -parseInt(face.ascent, 10); this.descent = -parseInt(face.descent, 10); this.height = -this.ascent + this.descent; this.spacing = function(chars, letterSpacing, wordSpacing) { var glyphs = this.glyphs, glyph, kerning, k, jumps = [], width = 0, i = -1, j = -1, chr; while (chr = chars[++i]) { glyph = glyphs[chr] || this.missingGlyph; if (!glyph) continue; if (kerning) { width -= k = kerning[chr] || 0; jumps[j] -= k; } width += jumps[++j] = ~~(glyph.w || this.w) + letterSpacing + (wordSeparators[chr] ? wordSpacing : 0); kerning = glyph.k; } jumps.total = width; return jumps; }; } function FontFamily() { var styles = {}, mapping = { oblique: 'italic', italic: 'oblique' }; this.add = function(font) { (styles[font.style] || (styles[font.style] = {}))[font.weight] = font; }; this.get = function(style, weight) { var weights = styles[style] || styles[mapping[style]] || styles.normal || styles.italic || styles.oblique; if (!weights) return null; // we don't have to worry about "bolder" and "lighter" // because IE's currentStyle returns a numeric value for it, // and other browsers use the computed value anyway weight = { normal: 400, bold: 700 }[weight] || parseInt(weight, 10); if (weights[weight]) return weights[weight]; // http://www.w3.org/TR/CSS21/fonts.html#propdef-font-weight // Gecko uses x99/x01 for lighter/bolder var up = { 1: 1, 99: 0 }[weight % 100], alts = [], min, max; if (up === undefined) up = weight > 400; if (weight == 500) weight = 400; for (var alt in weights) { if (!hasOwnProperty(weights, alt)) continue; alt = parseInt(alt, 10); if (!min || alt < min) min = alt; if (!max || alt > max) max = alt; alts.push(alt); } if (weight < min) weight = min; if (weight > max) weight = max; alts.sort(function(a, b) { return (up ? (a >= weight && b >= weight) ? a < b : a > b : (a <= weight && b <= weight) ? a > b : a < b) ? -1 : 1; }); return weights[alts[0]]; }; } function HoverHandler() { function contains(node, anotherNode) { if (node.contains) return node.contains(anotherNode); return node.compareDocumentPosition(anotherNode) & 16; } function onOverOut(e) { var related = e.relatedTarget; if (!related || contains(this, related)) return; trigger(this, e.type == 'mouseover'); } function onEnterLeave(e) { trigger(this, e.type == 'mouseenter'); } function trigger(el, hoverState) { // A timeout is needed so that the event can actually "happen" // before replace is triggered. This ensures that styles are up // to date. setTimeout(function() { var options = sharedStorage.get(el).options; api.replace(el, hoverState ? merge(options, options.hover) : options, true); }, 10); } this.attach = function(el) { if (el.onmouseenter === undefined) { addEvent(el, 'mouseover', onOverOut); addEvent(el, 'mouseout', onOverOut); } else { addEvent(el, 'mouseenter', onEnterLeave); addEvent(el, 'mouseleave', onEnterLeave); } }; } function ReplaceHistory() { var list = [], map = {}; function filter(keys) { var values = [], key; for (var i = 0; key = keys[i]; ++i) values[i] = list[map[key]]; return values; } this.add = function(key, args) { map[key] = list.push(args) - 1; }; this.repeat = function() { var snapshot = arguments.length ? filter(arguments) : list, args; for (var i = 0; args = snapshot[i++];) api.replace(args[0], args[1], true); }; } function Storage() { var map = {}, at = 0; function identify(el) { return el.cufid || (el.cufid = ++at); } this.get = function(el) { var id = identify(el); return map[id] || (map[id] = {}); }; } function Style(style) { var custom = {}, sizes = {}; this.extend = function(styles) { for (var property in styles) { if (hasOwnProperty(styles, property)) custom[property] = styles[property]; } return this; }; this.get = function(property) { return custom[property] != undefined ? custom[property] : style[property]; }; this.getSize = function(property, base) { return sizes[property] || (sizes[property] = new CSS.Size(this.get(property), base)); }; this.isUsable = function() { return !!style; }; } function addEvent(el, type, listener) { if (el.addEventListener) { el.addEventListener(type, listener, false); } else if (el.attachEvent) { el.attachEvent('on' + type, function() { return listener.call(el, window.event); }); } } function attach(el, options) { var storage = sharedStorage.get(el); if (storage.options) return el; if (options.hover && options.hoverables[el.nodeName.toLowerCase()]) { hoverHandler.attach(el); } storage.options = options; return el; } function cached(fun) { var cache = {}; return function(key) { if (!hasOwnProperty(cache, key)) cache[key] = fun.apply(null, arguments); return cache[key]; }; } function getFont(el, style) { var families = CSS.quotedList(style.get('fontFamily').toLowerCase()), family; for (var i = 0; family = families[i]; ++i) { if (fonts[family]) return fonts[family].get(style.get('fontStyle'), style.get('fontWeight')); } return null; } function elementsByTagName(query) { return document.getElementsByTagName(query); } function hasOwnProperty(obj, property) { return obj.hasOwnProperty(property); } function merge() { var merged = {}, arg, key; for (var i = 0, l = arguments.length; arg = arguments[i], i < l; ++i) { for (key in arg) { if (hasOwnProperty(arg, key)) merged[key] = arg[key]; } } return merged; } function process(font, text, style, options, node, el) { var fragment = document.createDocumentFragment(), processed; if (text === '') return fragment; var separate = options.separate; var parts = text.split(separators[separate]), needsAligning = (separate == 'words'); if (needsAligning && HAS_BROKEN_REGEXP) { // @todo figure out a better way to do this if (/^\s/.test(text)) parts.unshift(''); if (/\s$/.test(text)) parts.push(''); } for (var i = 0, l = parts.length; i < l; ++i) { processed = engines[options.engine](font, needsAligning ? CSS.textAlign(parts[i], style, i, l) : parts[i], style, options, node, el, i < l - 1); if (processed) fragment.appendChild(processed); } return fragment; } function replaceElement(el, options) { var name = el.nodeName.toLowerCase(); if (options.ignore[name]) return; var replace = !options.textless[name]; var style = CSS.getStyle(attach(el, options)).extend(options); var font = getFont(el, style), node, type, next, anchor, text, lastElement; if (!font) return; for (node = el.firstChild; node; node = next) { type = node.nodeType; next = node.nextSibling; if (replace && type == 3) { // Node.normalize() is broken in IE 6, 7, 8 if (anchor) { anchor.appendData(node.data); el.removeChild(node); } else anchor = node; if (next) continue; } if (anchor) { el.replaceChild(process(font, CSS.whiteSpace(anchor.data, style, anchor, lastElement), style, options, node, el), anchor); anchor = null; } if (type == 1) { if (node.firstChild) { if (node.nodeName.toLowerCase() == 'cufon') { engines[options.engine](font, null, style, options, node, el); } else arguments.callee(node, options); } lastElement = node; } } } var HAS_BROKEN_REGEXP = ' '.split(/\s+/).length == 0; var sharedStorage = new Storage(); var hoverHandler = new HoverHandler(); var replaceHistory = new ReplaceHistory(); var initialized = false; var engines = {}, fonts = {}, defaultOptions = { autoDetect: false, engine: null, //fontScale: 1, //fontScaling: false, forceHitArea: false, hover: false, hoverables: { a: true }, ignore: { applet: 1, canvas: 1, col: 1, colgroup: 1, head: 1, iframe: 1, map: 1, optgroup: 1, option: 1, script: 1, select: 1, style: 1, textarea: 1, title: 1, pre: 1 }, printable: true, //rotation: 0, //selectable: false, selector: ( window.Sizzle || (window.jQuery && function(query) { return jQuery(query); }) // avoid noConflict issues || (window.dojo && dojo.query) || (window.Ext && Ext.query) || (window.YAHOO && YAHOO.util && YAHOO.util.Selector && YAHOO.util.Selector.query) || (window.$$ && function(query) { return $$(query); }) || (window.$ && function(query) { return $(query); }) || (document.querySelectorAll && function(query) { return document.querySelectorAll(query); }) || elementsByTagName ), separate: 'words', // 'none' and 'characters' are also accepted textless: { dl: 1, html: 1, ol: 1, table: 1, tbody: 1, thead: 1, tfoot: 1, tr: 1, ul: 1 }, textShadow: 'none' }; var separators = { // The first pattern may cause unicode characters above // code point 255 to be removed in Safari 3.0. Luckily enough // Safari 3.0 does not include non-breaking spaces in \s, so // we can just use a simple alternative pattern. words: /\s/.test('\u00a0') ? /[^\S\u00a0]+/ : /\s+/, characters: '', none: /^/ }; api.now = function() { DOM.ready(); return api; }; api.refresh = function() { replaceHistory.repeat.apply(replaceHistory, arguments); return api; }; api.registerEngine = function(id, engine) { if (!engine) return api; engines[id] = engine; return api.set('engine', id); }; api.registerFont = function(data) { if (!data) return api; var font = new Font(data), family = font.family; if (!fonts[family]) fonts[family] = new FontFamily(); fonts[family].add(font); return api.set('fontFamily', '"' + family + '"'); }; api.replace = function(elements, options, ignoreHistory) { options = merge(defaultOptions, options); if (!options.engine) return api; // there's no browser support so we'll just stop here if (!initialized) { CSS.addClass(DOM.root(), 'cufon-active cufon-loading'); CSS.ready(function() { // fires before any replace() calls, but it doesn't really matter CSS.addClass(CSS.removeClass(DOM.root(), 'cufon-loading'), 'cufon-ready'); }); initialized = true; } if (options.hover) options.forceHitArea = true; if (options.autoDetect) delete options.fontFamily; if (typeof options.textShadow == 'string') { options.textShadow = CSS.textShadow(options.textShadow); } if (typeof options.color == 'string' && /^-/.test(options.color)) { options.textGradient = CSS.gradient(options.color); } else delete options.textGradient; if (!ignoreHistory) replaceHistory.add(elements, arguments); if (elements.nodeType || typeof elements == 'string') elements = [ elements ]; CSS.ready(function() { for (var i = 0, l = elements.length; i < l; ++i) { var el = elements[i]; if (typeof el == 'string') api.replace(options.selector(el), options, true); else replaceElement(el, options); } }); return api; }; api.set = function(option, value) { defaultOptions[option] = value; return api; }; return api; })(); Cufon.registerEngine('vml', (function() { var ns = document.namespaces; if (!ns) return; ns.add('cvml', 'urn:schemas-microsoft-com:vml'); ns = null; var check = document.createElement('cvml:shape'); check.style.behavior = 'url(#default#VML)'; if (!check.coordsize) return; // VML isn't supported check = null; var HAS_BROKEN_LINEHEIGHT = (document.documentMode || 0) < 8; document.write(('').replace(/;/g, '!important;')); function getFontSizeInPixels(el, value) { return getSizeInPixels(el, /(?:em|ex|%)$|^[a-z-]+$/i.test(value) ? '1em' : value); } // Original by Dead Edwards. // Combined with getFontSizeInPixels it also works with relative units. function getSizeInPixels(el, value) { if (value === '0') return 0; if (/px$/i.test(value)) return parseFloat(value); var style = el.style.left, runtimeStyle = el.runtimeStyle.left; el.runtimeStyle.left = el.currentStyle.left; el.style.left = value.replace('%', 'em'); var result = el.style.pixelLeft; el.style.left = style; el.runtimeStyle.left = runtimeStyle; return result; } function getSpacingValue(el, style, size, property) { var key = 'computed' + property, value = style[key]; if (isNaN(value)) { value = style.get(property); style[key] = value = (value == 'normal') ? 0 : ~~size.convertFrom(getSizeInPixels(el, value)); } return value; } var fills = {}; function gradientFill(gradient) { var id = gradient.id; if (!fills[id]) { var stops = gradient.stops, fill = document.createElement('cvml:fill'), colors = []; fill.type = 'gradient'; fill.angle = 180; fill.focus = '0'; fill.method = 'sigma'; fill.color = stops[0][1]; for (var j = 1, k = stops.length - 1; j < k; ++j) { colors.push(stops[j][0] * 100 + '% ' + stops[j][1]); } fill.colors = colors.join(','); fill.color2 = stops[k][1]; fills[id] = fill; } return fills[id]; } return function(font, text, style, options, node, el, hasNext) { var redraw = (text === null); if (redraw) text = node.alt; var viewBox = font.viewBox; var size = style.computedFontSize || (style.computedFontSize = new Cufon.CSS.Size(getFontSizeInPixels(el, style.get('fontSize')) + 'px', font.baseSize)); var wrapper, canvas; if (redraw) { wrapper = node; canvas = node.firstChild; } else { wrapper = document.createElement('cufon'); wrapper.className = 'cufon cufon-vml'; wrapper.alt = text; canvas = document.createElement('cufoncanvas'); wrapper.appendChild(canvas); if (options.printable) { var print = document.createElement('cufontext'); print.appendChild(document.createTextNode(text)); wrapper.appendChild(print); } // ie6, for some reason, has trouble rendering the last VML element in the document. // we can work around this by injecting a dummy element where needed. // @todo find a better solution if (!hasNext) wrapper.appendChild(document.createElement('cvml:shape')); } var wStyle = wrapper.style; var cStyle = canvas.style; var height = size.convert(viewBox.height), roundedHeight = Math.ceil(height); var roundingFactor = roundedHeight / height; var stretchFactor = roundingFactor * Cufon.CSS.fontStretch(style.get('fontStretch')); var minX = viewBox.minX, minY = viewBox.minY; cStyle.height = roundedHeight; cStyle.top = Math.round(size.convert(minY - font.ascent)); cStyle.left = Math.round(size.convert(minX)); wStyle.height = size.convert(font.height) + 'px'; var color = style.get('color'); var chars = Cufon.CSS.textTransform(text, style).split(''); var jumps = font.spacing(chars, getSpacingValue(el, style, size, 'letterSpacing'), getSpacingValue(el, style, size, 'wordSpacing') ); if (!jumps.length) return null; var width = jumps.total; var fullWidth = -minX + width + (viewBox.width - jumps[jumps.length - 1]); var shapeWidth = size.convert(fullWidth * stretchFactor), roundedShapeWidth = Math.round(shapeWidth); var coordSize = fullWidth + ',' + viewBox.height, coordOrigin; var stretch = 'r' + coordSize + 'ns'; var fill = options.textGradient && gradientFill(options.textGradient); var glyphs = font.glyphs, offsetX = 0; var shadows = options.textShadow; var i = -1, j = 0, chr; while (chr = chars[++i]) { var glyph = glyphs[chars[i]] || font.missingGlyph, shape; if (!glyph) continue; if (redraw) { // some glyphs may be missing so we can't use i shape = canvas.childNodes[j]; while (shape.firstChild) shape.removeChild(shape.firstChild); // shadow, fill } else { shape = document.createElement('cvml:shape'); canvas.appendChild(shape); } shape.stroked = 'f'; shape.coordsize = coordSize; shape.coordorigin = coordOrigin = (minX - offsetX) + ',' + minY; shape.path = (glyph.d ? 'm' + glyph.d + 'xe' : '') + 'm' + coordOrigin + stretch; shape.fillcolor = color; if (fill) shape.appendChild(fill.cloneNode(false)); // it's important to not set top/left or IE8 will grind to a halt var sStyle = shape.style; sStyle.width = roundedShapeWidth; sStyle.height = roundedHeight; if (shadows) { // due to the limitations of the VML shadow element there // can only be two visible shadows. opacity is shared // for all shadows. var shadow1 = shadows[0], shadow2 = shadows[1]; var color1 = Cufon.CSS.color(shadow1.color), color2; var shadow = document.createElement('cvml:shadow'); shadow.on = 't'; shadow.color = color1.color; shadow.offset = shadow1.offX + ',' + shadow1.offY; if (shadow2) { color2 = Cufon.CSS.color(shadow2.color); shadow.type = 'double'; shadow.color2 = color2.color; shadow.offset2 = shadow2.offX + ',' + shadow2.offY; } shadow.opacity = color1.opacity || (color2 && color2.opacity) || 1; shape.appendChild(shadow); } offsetX += jumps[j++]; } // addresses flickering issues on :hover var cover = shape.nextSibling, coverFill, vStyle; if (options.forceHitArea) { if (!cover) { cover = document.createElement('cvml:rect'); cover.stroked = 'f'; cover.className = 'cufon-vml-cover'; coverFill = document.createElement('cvml:fill'); coverFill.opacity = 0; cover.appendChild(coverFill); canvas.appendChild(cover); } vStyle = cover.style; vStyle.width = roundedShapeWidth; vStyle.height = roundedHeight; } else if (cover) canvas.removeChild(cover); wStyle.width = Math.max(Math.ceil(size.convert(width * stretchFactor)), 0); if (HAS_BROKEN_LINEHEIGHT) { var yAdjust = style.computedYAdjust; if (yAdjust === undefined) { var lineHeight = style.get('lineHeight'); if (lineHeight == 'normal') lineHeight = '1em'; else if (!isNaN(lineHeight)) lineHeight += 'em'; // no unit style.computedYAdjust = yAdjust = 0.5 * (getSizeInPixels(el, lineHeight) - parseFloat(wStyle.height)); } if (yAdjust) { wStyle.marginTop = Math.ceil(yAdjust) + 'px'; wStyle.marginBottom = yAdjust + 'px'; } } return wrapper; }; })()); Cufon.registerEngine('canvas', (function() { // Safari 2 doesn't support .apply() on native methods var check = document.createElement('canvas'); if (!check || !check.getContext || !check.getContext.apply) return; check = null; var HAS_INLINE_BLOCK = Cufon.CSS.supports('display', 'inline-block'); // Firefox 2 w/ non-strict doctype (almost standards mode) var HAS_BROKEN_LINEHEIGHT = !HAS_INLINE_BLOCK && (document.compatMode == 'BackCompat' || /frameset|transitional/i.test(document.doctype.publicId)); var styleSheet = document.createElement('style'); styleSheet.type = 'text/css'; styleSheet.appendChild(document.createTextNode(( 'cufon{text-indent:0;}' + '@media screen,projection{' + 'cufon{display:inline;display:inline-block;position:relative;vertical-align:middle;' + (HAS_BROKEN_LINEHEIGHT ? '' : 'font-size:1px;line-height:1px;') + '}cufon cufontext{display:-moz-inline-box;display:inline-block;width:0;height:0;overflow:hidden;text-indent:-10000in;}' + (HAS_INLINE_BLOCK ? 'cufon canvas{position:relative;}' : 'cufon canvas{position:absolute;}') + '}' + '@media print{' + 'cufon{padding:0;}' + // Firefox 2 'cufon canvas{display:none;}' + '}' ).replace(/;/g, '!important;'))); document.getElementsByTagName('head')[0].appendChild(styleSheet); function generateFromVML(path, context) { var atX = 0, atY = 0; var code = [], re = /([mrvxe])([^a-z]*)/g, match; generate: for (var i = 0; match = re.exec(path); ++i) { var c = match[2].split(','); switch (match[1]) { case 'v': code[i] = { m: 'bezierCurveTo', a: [ atX + ~~c[0], atY + ~~c[1], atX + ~~c[2], atY + ~~c[3], atX += ~~c[4], atY += ~~c[5] ] }; break; case 'r': code[i] = { m: 'lineTo', a: [ atX += ~~c[0], atY += ~~c[1] ] }; break; case 'm': code[i] = { m: 'moveTo', a: [ atX = ~~c[0], atY = ~~c[1] ] }; break; case 'x': code[i] = { m: 'closePath' }; break; case 'e': break generate; } context[code[i].m].apply(context, code[i].a); } return code; } function interpret(code, context) { for (var i = 0, l = code.length; i < l; ++i) { var line = code[i]; context[line.m].apply(context, line.a); } } return function(font, text, style, options, node, el) { var redraw = (text === null); if (redraw) text = node.getAttribute('alt'); var viewBox = font.viewBox; var size = style.getSize('fontSize', font.baseSize); var expandTop = 0, expandRight = 0, expandBottom = 0, expandLeft = 0; var shadows = options.textShadow, shadowOffsets = []; if (shadows) { for (var i = shadows.length; i--;) { var shadow = shadows[i]; var x = size.convertFrom(parseFloat(shadow.offX)); var y = size.convertFrom(parseFloat(shadow.offY)); shadowOffsets[i] = [ x, y ]; if (y < expandTop) expandTop = y; if (x > expandRight) expandRight = x; if (y > expandBottom) expandBottom = y; if (x < expandLeft) expandLeft = x; } } var chars = Cufon.CSS.textTransform(text, style).split(''); var jumps = font.spacing(chars, ~~size.convertFrom(parseFloat(style.get('letterSpacing')) || 0), ~~size.convertFrom(parseFloat(style.get('wordSpacing')) || 0) ); if (!jumps.length) return null; // there's nothing to render var width = jumps.total; expandRight += viewBox.width - jumps[jumps.length - 1]; expandLeft += viewBox.minX; var wrapper, canvas; if (redraw) { wrapper = node; canvas = node.firstChild; } else { wrapper = document.createElement('cufon'); wrapper.className = 'cufon cufon-canvas'; wrapper.setAttribute('alt', text); canvas = document.createElement('canvas'); wrapper.appendChild(canvas); if (options.printable) { var print = document.createElement('cufontext'); print.appendChild(document.createTextNode(text)); wrapper.appendChild(print); } } var wStyle = wrapper.style; var cStyle = canvas.style; var height = size.convert(viewBox.height); var roundedHeight = Math.ceil(height); var roundingFactor = roundedHeight / height; var stretchFactor = roundingFactor * Cufon.CSS.fontStretch(style.get('fontStretch')); var stretchedWidth = width * stretchFactor; var canvasWidth = Math.ceil(size.convert(stretchedWidth + expandRight - expandLeft)); var canvasHeight = Math.ceil(size.convert(viewBox.height - expandTop + expandBottom)); canvas.width = canvasWidth; canvas.height = canvasHeight; // needed for WebKit and full page zoom cStyle.width = canvasWidth + 'px'; cStyle.height = canvasHeight + 'px'; // minY has no part in canvas.height expandTop += viewBox.minY; cStyle.top = Math.round(size.convert(expandTop - font.ascent)) + 'px'; cStyle.left = Math.round(size.convert(expandLeft)) + 'px'; var wrapperWidth = Math.max(Math.ceil(size.convert(stretchedWidth)), 0) + 'px'; if (HAS_INLINE_BLOCK) { wStyle.width = wrapperWidth; wStyle.height = size.convert(font.height) + 'px'; } else { wStyle.paddingLeft = wrapperWidth; wStyle.paddingBottom = (size.convert(font.height) - 1) + 'px'; } var g = canvas.getContext('2d'), scale = height / viewBox.height; // proper horizontal scaling is performed later g.scale(scale, scale * roundingFactor); g.translate(-expandLeft, -expandTop); g.save(); function renderText() { var glyphs = font.glyphs, glyph, i = -1, j = -1, chr; g.scale(stretchFactor, 1); while (chr = chars[++i]) { var glyph = glyphs[chars[i]] || font.missingGlyph; if (!glyph) continue; if (glyph.d) { g.beginPath(); if (glyph.code) interpret(glyph.code, g); else glyph.code = generateFromVML('m' + glyph.d, g); g.fill(); } g.translate(jumps[++j], 0); } g.restore(); } if (shadows) { for (var i = shadows.length; i--;) { var shadow = shadows[i]; g.save(); g.fillStyle = shadow.color; g.translate.apply(g, shadowOffsets[i]); renderText(); } } var gradient = options.textGradient; if (gradient) { var stops = gradient.stops, fill = g.createLinearGradient(0, viewBox.minY, 0, viewBox.maxY); for (var i = 0, l = stops.length; i < l; ++i) { fill.addColorStop.apply(fill, stops[i]); } g.fillStyle = fill; } else g.fillStyle = style.get('color'); renderText(); return wrapper; }; })()); /*! * The following copyright notice may not be removed under any circumstances. * * Copyright: * \251 Dutch Design: Albert-Jan Pool, 1995. Published by FontShop International * FontFont release 15 * * Manufacturer: * \ Dutch Design: Albert-Jan Pool, . Published by FontShop International FontFont * release */ Cufon.registerFont({"w":200,"face":{"font-family":"DIN","font-weight":900,"font-stretch":"normal","units-per-em":"360","panose-1":"2 0 9 3 3 0 0 2 0 4","ascent":"288","descent":"-72","x-height":"2","bbox":"-19 -371 346 72","underline-thickness":"38.88","underline-position":"-8.64","unicode-range":"U+0020-U+201D"},"glyphs":{" ":{"w":79},"\u00f0":{"d":"18,-93v0,-58,21,-90,73,-95r-7,-15r-40,0r0,-41r20,0r-8,-16r64,0r7,16r35,0r0,41r-14,0v38,59,60,209,-49,205v-58,-2,-81,-35,-81,-95xm99,-51v21,0,22,-20,22,-42v0,-22,-1,-42,-22,-42v-21,0,-22,20,-22,42v0,22,1,42,22,42","w":198},"\u00dd":{"d":"123,-282r-35,0r17,-64r61,0xm140,-104r0,104r-63,0r0,-104r-77,-152r69,0r40,92r40,-92r69,0","w":217},"\u00fd":{"d":"107,-220r-35,0r17,-64r61,0xm108,23v-10,34,-36,45,-81,42r0,-53v26,5,33,-11,37,-31r-64,-175r62,0r33,101r31,-101r62,0","w":185},"\u00de":{"d":"89,-212v74,-6,126,18,126,82v0,65,-51,89,-126,83r0,47r-63,0r0,-256r63,0r0,44xm89,-104v30,1,63,3,63,-26v0,-29,-33,-27,-63,-26r0,52","w":225},"\u00fe":{"d":"81,-180v42,-37,119,-5,108,61v3,65,-2,122,-64,121v-21,0,-33,-6,-44,-16r0,77r-59,0r0,-319r59,0r0,76xm106,-51v30,0,24,-36,24,-65v0,-16,-7,-27,-24,-27v-30,0,-25,37,-24,65v1,16,7,27,24,27","w":205},"!":{"d":"94,-85r-42,0r-16,-171r74,0xm43,0r0,-58r60,0r0,58r-60,0","w":131},"#":{"d":"210,-148r-5,31r21,0r0,56r-30,0r-10,61r-62,0r10,-61r-33,0r-10,61r-62,0r10,-61r-21,0r0,-56r30,0r4,-31r-21,0r0,-56r30,0r9,-55r62,0r-8,55r32,0r9,-55r63,0r-9,55r21,0r0,56r-30,0xm115,-148r-5,31r33,0r4,-31r-32,0","w":256},"$":{"d":"169,-188v-10,-9,-23,-14,-41,-15r0,45v52,5,86,23,84,80v-2,48,-33,72,-77,78r0,41r-45,0r0,-39v-40,-1,-67,-12,-88,-34r40,-40v11,11,33,18,55,18r0,-48v-50,-2,-83,-24,-83,-75v0,-49,31,-74,76,-80r0,-33r45,0r0,32v32,3,55,12,73,30xm97,-203v-22,0,-30,32,-10,40v3,1,6,3,10,3r0,-43xm128,-55v31,-2,27,-45,0,-44r0,44","w":227},"%":{"d":"238,-132v46,-1,57,33,54,84v-2,34,-22,48,-54,50v-46,1,-57,-33,-54,-84v2,-34,21,-49,54,-50xm116,0r-45,0r122,-256r45,0xm71,-258v45,0,58,34,54,84v-3,33,-21,49,-54,50v-46,1,-59,-33,-55,-84v2,-33,22,-49,55,-50xm238,-35v20,0,13,-28,13,-46v0,-9,-4,-14,-13,-14v-20,0,-13,28,-13,46v0,9,4,14,13,14xm71,-162v19,1,11,-28,12,-45v1,-9,-3,-14,-12,-14v-19,-1,-13,27,-13,45v0,9,4,14,13,14","w":308},"&":{"d":"235,-139v-1,35,-11,60,-29,80r50,59r-75,0r-16,-19v-15,12,-32,22,-61,21v-57,1,-86,-26,-86,-80v1,-33,21,-50,40,-64v-43,-37,-24,-126,51,-116v71,-10,95,86,40,113r-11,8r30,35v7,-8,11,-23,12,-37r55,0xm107,-172v15,-5,30,-35,2,-37v-25,0,-14,31,-2,37xm90,-106v-25,12,-16,57,14,55v12,0,20,-4,26,-9","w":255},"'":{"d":"21,-172r0,-84r53,0r0,84r-53,0","w":94},"(":{"d":"72,34v-23,-22,-47,-45,-46,-93r2,-165v4,-31,27,-48,44,-66r39,39v-42,28,-22,123,-26,190v-2,31,12,40,26,55","w":128},")":{"d":"101,-224v0,82,21,194,-25,239r-19,19r-39,-40v43,-27,22,-122,26,-189v2,-32,-12,-41,-26,-56r39,-39v17,18,44,35,44,66","w":128},"*":{"d":"145,-128r-36,-23r2,42r-40,0r2,-42r-36,23r-20,-35r38,-20r-38,-19r20,-35r36,23r-2,-42r40,0r-2,42r36,-23r20,35r-38,19r38,20","w":182},"+":{"d":"128,-74r0,55r-56,0r0,-55r-54,0r0,-56r54,0r0,-54r56,0r0,54r55,0r0,56r-55,0"},",":{"d":"21,64r0,-127r62,0r0,81","w":103},"-":{"d":"18,-78r0,-56r118,0r0,56r-118,0","w":153},".":{"d":"21,0r0,-65r64,0r0,65r-64,0","w":105},"\/":{"d":"55,27r-55,0r103,-310r54,0","w":155},"0":{"d":"100,-258v50,0,83,29,83,79r0,101v-1,51,-33,80,-83,80v-50,0,-82,-28,-82,-80r0,-101v0,-51,33,-79,82,-79xm100,-51v13,0,23,-10,23,-26r0,-102v1,-16,-9,-26,-23,-26v-13,0,-23,10,-23,26r0,102v-1,16,9,26,23,26"},"1":{"d":"87,0r0,-193r-55,47r0,-63r55,-47r59,0r0,256r-59,0"},"2":{"d":"102,-258v81,-6,98,89,50,140r-61,65r93,0r0,53r-165,0r0,-53r103,-114v7,-16,1,-40,-20,-38v-16,1,-24,8,-24,25r-59,0v2,-50,33,-74,83,-78"},"3":{"d":"100,-258v74,-7,110,92,56,126v17,11,28,28,30,55v7,89,-133,104,-164,36v-5,-10,-7,-23,-7,-37r59,0v0,17,11,26,26,27v16,0,27,-11,27,-27v0,-19,-14,-30,-36,-27r0,-52v21,3,32,-7,33,-24v1,-15,-11,-24,-24,-24v-13,0,-24,9,-23,24r-59,0v2,-49,32,-73,82,-77"},"4":{"d":"172,-34r0,34r-56,0r0,-34r-107,0r0,-56r85,-166r65,0r-85,166r42,0r0,-34r56,0r0,34r19,0r0,56r-19,0"},"5":{"d":"76,-163v50,-29,118,7,108,76v16,98,-136,119,-161,38v-3,-10,-4,-20,-5,-29r59,0v2,15,7,28,24,27v19,-1,24,-12,24,-36v0,-42,-40,-47,-48,-18r-54,0r0,-151r156,0r0,53r-103,0r0,40"},"6":{"d":"102,-156v49,-9,82,27,82,76v0,53,-33,79,-85,82v-87,5,-93,-91,-61,-157r49,-101r65,0xm99,-51v16,0,26,-11,26,-29v0,-18,-10,-29,-26,-29v-16,0,-26,11,-26,29v0,18,10,29,26,29"},"7":{"d":"108,0r-65,0r80,-203r-55,0r0,40r-56,0r0,-93r176,0r0,53"},"8":{"d":"157,-132v15,12,30,27,29,55v-1,53,-34,79,-86,79v-52,0,-85,-26,-86,-79v0,-28,15,-43,29,-55v-13,-11,-27,-25,-26,-51v1,-50,35,-75,83,-75v49,0,82,26,84,75v0,25,-14,40,-27,51xm100,-156v14,0,25,-11,25,-25v0,-13,-12,-24,-25,-24v-13,0,-24,11,-24,24v0,13,11,25,24,25xm100,-51v14,0,27,-13,27,-27v0,-14,-13,-27,-27,-27v-14,0,-27,13,-27,27v0,14,13,27,27,27"},"9":{"d":"101,-258v87,-5,93,90,61,156r-49,102r-65,0r51,-100v-52,5,-83,-26,-83,-76v0,-53,32,-79,85,-82xm101,-147v16,0,26,-11,26,-29v0,-18,-10,-29,-26,-29v-16,0,-26,12,-26,29v0,18,10,29,26,29"},":":{"d":"29,-91r0,-65r65,0r0,65r-65,0xm29,0r0,-65r65,0r0,65r-65,0","w":114},";":{"d":"29,-91r0,-65r65,0r0,65r-65,0xm30,64r0,-127r63,0r0,81","w":114},"?":{"d":"102,-258v69,-5,100,70,63,121v-12,17,-30,26,-32,52r-59,0v-5,-53,39,-59,50,-98v0,-12,-9,-22,-22,-22v-15,0,-20,9,-21,22r-59,0v1,-49,32,-72,80,-75xm73,0r0,-58r61,0r0,58r-61,0","w":193},"@":{"d":"109,-81v-14,-72,56,-105,99,-69v7,-54,-35,-55,-88,-55v-66,0,-46,81,-46,140v0,17,4,21,13,31r-41,40v-40,-25,-24,-104,-28,-168v-5,-88,58,-96,149,-96v67,0,98,30,98,96r0,163r-55,-1r0,-14v-34,34,-108,11,-101,-46r0,-21xm187,-47v18,0,21,-12,21,-34v0,-22,-4,-35,-21,-35v-17,0,-22,13,-22,35v0,22,4,34,22,34","w":282},"A":{"d":"169,0r-12,-38r-79,0r-12,38r-66,0r93,-256r49,0r93,256r-66,0xm119,-159r-23,68r45,0","w":235},"B":{"d":"186,-131v18,10,31,26,31,55v0,92,-103,76,-191,76r0,-256v86,1,188,-16,188,74v0,25,-14,40,-28,51xm89,-158v26,-1,62,6,62,-21v0,-27,-35,-21,-62,-21r0,42xm89,-57v28,-1,65,7,65,-22v0,-29,-37,-23,-65,-23r0,45","w":235},"C":{"d":"81,-100v-6,51,61,60,67,19r64,0v-8,51,-40,83,-97,83v-83,0,-105,-65,-97,-158v-14,-105,138,-135,182,-56v6,10,10,23,12,37r-64,0v-4,-14,-13,-27,-33,-27v-46,0,-29,58,-34,102","w":219},"D":{"d":"121,-256v83,0,96,64,96,157v0,63,-35,99,-96,99r-95,0r0,-256r95,0xm89,-56v41,3,66,-4,64,-46v-2,-40,12,-100,-36,-98r-28,0r0,144","w":234},"E":{"d":"26,0r0,-256r174,0r0,56r-111,0r0,43r95,0r0,56r-95,0r0,45r111,0r0,56r-174,0","w":218},"F":{"d":"89,-200r0,45r95,0r0,56r-95,0r0,99r-63,0r0,-256r174,0r0,56r-111,0","w":214},"G":{"d":"215,-148v7,92,-19,150,-100,150v-83,0,-105,-65,-97,-158v-15,-110,151,-136,188,-49v4,10,8,20,9,31r-63,0v-6,-18,-14,-28,-37,-28v-45,0,-34,57,-34,102v0,27,7,45,34,46v26,0,38,-16,38,-41r-38,0r0,-53r100,0","w":232},"H":{"d":"156,0r0,-102r-67,0r0,102r-63,0r0,-256r63,0r0,98r67,0r0,-98r63,0r0,256r-63,0","w":244},"I":{"d":"26,0r0,-256r63,0r0,256r-63,0","w":114},"J":{"d":"163,-88v7,87,-114,117,-166,62r42,-41v16,23,61,15,61,-22r0,-167r63,0r0,168","w":185},"K":{"d":"169,0r-59,-105r-22,25r0,80r-62,0r0,-256r62,0r0,90r74,-90r77,0r-87,103r90,153r-73,0","w":242},"L":{"d":"26,0r0,-256r63,0r0,200r108,0r0,56r-171,0","w":207},"M":{"d":"202,0r0,-123r-36,64r-41,0r-36,-64r0,123r-63,0r0,-256r62,0r57,113r58,-113r62,0r0,256r-63,0","w":290},"N":{"d":"171,0r-82,-129r0,129r-63,0r0,-256r55,0r82,129r0,-129r63,0r0,256r-55,0","w":252},"O":{"d":"115,-258v85,0,104,66,98,158v-4,62,-34,102,-98,102v-83,0,-102,-65,-97,-158v3,-64,34,-102,97,-102xm115,-54v45,0,34,-60,34,-103v0,-27,-8,-45,-34,-45v-45,0,-34,57,-34,102v0,27,8,46,34,46","w":230},"P":{"d":"127,-256v54,1,88,31,88,82v0,65,-51,89,-126,83r0,91r-63,0r0,-256r101,0xm89,-148v30,1,63,3,63,-26v0,-29,-33,-27,-63,-26r0,52","w":225},"Q":{"d":"213,-156v0,43,3,89,-15,115r19,19r-32,32r-20,-20v-69,33,-147,-7,-147,-90v0,-91,12,-158,97,-158v65,1,98,39,98,102xm81,-157v0,46,-12,106,39,103r-16,-17r32,-32r12,13v0,0,15,-112,-33,-112v-26,0,-34,18,-34,45","w":230},"R":{"d":"215,-174v0,34,-20,55,-42,67r56,107r-73,0r-46,-95r-21,0r0,95r-63,0r0,-256r101,0v54,1,88,31,88,82xm89,-148v30,1,63,3,63,-26v0,-29,-33,-27,-63,-26r0,52","w":234},"S":{"d":"116,-203v-38,-10,-57,39,-18,43v58,5,100,18,100,82v0,93,-148,101,-196,46r40,-40v18,26,118,26,89,-20v-27,-15,-82,-8,-99,-34v-12,-12,-18,-29,-18,-51v0,-89,129,-102,180,-51r-40,40v-9,-9,-21,-15,-38,-15","w":213},"T":{"d":"137,-200r0,200r-63,0r0,-200r-63,0r0,-56r189,0r0,56r-63,0","w":210},"U":{"d":"216,-90v-3,58,-39,92,-98,92v-58,0,-96,-33,-96,-92r0,-166r63,0r0,165v0,23,11,37,33,37v22,0,35,-13,35,-37r0,-165r63,0r0,166","w":237},"V":{"d":"131,0r-46,0r-85,-256r65,0r43,143r43,-143r65,0","w":216},"W":{"d":"256,0r-52,0r-41,-126r-41,126r-51,0r-71,-256r66,0r33,135r42,-135r44,0r42,135r33,-135r66,0","w":326},"X":{"d":"156,0r-42,-79r-42,79r-72,0r80,-131r-75,-125r72,0r37,72r38,-72r71,0r-75,125r80,131r-72,0","w":228},"Y":{"d":"140,-104r0,104r-63,0r0,-104r-77,-152r69,0r40,92r40,-92r69,0","w":217},"Z":{"d":"11,0r0,-49r98,-151r-94,0r0,-56r170,0r0,49r-99,151r99,0r0,56r-174,0","w":195},"_":{"d":"0,67r0,-39r230,0r0,39r-230,0","w":230},"a":{"d":"18,-170v37,-44,156,-37,156,44r0,126r-58,0r0,-16v-32,36,-110,14,-106,-45v4,-52,48,-59,105,-56v8,-37,-46,-35,-60,-16xm66,-62v9,28,56,19,49,-16v-21,1,-49,-5,-49,16","w":192},"b":{"d":"189,-75v11,67,-69,99,-109,59r0,16r-58,0r0,-256r59,0r0,76v42,-37,119,-5,108,61r0,44xm106,-51v30,0,24,-36,24,-65v0,-16,-7,-27,-24,-27v-30,0,-25,37,-24,65v1,16,7,27,24,27","w":204},"c":{"d":"165,-23v-16,15,-34,25,-64,25v-58,-1,-87,-35,-87,-99v0,-93,94,-125,151,-74r-40,40v-21,-23,-59,-9,-52,34v-6,43,31,58,52,34","w":171},"d":{"d":"16,-119v-11,-66,65,-98,107,-61r0,-76r60,0r0,256r-58,0r0,-16v-39,40,-122,9,-109,-59v-1,-16,-1,-28,0,-44xm99,-51v31,1,24,-36,24,-65v0,-17,-8,-27,-24,-27v-30,0,-24,35,-24,65v0,16,7,27,24,27","w":204},"e":{"d":"100,-196v66,0,92,46,88,118r-116,0v-3,37,60,37,74,14r35,36v-18,18,-39,30,-75,30v-61,-1,-93,-33,-92,-99v1,-60,29,-99,86,-99xm100,-147v-19,0,-28,11,-28,30r57,0v0,-19,-10,-30,-29,-30","w":201},"f":{"d":"28,-186v-5,-59,30,-80,92,-74r0,49v-20,-1,-38,-2,-33,25r33,0r0,45r-33,0r0,141r-59,0r0,-141r-17,0r0,-45r17,0","w":128},"g":{"d":"16,-128v-8,-63,70,-88,106,-50r0,-16r58,0r0,180v5,79,-111,102,-161,54r37,-37v22,22,76,13,65,-31v-37,35,-105,9,-105,-52v0,-14,-1,-35,0,-48xm98,-66v25,1,24,-29,22,-52v-1,-15,-8,-25,-22,-25v-26,0,-23,27,-23,53v1,15,7,24,23,24","w":201},"h":{"d":"81,-178v37,-38,105,-10,105,52r0,126r-59,0r0,-117v0,-16,-10,-24,-23,-26v-13,2,-23,10,-23,26r0,117r-59,0r0,-256r59,0r0,78","w":206},"i":{"d":"22,-213r0,-45r59,0r0,45r-59,0xm22,0r0,-186r59,0r0,186r-59,0","w":103},"j":{"d":"22,-213r0,-45r59,0r0,45r-59,0xm81,8v-1,47,-38,62,-91,57r0,-50v14,-1,32,4,32,-12r0,-189r59,0r0,194","w":103},"k":{"d":"133,0r-40,-71r-12,13r0,58r-59,0r0,-256r59,0r0,130r53,-68r70,0r-71,81r73,113r-73,0","w":206},"l":{"d":"112,0v-53,4,-90,-10,-91,-57r0,-199r59,0r0,194v-2,16,18,11,32,12r0,50","w":122},"m":{"d":"172,-175v39,-41,122,-19,122,51r0,124r-59,0r0,-116v1,-18,-9,-25,-23,-27v-14,3,-24,9,-24,27r0,116r-59,0r0,-116v0,-17,-10,-25,-24,-27v-14,2,-24,10,-24,27r0,116r-59,0r0,-194r58,0r0,16v21,-23,75,-24,92,3","w":315},"n":{"d":"80,-178v39,-38,108,-10,108,54r0,124r-59,0r0,-116v0,-17,-10,-25,-24,-27v-14,2,-24,10,-24,27r0,116r-59,0r0,-194r58,0r0,16","w":208},"o":{"d":"99,-196v60,0,84,37,84,99v0,62,-24,99,-84,99v-60,0,-84,-37,-84,-99v0,-62,24,-99,84,-99xm99,-51v23,0,24,-21,24,-46v0,-25,-1,-46,-24,-46v-23,0,-24,21,-24,46v0,25,1,46,24,46","w":198},"p":{"d":"80,-178v40,-40,120,-8,109,59v3,65,-2,122,-64,121v-21,0,-33,-6,-44,-16r0,77r-59,0r0,-257r58,0r0,16xm106,-51v30,0,24,-36,24,-65v0,-16,-7,-27,-24,-27v-30,0,-25,37,-24,65v1,16,7,27,24,27","w":204},"q":{"d":"16,-119v-11,-68,68,-98,109,-59r0,-16r58,0r0,257r-60,0r0,-77v-41,37,-120,6,-107,-61v-1,-16,-1,-28,0,-44xm99,-51v31,1,24,-36,24,-65v0,-17,-8,-27,-24,-27v-30,0,-24,35,-24,65v0,16,7,27,24,27","w":204},"r":{"d":"80,-178v17,-21,72,-26,91,0r-45,46v-12,-18,-45,-12,-45,16r0,116r-59,0r0,-194r58,0r0,16","w":171},"s":{"d":"90,-147v-20,-2,-26,22,-6,22v48,0,88,12,88,62v0,79,-129,81,-168,37r38,-38v13,12,29,16,54,16v19,0,25,-24,4,-25v-46,-2,-86,-9,-86,-59v0,-72,111,-80,153,-40r-36,36v-9,-10,-24,-9,-41,-11","w":181},"t":{"d":"116,0v-52,4,-88,-10,-89,-57r0,-84r-18,0r0,-45r18,0r0,-56r59,0r0,56r30,0r0,45r-30,0r0,79v-1,15,16,12,30,12r0,50","w":130},"u":{"d":"103,-51v15,0,24,-9,24,-27r0,-116r59,0r0,194r-57,0r0,-16v-38,38,-108,11,-108,-54r0,-124r59,0r0,116v-1,18,8,27,23,27","w":208},"v":{"d":"116,0r-45,0r-71,-194r62,0r32,101r32,-101r62,0","w":187},"w":{"d":"222,0r-47,0r-35,-106r-35,106r-47,0r-58,-194r62,0r24,101r34,-101r41,0r33,101r25,-101r62,0","w":280},"x":{"d":"129,0r-29,-49r-29,49r-71,0r67,-99r-64,-95r70,0r27,47r27,-47r71,0r-65,95r67,99r-71,0"},"y":{"d":"108,23v-10,34,-36,45,-81,42r0,-53v26,5,33,-11,37,-31r-64,-175r62,0r33,101r31,-101r62,0","w":185},"z":{"d":"11,0r0,-44r74,-96r-70,0r0,-54r147,0r0,44r-76,97r76,0r0,53r-151,0","w":176},"\u00c4":{"d":"134,-281r0,-52r48,0r0,52r-48,0xm53,-281r0,-52r48,0r0,52r-48,0xm169,0r-12,-38r-79,0r-12,38r-66,0r93,-256r49,0r93,256r-66,0xm119,-159r-23,68r45,0","w":235},"\u00c5":{"d":"117,-371v30,0,50,20,50,50v0,30,-20,49,-50,49v-30,0,-49,-19,-49,-49v0,-30,19,-50,49,-50xm117,-303v10,1,19,-9,19,-18v0,-9,-9,-20,-19,-19v-10,-1,-19,9,-18,19v-1,9,9,19,18,18xm169,0r-12,-38r-79,0r-12,38r-66,0r93,-256r49,0r93,256r-66,0xm119,-159r-23,68r45,0","w":235},"\u00c7":{"d":"126,72r-53,0r24,-52r42,0xm81,-100v-6,51,61,60,67,19r64,0v-8,51,-40,83,-97,83v-83,0,-105,-65,-97,-158v-14,-105,138,-135,182,-56v6,10,10,23,12,37r-64,0v-4,-14,-13,-27,-33,-27v-46,0,-29,58,-34,102","w":219},"\u00c9":{"d":"126,-282r-36,0r18,-64r60,0xm26,0r0,-256r174,0r0,56r-111,0r0,43r95,0r0,56r-95,0r0,45r111,0r0,56r-174,0","w":218},"\u00d1":{"d":"195,-308v-13,13,-23,22,-44,23v-25,0,-51,-28,-70,-4r-24,-25v13,-13,22,-22,43,-23v28,-2,48,28,70,4xm171,0r-82,-129r0,129r-63,0r0,-256r55,0r82,129r0,-129r63,0r0,256r-55,0","w":252},"\u00d6":{"d":"132,-281r0,-52r48,0r0,52r-48,0xm50,-281r0,-52r49,0r0,52r-49,0xm115,-258v85,0,104,66,98,158v-4,62,-34,102,-98,102v-83,0,-102,-65,-97,-158v3,-64,34,-102,97,-102xm115,-54v45,0,34,-60,34,-103v0,-27,-8,-45,-34,-45v-45,0,-34,57,-34,102v0,27,8,46,34,46","w":230},"\u00dc":{"d":"135,-281r0,-52r49,0r0,52r-49,0xm54,-281r0,-52r48,0r0,52r-48,0xm216,-90v-3,58,-39,92,-98,92v-58,0,-96,-33,-96,-92r0,-166r63,0r0,165v0,23,11,37,33,37v22,0,35,-13,35,-37r0,-165r63,0r0,166","w":237},"\u00e1":{"d":"111,-220r-36,0r18,-64r60,0xm18,-170v37,-44,156,-37,156,44r0,126r-58,0r0,-16v-32,36,-110,14,-106,-45v4,-52,48,-59,105,-56v8,-37,-46,-35,-60,-16xm66,-62v9,28,56,19,49,-16v-21,1,-49,-5,-49,16","w":192},"\u00e0":{"d":"81,-220r-42,-64r60,0r18,64r-36,0xm18,-170v37,-44,156,-37,156,44r0,126r-58,0r0,-16v-32,36,-110,14,-106,-45v4,-52,48,-59,105,-56v8,-37,-46,-35,-60,-16xm66,-62v9,28,56,19,49,-16v-21,1,-49,-5,-49,16","w":192},"\u00e2":{"d":"124,-220r-28,-29r-29,29r-43,0r49,-64r45,0r49,64r-43,0xm18,-170v37,-44,156,-37,156,44r0,126r-58,0r0,-16v-32,36,-110,14,-106,-45v4,-52,48,-59,105,-56v8,-37,-46,-35,-60,-16xm66,-62v9,28,56,19,49,-16v-21,1,-49,-5,-49,16","w":192},"\u00e4":{"d":"112,-219r0,-52r49,0r0,52r-49,0xm31,-219r0,-52r48,0r0,52r-48,0xm18,-170v37,-44,156,-37,156,44r0,126r-58,0r0,-16v-32,36,-110,14,-106,-45v4,-52,48,-59,105,-56v8,-37,-46,-35,-60,-16xm66,-62v9,28,56,19,49,-16v-21,1,-49,-5,-49,16","w":192},"\u00e3":{"d":"165,-246v-13,13,-23,22,-44,23v-26,1,-49,-28,-70,-5r-25,-24v14,-12,23,-22,44,-23v28,-2,48,28,70,4xm18,-170v37,-44,156,-37,156,44r0,126r-58,0r0,-16v-32,36,-110,14,-106,-45v4,-52,48,-59,105,-56v8,-37,-46,-35,-60,-16xm66,-62v9,28,56,19,49,-16v-21,1,-49,-5,-49,16","w":192},"\u00e5":{"d":"96,-313v30,0,49,20,49,50v0,30,-19,50,-49,50v-30,0,-50,-20,-50,-50v0,-30,20,-50,50,-50xm96,-244v9,0,19,-9,18,-19v1,-10,-9,-19,-18,-19v-9,0,-19,10,-19,19v0,9,10,19,19,19xm18,-170v37,-44,156,-37,156,44r0,126r-58,0r0,-16v-32,36,-110,14,-106,-45v4,-52,48,-59,105,-56v8,-37,-46,-35,-60,-16xm66,-62v9,28,56,19,49,-16v-21,1,-49,-5,-49,16","w":192},"\u00e7":{"d":"107,72r-53,0r24,-52r42,0xm165,-23v-16,15,-34,25,-64,25v-58,-1,-87,-35,-87,-99v0,-93,94,-125,151,-74r-40,40v-21,-23,-59,-9,-52,34v-6,43,31,58,52,34","w":171},"\u00e9":{"d":"117,-220r-36,0r18,-64r60,0xm100,-196v66,0,92,46,88,118r-116,0v-3,37,60,37,74,14r35,36v-18,18,-39,30,-75,30v-61,-1,-93,-33,-92,-99v1,-60,29,-99,86,-99xm100,-147v-19,0,-28,11,-28,30r57,0v0,-19,-10,-30,-29,-30","w":201},"\u00e8":{"d":"87,-220r-42,-64r60,0r18,64r-36,0xm100,-196v66,0,92,46,88,118r-116,0v-3,37,60,37,74,14r35,36v-18,18,-39,30,-75,30v-61,-1,-93,-33,-92,-99v1,-60,29,-99,86,-99xm100,-147v-19,0,-28,11,-28,30r57,0v0,-19,-10,-30,-29,-30","w":201},"\u00ea":{"d":"130,-220r-28,-29r-29,29r-43,0r49,-64r46,0r49,64r-44,0xm100,-196v66,0,92,46,88,118r-116,0v-3,37,60,37,74,14r35,36v-18,18,-39,30,-75,30v-61,-1,-93,-33,-92,-99v1,-60,29,-99,86,-99xm100,-147v-19,0,-28,11,-28,30r57,0v0,-19,-10,-30,-29,-30","w":201},"\u00eb":{"d":"118,-219r0,-52r49,0r0,52r-49,0xm37,-219r0,-52r48,0r0,52r-48,0xm100,-196v66,0,92,46,88,118r-116,0v-3,37,60,37,74,14r35,36v-18,18,-39,30,-75,30v-61,-1,-93,-33,-92,-99v1,-60,29,-99,86,-99xm100,-147v-19,0,-28,11,-28,30r57,0v0,-19,-10,-30,-29,-30","w":201},"\u00ed":{"d":"22,0r0,-194r59,0r0,194r-59,0xm60,-220r-35,0r17,-64r61,0","w":103},"\u00ec":{"d":"22,0r0,-194r59,0r0,194r-59,0xm44,-220r-42,-64r60,0r18,64r-36,0","w":103},"\u00ee":{"d":"81,-220r-29,-29r-28,29r-43,0r49,-64r45,0r49,64r-43,0xm22,0r0,-194r59,0r0,194r-59,0","w":103},"\u00ef":{"d":"22,0r0,-194r59,0r0,194r-59,0xm69,-219r0,-52r49,0r0,52r-49,0xm-12,-219r0,-52r48,0r0,52r-48,0","w":103},"\u00f1":{"d":"175,-246v-14,13,-24,22,-45,23v-25,0,-49,-28,-70,-5r-24,-24v13,-13,23,-22,44,-23v27,-2,48,28,69,4xm80,-178v39,-38,108,-10,108,54r0,124r-59,0r0,-116v0,-17,-10,-25,-24,-27v-14,2,-24,10,-24,27r0,116r-59,0r0,-194r58,0r0,16","w":208},"\u00f3":{"d":"114,-220r-36,0r18,-64r60,0xm99,-196v60,0,84,37,84,99v0,62,-24,99,-84,99v-60,0,-84,-37,-84,-99v0,-62,24,-99,84,-99xm99,-51v23,0,24,-21,24,-46v0,-25,-1,-46,-24,-46v-23,0,-24,21,-24,46v0,25,1,46,24,46","w":198},"\u00f2":{"d":"84,-220r-42,-64r60,0r18,64r-36,0xm99,-196v60,0,84,37,84,99v0,62,-24,99,-84,99v-60,0,-84,-37,-84,-99v0,-62,24,-99,84,-99xm99,-51v23,0,24,-21,24,-46v0,-25,-1,-46,-24,-46v-23,0,-24,21,-24,46v0,25,1,46,24,46","w":198},"\u00f4":{"d":"127,-220r-28,-29r-28,29r-44,0r49,-64r46,0r49,64r-44,0xm99,-196v60,0,84,37,84,99v0,62,-24,99,-84,99v-60,0,-84,-37,-84,-99v0,-62,24,-99,84,-99xm99,-51v23,0,24,-21,24,-46v0,-25,-1,-46,-24,-46v-23,0,-24,21,-24,46v0,25,1,46,24,46","w":198},"\u00f6":{"d":"116,-219r0,-52r48,0r0,52r-48,0xm34,-219r0,-52r48,0r0,52r-48,0xm99,-196v60,0,84,37,84,99v0,62,-24,99,-84,99v-60,0,-84,-37,-84,-99v0,-62,24,-99,84,-99xm99,-51v23,0,24,-21,24,-46v0,-25,-1,-46,-24,-46v-23,0,-24,21,-24,46v0,25,1,46,24,46","w":198},"\u00f5":{"d":"168,-246v-13,13,-23,22,-44,23v-25,0,-49,-28,-70,-5r-24,-24v13,-13,22,-22,43,-23v28,-2,48,28,70,4xm99,-196v60,0,84,37,84,99v0,62,-24,99,-84,99v-60,0,-84,-37,-84,-99v0,-62,24,-99,84,-99xm99,-51v23,0,24,-21,24,-46v0,-25,-1,-46,-24,-46v-23,0,-24,21,-24,46v0,25,1,46,24,46","w":198},"\u00fa":{"d":"118,-220r-36,0r18,-64r61,0xm103,-51v15,0,24,-9,24,-27r0,-116r59,0r0,194r-57,0r0,-16v-38,38,-108,11,-108,-54r0,-124r59,0r0,116v-1,18,8,27,23,27","w":208},"\u00f9":{"d":"89,-220r-43,-64r61,0r17,64r-35,0xm103,-51v15,0,24,-9,24,-27r0,-116r59,0r0,194r-57,0r0,-16v-38,38,-108,11,-108,-54r0,-124r59,0r0,116v-1,18,8,27,23,27","w":208},"\u00fb":{"d":"132,-220r-29,-29r-28,29r-43,0r49,-64r45,0r49,64r-43,0xm103,-51v15,0,24,-9,24,-27r0,-116r59,0r0,194r-57,0r0,-16v-38,38,-108,11,-108,-54r0,-124r59,0r0,116v-1,18,8,27,23,27","w":208},"\u00fc":{"d":"120,-219r0,-52r48,0r0,52r-48,0xm39,-219r0,-52r48,0r0,52r-48,0xm103,-51v15,0,24,-9,24,-27r0,-116r59,0r0,194r-57,0r0,-16v-38,38,-108,11,-108,-54r0,-124r59,0r0,116v-1,18,8,27,23,27","w":208},"\u00a3":{"d":"159,-189v-16,-23,-67,-14,-62,22r0,22r34,0r0,45r-34,0r0,44r104,0r0,56r-167,0r0,-100r-21,0r0,-45r21,0v-20,-104,103,-145,167,-85","w":214},"\u00df":{"d":"192,-117v0,73,-2,129,-83,117r0,-50v34,6,22,-35,24,-63v0,-15,-9,-19,-24,-18r0,-45v14,1,24,-1,24,-15v0,-12,-10,-17,-24,-16v-20,0,-27,6,-27,25r0,182r-60,0r0,-187v1,-50,35,-71,87,-71v50,0,82,18,83,65v0,20,-9,32,-22,39v12,7,22,16,22,37","w":210},"\u00c6":{"d":"172,0r0,-54r-77,0r-27,54r-68,0r133,-256r213,0r0,56r-111,0r0,43r95,0r0,56r-95,0r0,45r111,0r0,56r-174,0xm172,-200r-49,94r49,0r0,-94","w":364},"\u00d8":{"d":"185,-231v31,24,28,76,28,131v0,76,-61,118,-136,96r-9,20r-43,0r20,-41v-29,-25,-27,-75,-27,-131v0,-77,61,-117,135,-96r10,-20r42,0xm131,-199v-55,-20,-54,50,-49,104xm99,-58v53,22,55,-49,50,-104","w":230},"\u00e6":{"d":"282,-28v-26,35,-110,41,-143,7v-33,40,-134,30,-129,-40v4,-52,48,-59,105,-56v8,-37,-46,-35,-60,-16r-37,-37v22,-31,100,-35,132,-10v58,-40,146,0,139,76r0,26r-116,0v-2,36,59,38,74,14xm230,-124v-1,-29,-56,-31,-56,0v0,3,-1,5,-1,7r57,0r0,-7xm66,-62v9,28,56,19,49,-16v-21,1,-49,-5,-49,16","w":302},"\u00f8":{"d":"160,-172v18,17,21,42,23,75v5,76,-52,115,-121,92r-13,21r-33,0r22,-38v-18,-17,-21,-42,-23,-75v-5,-76,53,-115,121,-92r13,-21r33,0xm111,-140v-33,-13,-40,23,-36,61xm87,-54v34,13,40,-23,36,-61","w":198},"\u00c0":{"d":"103,-282r-43,-64r61,0r17,64r-35,0xm169,0r-12,-38r-79,0r-12,38r-66,0r93,-256r49,0r93,256r-66,0xm119,-159r-23,68r45,0","w":235},"\u00c3":{"d":"187,-308v-14,12,-23,22,-44,23v-26,1,-50,-29,-71,-4r-24,-25v13,-13,23,-22,44,-23v27,-1,48,28,70,4xm169,0r-12,-38r-79,0r-12,38r-66,0r93,-256r49,0r93,256r-66,0xm119,-159r-23,68r45,0","w":235},"\u00d5":{"d":"185,-308v-14,13,-24,22,-45,23v-25,0,-51,-28,-70,-4r-24,-25v13,-13,23,-22,44,-23v27,-2,48,28,69,4xm115,-258v85,0,104,66,98,158v-4,62,-34,102,-98,102v-83,0,-102,-65,-97,-158v3,-64,34,-102,97,-102xm115,-54v45,0,34,-60,34,-103v0,-27,-8,-45,-34,-45v-45,0,-34,57,-34,102v0,27,8,46,34,46","w":230},"\u201c":{"d":"104,-204r0,-52r59,-44r0,96r-59,0xm21,-204r0,-52r58,-44r0,96r-58,0","w":183},"\u201d":{"d":"104,-161r0,-95r59,0r0,53xm21,-161r0,-95r58,0r0,53","w":183},"\u2018":{"d":"21,-204r0,-52r59,-44r0,96r-59,0","w":100},"\u2019":{"d":"21,-161r0,-95r59,0r0,53","w":100},"\u00ff":{"d":"109,-219r0,-52r48,0r0,52r-48,0xm28,-219r0,-52r48,0r0,52r-48,0xm108,23v-10,34,-36,45,-81,42r0,-53v26,5,33,-11,37,-31r-64,-175r62,0r33,101r31,-101r62,0","w":185},"\u00c2":{"d":"146,-282r-29,-29r-28,29r-43,0r49,-64r45,0r49,64r-43,0xm169,0r-12,-38r-79,0r-12,38r-66,0r93,-256r49,0r93,256r-66,0xm119,-159r-23,68r45,0","w":235},"\u00ca":{"d":"139,-282r-28,-29r-29,29r-43,0r49,-64r46,0r49,64r-44,0xm26,0r0,-256r174,0r0,56r-111,0r0,43r95,0r0,56r-95,0r0,45r111,0r0,56r-174,0","w":218},"\u00c1":{"d":"132,-282r-36,0r18,-64r61,0xm169,0r-12,-38r-79,0r-12,38r-66,0r93,-256r49,0r93,256r-66,0xm119,-159r-23,68r45,0","w":235},"\u00cb":{"d":"127,-281r0,-52r49,0r0,52r-49,0xm46,-281r0,-52r48,0r0,52r-48,0xm26,0r0,-256r174,0r0,56r-111,0r0,43r95,0r0,56r-95,0r0,45r111,0r0,56r-174,0","w":218},"\u00c8":{"d":"96,-282r-42,-64r60,0r18,64r-36,0xm26,0r0,-256r174,0r0,56r-111,0r0,43r95,0r0,56r-95,0r0,45r111,0r0,56r-174,0","w":218},"\u00cd":{"d":"73,-282r-36,0r18,-64r60,0xm26,0r0,-256r63,0r0,256r-63,0","w":114},"\u00ce":{"d":"84,-282r-28,-29r-29,29r-43,0r49,-64r45,0r49,64r-43,0xm26,0r0,-256r63,0r0,256r-63,0","w":114},"\u00cf":{"d":"74,-281r0,-52r48,0r0,52r-48,0xm-7,-281r0,-52r48,0r0,52r-48,0xm26,0r0,-256r63,0r0,256r-63,0","w":114},"\u00cc":{"d":"46,-282r-43,-64r61,0r17,64r-35,0xm26,0r0,-256r63,0r0,256r-63,0","w":114},"\u00d3":{"d":"130,-282r-36,0r18,-64r60,0xm115,-258v85,0,104,66,98,158v-4,62,-34,102,-98,102v-83,0,-102,-65,-97,-158v3,-64,34,-102,97,-102xm115,-54v45,0,34,-60,34,-103v0,-27,-8,-45,-34,-45v-45,0,-34,57,-34,102v0,27,8,46,34,46","w":230},"\u00d4":{"d":"144,-282r-29,-29r-28,29r-43,0r49,-64r45,0r49,64r-43,0xm115,-258v85,0,104,66,98,158v-4,62,-34,102,-98,102v-83,0,-102,-65,-97,-158v3,-64,34,-102,97,-102xm115,-54v45,0,34,-60,34,-103v0,-27,-8,-45,-34,-45v-45,0,-34,57,-34,102v0,27,8,46,34,46","w":230},"\u00d2":{"d":"100,-282r-42,-64r60,0r18,64r-36,0xm115,-258v85,0,104,66,98,158v-4,62,-34,102,-98,102v-83,0,-102,-65,-97,-158v3,-64,34,-102,97,-102xm115,-54v45,0,34,-60,34,-103v0,-27,-8,-45,-34,-45v-45,0,-34,57,-34,102v0,27,8,46,34,46","w":230},"\u00da":{"d":"134,-282r-36,0r18,-64r60,0xm216,-90v-3,58,-39,92,-98,92v-58,0,-96,-33,-96,-92r0,-166r63,0r0,165v0,23,11,37,33,37v22,0,35,-13,35,-37r0,-165r63,0r0,166","w":237},"\u00db":{"d":"147,-282r-28,-29r-29,29r-43,0r49,-64r45,0r49,64r-43,0xm216,-90v-3,58,-39,92,-98,92v-58,0,-96,-33,-96,-92r0,-166r63,0r0,165v0,23,11,37,33,37v22,0,35,-13,35,-37r0,-165r63,0r0,166","w":237},"\u00d9":{"d":"104,-282r-42,-64r60,0r18,64r-36,0xm216,-90v-3,58,-39,92,-98,92v-58,0,-96,-33,-96,-92r0,-166r63,0r0,165v0,23,11,37,33,37v22,0,35,-13,35,-37r0,-165r63,0r0,166","w":237},"\u00d0":{"d":"131,-256v83,0,96,64,96,157v0,63,-35,99,-96,99r-95,0r0,-105r-23,0r0,-49r23,0r0,-102r95,0xm99,-56v41,3,66,-4,64,-46v-2,-40,12,-100,-36,-98r-28,0r0,46r32,0r0,49r-32,0r0,49","w":244},"\u00a0":{"w":79}}}); // JavaScript Document function initCufon () { var elements = new Array ( '.moreLinks a', 'h2', 'h3:not(.people .col1 .choiceItem h3)', '.subnavTabs li', '.teaser', '.bookNow', '.eventArchive a', '.expandingboxInner a.slick-toggle', '.associatedevents h4', '.mediaCaptionTitle', '.cufon-text', '.bottomLinks a', '.subtablechoice #forthcomingevents .choiceItem h4', '#socialBookmarking .twitter h4' ); Cufon.replace(elements, {forceHitArea:true} ); Cufon.replace('#nav li a', { forceHitArea:true, hover: true} ); } initCufon(); // JavaScript Document // Author: Wagner // 25/06/2009 var formHasBeenCleared = false; // go through all form fields and clear the value, if they start with 'enter' or 'please' function clearAllDefaultsFromTextFields () { $("form input:text, form textarea").each(function () { if ( $(this).val().toLowerCase().substring(0,5)=="enter" || $(this).val().toLowerCase().substring(0,6)=="please" ) { $(this).val(""); } }); } // give all text fields a focus action, so that when they are focussed on, they trigger the command to go through all fields as above $(document).ready (function () { $("form input:text, form textarea").each(function () { // on blur, go through all text fields, and if they start 'Please or enter', clear them $(this).focus(function () { if (formHasBeenCleared == false) { // clear all form text elements clearAllDefaultsFromTextFields(); formHasBeenCleared = true; } }); }); }); var currentAudio = null; function audioPlayerPlay ( className, trackName, trackAudio ) { var $audioWidget = $(".audioPlayer"); $("#flashAudioPlayer",$audioWidget).remove(); var $flashHolder = $('
 
'); //$flashHolder.css('height',113); //$flashHolder.css('width',187); $flashHolder.flash({ // test_flashvars.swf is the flash document swf: '/audioPlayer/audioPlayer.swf', height: 70, width: 600, bgcolor: '#e5e5e5', flashvars: { mp3: trackAudio, mp3Name: trackName } }); $('.audioPlayerInner',$audioWidget).prepend($flashHolder); // save the played one currentAudio = className; // lastly go through the links and set the current active and the others inactive $('li',$audioWidget).each (function (){ if ($(this).hasClass(className) ) { $(this).addClass('active'); } else { $(this).removeClass('active'); } }); } function audioPlayerNext () { } $(document).ready(function () { if ($.hasFlashPlayerVersion(8)) { $(".audioPlayer").each(function () { // insert a new div to hold the flash before the list // add a new class to make the audioPlayer taller $(this).addClass('hasFlashAudioPlayer'); $('h3',this).remove(); // find the first li, make it active, and play the audio var $firstLi = $('li:first .cufon-text',this); $currentAudio = $firstLi; var trackName = $('a',$firstLi).text(); var trackAudio = $('a',$firstLi).attr('href'); // then make all li s into links that play audio var i = 1; $('li',this).each (function (){ // make the click action go to a function var $a = $('a',this); $a.attr('href','javascript:audioPlayerPlay("ap'+i+'","'+escape($a.text().replace(/play track/,''))+'","'+$a.attr('href')+'");'); $(this).addClass('ap'+i); i++; }); audioPlayerPlay ( 'ap1',escape(trackName), trackAudio ); }); } }); // JavaScript Document function startTabs() { // page to effectItOn var params = getParams('tabs'); //alert(params); //for (var p in params) { // alert(p+': '+params[p]); //} var anchorAvoid = '-'; // var $page = $('body.products'); var $currentTabLink = null; var i = 0; var callBackFunction = eval(params.callBack); //var callBackVar = eval(params.callBackVar); var effectCallBackFunction = eval(params.effectCallBack); var pageURL = document.location.toString(); var activeItem=''; // get anchor if (pageURL.match('#')) activeItem = pageURL.replace(anchorAvoid,'').split('#').pop(); //alert(activeItem); // hide all tabs $('.tab').css('display','none'); $(params.tabSelector).each(function () { // use 'bookmarked' item, else default to first link! // change the href so that it has 'goto' after the hash to stop page bouncing with the anchors $('a',this).attr('href', $('a',this).attr('href').replace('#','#'+anchorAvoid) ); if (i == 0) { if (activeItem=='') { $(this).addClass('active'); $currentTabLink = $('a',this); } else { $currentTabLink = $(params.tabSelector+' a.'+activeItem); $($currentTabLink).parent().addClass('active'); } //alert($currentTabLink.attr('class')); // set attributes and show current tab $('body').addClass('tab_'+$currentTabLink.attr('class')); //window.location.hash='#'+$currentTabLink.attr('class'); var myTargetTab = '.tab.'+$($currentTabLink).attr('href').replace('#'+anchorAvoid,'').replace('#',''); //alert(myTargetTab); $(myTargetTab).css('display','block'); } // reset scroll, if any //window.scrollTo(0,0); // then set up a click action that goes through all the other tabs and turns them off $('a',this).click(function () { if ($(this).parent().hasClass('active')==false) { var $newTabLink = $(this); var $newTargetTab = $('.tab.'+$newTabLink.attr('href').replace('#'+anchorAvoid,'')); if ($currentTabLink != null) { var $currentTab = $('.tab.'+$currentTabLink.attr('href').replace('#'+anchorAvoid,'')); $currentTabLink.parent().removeClass('active'); effectCallBackFunction($currentTab,$newTargetTab,params); // remove previous body class $('body').removeClass('tab_'+$currentTabLink.attr('class')); $currentTabLink = $newTabLink; $newTabLink.parent().addClass("active"); // and put a new body class on $('body').addClass('tab_'+$newTabLink.attr('class')); // REPLACE WITH CALLBACK CODE if(callBackFunction) callBackFunction(params.callBackVar); // return false; } } }); i++; }); // REPLACE WITH CALLBACK CODE if(callBackFunction) callBackFunction(params.callBackVar); } function slideEffect($currentTab, $newTargetTab, params) { $currentTab.slideUp(parseFloat(params.effectInSpeed), function() { // needs to be callback AFTER slide up, else animation is uneven $newTargetTab.slideDown(parseFloat(params.effectOutSpeed)); }); } function fadeEffect($currentTab, $newTargetTab, params) { $currentTab.fadeOut(parseFloat(params.effectInSpeed), function() { // needs to be callback AFTER slide up, else animation is uneven $newTargetTab.fadeIn(parseFloat(params.effectOutSpeed)); }); } $(document).ready(function () { var JSONdefaults = new Object({"template": "whatson", "tabSelector": "ol.subnavTabs li", "effectCallBack": "slideEffect", "effectInSpeed": "400", "effectOutSpeed": "600", "callBack": "", "callBackVar": "" }); // php generated overrides var JSONParameters={"template":"subtablechoice","callBack":"initCufon","callBackVar":".subnavTabs li"}; var params = getParams( 'tabs', JSONdefaults, JSONParameters ); //var param=getParams( 'adjustCssForRes'); var pageToActOn = params.template.split(","); for (var i=0;i