
/* $.preloadImages */
(function($) {
	var cache = [];
	// Arguments are image paths relative to the current page.
	$.preloadImages = function() {
		var args_len = arguments.length;
		for (var i = args_len; i--;) {
			var cacheImage = document.createElement('img');
			cacheImage.src = arguments[i];
			cache.push(cacheImage);
		}
	}
})(jQuery);

/**
 * 	$.easyListSplitter 1.0.2
 * 
 *  http://www.madeincima.eu/samples/jquery/easyListSplitter/scripts/jquery.easyListSplitter.js
 *  

	$('.your-list-class-name').easyListSplitter({ 
			colNumber: 3,
			direction: 'horizontal'
	});
	
 * 
 * gzip	Packer 3.1	shrink, privateVars
 * 
 */
var j=1;(function(a){a.fn.easyListSplitter=function(g){var h={colNumber:2,direction:'vertical'};this.each(function(){var m=a(this);var b=a.extend(h,g);var k=a(this).children('li').size();var f=Math.ceil(k/b.colNumber);var l=a(this).attr('class');for(i=1;i<=b.colNumber;i++){if(i==1){a(this).addClass('listCol1').wrap('<div class="listContainer'+j+'"></div>')}else if(a(this).is('ul')){a(this).parents('.listContainer'+j).append('<ul class="listCol'+i+'"></ul>')}else{a(this).parents('.listContainer'+j).append('<ol class="listCol'+i+'"></ol>')}a('.listContainer'+j+' > ul,.listContainer'+j+' > ol').addClass(l)}var e=0;var d=1;var c=0;if(b.direction=='vertical'){a(this).children('li').each(function(){e=e+1;if(e>f*(b.colNumber-1)){a(this).parents('.listContainer'+j).find('.listCol'+b.colNumber).append(this)}else{if(e<=(f*d)){a(this).parents('.listContainer'+j).find('.listCol'+d).append(this)}else{a(this).parents('.listContainer'+j).find('.listCol'+(d+1)).append(this);d=d+1}}});a('.listContainer'+j).find('ol,ul').each(function(){if(a(this).children().size()==0){a(this).remove()}})}else{a(this).children('li').each(function(){c=c+1;if(c<=b.colNumber){a(this).parents('.listContainer'+j).find('.listCol'+c).append(this)}else{c=1;a(this).parents('.listContainer'+j).find('.listCol'+c).append(this)}})}a('.listContainer'+j).find('ol:last,ul:last').addClass('last');j=j+1})}})(jQuery);

/**
 * jquery.tools 1.1.2 - The missing UI library for the Web
 * tools.tabs-1.0.4, tools.tabs.slideshow-1.0.2, tools.tabs.history-1.0.2, tools.tooltip-1.1.2, tools.tooltip.slide-1.0.0, tools.tooltip.dynamic-1.0.1, tools.scrollable-1.1.2, tools.scrollable.circular-0.5.1, tools.scrollable.autoscroll-1.0.1, tools.scrollable.navigator-1.0.2, tools.scrollable.mousewheel-1.0.1, tools.overlay-1.1.2, tools.overlay.gallery-1.0.0, tools.overlay.apple-1.0.1, tools.expose-1.0.5
 * jquery.event.wheel.js
 */
(function(d){d.tools=d.tools||{};d.tools.tabs={version:"1.0.4",conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",api:false,rotate:false},addEffect:function(e,f){c[e]=f}};var c={"default":function(f,e){this.getPanes().hide().eq(f).show();e.call()},fade:function(g,e){var f=this.getConf(),j=f.fadeOutSpeed,h=this.getPanes();if(j){h.fadeOut(j)}else{h.hide()}h.eq(g).fadeIn(f.fadeInSpeed,e)},slide:function(f,e){this.getPanes().slideUp(200);this.getPanes().eq(f).slideDown(400,e)},ajax:function(f,e){this.getPanes().eq(0).load(this.getTabs().eq(f).attr("href"),e)}};var b;d.tools.tabs.addEffect("horizontal",function(f,e){if(!b){b=this.getPanes().eq(0).width()}this.getCurrentPane().animate({width:0},function(){d(this).hide()});this.getPanes().eq(f).animate({width:b},function(){d(this).show();e.call()})});function a(g,h,f){var e=this,j=d(this),i;d.each(f,function(k,l){if(d.isFunction(l)){j.bind(k,l)}});d.extend(this,{click:function(k,n){var o=e.getCurrentPane();var l=g.eq(k);if(typeof k=="string"&&k.replace("#","")){l=g.filter("[href*="+k.replace("#","")+"]");k=Math.max(g.index(l),0)}if(f.rotate){var m=g.length-1;if(k<0){return e.click(m,n)}if(k>m){return e.click(0,n)}}if(!l.length){if(i>=0){return e}k=f.initialIndex;l=g.eq(k)}if(k===i){return e}n=n||d.Event();n.type="onBeforeClick";j.trigger(n,[k]);if(n.isDefaultPrevented()){return}c[f.effect].call(e,k,function(){n.type="onClick";j.trigger(n,[k])});n.type="onStart";j.trigger(n,[k]);if(n.isDefaultPrevented()){return}i=k;g.removeClass(f.current);l.addClass(f.current);return e},getConf:function(){return f},getTabs:function(){return g},getPanes:function(){return h},getCurrentPane:function(){return h.eq(i)},getCurrentTab:function(){return g.eq(i)},getIndex:function(){return i},next:function(){return e.click(i+1)},prev:function(){return e.click(i-1)},bind:function(k,l){j.bind(k,l);return e},onBeforeClick:function(k){return this.bind("onBeforeClick",k)},onClick:function(k){return this.bind("onClick",k)},unbind:function(k){j.unbind(k);return e}});g.each(function(k){d(this).bind(f.event,function(l){e.click(k,l);return false})});if(location.hash){e.click(location.hash)}else{if(f.initialIndex===0||f.initialIndex>0){e.click(f.initialIndex)}}h.find("a[href^=#]").click(function(k){e.click(d(this).attr("href"),k)})}d.fn.tabs=function(i,f){var g=this.eq(typeof f=="number"?f:0).data("tabs");if(g){return g}if(d.isFunction(f)){f={onBeforeClick:f}}var h=d.extend({},d.tools.tabs.conf),e=this.length;f=d.extend(h,f);this.each(function(l){var j=d(this);var k=j.find(f.tabs);if(!k.length){k=j.children()}var m=i.jquery?i:j.children(i);if(!m.length){m=e==1?d(i):j.parent().find(i)}g=new a(k,m,f);j.data("tabs",g)});return f.api?g:this}})(jQuery);
(function(b){var a=b.tools.tabs;a.plugins=a.plugins||{};a.plugins.slideshow={version:"1.0.2",conf:{next:".forward",prev:".backward",disabledClass:"disabled",autoplay:false,autopause:true,interval:3000,clickable:true,api:false}};b.prototype.slideshow=function(e){var f=b.extend({},a.plugins.slideshow.conf),c=this.length,d;e=b.extend(f,e);this.each(function(){var p=b(this),m=p.tabs(),i=b(m),o=m;b.each(e,function(t,u){if(b.isFunction(u)){m.bind(t,u)}});function n(t){return c==1?b(t):p.parent().find(t)}var s=n(e.next).click(function(){m.next()});var q=n(e.prev).click(function(){m.prev()});var h,j,l,g=false;b.extend(m,{play:function(){if(h){return}var t=b.Event("onBeforePlay");i.trigger(t);if(t.isDefaultPrevented()){return m}g=false;h=setInterval(m.next,e.interval);i.trigger("onPlay");m.next()},pause:function(){if(!h){return m}var t=b.Event("onBeforePause");i.trigger(t);if(t.isDefaultPrevented()){return m}h=clearInterval(h);l=clearInterval(l);i.trigger("onPause")},stop:function(){m.pause();g=true},onBeforePlay:function(t){return m.bind("onBeforePlay",t)},onPlay:function(t){return m.bind("onPlay",t)},onBeforePause:function(t){return m.bind("onBeforePause",t)},onPause:function(t){return m.bind("onPause",t)}});if(e.autopause){var k=m.getTabs().add(s).add(q).add(m.getPanes());k.hover(function(){m.pause();j=clearInterval(j)},function(){if(!g){j=setTimeout(m.play,e.interval)}})}if(e.autoplay){l=setTimeout(m.play,e.interval)}else{m.stop()}if(e.clickable){m.getPanes().click(function(){m.next()})}if(!m.getConf().rotate){var r=e.disabledClass;if(!m.getIndex()){q.addClass(r)}m.onBeforeClick(function(u,t){if(!t){q.addClass(r)}else{q.removeClass(r);if(t==m.getTabs().length-1){s.addClass(r)}else{s.removeClass(r)}}})}});return e.api?d:this}})(jQuery);
(function(d){var a=d.tools.tabs;a.plugins=a.plugins||{};a.plugins.history={version:"1.0.2",conf:{api:false}};var e,b;function c(f){if(f){var g=b.contentWindow.document;g.open().close();g.location.hash=f}}d.fn.onHash=function(g){var f=this;if(d.browser.msie&&d.browser.version<"8"){if(!b){b=d("<iframe/>").attr("src","javascript:false;").hide().get(0);d("body").append(b);setInterval(function(){var i=b.contentWindow.document,j=i.location.hash;if(e!==j){d.event.trigger("hash",j);e=j}},100);c(location.hash||"#")}f.bind("click.hash",function(h){c(d(this).attr("href"))})}else{setInterval(function(){var j=location.hash;var i=f.filter("[href$="+j+"]");if(!i.length){j=j.replace("#","");i=f.filter("[href$="+j+"]")}if(i.length&&j!==e){e=j;d.event.trigger("hash",j)}},100)}d(window).bind("hash",g);return this};d.fn.history=function(g){var h=d.extend({},a.plugins.history.conf),f;g=d.extend(h,g);this.each(function(){var j=d(this).tabs(),i=j.getTabs();if(j){f=j}i.onHash(function(k,l){if(!l||l=="#"){l=j.getConf().initialIndex}j.click(l)});i.click(function(k){location.hash=d(this).attr("href").replace("#","")})});return g.api?f:this}})(jQuery);
(function(b){b.tools=b.tools||{};b.tools.scrollable={version:"1.1.2",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var c;function a(o,m){var r=this,p=b(this),d=!m.vertical,e=o.children(),k=0,i;if(!c){c=r}b.each(m,function(s,t){if(b.isFunction(t)){p.bind(s,t)}});if(e.length>1){e=b(m.items,o)}function l(t){var s=b(t);return m.globalNav?s:o.parent().find(t)}o.data("finder",l);var f=l(m.prev),h=l(m.next),g=l(m.prevPage),n=l(m.nextPage);b.extend(r,{getIndex:function(){return k},getClickIndex:function(){var s=r.getItems();return s.index(s.filter("."+m.activeClass))},getConf:function(){return m},getSize:function(){return r.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/m.size)},getPageIndex:function(){return Math.ceil(k/m.size)},getNaviButtons:function(){return f.add(h).add(g).add(n)},getRoot:function(){return o},getItemWrap:function(){return e},getItems:function(){return e.children(m.item)},getVisibleItems:function(){return r.getItems().slice(k,k+m.size)},seekTo:function(s,w,t){if(s<0){s=0}if(k===s){return r}if(b.isFunction(w)){t=w}if(s>r.getSize()-m.size){return m.loop?r.begin():this.end()}var u=r.getItems().eq(s);if(!u.length){return r}var v=b.Event("onBeforeSeek");p.trigger(v,[s]);if(v.isDefaultPrevented()){return r}if(w===undefined||b.isFunction(w)){w=m.speed}function x(){if(t){t.call(r,s)}p.trigger("onSeek",[s])}if(d){e.animate({left:-u.position().left},w,m.easing,x)}else{e.animate({top:-u.position().top},w,m.easing,x)}c=r;k=s;v=b.Event("onStart");p.trigger(v,[s]);if(v.isDefaultPrevented()){return r}f.add(g).toggleClass(m.disabledClass,s===0);h.add(n).toggleClass(m.disabledClass,s>=r.getSize()-m.size);return r},move:function(u,t,s){i=u>0;return this.seekTo(k+u,t,s)},next:function(t,s){return this.move(1,t,s)},prev:function(t,s){return this.move(-1,t,s)},movePage:function(w,v,u){i=w>0;var s=m.size*w;var t=k%m.size;if(t>0){s+=(w>0?-t:m.size-t)}return this.move(s,v,u)},prevPage:function(t,s){return this.movePage(-1,t,s)},nextPage:function(t,s){return this.movePage(1,t,s)},setPage:function(t,u,s){return this.seekTo(t*m.size,u,s)},begin:function(t,s){i=false;return this.seekTo(0,t,s)},end:function(t,s){i=true;var u=this.getSize()-m.size;return u>0?this.seekTo(u,t,s):r},reload:function(){p.trigger("onReload");return r},focus:function(){c=r;return r},click:function(u){var v=r.getItems().eq(u),s=m.activeClass,t=m.size;if(u<0||u>=r.getSize()){return r}if(t==1){if(m.loop){return r.next()}if(u===0||u==r.getSize()-1){i=(i===undefined)?true:!i}return i===false?r.prev():r.next()}if(t==2){if(u==k){u--}r.getItems().removeClass(s);v.addClass(s);return r.seekTo(u,time,fn)}if(!v.hasClass(s)){r.getItems().removeClass(s);v.addClass(s);var x=Math.floor(t/2);var w=u-x;if(w>r.getSize()-t){w=r.getSize()-t}if(w!==u){return r.seekTo(w)}}return r},bind:function(s,t){p.bind(s,t);return r},unbind:function(s){p.unbind(s);return r}});b.each("onBeforeSeek,onStart,onSeek,onReload".split(","),function(s,t){r[t]=function(u){return r.bind(t,u)}});f.addClass(m.disabledClass).click(function(){r.prev()});h.click(function(){r.next()});n.click(function(){r.nextPage()});if(r.getSize()<m.size){h.add(n).addClass(m.disabledClass)}g.addClass(m.disabledClass).click(function(){r.prevPage()});var j=m.hoverClass,q="keydown."+Math.random().toString().substring(10);r.onReload(function(){if(j){r.getItems().hover(function(){b(this).addClass(j)},function(){b(this).removeClass(j)})}if(m.clickable){r.getItems().each(function(s){b(this).unbind("click.scrollable").bind("click.scrollable",function(t){if(b(t.target).is("a")){return}return r.click(s)})})}if(m.keyboard){b(document).unbind(q).bind(q,function(t){if(t.altKey||t.ctrlKey){return}if(m.keyboard!="static"&&c!=r){return}var u=m.keyboardSteps;if(d&&(t.keyCode==37||t.keyCode==39)){r.move(t.keyCode==37?-u:u);return t.preventDefault()}if(!d&&(t.keyCode==38||t.keyCode==40)){r.move(t.keyCode==38?-u:u);return t.preventDefault()}return true})}else{b(document).unbind(q)}});r.reload()}b.fn.scrollable=function(d){var e=this.eq(typeof d=="number"?d:0).data("scrollable");if(e){return e}var f=b.extend({},b.tools.scrollable.conf);d=b.extend(f,d);d.keyboardSteps=d.keyboardSteps||d.size;this.each(function(){e=new a(b(this),d);b(this).data("scrollable",e)});return d.api?e:this}})(jQuery);
(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.circular={version:"0.5.1",conf:{api:false,clonedClass:"cloned"}};b.fn.circular=function(e){var d=b.extend({},a.plugins.circular.conf),c;b.extend(d,e);this.each(function(){var i=b(this).scrollable(),n=i.getItems(),k=i.getConf(),f=i.getItemWrap(),j=0;if(i){c=i}if(n.length<k.size){return false}n.slice(0,k.size).each(function(o){b(this).clone().appendTo(f).click(function(){i.click(n.length+o)}).addClass(d.clonedClass)});var l=b.makeArray(n.slice(-k.size)).reverse();b(l).each(function(o){b(this).clone().prependTo(f).click(function(){i.click(-o-1)}).addClass(d.clonedClass)});var m=f.children(k.item);var h=k.hoverClass;if(h){m.hover(function(){b(this).addClass(h)},function(){b(this).removeClass(h)})}function g(o){var p=m.eq(o);if(k.vertical){f.css({top:-p.position().top})}else{f.css({left:-p.position().left})}}g(k.size);b.extend(i,{move:function(s,r,p,q){var u=j+s+k.size;var t=u>i.getSize()-k.size;if(u<=0||t){var o=j+k.size+(t?-n.length:n.length);g(o);u=o+s}if(q){m.removeClass(k.activeClass).eq(u+Math.floor(k.size/2)).addClass(k.activeClass)}if(u===j+k.size){return self}return i.seekTo(u,r,p)},begin:function(p,o){return this.seekTo(k.size,p,o)},end:function(p,o){return this.seekTo(n.length,p,o)},click:function(p,r,q){if(!k.clickable){return self}if(k.size==1){return this.next()}var s=p-j,o=k.activeClass;s-=Math.floor(k.size/2);return this.move(s,r,q,true)},getIndex:function(){return j},setPage:function(p,q,o){return this.seekTo(p*k.size+k.size,q,o)},getPageAmount:function(){return Math.ceil(n.length/k.size)},getPageIndex:function(){if(j<0){return this.getPageAmount()-1}if(j>=n.length){return 0}var o=(j+k.size)/k.size-1;return o},getVisibleItems:function(){var o=j+k.size;return m.slice(o,o+k.size)}});i.onStart(function(p,o){j=o-k.size;return false});i.getNaviButtons().removeClass(k.disabledClass)});return d.api?c:this}})(jQuery);
(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.autoscroll={version:"1.0.1",conf:{autoplay:true,interval:3000,autopause:true,steps:1,api:false}};b.fn.autoscroll=function(d){if(typeof d=="number"){d={interval:d}}var e=b.extend({},a.plugins.autoscroll.conf),c;b.extend(e,d);this.each(function(){var g=b(this).scrollable();if(g){c=g}var i,f,h=true;g.play=function(){if(i){return}h=false;i=setInterval(function(){g.move(e.steps)},e.interval);g.move(e.steps)};g.pause=function(){i=clearInterval(i)};g.stop=function(){g.pause();h=true};if(e.autopause){g.getRoot().add(g.getNaviButtons()).hover(function(){g.pause();clearInterval(f)},function(){if(!h){f=setTimeout(g.play,e.interval)}})}if(e.autoplay){setTimeout(g.play,e.interval)}});return e.api?c:this}})(jQuery);
(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.navigator={version:"1.0.2",conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,api:false,idPrefix:null}};b.fn.navigator=function(d){var e=b.extend({},a.plugins.navigator.conf),c;if(typeof d=="string"){d={navi:d}}d=b.extend(e,d);this.each(function(){var i=b(this).scrollable(),f=i.getRoot(),l=f.data("finder").call(null,d.navi),g=null,k=i.getNaviButtons();if(i){c=i}i.getNaviButtons=function(){return k.add(l)};function j(){if(!l.children().length||l.data("navi")==i){l.empty();l.data("navi",i);for(var m=0;m<i.getPageAmount();m++){l.append(b("<"+(d.naviItem||"a")+"/>"))}g=l.children().each(function(n){var o=b(this);o.click(function(p){i.setPage(n);return p.preventDefault()});if(d.indexed){o.text(n)}if(d.idPrefix){o.attr("id",d.idPrefix+n)}})}else{g=d.naviItem?l.find(d.naviItem):l.children();g.each(function(n){var o=b(this);o.click(function(p){i.setPage(n);return p.preventDefault()})})}g.eq(0).addClass(d.activeClass)}i.onStart(function(o,n){var m=d.activeClass;g.removeClass(m).eq(i.getPageIndex()).addClass(m)});i.onReload(function(){j()});j();var h=g.filter("[href="+location.hash+"]");if(h.length){i.move(g.index(h))}});return d.api?c:this}})(jQuery);

/* ColorBox v1.3.14 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+ */
/**
 * REW Hack Added
 * 
if (!percent) {
	if (img.width < settings.mw) {
		percent = (img.width - settings.mw) / img.width;
		tw = img.width - (img.width * percent);
		th = img.height - (img.height * percent);
		if (tw <= settings.mw && th <= settings.mh) {
			setResize();
		}
	}
	if (img.height < settings.mh) {
		percent = (img.height - settings.mh) / img.height;
		tw = img.width - (img.width * percent);
		th = img.height - (img.height * percent);
		if (tw <= settings.mw && th <= settings.mh) {
			setResize();
		}								
	}	
}
* 
* gzip	Packer 3.1	shrink, privateVars
* 
*/
(function(c,bk){var bd={transition:"elastic",speed:300,width:false,initialWidth:"600",innerWidth:false,maxWidth:false,height:false,initialHeight:"450",innerHeight:false,maxHeight:false,scalePhotos:true,scrolling:true,inline:false,html:false,iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:true,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,returnFocus:true,loop:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,overlayClose:true,escKey:true,arrowKey:true},u='colorbox',m='cbox',be=m+'_0',R=m+'_1',S=m+'_2',N=m+'_3',bf=m+'_4',O=m+'_5',bg=m+'_6',F=c.browser.msie&&!c.support.opacity,T=F&&c.browser.version<7,P=m+'_7',x,o,C,v,U,V,W,X,l,r,p,H,I,Y,Z,J,K,L,ba,D,E,y,z,q,j,a,w,G,Q=false,g,M=m+'Element';function h(b,f){b=b?' id="'+m+b+'"':'';f=f?' style="'+f+'"':'';return c('<div'+b+f+'/>')}function t(b,f){f=f==='x'?r.width():r.height();return(typeof b==='string')?Math.round((/%/.test(b)?(f/100)*parseInt(b,10):parseInt(b,10))):b}function bb(b){return a.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(b)}function bh(b){for(var f in b){if(c.isFunction(b[f])&&f.substring(0,2)!=='on'){b[f]=b[f].call(q)}}b.rel=b.rel||q.rel||'nofollow';b.href=b.href||c(q).attr('href');b.title=b.title||q.title;return b}function A(b,f){if(f){f.call(q)}c.event.trigger(b)}function bl(){var b,f=m+"Slideshow_",i="click."+m,k,n,d;if(a.slideshow&&l[1]){k=function(){J.text(a.slideshowStop).unbind(i).bind(S,function(){if(j<l.length-1||a.loop){b=setTimeout(g.next,a.slideshowSpeed)}}).bind(R,function(){clearTimeout(b)}).one(i+' '+N,n);o.removeClass(f+"off").addClass(f+"on");b=setTimeout(g.next,a.slideshowSpeed)};n=function(){clearTimeout(b);J.text(a.slideshowStart).unbind([S,R,N,i].join(' ')).one(i,k);o.removeClass(f+"on").addClass(f+"off")};if(a.slideshowAuto){k()}else{n()}}}function bi(f){if(!Q){q=f;a=bh(c.extend({},c.data(q,u)));l=c(q);j=0;if(a.rel!=='nofollow'){l=c('.'+M).filter(function(){var b=c.data(this,u).rel||this.rel;return(b===a.rel)});j=l.index(q);if(j===-1){l=l.add(q);j=l.length-1}}if(!w){w=G=true;o.show();if(a.returnFocus){try{q.blur();c(q).one(bf,function(){try{this.focus()}catch(e){}})}catch(e){}}x.css({"opacity":+a.opacity,"cursor":a.overlayClose?"pointer":"auto"}).show();a.w=t(a.initialWidth,'x');a.h=t(a.initialHeight,'y');g.position(0);if(T){r.bind('resize.'+P+' scroll.'+P,function(){x.css({width:r.width(),height:r.height(),top:r.scrollTop(),left:r.scrollLeft()})}).trigger('scroll.'+P)}A(be,a.onOpen);Z.add(L).add(K).add(J).add(Y).hide();ba.html(a.close).show()}g.load(true)}}g=c.fn[u]=c[u]=function(b,f){var i=this,k;if(!i[0]&&i.selector){return i}b=b||{};if(f){b.onComplete=f}if(!i[0]||i.selector===undefined){i=c('<a/>');b.open=true}i.each(function(){c.data(this,u,c.extend({},c.data(this,u)||bd,b));c(this).addClass(M)});k=b.open;if(c.isFunction(k)){k=k.call(i)}if(k){bi(i[0])}return i};g.init=function(){r=c(bk);o=h().attr({id:u,'class':F?m+'IE':''});x=h("Overlay",T?'position:absolute':'').hide();C=h("Wrapper");v=h("Content").append(p=h("LoadedContent",'width:0;height:0;overflow:hidden'),I=h("LoadingOverlay").add(h("LoadingGraphic")),Y=h("Title"),Z=h("Current"),K=h("Next"),L=h("Previous"),J=h("Slideshow").bind(be,bl),ba=h("Close"));C.append(h().append(h("TopLeft"),U=h("TopCenter"),h("TopRight")),h(false,'clear:left').append(V=h("MiddleLeft"),v,W=h("MiddleRight")),h(false,'clear:left').append(h("BottomLeft"),X=h("BottomCenter"),h("BottomRight"))).children().children().css({'float':'left'});H=h(false,'position:absolute; width:9999px; visibility:hidden; display:none');c('body').prepend(x,o.append(C,H));v.children().hover(function(){c(this).addClass('hover')},function(){c(this).removeClass('hover')}).addClass('hover');D=U.height()+X.height()+v.outerHeight(true)-v.height();E=V.width()+W.width()+v.outerWidth(true)-v.width();y=p.outerHeight(true);z=p.outerWidth(true);o.css({"padding-bottom":D,"padding-right":E}).hide();K.click(g.next);L.click(g.prev);ba.click(g.close);v.children().removeClass('hover');c('.'+M).live('click',function(b){if(!((b.button!==0&&typeof b.button!=='undefined')||b.ctrlKey||b.shiftKey||b.altKey)){b.preventDefault();bi(this)}});x.click(function(){if(a.overlayClose){g.close()}});c(document).bind("keydown",function(b){if(w&&a.escKey&&b.keyCode===27){b.preventDefault();g.close()}if(w&&a.arrowKey&&!G&&l[1]){if(b.keyCode===37&&(j||a.loop)){b.preventDefault();L.click()}else if(b.keyCode===39&&(j<l.length-1||a.loop)){b.preventDefault();K.click()}}})};g.remove=function(){o.add(x).remove();c('.'+M).die('click').removeData(u).removeClass(M)};g.position=function(f,i){var k,n=Math.max(document.documentElement.clientHeight-a.h-y-D,0)/2+r.scrollTop(),d=Math.max(r.width()-a.w-z-E,0)/2+r.scrollLeft();k=(o.width()===a.w+z&&o.height()===a.h+y)?0:f;C[0].style.width=C[0].style.height="9999px";function s(b){U[0].style.width=X[0].style.width=v[0].style.width=b.style.width;I[0].style.height=I[1].style.height=v[0].style.height=V[0].style.height=W[0].style.height=b.style.height}o.dequeue().animate({width:a.w+z,height:a.h+y,top:n,left:d},{duration:k,complete:function(){s(this);G=false;C[0].style.width=(a.w+z+E)+"px";C[0].style.height=(a.h+y+D)+"px";if(i){i()}},step:function(){s(this)}})};g.resize=function(b){if(w){b=b||{};if(b.width){a.w=t(b.width,'x')-z-E}if(b.innerWidth){a.w=t(b.innerWidth,'x')}p.css({width:a.w});if(b.height){a.h=t(b.height,'y')-y-D}if(b.innerHeight){a.h=t(b.innerHeight,'y')}if(!b.innerHeight&&!b.height){var f=p.wrapInner("<div style='overflow:auto'></div>").children();a.h=f.height();f.replaceWith(f.children())}p.css({height:a.h});g.position(a.transition==="none"?0:a.speed)}};g.prep=function(bm){if(!w){return}var bn,bc=a.transition==="none"?0:a.speed;r.unbind('resize.'+m);p.remove();p=h('LoadedContent').html(bm);function bo(){a.w=a.w||p.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}function bp(){a.h=a.h||p.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}p.hide().appendTo(H.show()).css({width:bo(),overflow:a.scrolling?'auto':'hidden'}).css({height:bp()}).prependTo(v);H.hide();c('#'+m+'Photo').css({cssFloat:'none',marginLeft:'auto',marginRight:'auto'});if(T){c('select').not(o.find('select')).filter(function(){return this.style.visibility!=='hidden'}).css({'visibility':'hidden'}).one(N,function(){this.style.visibility='inherit'})}function bj(f){var i,k,n,d,s=l.length,B=a.loop;g.position(f,function(){function b(){if(F){o[0].style.filter=false}}if(!w){return}if(F){if(bn){p.fadeIn(100)}}p.show();A(bg);Y.show().html(a.title);if(s>1){if(typeof a.current==="string"){Z.html(a.current.replace(/\{current\}/,j+1).replace(/\{total\}/,s)).show()}K[(B||j<s-1)?"show":"hide"]().html(a.next);L[(B||j)?"show":"hide"]().html(a.previous);i=j?l[j-1]:l[s-1];n=j<s-1?l[j+1]:l[0];if(a.slideshow){J.show()}if(a.preloading){d=c.data(n,u).href||n.href;k=c.data(i,u).href||i.href;d=c.isFunction(d)?d.call(n):d;k=c.isFunction(k)?k.call(i):k;if(bb(d)){c('<img/>')[0].src=d}if(bb(k)){c('<img/>')[0].src=k}}}I.hide();if(a.transition==='fade'){o.fadeTo(bc,1,function(){b()})}else{b()}r.bind('resize.'+m,function(){g.position(0)});A(S,a.onComplete)})}if(a.transition==='fade'){o.fadeTo(bc,0,function(){bj(0)})}else{bj(bc)}};g.load=function(k){var n,d,s,B=g.prep;G=true;q=l[j];if(!k){a=bh(c.extend({},c.data(q,u)))}A(O);A(R,a.onLoad);a.h=a.height?t(a.height,'y')-y-D:a.innerHeight&&t(a.innerHeight,'y');a.w=a.width?t(a.width,'x')-z-E:a.innerWidth&&t(a.innerWidth,'x');a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=t(a.maxWidth,'x')-z-E;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=t(a.maxHeight,'y')-y-D;a.mh=a.h&&a.h<a.mh?a.h:a.mh}n=a.href;I.show();if(a.inline){h().hide().insertBefore(c(n)[0]).one(O,function(){c(this).replaceWith(p.children())});B(c(n))}else if(a.iframe){o.one(bg,function(){var b=c("<iframe name='"+new Date().getTime()+"' frameborder=0"+(a.scrolling?"":" scrolling='no'")+(F?" allowtransparency='true'":'')+" style='width:100%; height:100%; border:0; display:block;'/>");b[0].src=a.href;b.appendTo(p).one(O,function(){b[0].src='//about:blank'})});B(" ")}else if(a.html){B(a.html)}else if(bb(n)){d=new Image();d.onload=function(){var b;d.onload=null;d.id=m+'Photo';c(d).css({border:'none',display:'block',cssFloat:'left'});if(a.scalePhotos){s=function(){d.height-=d.height*b;d.width-=d.width*b};if(a.mw&&d.width>a.mw){b=(d.width-a.mw)/d.width;s()}if(a.mh&&d.height>a.mh){b=(d.height-a.mh)/d.height;s()}if(!b){if(d.width<a.mw){b=(d.width-a.mw)/d.width;tw=d.width-(d.width*b);th=d.height-(d.height*b);if(tw<=a.mw&&th<=a.mh){s()}}if(d.height<a.mh){b=(d.height-a.mh)/d.height;tw=d.width-(d.width*b);th=d.height-(d.height*b);if(tw<=a.mw&&th<=a.mh){s()}}}}if(a.h){d.style.marginTop=Math.max(a.h-d.height,0)/2+'px'}if(l[1]&&(j<l.length-1||a.loop)){c(d).css({cursor:'pointer'}).click(g.next)}if(F){d.style.msInterpolationMode='bicubic'}setTimeout(function(){B(d)},1)};setTimeout(function(){d.src=n},1)}else if(n){H.load(n,function(b,f,i){B(f==='error'?'Request unsuccessful: '+i.statusText:c(this).children())})}};g.next=function(){if(!G){j=j<l.length-1?j+1:0;g.load()}};g.prev=function(){if(!G){j=j?j-1:l.length-1;g.load()}};g.close=function(){if(w&&!Q){Q=true;w=false;A(N,a.onCleanup);r.unbind('.'+m+' .'+P);x.fadeTo('fast',0);o.stop().fadeTo('fast',0,function(){A(O);p.remove();o.add(x).css({'opacity':1,cursor:'auto'}).hide();setTimeout(function(){Q=false;A(bf,a.onClosed)},1)})}};g.element=function(){return c(q)};g.settings=bd;c(g.init)}(jQuery,this));

/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
*
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(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))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);

/* $.masonry */
(function($){

	//Finding min and max values in array from http://snippets.dzone.com/posts/show/769
	Array.prototype.min = function(){ return Math.min.apply({},this) };
	Array.prototype.max = function(){ return Math.max.apply({},this) };

	$.fn.masonry = function() {
		this.each(function() {

			var wall = $(this);

			if ( wall.children().length > 0 ) { // check if the element has anything in it

				if( wall.children('.masonryWrap').length == 0 ) {      // checks if the masonryWrap div is already there
					wall.wrapInner('<div class=\"masonryWrap\"></div>');
				}
				var mWrap = wall.children('.masonryWrap');

				var brick = mWrap.children();
				var brickW = brick.outerWidth(true);
				var colCount = Math.floor( mWrap.width() / brickW ) ;

				var colH=new Array();
				for ( i=0; i < colCount; i++) {
					colH[ i ] =  0 ;
				}

				mWrap.css({ position: 'relative' });

				brick.css({
						float: 'none',
						position: 'absolute',
						display: 'block'
					})
					.each(function(){
						for ( i=colCount-1; i > -1; i-- ) {
							if ( colH[ i ] == colH.min() ) {
								var thisCol = i;
							}
						}
						$(this).css({
							top: colH[ thisCol ],
							left: brickW * thisCol
						});
						colH[ thisCol ] += $(this).outerHeight(true);
					});

				mWrap.height( colH.max() );
			}

			return this;
		});
	};
})(jQuery);

// HTML Truncator for jQuery
// by Henrik Nyh <http://henrik.nyh.se> 2008-02-28.
// Free to modify and redistribute with credit.
(function($) {

  var trailing_whitespace = true;

  $.fn.truncate = function(options) {

    var opts = $.extend({}, $.fn.truncate.defaults, options);

    $(this).each(function() {

      var content_length = $.trim(squeeze($(this).text())).length;
      if (content_length <= opts.max_length)
        return;  // bail early if not overlong

      var actual_max_length = opts.max_length - opts.more.length - 3;  // 3 for " ()"
      var truncated_node = recursivelyTruncate(this, actual_max_length);
      var full_node = $(this).hide();

      truncated_node.insertAfter(full_node);

      findNodeForMore(truncated_node).append(' (<a href="#show more content">'+opts.more+'</a>)');
      findNodeForLess(full_node).append(' (<a href="#show less content">'+opts.less+'</a>)');

      truncated_node.find('a:last').click(function() {
        truncated_node.hide(); full_node.show(); return false;
      });
      full_node.find('a:last').click(function() {
        truncated_node.show(); full_node.hide(); return false;
      });

    });
  }
  // Note that the " (more)" bit counts towards the max length ��� so a max
  // length of 10 would truncate "1234567890" to "12 (��?more)".
  $.fn.truncate.defaults = {
    max_length: 100,
    more: 'more',
    less: 'less'
  };
  function recursivelyTruncate(node, max_length) {
    return (node.nodeType == 3) ? truncateText(node, max_length) : truncateNode(node, max_length);
  }
  function truncateNode(node, max_length) {
    var node = $(node);
    var new_node = node.clone().empty();
    var truncatedChild;
    node.contents().each(function() {
      var remaining_length = max_length - new_node.text().length;
      if (remaining_length == 0) return;  // breaks the loop
      truncatedChild = recursivelyTruncate(this, remaining_length);
      if (truncatedChild) new_node.append(truncatedChild);
    });
    return new_node;
  }
  function truncateText(node, max_length) {
    var text = squeeze(node.data);
    if (trailing_whitespace)  // remove initial whitespace if last text
      text = text.replace(/^ /, '');  // node had trailing whitespace.
    trailing_whitespace = !!text.match(/ $/);
    var text = text.slice(0, max_length);
    // Ensure HTML entities are encoded
    // http://debuggable.com/posts/encode-html-entities-with-jquery:480f4dd6-13cc-4ce9-8071-4710cbdd56cb
    text = $('<div/>').text(text).html();
    return text;
  }
  // Collapses a sequence of whitespace into a single space.
  function squeeze(string) {
    return string.replace(/\s+/g, ' ');
  }
  // Finds the last, innermost block-level element
  function findNodeForMore(node) {
    var $node = $(node);
    var last_child = $node.children(":last");
    if (!last_child) return node;
    var display = last_child.css('display');
    if (!display || display=='inline') return $node;
    return findNodeForMore(last_child);
  };
  // Finds the last child if it's a p; otherwise the parent
  function findNodeForLess(node) {
    var $node = $(node);
    var last_child = $node.children(":last");
    if (last_child && last_child.is('p')) return last_child;
    return node;
  };
})(jQuery);

/**
 * jQuery.fn.rewImgSizer
 * version 1.2
 * COPYRIGHT 2010
 *
 * Usage: $('img').rewImgSizer({});
 *
 * Options:
 *
 * scale : Ratio (e.g 1.25)
 * align: 'top left', 'top center', 'top right', 'center', 'center right', 'center left', 'bottom right', 'bottom center' or 'bottom left'
 * scale: 'scale', 'crop', 'fit' or 'none'
 * noUpscale: bollean (true or false)
 * onBeforeShow:
 * onAfterShow:
 *
**/
jQuery.fn.rewImgSizer = function(options) {

	var $self = this;

	var defaults = {
		method: 'crop',
		scale: 1,
		align: 'center',
		effect: 'fadeIn',
		noUpScale: false,
		onBeforeShow: function(){},
		onAfterShow: function(){}
	};

	var options = $.extend(defaults, options);

	$self.resize = function ($img) {

	    $self.show();

		/* photo
		----------------------------------------------------------- */

		var pho_vsize = 1;
		var pho_hsize = 1;
		var pho_width = $img.width();
		var pho_heigh = $img.height();

		// Steve: Generate both to prevent square images
//		if (pho_width > pho_heigh) {
			pho_vsize = Math.round((pho_width / pho_heigh) * 100) / 100;
//		} else{
			pho_hsize = Math.round((pho_heigh / pho_width) * 100) / 100;
//		}

		/* canvas
		----------------------------------------------------------- */

		$can = $img.parent();

		var can_vsize = 1;
		var can_hsize = 1;
		var can_width = $can.width();
		var can_heigh = $can.height();

		// Steve: Generate both to prevent square images
//		if (can_width > can_heigh) {
			can_vsize = Math.round((can_width / can_heigh) * 100) / 100;
//		} else{
			can_hsize = Math.round((can_heigh / can_width) * 100) / 100;
//		}

		/* store in case we want to revert */
		oldmethod = options.method;

		if (options.noUpScale) {
			if(pho_width < can_width && pho_heigh < can_heigh) {
				options.method = 'none';
			}

		}

		/* ect.
		----------------------------------------------------------- */
		//$img.attr('title', 'photo height=' + pho_hsize + '; photo width=' + pho_vsize + '; canvas height=' + can_hsize + '; canvas width=' + can_vsize);

		if (options.method == 'crop') {

			if (pho_hsize > can_hsize) {
				$img.width(can_width);
				$img.height($img.width() * pho_hsize);
			} else if (pho_vsize > can_vsize) {
				$img.height(can_heigh);
				$img.width($img.height() * pho_vsize);
			} else {
				// square 1:1
				$img.width(can_width);
				$img.height($img.width() * pho_hsize);
			}

		} else if (options.method == 'fit') {

			$img.height(can_heigh);
			$img.width(can_width);

		} else if (options.method == 'scale') {

			if (pho_hsize > can_hsize) {
				$img.height(can_heigh);
			} else if (pho_vsize > can_vsize) {
				$img.width(can_width);
			} else {
				// square 1:1
				if (can_hsize > can_vsize) {
					$img.width(can_width);
				} else {
					$img.height(can_heigh);
				}
			}

		} else {

			/* no resize */

		}

		/* SCALE OPTION */
		if (options.scale) {
			sImgH = $img.height() * options.scale;
			sImgW = $img.width() * options.scale;
			$img.width(sImgW);
			$img.height(sImgH);
		}

		$img.css({position:'absolute', left: ''});

		switch (options.align) {

			case 'center':
    			$img.css('top', -($img.height() - can_heigh) / 2 + 'px');
    			$img.css('left', -($img.width() - can_width) / 2 + 'px');
			break;

			case 'top left':
    			$img.css({'top': 0, 'left': 0});
			break;

			case 'top center':
    			$img.css('top', 0);
    			$img.css('left', -($img.width() - can_width) / 2 + 'px');
			break;

			case 'top right':
    			$img.css('top', 0);
    			$img.css('right', 0);
			break;

			case 'center right':
    			$img.css('top', -($img.height() - can_heigh) / 2 + 'px');
    			$img.css('right', 0);
			break;

			case 'center left':
    			$img.css('top', -($img.height() - can_heigh) / 2 + 'px');
    			$img.css('left', 0);
			break;

			case 'bottom right':
    			$img.css('bottom', 0);
    			$img.css('right', 0);
			break;

			case 'bottom center':
    			$img.css('bottom', 0);
    			$img.css('left', -($img.width() - can_width) / 2 + 'px');
			break;

			case 'bottom left':
    			$img.css('bottom', 0);
    			$img.css('left', 0);
			break;

		}

		$img.hide();

		//showImage();

		//function showImage() {
			options.onBeforeShow.call(this);
			$img.fadeIn('slow', options.onAfterShow.call(this));
		//}

		options.method = oldmethod;

	};

    jQuery(this).each(function (i) {

		$img = $(this);
		$img.css({position: 'absolute', left: '-999em'});

		var orgSrc = this.src;
		if (!$.browser.msie) {
			this.src = ""; //ie will do funky things if this is here (show the image as an X, only show half of the image, etc)
		}
		$(this).bind('load', function(){
		    $(this).unbind('load');
			$self.resize($(this));
		});
		if (!$.browser.msie) {
			this.src = orgSrc; //needed for potential cached images
		} else if (this.complete || this.complete === undefined) {
			this.src = orgSrc;
			$(this).trigger('load');
		}

	});

	// allow jQuery chaining
	return this;

};


(function($){

	/* rewIDX_SLIDES */
	$.fn.rewIDX_SLIDES = function(options) {
        return this.each(function() {
            $.innerfade(this, options);
        });
    };

    $.innerfade = function(container, options) {
        var settings = {
            'speed':            'slow',
            'timeout':          5000,
            'order':			'sequential'
        };
        if (options) $.extend(settings, options);

        var elements = $(container).children();

        if (elements.length > 1) {
            $(container).css('position', 'relative');
            for (var i = 0; i < elements.length; i++) {
                $(elements[i]).css('z-index', String(elements.length-i)).css('position', 'absolute').hide();
            };
			setTimeout(function() {
				$.innerfade.next(elements, settings, 1, 0);
			}, settings.timeout);
			$(elements[0]).show();
        }
    };

    $.innerfade.next = function(elements, settings, current, last) {

		if(settings.order == 'random') { elements[current] = elements.get(Math.random()*elements.length())}

		$(elements[last]).fadeOut(settings.speed);
		$(elements[current]).fadeIn(settings.speed, function(){});
		$(elements[current]).find('img').not('.resized').rewIDX_IMGCANVAS({'method':'crop'});

		if ((current + 1) < elements.length) {
			current = current + 1;
			last = current - 1;
		} else {
			current = 0;
			last = elements.length - 1;
		}

        setTimeout((function() {
            $.innerfade.next(elements, settings, current, last);
        }), settings.timeout);
    };

	/* rewIDX_IMGCANVAS */
	jQuery.fn.rewIDX_IMGCANVAS = function(options) {
		var $self = $(this);
		var defaults = {
			method: 'crop',
			align: 'center'
		};
		var options = $.extend(defaults, options);
		jQuery(this).each(function(i) {

			$self.resize = function ($img) {

				/* the canvas */
				$imgCanvas 	= $img.parent();
				$imgCanvasW	= $imgCanvas.width();
				$imgCanvasH	= $imgCanvas.height();

				if($imgCanvasW > $imgCanvasH) {
					$imgCanvasAspect = 'landscape';
					$imgCanvasRatioH = 1;
					$imgCanvasRatioV = Math.round(($imgCanvasW / $imgCanvasH) * 100) / 100;
				} else {
					$imgCanvasAspect = 'portrait';
					$imgCanvasRatioV = 1;
					$imgCanvasRatioH = Math.round(($imgCanvasH / $imgCanvasW) * 100) / 100;
				}

				/* the image */
				$img		= $('img', $imgCanvas);
				$imgW		= $img.width();
				$imgH		= $img.height();
				if($imgW > $imgH) {
					$imgAspect = 'landscape';
					$imgRatioH = 1;
					$imgRatioV = Math.round(($imgW / $imgH) * 100) / 100;
				} else {
					$imgAspect = 'portrait';
					$imgRatioH = 1;
					$imgRatioV = Math.round(($imgW / $imgH) * 100) / 100;
				}

				if(options.method == 'crop'){

						if($imgRatioV > $imgCanvasRatioV) {

							$img.height($imgCanvasH);
							$img.width($img.height() * $imgRatioV);

						} else {

							$img.width($imgCanvasW);
							$img.height($img.width() * Math.round(($imgH / $imgW) * 100) / 100);

						}


						/* recheck and adjust size. easiest this way */
						if($img.height() < $imgCanvasH) {
							$img.height($imgCanvasH);
							$img.width($imgCanvasH * $imgRatioV);
						}

				} else if (options.method == 'scale') {

						if($imgRatioV > $imgCanvasRatioV) {

							$img.width($imgCanvasW);
							$img.height($img.width() * Math.round(($imgH / $imgW) * 100) / 100);

						} else {

							$img.height($imgCanvasH);
							$img.height($img.width() * Math.round(($imgH / $imgW) * 100) / 100);

						}

						/* recheck and adjust size. easiest this way */
						if($img.width() > $imgCanvasW) {
							$img.width($imgCanvasW);
							$img.height($imgCanvasW * Math.round(($imgH / $imgW) * 100) / 100);
						}

				}

				/* SCALE OPTION */
				if (options.scale) {
					sImgH = $img.height() * options.scale;
					sImgW = $img.width() * options.scale;
					$img.width(sImgW); $img.height(sImgH);
				}

				$imgCanvas.css({position: 'relative'});
				$img.css({position: 'absolute'});

				/* ALIGN OPTION */
				switch (options.align) {

					case 'center':
						$img.css('top', -($img.height() - $imgCanvasH) / 2 + 'px');
						$img.css('left', -($img.width() - $imgCanvasW) / 2 + 'px');
					break;

					case 'top left':
						$img.css({'top': 0, 'left': 0});
					break;

					case 'top center':
						$img.css('top', 0);
						$img.css('left', -($img.width() - $imgCanvasW) / 2 + 'px');
					break;

					case 'top right':
						$img.css('top', 0);
						$img.css('right', 0);
					break;

					case 'center right':
						$img.css('top', -($img.height() - $imgCanvasH) / 2 + 'px');
						$img.css('right', 0);
					break;

					case 'center left':
						$img.css('top', -($img.height() - $imgCanvasH) / 2 + 'px');
						$img.css('left', 0);
					break;

					case 'bottom right':
						$img.css('bottom', 0);
						$img.css('right', 0);
					break;

					case 'bottom center':
						$img.css('bottom', 0);
						$img.css('left', -($img.width() - $imgCanvasW) / 2 + 'px');
					break;

					case 'bottom left':
						$img.css('bottom', 0);
						$img.css('left', 0);
					break;

				}

				$img.addClass('resized');

			}

			jQuery(this).each(function (i) {

				$img = $(this);

				var orgSrc = this.src;

				if (!$.browser.msie) {
					this.src = ""; //ie will do funky things if this is here (show the image as an X, only show half of the image, etc)
				}
				$(this).bind('load', function(){
					$(this).unbind('load');
					if($(this).parent().height() > 0) {
						$self.resize($(this));
					}
				});
				if (!$.browser.msie) {
					this.src = orgSrc; //needed for potential cached images
				} else if (this.complete || this.complete === undefined) {
					this.src = orgSrc;
					$(this).trigger('load');
				}

			});

			return this;

		});

	};

})(jQuery);

/**
 * $.splitList
 */
(function($) {
    $.fn.splitList = function(options) {
        var defaults = { itemsPerColumn: 10 };
        var opts = $.extend($.fn.splitList.defaults, options);
        this.each(function() {
            var ul = this;
            var li = $(ul).children("li");
            $(ul).empty();
            for (var i = 0; i < opts.itemsPerColumn; i++) $(ul).append(li[i]);
            var curUl = ul;
            $(curUl).css("float", "left");
            for (var i = 1; i < li.length / opts.itemsPerColumn; i++) {
                var newUl = document.createElement("ul");
                for (var j = opts.itemsPerColumn * i; j < (opts.itemsPerColumn * i) + opts.itemsPerColumn; j++) $(newUl).append(li[j]);
                $(newUl).attr('class', $(curUl).attr('class')).css("float", "left");
                $(curUl).after(newUl);
                curUl = newUl;
            }
        });
    };
})(jQuery);

/*
 * jQuery UI Position 1.8.5
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Position
 */
(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.scrollTo&&d.document){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j=
{top:b.of.pageY,left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/
2;if(b.at[1]==="bottom")j.top+=k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+parseInt(c.curCSS(this,"marginRight",true))||0,w=m+q+parseInt(c.curCSS(this,"marginBottom",true))||0,i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]===
"center")i.top-=m/2;i.left=parseInt(i.left);i.top=parseInt(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();
b.left=d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];
b.left+=a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=
c(b),g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery);
/**
 * jQuery Facebox Plugin (Redux)
 */
(function($) {

    /* jQuery.fn.facebox */
    $.facebox = function(options) {
        
        /* Instance */
        var $self = this;

        /* Facebox Defaults */
        $self.defaults = {
            opacity      : 0.3,
            overlay      : true,
            modal        : true,
            noclose      : false,
            //
            div          : false,
            ajax         : false,
            image        : false,
            data         : false,
            iframe       : false,
            //
            title        : '&nbsp;',
            css_top      : 'auto', // auto or number of pixels
            css_left     : 'auto', // auto or number of pixels
            loadingImage : '/img/facebox/loading.gif',
            closeImage   : '/img/facebox/closelabel.gif',
            imageTypes   : [ 'png', 'jpg', 'jpeg', 'gif' ],
            faceboxHtml  : '\
                <div id="facebox" style="display:none;"> \
                    <div class="popup"> \
                        <table> \
                          <tbody> \
                            <tr> \
                              <td class="tl"/><td class="b"/><td class="tr"/> \
                            </tr> \
                            <tr> \
                              <td class="b"/> \
                              <td class="body"> \
                                <div class="titlebar"> \
                                  <span class="title">&nbsp;</span> \
                                  <a href="#" class="close">Close</a> \
                                </div> \
                                <div class="content"> \
                                </div> \
                              </td> \
                              <td class="b"/> \
                            </tr> \
                            <tr> \
                              <td class="bl"/><td class="b"/><td class="br"/> \
                            </tr> \
                          </tbody> \
                        </table> \
                      </div> \
                </div>'
        };

        /* Instance Options */
        $self.options = $.extend($self.defaults, options);

        /* Initilized Boolean */
        $self.initilized = false;

        /* $.facebox.makeCompatible */
        $self.makeCompatible = function () {
            $self.options.loadingImage = $self.options.loading_image || $self.options.loadingImage;
            $self.options.closeImage   = $self.options.close_image   || $self.options.closeImage;
            $self.options.imageTypes   = $self.options.image_types   || $self.options.imageTypes;
            $self.options.faceboxHtml  = $self.options.facebox_html  || $self.options.faceboxHtml;
        }

        /* $facebox.close */
        $self.close = function () {
            $(document).unbind('close.facebox');
            $(document).unbind('keydown.facebox');
            $('#facebox').fadeOut(function() {
                $('#facebox .content').removeClass().addClass('content');
                $self.hideOverlay();
                $('#facebox .loading').remove();
            }).remove();
            return false;
        }

        /* $facebox.skipOverlay */
        $self.skipOverlay = function () {
            return $self.options.overlay == false || $self.options.opacity === null;
        }

        /* $facebox.showOverlay */
        $self.showOverlay = function () {
            if ($self.skipOverlay()) return;
            if ($('#facebox_overlay').length == 0) {
                $("body").append('<div id="facebox_overlay" class="facebox_hide"></div>');
            }
            $('#facebox_overlay').hide().addClass("facebox_overlayBG").css('opacity', $self.options.opacity).click(function() {
                if ($self.options.modal != true) {
                    $self.close();
                }
            }).fadeIn(200);
            return false;
        }

        /* $facebox.hideOverlay */
        $self.hideOverlay = function () {
            if ($self.skipOverlay()) return;
            $('#facebox_overlay').fadeOut(200, function() {
                $("#facebox_overlay").removeClass("facebox_overlayBG");
                $("#facebox_overlay").addClass("facebox_hide");
                $("#facebox_overlay").remove();
            });
            return false;
        }

        /* $facebox.fillFaceboxFromHref */
        $self.fillFaceboxFromHref = function (href) {

            // div
            if (href.match(/#/)) {
                var url    = window.location.href.split('#')[0];
                var target = href.replace(url, '');
                if (target == '#') return;
                $self.reveal($(target).html());

            // image
            } else if (href.match($self.options.imageTypesRegexp)) {
                $self.fillFaceboxFromImage(href);

            // ajax
            } else {
                $self.fillFaceboxFromAjax(href);

            }

        }

        /* $facebox.fillFaceboxFromImage */
        $self.fillFaceboxFromImage = function (href) {
            var image = new Image();
            image.onload = function () {
                $self.reveal('<div class="image"><img src="' + image.src + '" /></div>');
            }
            image.src = href;
        }

        /* $facebox.fillFaceboxFromAjax */
        $self.fillFaceboxFromAjax = function (href) {
            $.get(href, function(data) {
                $self.reveal(data);
            });
        }

        /* $facebox.fillFaceboxFromIFrame */
        $self.fillFaceboxFromIFrame = function (href) {
            
            /* Append facebox_Frame=true to URL Query */
            var href = (href.indexOf('?') != -1) ? href + '&facebox_Frame=true' : href + '?facebox_Frame=false';

            /* Remove Existing IFrame */
            $('#facebox-iframe').remove();
            
            /* Build IFrame */
            href = href.replace(/\"/g, "'");
            var iframe = $('<iframe id="facebox-iframe" src="' + href + '" width="100%" height="100" frameborder="0" scrolling="no" style="overflow-x: hidden;" />');
            
            /*
            iframe.load(function () {
                var height = this.contentWindow.document.body.scrollHeight;
                $(this).css('height', height + 'px');
            });
            */
            
            $self.reveal(iframe);

        }

        /* $facebox.reveal */
        $self.reveal = function (data) {
            $('#facebox .content').append(data);
            $('#facebox .loading').remove();
            $('#facebox .body').children().fadeIn('normal');
            if ($self.options.noclose == true) {
                $('#facebox .titlebar a.close').hide();
            } else {
                $('#facebox .titlebar a.close').show();
            }
            $('#facebox').css('left', $(window).width() / 2 - ($('#facebox table').width() / 2));
        }

        /* $facebox.getPageScroll */
        $self.getPageScroll = function () {
            var xScroll, yScroll;
            if (self.pageYOffset) {
                yScroll = self.pageYOffset;
                xScroll = self.pageXOffset;
            } else if (document.documentElement && document.documentElement.scrollTop) {     // Explorer 6 Strict
                yScroll = document.documentElement.scrollTop;
                xScroll = document.documentElement.scrollLeft;
            } else if (document.body) {// all other Explorers
                yScroll = document.body.scrollTop;
                xScroll = document.body.scrollLeft;
            }
            return new Array(xScroll, yScroll);
        }

        /* $facebox.getPageHeight */
        $self.getPageHeight = function () {
            var windowHeight;
            if (self.innerHeight) { // all except Explorer
                windowHeight = self.innerHeight;
            } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
                windowHeight = document.documentElement.clientHeight;
            } else if (document.body) { // other Explorers
                windowHeight = document.body.clientHeight;
            }
            return windowHeight;
        }

        /* $.facebox.init */
        $self.init = function () {

            /* Return if Already Initilized */
            if ($self.initilized) {
                return true;
            } else {
                $self.initilized = true;
            }

            /* Make Compatible */
            $self.makeCompatible();

            var imageTypes = $self.options.imageTypes.join('|');
            $self.options.imageTypesRegexp = new RegExp('\.(' + imageTypes + ')$', 'i');

            /* Append Facebox Content to Document Body */
            $('body').append($self.options.faceboxHtml);

            /* Preload Close & Loading Images */
            var preload = [ new Image(), new Image() ];
            preload[0].src = $self.options.closeImage;
            preload[1].src = $self.options.loadingImage;

            /* Preload Images */
            $('#facebox').find('.b:first, .bl').each(function() {
                preload.push(new Image());
                preload.slice(-1).src = $(this).css('background-image').replace(/url\((.+)\)/, '$1');
            });

            /* Close Button */
            $('#facebox .close').click($self.close);
            $('#facebox .close_image').attr('src', $self.options.closeImage);

        }

        /* $.facebox.loading */
        $self.loading = function() {

            $self.init();

            if ($('#facebox .loading').length == 1) return true;

            $self.showOverlay();

            $('#facebox .content').empty();
            $('#facebox .body').children().hide().end().
            append('<div class="loading"><img src="' + $self.options.loadingImage + '"/></div>')

            $('#facebox').css({
                top:    $self.options.css_top  != 'auto' ? $self.options.css_top  : $self.getPageScroll()[1] + ($self.getPageHeight() / 10),
                left:   $self.options.css_left != 'auto' ? $self.options.css_left : $(window).width() / 2 - 205
            }).show()

            if (typeof($self.options.title) != 'undefined') {
                $('#facebox .titlebar span.title').html($self.options.title);
            }

            if (typeof($self.options.width) != 'undefined') {
                $('#facebox .body').width($self.options.width);
            }

            if (typeof($self.options.height) != 'undefined') {
                $('#facebox .body').height($self.options.height);
            }

            $(document).bind('keydown.facebox', function(e) {
                if ($self.options.modal != true) {
                    if (e.keyCode == 27) {
                        $self.close();
                    }
                }
                return true;
            });
            
            $(document).bind('close.facebox', function(e) {
                $self.close();
            });

        }

        /* Initilize Facebox */
        $self.init();

        /* Loading */
        $self.loading();

        /* AJAX */
        if ($self.options.ajax) {
            $self.fillFaceboxFromAjax($self.options.ajax);

        /* IFrame */
        } else if ($self.options.iframe) {
            $self.fillFaceboxFromIFrame($self.options.iframe);

        /* Image */
        } else if ($self.options.image) {
            $self.fillFaceboxFromImage($self.options.image);

        /* Container */
        } else if ($self.options.div) {
            $self.fillFaceboxFromHref($self.options.div);

        /* Load Data */
        } else {
            $self.reveal($self.options.data);

        }

        /* Return Facebox Instance */
        return $self;

    };

})(jQuery);
/**
 * REW Forms
 */
var rewForm = function (rewform) {
    var l = rewform.length;
    for (var i = 0; i < l; i++) {
        var $form = $(rewform[i]);
        // these three lines cause a strange flash in top left corner (ON search.html ONLY)
        $form.wrapInner('<div class="form-wrap"></div>');
        $form.find('.field').wrapInner('<span class="field-iwrap"></span>');
        $form.find('.field select').wrap('<span class="select-wrap"></span>');
        //
        $form.find('.field input:text,.field input:password').wrap('<span class="input-wrap"></span>');
        $form.find('.field textarea').not('.richtext').wrap('<span class="textarea-wrap"></span>');
        $form.find('.token').wrapInner('<span class="token-iwrap"></span>');
        $form.find('legend').each(function() {
            var content = $(this).html();
            $(this).after('<h4 class="legend">'+ content +'</h4>').hide();
            $(this).remove();
         });
    }
};

$(document).ready(function() {

    /* Skin */
    var skin = 'template-06';

    /* Preload Image */
    $.preloadImages('/img/no-bookmarks.png');

    /* Business Directory, Categories */
    $('#directory-categories').splitList({'itemsPerColumn':3});
	$('#content .directory-categories:nth-child(4n)').addClass('last');
	
	$('#blog-entries .blog-entry:last-child').addClass('last');
    
    /* Tooltip Container */
    $('body').append('<div class="tooltip"></div>');

    /* Tabset Events */
    $('#content .tabset li').bind('click', function(event) {
        var target = $(event.target);
        if (target.is('li')) {
            target.find('a').trigger('click');
            return false;
        } else if (target.is('a')) {
            window.location.href = target.attr('href');
        }
    });

    /* Communities Box */
    var colNumber = (skin == 'lec3') ? 2: 3;
    $('.communities-nav ul').easyListSplitter({'colNumber': colNumber});
    $('.communities-nav ul').each(function() {
        $(this).find('li:odd').addClass('odd');
	});

    /* rewImgSizer */
    $('.agent .photos img, .office .photos img').rewImgSizer({method:'crop'});

    /* Refine Search Panels */
    $('#refine-form dl.panel, #quick-search dl.panel').each(function(i){
        $(this).find('dt').append('<span class="ico-panel-trigger"></span>');
        $(this).find('dt').bind('click', function(){
                $(this).parent('dl').toggleClass('open');
            $(this).next('dd').slideToggle();
            });
        });

    $("#content div.item").wrap('<div class="dialog">'+'<div class="bd">'+'<div class="c">'+'<div class="s">'+'</div>'+'</div>'+'</div>'+'</div>');

    $('div.dialog').prepend('<div class="hd">'+'<div class="c"></div>'+'</div>').append('<div class="ft">'+'<div class="c"></div>'+'</div>');


    $('#nav .nav.primary li div').css({'left':'-1px'}).hide();

    $('#nav .nav.primary li').hoverIntent(function() {
        $(this).find('div').show();
    }, function() {
        $(this).find('div').hide();
    });

    $('#content hr').wrap('<div class="hr"></div>');

    $('#content legend').each( function() {
        val = $(this).html();
        $(this).after('<h5 class="legend"><span>' + val + '</span></h5>');
        $(this).html('');
    });

    /* Suckerfish Check */
    if (!$('body').hasClass('enablesuckerfish')) {
        $('#nav ul ul, #nav ul div').remove();
    }

    /* Disable Form Autocomplete */
    $("form").attr("autocomplete", "off");

    /* REW Forms */
    rewForm($('form.rewfw'));

    /* REW Buttons */
    $('#content .actions a.button').each(function(){
        $button = $(this);
        $label = $(this).html();
        $classes = $(this).attr('class').replace('button','');
        $(this).wrap('<div class="button link ' + $classes + '"></div>').after('<span class="label">' + $label + '</span>');
        $(this).find('.button').live('click', function() {
            document.location = $(this).find('a').attr('href');
        });
    });

    /* REW Buttons */
    $('.rewbtn').bind({
        'mousedown'  : function() { $(this).addClass('active'); },
        'mouseleave' : function() { $(this).removeClass('active'); }
    });

    /* Autocomplete Fields */
    $('input.autocomplete').each(function () {
        var $this = $(this), multiple = $this.hasClass('single') ? false : true;
        $this.autocomplete({
            source: function (request, response) {
        		if (multiple) {
        			request.term = request.term.split(/,\s*/).pop();
        		}
                $.getJSON('/idx/inc/php/ajax/json.php?limit=10&search=' + $this.attr('name'), {
                    q : request.term,
                    search_city : function () {
                	    var search_city = $('select[name="search_city"]');
                	    if (search_city.length == 1) {
                	    	return search_city.val();
                	    } else {
                	    	return '';
                	    }
                    }
                }, function (data) {
                    var parsed = [];
                    var rows   = data.options ? data.options : [];
                    for (var i=0; i < rows.length; i++) {
                        var row = $.trim(rows[i].title);
                        if (row) {
                            row = row.split('|');
                            parsed.push({
                                value: row[0],
                                label: row[0]
                            });
                        }
                    }
                    response(parsed);
                });
            },
            focus: function () {
                return false;
            },
            select: function (event, ui) {
            	if (multiple) {
	                var terms = this.value.split(/,\s*/);
	                terms.pop();
	                terms.push(ui.item.value);
	                terms.push('');
	                this.value = terms.join(', ');
	                return false;
            	}
            }
        });
    });

    /* IDX Nav Toolbar */
    $('#nav-supplementary li a').mouseover(function() { $('.menu').hide(); });
    $('.menu').hover(function() {}, function() { $('.menu').hide(); });

    /* Compact Listings */
    var $compact = $('.compact .listing');
    $compact.live('mouseover', function() { $(this).addClass('hover'); });
    $compact.live('mouseout', function() { $(this).removeClass('hover'); });
    $compact.live('click', function() {
        document.location = $(this).find('a:first').attr('href');
    });

    /* IDX Search Result: Resize Thumbnails */
    $('.set .photos img').rewImgSizer({ method: 'crop', scale: 1 });

});
/**
 * Set Cookie
 * @param name
 * @param value
 * @param expires
 * @return
 */
var rew_setCookie = function (name, value, expires) {
    if (typeof(expires) == 'undefined') {
        var exp = new Date(); //set new date object
        exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 30)); //set it 30 days ahead
    }
    document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? "" : "; expires=" + expires.toGMTString());
};

/**
 * Get Cookie
 * @param c_name
 * @return
 */
var rew_getCookie = function (c_name) {
    if (document.cookie.length > 0) {
        c_start = document.cookie.indexOf(c_name + "=");
        if (c_start != -1) {
            c_start = c_start + c_name.length + 1;
            c_end = document.cookie.indexOf(";", c_start);
            if (c_end == -1) c_end = document.cookie.length;
            return unescape(document.cookie.substring(c_start, c_end));
        }
    }
    return "";
};

/**
 * Open Facebox Iframe
 * @param href
 * @return
 */
var openPage = function openPage (href) {
    closeFacebox();
    $.facebox({'iframe' : href});
};

/**
 * Close Facebox
 * @return
 */
var closeFacebox = function () {
    $(document).trigger('close.facebox');
};

/**
 * Re-Load User Search Tools
 * @return
 */
var reloadUserTools = function () {
    $.ajax({
        'url' : '?',
        'success' : function (data) {
            var data = $('#login', data).html();
            if (typeof(data) != 'undefined') {
                $('#login', window.parent.document.body).html(data);
                if (typeof(Cufon) != 'undefined') Cufon.refresh();
            }
        }
    });
};

/**
 * Bookmarking IDX Listing
 * @param mls_number
 * @param container
 * @return
 */
var bookmarkListing = function (mls_number, container) {

    /* POST HTTP Request, Expect JSON */
    $.ajax({
        'url'      : '/idx/inc/php/ajax/json.php?bookmarkListing',
        'type'     : 'POST',
        'dataType' : 'json',
        'data'     : {
            'mls_number' : mls_number
        },
        'error'    : function (XMLHttpRequest, textStatus, errorThrown) {
            alert('An error has occurred. Listing could not be saved.');
            return;
        },
        'success'  : function (json, textStatus) {

            /* Return Code */
            if (json.returnCode == 200) {

                /* Success - Saved */
                if (json.added) $(container).addClass('saved');

                /* Success - Removed */
                if (json.removed) $(container).removeClass('saved');

                /* reload favs menu */
                $('#favs-menu').load('/idx/inc/php/ajax/favourites.php', function () {
                    $(this).addClass('loaded');
                });

            } else {

                /* Require Registration */
                if (json.register) {

                    /* Registration Form Overlay */
                    openPage(json.register);

                } else {

                    /* Error Occurred */
                    alert('An error has occurred. Listing could not be saved.');

                }
            }
            return;
        }
    });

};

/**
 * Save IDX Search
 * @param search
 * @return
 */
var saveSearch = function (search) {

    /* Search Object */
    search = search ? search : {};

    /* Create Container */
    var content  = $('<div />', {
        'id'  : 'save-search'
    });

    /* Create Container */
    var message  = $('<div />', {
        'class'  : 'response'
    });

    /* Create Form */
    var form  = $('<form />', {
        'class'  : 'rewfw',
        'autocomplete' : 'off'
    });
    
    /* Default Title? */
    var search_title = search.search_title ? search.search_title : search.save_prompt;

    /* Search Title */
    var input_text = $('<input />', {
        type  : 'text',
        name  : 'search_title',
        value : (search_title != '') ? search_title : 'My Saved Search'
    });

    /* Wrap Form */
    form.wrapInner('<div class="form-wrap"><fieldset><ul></ul></fieldset><div class="buttonset"><button type="submit" name="search" value="Save Search" class="rewbtn primary"><b><i>Save Search</i></b></button></div></div>');

    /* Add Inputs to Form */
    form.find('ul').append(input_text);

    /* Wrap Form Inputs */
    input_text.wrap('<span class="input-wrap" />').wrap('<li><div class="field rpd-gridcolx6"><span class="field-iwrap"><label>Search Title</label></span></div></li>');

    /* Container Content */
    content.append(message).append(form);

    /* Form Submit Event */
    form.bind('submit', function () {

        /* Reset Message */
        message.html('');

        /* Search Title */
        var search_title = $(this).find('input[name="search_title"]').val();

        /* Set Search Title */
        search.search_title = search_title;

        /* Save Search Action */
        search.save_search = true;

        /* AJAX Request */
        $.ajax({
            'url'      : '/idx/inc/php/ajax/json.php?saveSearch',
            'type'     : 'POST',
            'dataType' : 'json',
            'data'     : search,
            'error'    : function (XMLHttpRequest, textStatus, errorThrown) {
                //alert('AJAX Error');
            },
            'success'  : function (json, textStatus) {
                if (typeof(json) == 'undefined' || !json) return;
                if (json.success) {
                    if (search.create_search && search.lead_id) {
                        window.location = '/backend/leadman/leads/lead_searches.php?lead_id=' + search.lead_id;
                    } else {
                        $(document).trigger('close.facebox');
                        if (json.search) {
                            $('#results-message').html('<p>You are viewing your <strong>"' + search.search_title + '"</strong> saved search. <a href="?edit_search=true&saved_search_id=' + json.search + '">Edit this Search</a></p>');
                        }
                    }
                } else {
                    if (json.error) message.html('<div class="msg errors"><h5 class="title">Oops, There was an Error with your Form Submission!</h5><ul><li>' + json.error + '</li></ul></div>');
                    if (json.redirect) {
                        openPage(json.redirect);
                    }
                }
            }
        });

        /* Return */
        return false;

    });

    /* Trigger Submit */
    if (search.trigger) {
        form.trigger('submit');
    }

    /* Load Facebox */
    $.facebox({
        title : 'Save this Search',
        data : content
    });

    /* Return */
    return;

};

/**
 * Edit IDX Search
 * @param search
 * @return
 */
var editSearch = function (search) {

    /* Search Object */
    search = search ? search : {};

    /* AJAX Request */
    $.ajax({
        'url'      : '/idx/inc/php/ajax/json.php?editSearch',
        'type'     : 'POST',
        'dataType' : 'json',
        'data'     : search,
        'success'  : function (json, textStatus) {
            if (typeof(json) == 'undefined' || !json) return;
            if (json.success) {
                if (search.edit_search && search.lead_id) {
                    window.location = '/backend/leadman/leads/lead_searches.php?lead_id=' + search.lead_id;
                } else if (search.saved_search_id && search.search_by == 'map') {
                    window.location = '/idx/map/' + search.saved_search_id + '/';
                } else if (search.saved_search_id) {
                    window.location = '/idx/search/' + search.saved_search_id + '/';
                }
            } else if (json.error) {
                alert(json.error);
            }
        }
    });

    /* Return */
    return;

};
/*
 * Copyright (c) 2009 Simo Kinnunen.
 * Licensed under the MIT license.
 *
 * @version 1.09
 */
var Cufon=(function(){var m=function(){return m.replace.apply(null,arguments)};var x=m.DOM={ready:(function(){var C=false,E={loaded:1,complete:1};var B=[],D=function(){if(C){return}C=true;for(var F;F=B.shift();F()){}};if(document.addEventListener){document.addEventListener("DOMContentLoaded",D,false);window.addEventListener("pageshow",D,false)}if(!window.opera&&document.readyState){(function(){E[document.readyState]?D():setTimeout(arguments.callee,10)})()}if(document.readyState&&document.createStyleSheet){(function(){try{document.body.doScroll("left");D()}catch(F){setTimeout(arguments.callee,1)}})()}q(window,"load",D);return function(F){if(!arguments.length){D()}else{C?F():B.push(F)}}})(),root:function(){return document.documentElement||document.body}};var n=m.CSS={Size:function(C,B){this.value=parseFloat(C);this.unit=String(C).match(/[a-z%]*$/)[0]||"px";this.convert=function(D){return D/B*this.value};this.convertFrom=function(D){return D/this.value*B};this.toString=function(){return this.value+this.unit}},addClass:function(C,B){var D=C.className;C.className=D+(D&&" ")+B;return C},color:j(function(C){var B={};B.color=C.replace(/^rgba\((.*?),\s*([\d.]+)\)/,function(E,D,F){B.opacity=parseFloat(F);return"rgb("+D+")"});return B}),fontStretch:j(function(B){if(typeof B=="number"){return B}if(/%$/.test(B)){return parseFloat(B)/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}[B]||1}),getStyle:function(C){var B=document.defaultView;if(B&&B.getComputedStyle){return new a(B.getComputedStyle(C,null))}if(C.currentStyle){return new a(C.currentStyle)}return new a(C.style)},gradient:j(function(F){var G={id:F,type:F.match(/^-([a-z]+)-gradient\(/)[1],stops:[]},C=F.substr(F.indexOf("(")).match(/([\d.]+=)?(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)/ig);for(var E=0,B=C.length,D;E<B;++E){D=C[E].split("=",2).reverse();G.stops.push([D[1]||E/(B-1),D[0]])}return G}),quotedList:j(function(E){var D=[],C=/\s*((["'])([\s\S]*?[^\\])\2|[^,]+)\s*/g,B;while(B=C.exec(E)){D.push(B[3]||B[1])}return D}),recognizesMedia:j(function(G){var E=document.createElement("style"),D,C,B;E.type="text/css";E.media=G;try{E.appendChild(document.createTextNode("/**/"))}catch(F){}C=g("head")[0];C.insertBefore(E,C.firstChild);D=(E.sheet||E.styleSheet);B=D&&!D.disabled;C.removeChild(E);return B}),removeClass:function(D,C){var B=RegExp("(?:^|\\s+)"+C+"(?=\\s|$)","g");D.className=D.className.replace(B,"");return D},supports:function(D,C){var B=document.createElement("span").style;if(B[D]===undefined){return false}B[D]=C;return B[D]===C},textAlign:function(E,D,B,C){if(D.get("textAlign")=="right"){if(B>0){E=" "+E}}else{if(B<C-1){E+=" "}}return E},textShadow:j(function(F){if(F=="none"){return null}var E=[],G={},B,C=0;var D=/(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)|(-?[\d.]+[a-z%]*)|,/ig;while(B=D.exec(F)){if(B[0]==","){E.push(G);G={};C=0}else{if(B[1]){G.color=B[1]}else{G[["offX","offY","blur"][C++]]=B[2]}}}E.push(G);return E}),textTransform:(function(){var B={uppercase:function(C){return C.toUpperCase()},lowercase:function(C){return C.toLowerCase()},capitalize:function(C){return C.replace(/\b./g,function(D){return D.toUpperCase()})}};return function(E,D){var C=B[D.get("textTransform")];return C?C(E):E}})(),whiteSpace:(function(){var D={inline:1,"inline-block":1,"run-in":1};var C=/^\s+/,B=/\s+$/;return function(H,F,G,E){if(E){if(E.nodeName.toLowerCase()=="br"){H=H.replace(C,"")}}if(D[F.get("display")]){return H}if(!G.previousSibling){H=H.replace(C,"")}if(!G.nextSibling){H=H.replace(B,"")}return H}})()};n.ready=(function(){var B=!n.recognizesMedia("all"),E=false;var D=[],H=function(){B=true;for(var K;K=D.shift();K()){}};var I=g("link"),J=g("style");function C(K){return K.disabled||G(K.sheet,K.media||"screen")}function G(M,P){if(!n.recognizesMedia(P||"all")){return true}if(!M||M.disabled){return false}try{var Q=M.cssRules,O;if(Q){search:for(var L=0,K=Q.length;O=Q[L],L<K;++L){switch(O.type){case 2:break;case 3:if(!G(O.styleSheet,O.media.mediaText)){return false}break;default:break search}}}}catch(N){}return true}function F(){if(document.createStyleSheet){return true}var L,K;for(K=0;L=I[K];++K){if(L.rel.toLowerCase()=="stylesheet"&&!C(L)){return false}}for(K=0;L=J[K];++K){if(!C(L)){return false}}return true}x.ready(function(){if(!E){E=n.getStyle(document.body).isUsable()}if(B||(E&&F())){H()}else{setTimeout(arguments.callee,10)}});return function(K){if(B){K()}else{D.push(K)}}})();function s(D){var C=this.face=D.face,B={"\u0020":1,"\u00a0":1,"\u3000":1};this.glyphs=D.glyphs;this.w=D.w;this.baseSize=parseInt(C["units-per-em"],10);this.family=C["font-family"].toLowerCase();this.weight=C["font-weight"];this.style=C["font-style"]||"normal";this.viewBox=(function(){var F=C.bbox.split(/\s+/);var E={minX:parseInt(F[0],10),minY:parseInt(F[1],10),maxX:parseInt(F[2],10),maxY:parseInt(F[3],10)};E.width=E.maxX-E.minX;E.height=E.maxY-E.minY;E.toString=function(){return[this.minX,this.minY,this.width,this.height].join(" ")};return E})();this.ascent=-parseInt(C.ascent,10);this.descent=-parseInt(C.descent,10);this.height=-this.ascent+this.descent;this.spacing=function(L,N,E){var O=this.glyphs,M,K,G,P=[],F=0,J=-1,I=-1,H;while(H=L[++J]){M=O[H]||this.missingGlyph;if(!M){continue}if(K){F-=G=K[H]||0;P[I]-=G}F+=P[++I]=~~(M.w||this.w)+N+(B[H]?E:0);K=M.k}P.total=F;return P}}function f(){var C={},B={oblique:"italic",italic:"oblique"};this.add=function(D){(C[D.style]||(C[D.style]={}))[D.weight]=D};this.get=function(H,I){var G=C[H]||C[B[H]]||C.normal||C.italic||C.oblique;if(!G){return null}I={normal:400,bold:700}[I]||parseInt(I,10);if(G[I]){return G[I]}var E={1:1,99:0}[I%100],K=[],F,D;if(E===undefined){E=I>400}if(I==500){I=400}for(var J in G){if(!k(G,J)){continue}J=parseInt(J,10);if(!F||J<F){F=J}if(!D||J>D){D=J}K.push(J)}if(I<F){I=F}if(I>D){I=D}K.sort(function(M,L){return(E?(M>=I&&L>=I)?M<L:M>L:(M<=I&&L<=I)?M>L:M<L)?-1:1});return G[K[0]]}}function r(){function D(F,G){if(F.contains){return F.contains(G)}return F.compareDocumentPosition(G)&16}function B(G){var F=G.relatedTarget;if(!F||D(this,F)){return}C(this,G.type=="mouseover")}function E(F){C(this,F.type=="mouseenter")}function C(F,G){setTimeout(function(){var H=d.get(F).options;m.replace(F,G?h(H,H.hover):H,true)},10)}this.attach=function(F){if(F.onmouseenter===undefined){q(F,"mouseover",B);q(F,"mouseout",B)}else{q(F,"mouseenter",E);q(F,"mouseleave",E)}}}function u(){var C=[],D={};function B(H){var E=[],G;for(var F=0;G=H[F];++F){E[F]=C[D[G]]}return E}this.add=function(F,E){D[F]=C.push(E)-1};this.repeat=function(){var E=arguments.length?B(arguments):C,F;for(var G=0;F=E[G++];){m.replace(F[0],F[1],true)}}}function A(){var D={},B=0;function C(E){return E.cufid||(E.cufid=++B)}this.get=function(E){var F=C(E);return D[F]||(D[F]={})}}function a(B){var D={},C={};this.extend=function(E){for(var F in E){if(k(E,F)){D[F]=E[F]}}return this};this.get=function(E){return D[E]!=undefined?D[E]:B[E]};this.getSize=function(F,E){return C[F]||(C[F]=new n.Size(this.get(F),E))};this.isUsable=function(){return !!B}}function q(C,B,D){if(C.addEventListener){C.addEventListener(B,D,false)}else{if(C.attachEvent){C.attachEvent("on"+B,function(){return D.call(C,window.event)})}}}function v(C,B){var D=d.get(C);if(D.options){return C}if(B.hover&&B.hoverables[C.nodeName.toLowerCase()]){b.attach(C)}D.options=B;return C}function j(B){var C={};return function(D){if(!k(C,D)){C[D]=B.apply(null,arguments)}return C[D]}}function c(F,E){var B=n.quotedList(E.get("fontFamily").toLowerCase()),D;for(var C=0;D=B[C];++C){if(i[D]){return i[D].get(E.get("fontStyle"),E.get("fontWeight"))}}return null}function g(B){return document.getElementsByTagName(B)}function k(C,B){return C.hasOwnProperty(B)}function h(){var C={},B,F;for(var E=0,D=arguments.length;B=arguments[E],E<D;++E){for(F in B){if(k(B,F)){C[F]=B[F]}}}return C}function o(E,M,C,N,F,D){var K=document.createDocumentFragment(),H;if(M===""){return K}var L=N.separate;var I=M.split(p[L]),B=(L=="words");if(B&&t){if(/^\s/.test(M)){I.unshift("")}if(/\s$/.test(M)){I.push("")}}for(var J=0,G=I.length;J<G;++J){H=z[N.engine](E,B?n.textAlign(I[J],C,J,G):I[J],C,N,F,D,J<G-1);if(H){K.appendChild(H)}}return K}function l(D,M){var C=D.nodeName.toLowerCase();if(M.ignore[C]){return}var E=!M.textless[C];var B=n.getStyle(v(D,M)).extend(M);var F=c(D,B),G,K,I,H,L,J;if(!F){return}for(G=D.firstChild;G;G=I){K=G.nodeType;I=G.nextSibling;if(E&&K==3){if(H){H.appendData(G.data);D.removeChild(G)}else{H=G}if(I){continue}}if(H){D.replaceChild(o(F,n.whiteSpace(H.data,B,H,J),B,M,G,D),H);H=null}if(K==1){if(G.firstChild){if(G.nodeName.toLowerCase()=="cufon"){z[M.engine](F,null,B,M,G,D)}else{arguments.callee(G,M)}}J=G}}}var t=" ".split(/\s+/).length==0;var d=new A();var b=new r();var y=new u();var e=false;var z={},i={},w={autoDetect:false,engine:null,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,selector:(window.Sizzle||(window.jQuery&&function(B){return jQuery(B)})||(window.dojo&&dojo.query)||(window.Ext&&Ext.query)||(window.YAHOO&&YAHOO.util&&YAHOO.util.Selector&&YAHOO.util.Selector.query)||(window.$$&&function(B){return $$(B)})||(window.$&&function(B){return $(B)})||(document.querySelectorAll&&function(B){return document.querySelectorAll(B)})||g),separate:"words",textless:{dl:1,html:1,ol:1,table:1,tbody:1,thead:1,tfoot:1,tr:1,ul:1},textShadow:"none"};var p={words:/\s/.test("\u00a0")?/[^\S\u00a0]+/:/\s+/,characters:"",none:/^/};m.now=function(){x.ready();return m};m.refresh=function(){y.repeat.apply(y,arguments);return m};m.registerEngine=function(C,B){if(!B){return m}z[C]=B;return m.set("engine",C)};m.registerFont=function(D){if(!D){return m}var B=new s(D),C=B.family;if(!i[C]){i[C]=new f()}i[C].add(B);return m.set("fontFamily",'"'+C+'"')};m.replace=function(D,C,B){C=h(w,C);if(!C.engine){return m}if(!e){n.addClass(x.root(),"cufon-active cufon-loading");n.ready(function(){n.addClass(n.removeClass(x.root(),"cufon-loading"),"cufon-ready")});e=true}if(C.hover){C.forceHitArea=true}if(C.autoDetect){delete C.fontFamily}if(typeof C.textShadow=="string"){C.textShadow=n.textShadow(C.textShadow)}if(typeof C.color=="string"&&/^-/.test(C.color)){C.textGradient=n.gradient(C.color)}else{delete C.textGradient}if(!B){y.add(D,arguments)}if(D.nodeType||typeof D=="string"){D=[D]}n.ready(function(){for(var F=0,E=D.length;F<E;++F){var G=D[F];if(typeof G=="string"){m.replace(C.selector(G),C,true)}else{l(G,C)}}});return m};m.set=function(B,C){w[B]=C;return m};return m})();Cufon.registerEngine("canvas",(function(){var b=document.createElement("canvas");if(!b||!b.getContext||!b.getContext.apply){return}b=null;var a=Cufon.CSS.supports("display","inline-block");var e=!a&&(document.compatMode=="BackCompat"||/frameset|transitional/i.test(document.doctype.publicId));var f=document.createElement("style");f.type="text/css";f.appendChild(document.createTextNode(("cufon{text-indent:0;}@media screen,projection{cufon{display:inline;display:inline-block;position:relative;vertical-align:middle;"+(e?"":"font-size:1px;line-height:1px;")+"}cufon cufontext{display:-moz-inline-box;display:inline-block;width:0;height:0;overflow:hidden;text-indent:-10000in;}"+(a?"cufon canvas{position:relative;}":"cufon canvas{position:absolute;}")+"}@media print{cufon{padding:0;}cufon canvas{display:none;}}").replace(/;/g,"!important;")));document.getElementsByTagName("head")[0].appendChild(f);function d(p,h){var n=0,m=0;var g=[],o=/([mrvxe])([^a-z]*)/g,k;generate:for(var j=0;k=o.exec(p);++j){var l=k[2].split(",");switch(k[1]){case"v":g[j]={m:"bezierCurveTo",a:[n+~~l[0],m+~~l[1],n+~~l[2],m+~~l[3],n+=~~l[4],m+=~~l[5]]};break;case"r":g[j]={m:"lineTo",a:[n+=~~l[0],m+=~~l[1]]};break;case"m":g[j]={m:"moveTo",a:[n=~~l[0],m=~~l[1]]};break;case"x":g[j]={m:"closePath"};break;case"e":break generate}h[g[j].m].apply(h,g[j].a)}return g}function c(m,k){for(var j=0,h=m.length;j<h;++j){var g=m[j];k[g.m].apply(k,g.a)}}return function(V,w,P,t,C,W){var k=(w===null);if(k){w=C.getAttribute("alt")}var A=V.viewBox;var m=P.getSize("fontSize",V.baseSize);var B=0,O=0,N=0,u=0;var z=t.textShadow,L=[];if(z){for(var U=z.length;U--;){var F=z[U];var K=m.convertFrom(parseFloat(F.offX));var I=m.convertFrom(parseFloat(F.offY));L[U]=[K,I];if(I<B){B=I}if(K>O){O=K}if(I>N){N=I}if(K<u){u=K}}}var Z=Cufon.CSS.textTransform(w,P).split("");var E=V.spacing(Z,~~m.convertFrom(parseFloat(P.get("letterSpacing"))||0),~~m.convertFrom(parseFloat(P.get("wordSpacing"))||0));if(!E.length){return null}var h=E.total;O+=A.width-E[E.length-1];u+=A.minX;var s,n;if(k){s=C;n=C.firstChild}else{s=document.createElement("cufon");s.className="cufon cufon-canvas";s.setAttribute("alt",w);n=document.createElement("canvas");s.appendChild(n);if(t.printable){var S=document.createElement("cufontext");S.appendChild(document.createTextNode(w));s.appendChild(S)}}var aa=s.style;var H=n.style;var j=m.convert(A.height);var Y=Math.ceil(j);var M=Y/j;var G=M*Cufon.CSS.fontStretch(P.get("fontStretch"));var J=h*G;var Q=Math.ceil(m.convert(J+O-u));var o=Math.ceil(m.convert(A.height-B+N));n.width=Q;n.height=o;H.width=Q+"px";H.height=o+"px";B+=A.minY;H.top=Math.round(m.convert(B-V.ascent))+"px";H.left=Math.round(m.convert(u))+"px";var r=Math.max(Math.ceil(m.convert(J)),0)+"px";if(a){aa.width=r;aa.height=m.convert(V.height)+"px"}else{aa.paddingLeft=r;aa.paddingBottom=(m.convert(V.height)-1)+"px"}var X=n.getContext("2d"),D=j/A.height;X.scale(D,D*M);X.translate(-u,-B);X.save();function T(){var x=V.glyphs,ab,l=-1,g=-1,y;X.scale(G,1);while(y=Z[++l]){var ab=x[Z[l]]||V.missingGlyph;if(!ab){continue}if(ab.d){X.beginPath();if(ab.code){c(ab.code,X)}else{ab.code=d("m"+ab.d,X)}X.fill()}X.translate(E[++g],0)}X.restore()}if(z){for(var U=z.length;U--;){var F=z[U];X.save();X.fillStyle=F.color;X.translate.apply(X,L[U]);T()}}var q=t.textGradient;if(q){var v=q.stops,p=X.createLinearGradient(0,A.minY,0,A.maxY);for(var U=0,R=v.length;U<R;++U){p.addColorStop.apply(p,v[U])}X.fillStyle=p}else{X.fillStyle=P.get("color")}T();return s}})());Cufon.registerEngine("vml",(function(){var e=document.namespaces;if(!e){return}e.add("cvml","urn:schemas-microsoft-com:vml");e=null;var b=document.createElement("cvml:shape");b.style.behavior="url(#default#VML)";if(!b.coordsize){return}b=null;var h=(document.documentMode||0)<8;document.write(('<style type="text/css">cufoncanvas{text-indent:0;}@media screen{cvml\\:shape,cvml\\:rect,cvml\\:fill,cvml\\:shadow{behavior:url(#default#VML);display:block;antialias:true;position:absolute;}cufoncanvas{position:absolute;text-align:left;}cufon{display:inline-block;position:relative;vertical-align:'+(h?"middle":"text-bottom")+";}cufon cufontext{position:absolute;left:-10000in;font-size:1px;}a cufon{cursor:pointer}}@media print{cufon cufoncanvas{display:none;}}</style>").replace(/;/g,"!important;"));function c(i,j){return a(i,/(?:em|ex|%)$|^[a-z-]+$/i.test(j)?"1em":j)}function a(l,m){if(m==="0"){return 0}if(/px$/i.test(m)){return parseFloat(m)}var k=l.style.left,j=l.runtimeStyle.left;l.runtimeStyle.left=l.currentStyle.left;l.style.left=m.replace("%","em");var i=l.style.pixelLeft;l.style.left=k;l.runtimeStyle.left=j;return i}function f(l,k,j,n){var i="computed"+n,m=k[i];if(isNaN(m)){m=k.get(n);k[i]=m=(m=="normal")?0:~~j.convertFrom(a(l,m))}return m}var g={};function d(p){var q=p.id;if(!g[q]){var n=p.stops,o=document.createElement("cvml:fill"),i=[];o.type="gradient";o.angle=180;o.focus="0";o.method="sigma";o.color=n[0][1];for(var m=1,l=n.length-1;m<l;++m){i.push(n[m][0]*100+"% "+n[m][1])}o.colors=i.join(",");o.color2=n[l][1];g[q]=o}return g[q]}return function(ac,G,Y,C,K,ad,W){var n=(G===null);if(n){G=K.alt}var I=ac.viewBox;var p=Y.computedFontSize||(Y.computedFontSize=new Cufon.CSS.Size(c(ad,Y.get("fontSize"))+"px",ac.baseSize));var y,q;if(n){y=K;q=K.firstChild}else{y=document.createElement("cufon");y.className="cufon cufon-vml";y.alt=G;q=document.createElement("cufoncanvas");y.appendChild(q);if(C.printable){var Z=document.createElement("cufontext");Z.appendChild(document.createTextNode(G));y.appendChild(Z)}if(!W){y.appendChild(document.createElement("cvml:shape"))}}var ai=y.style;var R=q.style;var l=p.convert(I.height),af=Math.ceil(l);var V=af/l;var P=V*Cufon.CSS.fontStretch(Y.get("fontStretch"));var U=I.minX,T=I.minY;R.height=af;R.top=Math.round(p.convert(T-ac.ascent));R.left=Math.round(p.convert(U));ai.height=p.convert(ac.height)+"px";var F=Y.get("color");var ag=Cufon.CSS.textTransform(G,Y).split("");var L=ac.spacing(ag,f(ad,Y,p,"letterSpacing"),f(ad,Y,p,"wordSpacing"));if(!L.length){return null}var k=L.total;var x=-U+k+(I.width-L[L.length-1]);var ah=p.convert(x*P),X=Math.round(ah);var O=x+","+I.height,m;var J="r"+O+"ns";var u=C.textGradient&&d(C.textGradient);var o=ac.glyphs,S=0;var H=C.textShadow;var ab=-1,aa=0,w;while(w=ag[++ab]){var D=o[ag[ab]]||ac.missingGlyph,v;if(!D){continue}if(n){v=q.childNodes[aa];while(v.firstChild){v.removeChild(v.firstChild)}}else{v=document.createElement("cvml:shape");q.appendChild(v)}v.stroked="f";v.coordsize=O;v.coordorigin=m=(U-S)+","+T;v.path=(D.d?"m"+D.d+"xe":"")+"m"+m+J;v.fillcolor=F;if(u){v.appendChild(u.cloneNode(false))}var ae=v.style;ae.width=X;ae.height=af;if(H){var s=H[0],r=H[1];var B=Cufon.CSS.color(s.color),z;var N=document.createElement("cvml:shadow");N.on="t";N.color=B.color;N.offset=s.offX+","+s.offY;if(r){z=Cufon.CSS.color(r.color);N.type="double";N.color2=z.color;N.offset2=r.offX+","+r.offY}N.opacity=B.opacity||(z&&z.opacity)||1;v.appendChild(N)}S+=L[aa++]}var M=v.nextSibling,t,A;if(C.forceHitArea){if(!M){M=document.createElement("cvml:rect");M.stroked="f";M.className="cufon-vml-cover";t=document.createElement("cvml:fill");t.opacity=0;M.appendChild(t);q.appendChild(M)}A=M.style;A.width=X;A.height=af}else{if(M){q.removeChild(M)}}ai.width=Math.max(Math.ceil(p.convert(k*P)),0);if(h){var Q=Y.computedYAdjust;if(Q===undefined){var E=Y.get("lineHeight");if(E=="normal"){E="1em"}else{if(!isNaN(E)){E+="em"}}Y.computedYAdjust=Q=0.5*(a(ad,E)-parseFloat(ai.height))}if(Q){ai.marginTop=Math.ceil(Q)+"px";ai.marginBottom=Q+"px"}}return y}})());
/*!
 * The following copyright notice may not be removed under any circumstances.
 * 
 * Copyright:
 *  The digitally encoded machine readable software for producing the
 Typefaces
 * licensed to you is copyrighted (c) 1991 Adobe Systems.
 All Rights Reserved.
 * This software is the property of Adobe Systems
 Incorporated and its licensors,
 * and may not be reproduced, used, 
 displayed, modified, disclosed or transferred
 * without the express 
 written approval of Adobe.
 
 The digitally encoded
 * machine readable outline data for producing
 the Typefaces licensed to you is
 * copyrighted (c) 1981 Linotype-Hell AG
 and/or its subsidiaries. All Rights
 * Reserved.
 This data is the property of Linotype-Hell AG and/or its
 * subsidiaries
 and may not be reproduced, used, displayed, modified, disclosed or
 * 
 transferred without the express written approval of Linotype-Hell AG 
 and/or
 * its subsidiaries.
 12 Palatino* Light 02206
 */
Cufon.registerFont({"w":180,"face":{"font-family":"palantino-adobe","font-weight":200,"font-stretch":"normal","units-per-em":"360","panose-1":"2 0 3 3 0 0 0 0 0 0","ascent":"288","descent":"-72","x-height":"4","cap-height":"1","bbox":"-9.31262 -275 350.346 98","underline-thickness":"18","underline-position":"-36","stemh":"9","stemv":"23","unicode-range":"U+0020-U+007E"},"glyphs":{" ":{"w":90},"!":{"d":"51,-68v-10,-52,-7,-117,-13,-173v10,-4,16,-13,31,-12v4,53,-11,116,-10,178xm35,-16v0,-10,8,-19,18,-19v10,0,19,9,19,19v0,10,-9,19,-19,19v-9,0,-18,-9,-18,-19","w":106},"\"":{"d":"114,-156v-16,-16,-8,-55,-13,-83v0,-5,3,-14,13,-14v29,9,3,58,6,87v0,4,-2,10,-6,10xm59,-156v-14,-17,-6,-57,-13,-84v0,-5,3,-13,13,-13v29,8,3,58,7,87v0,4,-3,10,-7,10","w":173},"#":{"d":"68,-150r-8,55r52,0r8,-55r-52,0xm30,0r11,-80r-40,0r0,-15r42,0r8,-55r-40,0r0,-15r42,0r12,-80r17,0r-11,80r51,0r11,-80r17,0r-11,80r40,0r0,15r-42,0r-8,55r40,0r0,15r-42,0r-12,80r-17,0r11,-80r-51,0r-11,80r-17,0"},"$":{"d":"77,-147r0,-90v-28,4,-42,23,-42,45v0,24,16,36,42,45xm92,-112r0,103v27,-4,51,-22,51,-55v0,-27,-14,-36,-51,-48xm77,5v-28,0,-54,-4,-67,-13v3,-21,1,-43,4,-59v16,-5,7,21,13,32v8,15,20,27,50,27r0,-109v-27,-12,-65,-17,-65,-64v0,-29,15,-59,65,-66v1,-9,-2,-21,1,-28v4,1,11,-1,14,1r0,26v29,0,50,6,64,14v-3,8,-4,36,-7,51v-14,4,-10,-12,-11,-22v-8,-20,-23,-31,-46,-32r0,95v37,13,78,20,78,69v0,32,-25,68,-78,77v-1,12,2,28,-1,38v-4,-1,-11,1,-14,-1r0,-36"},"%":{"d":"35,-180v0,-33,15,-66,55,-66v37,0,49,22,49,60v0,50,-27,67,-54,67v-37,0,-50,-27,-50,-61xm57,-189v0,33,8,59,33,59v21,0,28,-18,28,-49v0,-39,-11,-56,-34,-56v-19,0,-27,18,-27,46xm181,-55v0,-33,14,-66,54,-66v37,0,50,21,50,59v0,50,-27,67,-54,67v-37,0,-50,-26,-50,-60xm202,-64v0,33,8,59,33,59v21,0,28,-18,28,-49v0,-39,-10,-57,-33,-57v-19,0,-28,19,-28,47xm87,17r133,-274v4,1,11,-1,14,1r-134,273r-13,0","w":320},"&":{"d":"262,-141v3,6,0,18,-5,19r-42,-1v7,34,-5,54,-31,82v18,19,58,34,81,13v3,1,2,5,3,8v-14,7,-18,24,-40,24v-27,0,-51,-20,-61,-29v-14,11,-35,29,-70,29v-53,0,-71,-41,-71,-68v0,-37,26,-60,52,-76v-4,-9,-9,-24,-9,-41v0,-43,36,-63,57,-67v62,16,0,94,-26,104v21,42,58,80,77,97v14,-10,30,-51,15,-75v-15,-5,-24,0,-34,-5v6,-5,8,-7,12,-13v32,2,47,2,92,-1xm83,-131v-54,25,-35,117,26,117v19,0,35,-7,50,-19v-37,-35,-61,-71,-76,-98xm113,-232v-29,0,-33,55,-17,78v27,-18,37,-39,37,-54v0,-13,-7,-24,-20,-24","w":286},"(":{"d":"114,-268v3,2,5,5,7,8v-19,19,-62,60,-62,161v0,93,38,135,61,163v-3,2,-4,6,-8,7v-23,-23,-79,-78,-79,-172v0,-68,30,-125,81,-167","w":119},")":{"d":"6,71v-3,-2,-5,-5,-7,-8v19,-19,62,-61,62,-162v0,-93,-38,-135,-61,-163v3,-2,4,-5,8,-6v23,23,79,78,79,172v0,68,-30,125,-81,167","w":119},"*":{"d":"27,-220v6,-4,6,-17,15,-19v15,18,27,29,40,40v9,-27,-3,-68,32,-49v-7,26,-21,37,-24,52v19,-1,40,-8,55,-7v-1,8,3,19,-1,24v-19,-4,-32,-7,-54,-8v7,20,20,34,23,48v-8,2,-14,11,-22,10v-1,-15,-3,-27,-10,-54v-11,9,-27,22,-42,36v-6,-4,-12,-16,-10,-23v17,-7,40,-16,49,-21v-15,-10,-39,-17,-51,-29","w":173},"+":{"d":"99,0r0,-82r-82,0r0,-18r82,0r0,-82r18,0r0,82r82,0r0,18r-82,0r0,82r-18,0","w":216},",":{"d":"14,46v-6,2,-13,11,-17,5v23,-36,33,-72,34,-87v15,0,25,-11,35,-5v-12,28,-37,69,-52,87","w":90},"-":{"d":"32,-98v34,5,73,-3,97,3v-4,4,-7,9,-8,15v-31,-2,-69,3,-97,-2v3,-5,5,-11,8,-16","w":153},".":{"d":"26,-16v0,-10,9,-19,19,-19v10,0,19,9,19,19v0,10,-9,19,-19,19v-9,0,-19,-9,-19,-19","w":90},"\/":{"d":"13,5r73,-258v5,1,13,-1,16,1r-74,257r-15,0","w":113},"0":{"d":"90,-5v47,0,49,-73,49,-119v0,-35,0,-111,-49,-111v-44,0,-50,53,-50,117v0,50,6,113,50,113xm87,5v-71,0,-72,-90,-72,-126v0,-105,48,-125,78,-125v71,0,72,86,72,119v0,39,-6,132,-78,132"},"1":{"d":"23,-192v-5,-15,-12,-15,15,-24v24,-8,56,-24,71,-33v9,8,2,21,2,48r0,159v-2,50,9,22,46,34v0,3,1,8,-1,9r-117,-1v-3,-11,8,-9,17,-10v31,-5,29,10,29,-32r-2,-179v-16,6,-43,21,-60,29"},"2":{"d":"79,-222v-47,0,-41,21,-53,51v-3,0,-7,1,-8,-1v4,-15,3,-37,7,-52v6,-5,31,-22,60,-22v44,0,69,28,69,67v11,35,-81,122,-116,156r130,-2v-3,7,1,21,-1,26r-156,-1v-2,-15,8,-18,15,-25v84,-88,101,-109,101,-146v0,-33,-19,-51,-48,-51"},"3":{"d":"78,-222v-43,0,-35,12,-48,43v-3,0,-8,1,-10,-1v6,-15,10,-32,12,-45v27,-31,116,-29,116,35v0,27,-25,48,-40,58v12,1,55,7,55,52v0,63,-78,104,-142,76v-3,-28,-13,-46,-11,-54r7,-2v16,38,34,52,61,52v26,0,57,-16,57,-61v0,-56,-46,-55,-81,-45v3,-8,3,-11,4,-19v36,9,66,-16,66,-48v0,-18,-10,-41,-46,-41"},"4":{"d":"129,-42v-2,45,8,25,37,34v0,3,1,8,-1,9r-105,-1v-3,-10,6,-10,15,-10v38,0,26,-8,29,-55r-96,1r-3,-8v33,-63,67,-117,100,-167v8,-2,19,-13,25,-7r-1,162v14,1,26,-2,35,0v-2,8,1,15,-1,21v-6,-1,-29,-2,-34,-2r0,23xm105,-84r0,-137v-28,45,-58,93,-81,137r81,0"},"5":{"d":"14,-54v12,23,29,45,60,44v35,0,60,-26,60,-63v0,-28,-15,-65,-54,-65v-27,0,-40,13,-49,24r-5,-1v2,-37,5,-89,1,-127v27,-3,87,-1,122,-1v-3,6,2,23,-2,26v-25,-4,-81,-3,-105,-1v-3,24,-2,51,-3,78v9,-8,22,-19,49,-19v44,0,71,32,71,69v0,69,-73,113,-133,87v-5,-17,-16,-34,-18,-48"},"6":{"d":"44,-117v27,-18,23,-31,60,-31v29,0,61,21,61,66v0,51,-36,87,-79,87v-37,0,-71,-28,-71,-96v0,-95,73,-147,125,-157v3,3,12,3,9,8v-16,3,-98,27,-105,123xm92,-128v-36,0,-51,16,-51,51v0,20,4,73,51,73v33,0,48,-32,48,-66v0,-32,-17,-58,-48,-58"},"7":{"d":"155,-217v-22,-8,-69,1,-101,-3v-18,-2,-14,32,-20,47v-3,0,-7,1,-8,-1v4,-25,-3,-54,1,-72v47,6,99,1,150,3r0,8v-41,68,-89,194,-107,236v-6,-3,-27,2,-30,-2v37,-71,74,-145,115,-216"},"8":{"d":"14,-58v0,-40,41,-61,54,-67v-74,-21,-46,-121,25,-121v40,0,64,24,64,52v0,33,-31,51,-50,59v33,14,59,26,59,65v0,35,-29,75,-82,75v-44,0,-70,-31,-70,-63xm39,-62v0,32,20,56,53,56v24,0,52,-17,52,-51v0,-36,-25,-44,-66,-63v-30,15,-39,42,-39,58xm45,-191v0,27,26,40,51,51v18,-8,38,-22,38,-49v0,-31,-20,-46,-44,-46v-24,0,-45,16,-45,44"},"9":{"d":"136,-123v-27,18,-23,30,-60,30v-29,0,-61,-21,-61,-66v0,-51,36,-87,79,-87v37,0,71,29,71,97v0,95,-73,146,-125,156v-3,-2,-11,-3,-9,-7v16,-3,98,-27,105,-123xm88,-112v36,0,51,-17,51,-52v0,-20,-4,-72,-51,-72v-33,0,-48,31,-48,65v0,32,17,59,48,59"},":":{"d":"26,-140v0,-10,9,-19,19,-19v10,0,19,9,19,19v0,10,-9,18,-19,18v-9,0,-19,-8,-19,-18xm26,-16v0,-10,9,-19,19,-19v10,0,19,9,19,19v0,10,-9,19,-19,19v-9,0,-19,-9,-19,-19","w":90},";":{"d":"14,46v-6,2,-13,11,-17,5v23,-36,33,-72,34,-87v15,0,25,-11,35,-5v-12,28,-37,69,-52,87xm26,-140v0,-10,9,-19,19,-19v10,0,19,9,19,19v0,10,-9,18,-19,18v-9,0,-19,-8,-19,-18","w":90},"<":{"d":"199,3r-182,-84r0,-20r182,-84r0,19r-160,75r160,74r0,20","w":216},"=":{"d":"17,-118r0,-17r182,0r0,17r-182,0xm17,-47r0,-17r182,0r0,17r-182,0","w":216},">":{"d":"17,-185r182,84r0,20r-182,84r0,-20r160,-74r-160,-75r0,-19","w":216},"?":{"d":"144,-195v10,31,-71,85,-71,105v0,11,10,15,0,19v-42,-42,47,-73,44,-118v5,-31,-40,-55,-70,-36v-8,9,-11,35,-24,26v6,-17,10,-30,13,-40v40,-28,108,-13,108,44xm54,-16v0,-10,9,-19,19,-19v10,0,18,9,18,19v0,10,-8,19,-18,19v-9,0,-19,-9,-19,-19","w":166},"@":{"d":"187,-150v0,-20,-9,-25,-19,-25v-20,0,-52,28,-52,81v0,19,8,27,18,27v26,0,53,-40,53,-83xm228,-23r4,7v-25,13,-48,21,-77,21v-98,0,-140,-73,-140,-123v0,-81,60,-135,139,-135v73,0,119,50,119,110v0,49,-28,89,-70,89v-24,0,-31,-19,-31,-26v-22,36,-82,38,-82,-20v0,-45,35,-90,75,-90v16,-1,21,8,27,19r3,-14r25,0r-26,107v0,8,4,13,13,13v34,0,55,-33,55,-78v0,-54,-44,-100,-105,-100v-71,0,-116,45,-116,129v0,54,42,108,113,108v32,0,53,-8,74,-17","w":288},"A":{"d":"52,-79r71,-172r10,0r77,192v22,49,18,48,47,50v0,3,1,8,-1,10r-93,-1v-9,-17,38,-6,31,-18v1,-4,-18,-48,-23,-64r-102,0v-5,13,-24,58,-22,62v0,5,2,10,21,10v8,-2,15,3,10,11r-82,-1v0,-3,-1,-8,1,-10v26,0,27,-1,55,-69xm166,-96r-45,-115r-47,115r92,0","w":253},"B":{"d":"192,-80v0,59,-69,90,-141,80v-9,-1,-22,3,-29,0v-3,-11,10,-10,13,-17v3,-68,3,-147,0,-216v-1,-2,-5,-4,-19,-5v-7,0,-19,-1,-13,-11v70,6,172,-23,177,49v2,34,-33,53,-62,60v35,1,74,14,74,60xm64,-132r2,117v49,15,96,-14,96,-61v0,-55,-48,-60,-98,-56xm64,-145v50,1,88,-1,88,-47v0,-49,-47,-47,-86,-43v-3,22,-2,62,-2,90","w":206},"C":{"d":"237,-240v-1,14,-8,35,-9,54v-3,0,-9,1,-9,-2v0,-14,0,-17,-1,-31v-68,-46,-170,-20,-169,90v0,53,38,119,116,119v40,0,60,-14,73,-23v7,4,-5,14,-6,20v-14,8,-33,18,-73,18v-84,0,-141,-54,-141,-126v0,-72,61,-133,133,-132v45,0,65,11,86,13","w":246},"D":{"d":"71,-235v-4,65,-2,152,-1,221v88,14,158,-27,153,-115v-6,-113,-81,-111,-152,-106xm40,-17v3,-68,3,-147,0,-216v-1,-2,-5,-5,-19,-5v-8,0,-21,-2,-13,-11v123,3,247,-27,247,114v0,60,-42,136,-143,136r-86,-1v-2,-12,10,-10,14,-17","w":273},"E":{"d":"154,-86v1,-53,-40,-30,-85,-34r1,108v38,-1,74,3,106,-6v7,-20,6,-28,10,-42v3,0,8,-1,9,1v-5,34,-2,44,-5,60r-164,-1v-2,-12,10,-10,14,-17v3,-68,3,-147,0,-216v-1,-2,-5,-5,-19,-5v-8,0,-21,-2,-13,-11r181,1v-10,33,7,61,-16,54v0,-11,0,-14,-2,-35v-24,-8,-69,-8,-101,-6v-2,32,-1,67,-1,100v44,-5,93,22,85,-31v3,0,8,-1,9,1v-2,15,1,70,-1,79r-8,0","w":206},"F":{"d":"152,-86v1,-53,-37,-30,-83,-34v1,31,-3,82,3,105v1,2,5,4,19,5v7,0,19,1,13,11r-98,-1v-3,-10,6,-9,15,-10v28,-4,21,2,21,-30r-2,-193v-1,-2,-5,-5,-19,-5v-8,0,-21,-2,-13,-11r175,1v-10,28,7,62,-16,54v0,-11,0,-14,-2,-35v-29,-9,-64,-7,-95,-4v-2,30,-1,66,-1,98v45,-4,88,21,83,-31v3,0,7,-1,9,1v-4,15,2,72,-2,79r-7,0","w":186},"G":{"d":"249,-238v-2,20,-5,37,-8,54v-3,0,-8,1,-9,-1v0,-4,-1,-29,-3,-35v-19,-14,-45,-20,-75,-20v-65,0,-106,43,-106,110v0,98,92,146,173,110v-4,-11,21,-78,-20,-68v-8,-1,-27,3,-20,-11r82,1v2,11,-7,12,-13,16v0,22,-3,49,1,68v-13,7,-51,18,-95,19v-76,0,-140,-45,-140,-130v0,-81,69,-128,141,-128v42,0,74,9,92,15","w":280},"H":{"d":"40,-15v4,-63,3,-152,0,-218v-1,-2,-5,-5,-19,-5v-8,0,-21,-2,-13,-11r97,1v7,17,-34,7,-33,15v-6,18,-2,69,-3,95r148,0v-1,-27,2,-75,-2,-95v-1,-2,-5,-4,-19,-5v-7,0,-19,-1,-13,-11r97,1v7,17,-34,7,-33,15v-6,61,-4,154,0,218v1,2,5,4,19,5v7,0,19,1,13,11r-97,-1v-7,-17,34,-7,33,-15v5,-24,1,-77,2,-108r-148,0v1,32,-3,84,3,108v1,2,5,4,19,5v7,0,19,1,13,11r-98,-1v-3,-10,6,-10,15,-10v14,-1,18,-3,19,-5","w":286},"I":{"d":"41,-15v0,-63,3,-152,0,-218v-1,-2,-5,-4,-19,-5v-7,0,-19,-1,-13,-11r97,1v7,17,-34,7,-33,15v-6,61,-4,154,0,218v1,2,5,4,19,5v7,0,19,1,13,11r-97,-1v-7,-17,33,-7,33,-15","w":113},"J":{"d":"73,-233v-19,109,40,295,-77,301v3,-8,-3,-27,3,-29v25,20,45,16,44,-48r-2,-224v-1,-2,-5,-4,-19,-5v-7,0,-19,-1,-13,-11r97,1v7,17,-34,7,-33,15","w":113},"K":{"d":"40,-15v4,-63,3,-152,0,-218v-1,-2,-5,-5,-19,-5v-8,0,-21,-2,-13,-11r97,1v7,17,-34,7,-33,15v-6,21,-2,73,-3,102v33,-28,77,-71,114,-111v-1,-14,37,-4,54,-6v0,3,1,9,-2,9v-22,0,-23,2,-35,10v-20,14,-77,67,-107,94r127,114v10,11,16,9,29,12v3,20,-27,5,-46,10r-134,-121v1,31,-3,82,3,105v1,2,5,4,19,5v7,0,19,1,13,11r-98,-1v-3,-10,6,-10,15,-10v14,-1,18,-3,19,-5","w":246},"L":{"d":"40,-15v4,-62,-1,-128,2,-193v2,-38,-4,-24,-36,-32v0,-3,-1,-9,2,-9r97,1v7,17,-34,7,-33,15v-7,62,-3,153,-1,220v36,1,88,0,109,-8v6,-15,5,-22,12,-42v3,0,8,-1,9,1v-5,20,-5,46,-8,63r-167,-1v-2,-11,8,-11,14,-15","w":213},"M":{"d":"8,1v-8,-9,4,-11,12,-11v18,-3,16,0,19,-16v4,-26,3,-135,3,-181v0,-38,-13,-28,-36,-33v-2,-20,38,-2,63,-9r95,213r97,-213v17,2,48,-1,59,1v7,17,-34,7,-33,15v-6,61,-4,154,0,218v1,2,5,4,19,5v7,0,19,1,13,11r-97,-1v-7,-17,34,-7,33,-15v5,-54,0,-131,2,-191r-98,210r-6,0r-98,-216r2,186v-1,21,15,12,33,18v0,3,1,8,-1,9v-16,-1,-65,-1,-81,0","w":326},"N":{"d":"36,-15v9,-31,4,-138,6,-192v2,-38,-13,-28,-36,-33v-1,-19,34,-3,56,-9v34,46,115,149,170,213r-3,-186v1,-21,-14,-12,-32,-18v0,-3,-1,-8,1,-9v16,2,68,-1,82,1v4,22,-33,-3,-33,26v0,44,-3,172,-1,229v-6,-3,-13,-4,-19,-5r-172,-214r2,186v-1,21,15,12,33,18v0,3,1,8,-1,9v-17,-2,-68,1,-83,-1v-6,-16,27,-7,30,-15","w":286},"O":{"d":"46,-138v0,67,31,132,101,132v44,0,100,-28,100,-114v0,-81,-46,-123,-104,-123v-50,0,-97,34,-97,105xm16,-121v0,-93,63,-132,129,-132v82,0,132,46,132,124v0,66,-47,134,-136,134v-96,0,-125,-76,-125,-126","w":293},"P":{"d":"42,-15v0,-63,3,-152,0,-218v-1,-2,-5,-4,-19,-5v-7,0,-19,-1,-13,-11v79,4,197,-21,196,59v6,33,-51,87,-112,68v0,-4,-4,-8,-2,-11v45,17,92,-21,84,-52v4,-51,-57,-57,-103,-50v-3,64,-5,155,1,220v1,2,5,4,19,5v7,0,19,1,13,11r-97,-1v-7,-17,33,-7,33,-15","w":213},"Q":{"d":"46,-138v0,67,31,132,101,132v44,0,100,-28,100,-114v0,-81,-46,-123,-104,-123v-50,0,-97,34,-97,105xm102,40v-9,-18,32,-28,39,-35v-96,0,-125,-76,-125,-126v0,-93,63,-132,129,-132v82,0,132,46,132,124v0,65,-47,128,-127,134v17,0,108,42,108,32v9,1,19,-6,25,-5v-17,57,-119,-6,-148,-7v-10,0,-16,4,-33,15","w":293},"R":{"d":"40,-15v4,-63,3,-152,0,-218v-1,-2,-5,-5,-19,-5v-8,0,-21,-2,-13,-11v77,6,191,-24,191,55v0,39,-39,64,-78,68r81,101v10,14,16,14,29,17v2,18,-25,4,-45,9v0,0,-81,-104,-104,-131v0,-7,12,-1,17,-3v51,0,70,-30,70,-56v0,-53,-57,-51,-98,-45v-4,58,0,132,-2,194v-1,38,4,23,36,32v0,3,1,8,-1,9r-98,-1v-3,-10,6,-10,15,-10v14,-1,18,-3,19,-5","w":226},"S":{"d":"32,-68v4,34,11,60,57,60v33,0,64,-19,64,-58v0,-66,-131,-35,-131,-119v0,-33,20,-68,84,-68v28,0,47,6,60,14v-3,9,-5,37,-7,53v-14,4,-9,-13,-11,-24v-11,-50,-103,-36,-103,14v0,68,135,37,135,121v0,38,-33,80,-102,80v-26,0,-46,-4,-57,-13v3,-21,0,-43,3,-60r8,0","w":200},"T":{"d":"84,-15v7,-60,2,-154,2,-220v-21,4,-70,-10,-69,14v-3,10,3,34,-13,28v1,-23,-4,-43,-2,-56r197,1v-2,13,0,36,-3,56v-27,4,9,-41,-31,-42r-50,-1r1,220v1,2,5,4,19,5v7,0,19,1,13,11r-97,-1v-7,-17,34,-7,33,-15","w":200},"U":{"d":"136,-11v79,0,83,-48,80,-128v-1,-56,2,-75,-5,-94v0,-9,-38,2,-29,-16v16,2,69,-1,83,1v4,22,-37,-3,-33,26v-6,21,2,156,-11,180v-14,26,-37,47,-90,47v-148,0,-73,-124,-96,-238v-1,-2,-5,-4,-19,-5v-7,0,-19,-1,-13,-11r97,1v7,17,-34,7,-33,15v-5,42,-2,106,-2,153v0,40,17,69,71,69","w":266},"V":{"d":"109,3r-74,-191v-24,-55,-16,-46,-43,-52v0,-3,-1,-9,2,-9r87,1v5,19,-30,2,-30,18v21,69,49,130,72,196r45,-117v16,-41,27,-70,27,-79v1,-12,-23,-6,-32,-10v0,-3,-1,-8,1,-9r77,1v-1,20,-24,0,-29,28r-90,223r-13,0","w":233},"W":{"d":"78,3r-46,-201v-11,-44,-12,-37,-36,-42v0,-3,-1,-8,1,-9r89,1v6,21,-38,-6,-30,30r39,178r80,-211r7,0r73,211r50,-190v0,-4,-4,-7,-17,-8v-8,0,-20,0,-14,-11v25,1,53,-2,76,1v4,16,-28,7,-26,21r-70,230r-11,0r-73,-205r-80,205r-12,0","w":346},"X":{"d":"24,-23r75,-103r-25,-40v-49,-73,-38,-68,-70,-69v0,-3,-1,-8,1,-9v17,0,40,-14,50,-1v21,27,41,64,61,96r68,-100v9,2,28,-1,35,1v-2,20,-15,5,-32,27r-64,84r59,95v18,29,18,30,40,34v3,15,-12,6,-26,8v-27,4,-27,-8,-38,-26r-51,-87r-74,114v-8,-2,-29,1,-35,-1v0,-18,18,-3,26,-23","w":219},"Y":{"d":"29,-253v35,13,69,104,89,134r77,-130v7,3,27,-5,23,6v-21,20,-75,102,-89,131v-10,20,-5,74,-1,97v1,2,5,4,19,5v7,0,19,1,13,11r-97,-1v-7,-17,34,-7,33,-15v4,-17,1,-65,2,-89v-24,-41,-48,-82,-58,-96v-22,-33,-30,-33,-46,-38v0,-15,25,-9,35,-15","w":213},"Z":{"d":"102,-13v61,-6,97,20,100,-50v3,0,8,-1,9,1v-3,19,-1,38,-4,63r-204,-1r0,-7v58,-74,112,-151,166,-228r-112,2v-22,-5,-18,25,-24,43v-3,0,-8,1,-8,-2v2,-17,-1,-47,0,-57r185,1r0,8r-167,227r59,0","w":226},"[":{"d":"68,-15v2,42,-8,73,40,66v1,3,2,10,0,13v-21,-1,-47,2,-66,-1r2,-261v1,-14,-3,-49,-1,-63v21,1,47,-2,66,1v0,4,1,9,-1,11r-23,2v-25,1,-17,33,-17,64r0,168","w":119},"\\":{"d":"27,-253r74,258v-5,-1,-13,1,-16,-1r-72,-257r14,0","w":113},"]":{"d":"51,-183v-3,-31,8,-63,-16,-64v-10,-1,-33,1,-23,-14v21,1,47,-2,66,1r-2,260v-1,14,3,50,1,64v-22,-1,-47,2,-67,-1v-4,-16,13,-12,25,-13v25,-1,16,-34,16,-65r0,-168","w":119},"^":{"d":"33,-111r66,-132r18,0r66,132r-20,0r-55,-108r-55,108r-20,0","w":216},"_":{"d":"180,45r-180,0r0,-18r180,0r0,18"},"a":{"d":"117,-93v-28,8,-77,9,-78,47v-2,55,70,24,78,5r0,-52xm28,-145v32,-36,131,-33,112,50r0,67v-4,21,12,18,27,22v2,16,-33,1,-49,7v-4,-6,0,-20,-1,-29v-10,7,-30,32,-55,32v-34,0,-49,-18,-49,-46v-1,-50,65,-49,104,-60v11,-49,-50,-65,-72,-35v-4,7,-6,23,-16,15","w":173},"b":{"d":"103,-149v-64,0,-49,59,-49,118v12,12,27,19,44,19v39,0,57,-36,57,-71v0,-28,-13,-66,-52,-66xm53,-134v17,-12,25,-34,57,-34v45,0,69,35,69,73v0,45,-22,62,-39,77v-31,26,-60,29,-91,9v-7,3,-14,17,-22,10v6,-51,-1,-153,3,-216v2,-26,-9,-23,-27,-26r0,-6v10,-4,33,-8,48,-15v10,4,-2,85,2,128","w":193},"c":{"d":"129,-113v-6,-20,-5,-40,-41,-40v-20,0,-49,12,-49,64v0,35,18,77,61,77v22,0,35,-14,43,-8v-10,18,-22,24,-57,24v-35,0,-72,-23,-72,-83v0,-69,71,-107,127,-78v-5,16,-2,33,-6,44r-6,0","w":153},"d":{"d":"39,-88v0,36,15,74,56,74v26,0,41,-23,44,-29v5,-2,4,-72,3,-88v-6,-8,-24,-24,-53,-24v-26,0,-50,21,-50,67xm14,-76v0,-71,71,-110,129,-80r0,-59v4,-26,-9,-23,-27,-26r0,-6v10,-4,33,-8,48,-15v10,10,2,29,2,84r0,150v-3,21,13,18,28,22v1,16,-34,1,-50,7v-4,-6,0,-20,-1,-29v-22,13,-28,32,-60,32v-36,0,-69,-29,-69,-80","w":200},"e":{"d":"89,-157v-40,0,-47,36,-49,59r89,-1v7,-35,-20,-58,-40,-58xm14,-80v0,-52,24,-81,82,-88v26,-3,69,21,60,77v-25,4,-81,4,-116,4v0,43,20,75,60,75v24,0,42,-17,53,-14v-9,22,-29,30,-65,30v-26,0,-74,-17,-74,-84","w":173},"f":{"d":"31,-13v8,-33,1,-89,3,-128v-8,0,-19,2,-25,0v0,-12,17,-10,25,-16v1,-40,1,-58,26,-79v30,-24,28,-29,56,-24v-2,9,0,19,0,28v-24,-15,-59,-4,-59,33r0,42v15,1,34,-3,48,0r-3,16r-45,0v2,40,-4,94,3,128v11,3,25,3,35,7v0,2,1,6,-1,7r-88,-1v-4,-13,24,-5,25,-13","w":106},"g":{"d":"14,46v0,-30,18,-31,39,-46v-41,-10,-18,-44,9,-58v-16,-4,-40,-14,-40,-49v0,-53,86,-79,120,-46v18,0,40,-2,50,-3v2,6,-3,11,-4,17r-39,0v18,44,-12,87,-76,84v-12,6,-20,11,-20,22v-1,25,58,14,81,14v20,0,43,4,43,41v0,46,-41,76,-96,76v-34,0,-67,-17,-67,-52xm37,45v0,67,117,46,117,-10v0,-45,-51,-31,-91,-34v-17,12,-26,24,-26,44xm48,-111v0,24,14,45,42,45v20,0,39,-14,39,-46v0,-32,-22,-45,-40,-45v-28,0,-41,20,-41,46","w":186},"h":{"d":"58,-137v20,-12,25,-34,58,-31v77,5,51,74,56,140v-4,21,12,18,27,22v1,16,-33,1,-50,7v-12,-44,28,-153,-46,-150v-23,0,-41,20,-42,23v-4,8,-4,107,0,111v-4,10,34,0,27,16r-80,-1v2,-19,35,4,27,-35r0,-180v4,-26,-9,-23,-27,-26r0,-6v10,-4,33,-8,48,-15v10,3,-2,82,2,125","w":206},"i":{"d":"6,-154v12,-1,40,-13,53,-12v-1,39,-3,114,2,153v1,8,32,-1,25,14r-80,-1v2,-19,38,5,29,-35r0,-87v5,-27,-11,-23,-29,-26r0,-6xm29,-226v0,-10,7,-18,17,-18v10,0,18,8,18,18v0,10,-8,17,-18,17v-10,0,-17,-7,-17,-17","w":93},"j":{"d":"3,-154v12,-1,40,-13,53,-12r-1,166v0,30,-3,92,-61,98v-1,-4,-8,-13,2,-11v49,4,31,-146,36,-209v2,-27,-11,-23,-29,-26r0,-6xm28,-226v0,-10,7,-18,17,-18v10,0,18,8,18,18v0,10,-8,17,-18,17v-10,0,-17,-7,-17,-17","w":86},"k":{"d":"81,-99v22,20,69,79,103,86r0,6r-31,10v-21,-15,-84,-82,-98,-92v5,33,-17,86,29,83v0,2,1,6,-1,7r-80,-1v2,-19,38,5,29,-35r0,-180v5,-27,-11,-23,-29,-26r0,-6v11,-4,36,-8,50,-15v10,10,2,29,2,84r0,87v18,-13,54,-46,77,-75v13,1,29,-2,40,1v0,3,1,7,-1,8v-12,0,-23,1,-90,58","w":186},"l":{"d":"6,-247v11,-4,36,-8,50,-15v10,10,-1,29,2,84v3,53,-4,117,3,165v0,8,32,-1,25,14r-80,-1v2,-19,38,5,29,-35r0,-180v5,-27,-11,-23,-29,-26r0,-6","w":93},"m":{"d":"161,-137v20,-12,25,-33,58,-31v69,4,49,77,52,140v-3,21,13,18,28,22v1,16,-34,2,-51,7v-10,-42,27,-152,-41,-150v-15,0,-33,9,-42,21r2,115v0,7,31,0,24,14r-77,-1v2,-19,33,5,27,-35v-7,-47,16,-116,-38,-114v-23,0,-41,20,-42,23v-4,8,-4,107,0,111v-4,10,34,0,27,16r-80,-1v2,-19,35,4,27,-35r0,-87v4,-26,-9,-23,-27,-26r0,-6v10,-1,38,-13,50,-12r0,29v19,-11,25,-31,55,-31v33,0,42,19,48,31","w":306},"n":{"d":"58,-137v20,-12,25,-34,58,-31v77,5,51,74,56,140v-4,21,12,18,27,22v1,16,-33,1,-50,7v-12,-44,28,-153,-46,-150v-23,0,-41,20,-42,23v-4,8,-4,107,0,111v-4,10,34,0,27,16r-80,-1v2,-19,35,4,27,-35r0,-87v4,-26,-9,-23,-27,-26r0,-6v10,-1,38,-13,50,-12r0,29","w":206},"o":{"d":"14,-81v0,-51,35,-87,85,-87v47,0,80,29,80,84v0,52,-39,88,-83,88v-63,0,-82,-52,-82,-85xm41,-91v0,100,112,123,111,10v0,-39,-16,-77,-58,-77v-32,0,-53,22,-53,67","w":193},"p":{"d":"106,-149v-32,0,-50,14,-50,48r0,73v9,10,23,17,41,17v42,0,61,-34,61,-73v0,-51,-30,-65,-52,-65xm183,-94v0,64,-67,114,-127,91r2,84v-4,10,33,1,26,16r-79,-1v1,-19,37,5,27,-35r0,-183v4,-26,-9,-23,-27,-26r0,-6v10,-1,39,-13,51,-12r0,32v31,-29,41,-34,60,-34v35,0,67,25,67,74","w":200},"q":{"d":"140,-121v5,-31,-22,-29,-45,-35v-34,0,-56,26,-56,72v0,31,18,70,55,70v22,0,32,-9,46,-22r0,-85xm140,-23v-10,2,-29,27,-55,27v-66,0,-86,-86,-59,-129v17,-27,73,-61,124,-32v6,-2,14,-15,19,-8v-10,54,-3,158,-6,226v-1,29,7,24,28,29v0,2,1,6,-1,7r-79,-1v-5,-14,29,-5,27,-15v4,-8,1,-80,2,-104","w":193},"r":{"d":"121,-137v-25,-17,-58,0,-64,24v1,31,-3,74,2,100v12,3,26,3,36,7v0,2,1,6,-1,7r-88,-1v2,-19,37,4,27,-35r0,-87v4,-26,-9,-23,-27,-26r0,-6v10,-1,39,-13,51,-12r0,35v27,-28,37,-47,67,-32v-3,10,-3,17,-3,26","w":126},"s":{"d":"124,-159v0,7,-2,18,-4,38v-11,3,-7,-11,-9,-19v-5,-21,-75,-28,-75,14v0,51,98,10,98,72v0,28,-23,58,-76,58v-17,0,-33,-3,-44,-9v2,-7,1,-27,4,-41v11,-3,8,10,9,19v13,24,83,36,83,-16v0,-50,-100,-14,-97,-73v3,-53,67,-62,111,-43","w":146},"t":{"d":"105,-15v-8,10,-14,20,-36,19v-25,0,-36,-14,-36,-33v0,-41,1,-76,1,-112v-9,0,-21,2,-28,0v1,-13,19,-10,28,-16v0,-36,-1,-39,-2,-53v10,-1,18,-10,28,-7v-2,20,-3,40,-3,60v17,1,38,-5,52,0v-3,7,-2,12,-4,16r-48,0r0,106v-5,24,31,27,45,16","w":113},"u":{"d":"113,-154v12,-1,40,-13,53,-12v-2,35,1,97,-1,138v-1,22,13,18,28,22v1,15,-36,3,-52,6v0,-10,1,-21,1,-31v-20,15,-24,36,-62,35v-68,-3,-43,-68,-48,-126v5,-27,-11,-23,-29,-26r0,-6v12,-1,40,-13,53,-12v-2,17,-1,66,-1,91v1,50,-1,52,36,61v27,-6,51,-10,51,-53r0,-55v5,-27,-11,-23,-29,-26r0,-6","w":200},"v":{"d":"78,3v-5,-23,-29,-76,-41,-103v-23,-51,-17,-52,-44,-56v-2,-14,22,-3,33,-6v15,1,33,-3,46,0v4,15,-24,1,-26,14v7,27,35,87,48,118v14,-36,38,-79,47,-117v3,-11,-31,-1,-24,-16v20,2,44,-1,63,1v1,6,-2,8,-8,8v-21,1,-43,77,-55,101v-14,28,-18,42,-22,56r-17,0","w":173},"w":{"d":"134,-123r-53,126r-15,0v-7,-28,-23,-80,-34,-114v-15,-43,-12,-40,-35,-45v0,-2,-1,-6,1,-7r77,1v4,14,-29,4,-26,17v9,38,22,77,32,114r56,-133r10,0v13,45,28,84,48,133v18,-47,41,-101,41,-114v0,-13,-19,-7,-28,-11v-1,-15,23,-3,34,-6v11,1,24,-3,34,0v1,5,-1,8,-6,8v-15,2,-17,9,-26,31v-21,52,-24,60,-48,126r-15,0","w":273},"x":{"d":"77,-70v-14,16,-35,50,-50,71v-10,-2,-35,4,-24,-9v21,-10,50,-53,68,-72v-19,-23,-43,-79,-70,-73r0,-5v8,-3,27,-3,35,-7v16,12,34,46,50,67r48,-65v7,3,31,-6,24,8v-20,-1,-46,49,-65,67v19,24,39,73,67,82v2,12,-9,5,-20,6v-7,0,-13,2,-17,0","w":159},"y":{"d":"3,95v3,-8,1,-22,9,-26v35,32,59,-41,68,-63v-9,-32,-51,-126,-56,-136v-14,-28,-16,-20,-31,-26v-2,-14,23,-3,33,-6v15,1,33,-3,46,0v4,15,-28,3,-26,15v5,28,36,87,48,119r10,-23v8,-17,36,-84,36,-94v5,-13,-29,-2,-23,-18v20,2,44,-1,63,1v1,5,-1,8,-6,8v-23,-3,-79,156,-98,197v-19,40,-35,63,-73,52","w":173},"z":{"d":"153,-49v1,10,-2,25,-4,50r-141,-1r-3,-8v10,-11,58,-71,111,-144v-65,1,-86,-9,-89,36v-17,0,-1,-26,-6,-46r129,0r0,8v-19,21,-83,107,-110,143v61,-8,97,20,106,-38r7,0","w":166},"{":{"d":"39,-99v69,22,-8,148,60,158v0,2,0,4,-1,5v-71,4,-54,-61,-54,-120v0,-23,-4,-36,-27,-43v70,-13,-26,-171,82,-161r0,3v-44,9,-30,63,-30,110v0,24,-3,42,-30,48","w":119},"|":{"d":"31,90r0,-360r18,0r0,360r-18,0","w":79},"}":{"d":"81,-98v-69,-22,8,-148,-60,-159v0,-2,0,-3,1,-4v72,-4,54,61,54,120v0,23,4,35,27,42v-69,14,25,171,-82,162r0,-4v44,-9,30,-62,30,-109v0,-24,3,-42,30,-48","w":119},"~":{"d":"146,-70v-37,0,-89,-50,-108,0r-13,-11v8,-15,21,-31,45,-31v24,-1,57,25,77,25v14,0,23,-14,31,-25r13,11v-11,15,-23,31,-45,31","w":216},"'":{"d":"47,-156v-16,-16,-8,-55,-13,-84v0,-5,3,-13,13,-13v30,8,3,59,6,87v0,4,-2,10,-6,10","w":93},"`":{"d":"60,-200r-58,-37v-12,-6,-10,-23,4,-24v28,13,44,42,67,61r-13,0","w":93},"\u00a0":{"w":90}}});

Cufon.replace('#tagline');
