function myPopup(addr,w,h) {
	if(addr.indexOf(".jpg")!=-1) {
		var generator=window.open('', 'Preview', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width='+w+',height='+h);
		generator.document.write('<html><head><title>de Radigues Rider School</title>');
		generator.document.write('</head><body style="margin: 0;padding: 0;">');
		generator.document.write('<img src="'+addr+'" border="0">');
		generator.document.write('</body></html>');
		generator.document.close();
	} else {
		window.open(addr, 'Preview', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width='+w+',height='+h);
	}
}

window.addEvent('domready', function(){
	$('wrapper').setStyle('height', (Math.max($('main_text').getSize().y,$('right').getSize().y) + 160)+'px');
	$('footer').setStyle('top', (window.getScroll().y + window.getSize().y - 70)+'px');
	new MooZoom({
		duration: 250,
		linkSelector: "a.zoom",
		imageRoot: "../gfx/"
	});
});

window.addEvent('scroll', function(){
	$('footer').set('tween', {duration: 1000, transition: Fx.Transitions.Expo.easeOut});
	$('footer').tween('top', (window.getScroll().y + window.getSize().y - 70) );
});

/* description: MooZoom license: MIT-style authors: Luke Ehresman (http://luke.ehresman.org) requires: core:1.2.1: '*' provides: [MooZoom] */
var MooZoom=new Class({Implements:Options,elements:null,options:{linkSelector:"a",imageSelector:"img",imageRoot:"/images/",transition:Fx.Transitions.linear.easeOut,duration:250,close:"top-left"},initialize:function(options){this.setOptions(options);if(this.options.imageRoot[this.options.imageRoot.length-1]!="/")this.options.imageRoot+="/";this.elements=document.getElements(this.options.linkSelector);this.elements.each(function(a){a.getElements(this.options.imageSelector).each(function(img){this.setupImage(a,img)}.bind(this))}.bind(this))},setupImage:function(a,img){var href=a.getProperty("href");a.setProperty("href",null);a.setStyle("cursor","pointer");var container=new Element("img",{src:href,styles:{"opacity":0,"top":-99999,"left":-99999,"position":"absolute","z-index":"1000","cursor":"pointer","border":"none"}}).inject(document.body);if(this.options.close){var close=new Element("img",{src:this.options.imageRoot+"/moozoom_close.png",styles:{"opacity":0,"top":-99999,"left":-99999,"position":"absolute","z-index":"1000","cursor":"pointer"}}).inject(document.body)}var bigCoords=null;var smallCoords=null;a.addEvent("click",function(e){if(!bigCoords)bigCoords={width:container.width,height:container.height};if(!smallCoords)smallCoords=img.getCoordinates();var startWidth=(smallCoords.width/bigCoords.width)*bigCoords.width;var startHeight=(smallCoords.height/bigCoords.height)*bigCoords.height;var bodyElem=document.id(document.body);var endTop=bodyElem.getScroll().y+(bodyElem.getHeight()-bigCoords.height)/2;var endLeft=bodyElem.getScroll().x+(bodyElem.getWidth()-bigCoords.width)/2;if(this.options.close){var closeTop=endTop-10;var closeLeft=endLeft-10;switch(this.options.close){case"bottom-right":closeTop=endTop+bigCoords.height-14;closeLeft=endLeft+bigCoords.width-14;break;case"bottom-left":closeTop=endTop+bigCoords.height-14;break;case"top-right":closeLeft=endLeft+bigCoords.width-14;break}close.setStyles({"top":smallCoords.top,"left":smallCoords.left,"opacity":0,"width":1,"height":1});new Fx.Morph(close,{transition:this.options.transition,duration:this.options.duration}).start({height:24,width:24,opacity:1,top:closeTop,left:closeLeft})}container.setStyles({"position":"absolute","top":smallCoords.top,"left":smallCoords.left,"opacity":0,"width":startWidth,"height":startHeight});new Fx.Morph(container,{transition:this.options.transition,duration:this.options.duration,onComplete:function(e){container.setStyles({"-moz-box-shadow":"0px 2px 15px #000","-webkit-box-shadow":"0px 2px 15px #000"})}.bind(this)}).start({height:bigCoords.height,width:bigCoords.width,opacity:1,top:endTop,left:endLeft})}.bind(this));var closeEvent=function(e){if(!bigCoords)bigCoords={width:container.width,height:container.height};if(!smallCoords)smallCoords=img.getCoordinates();var endWidth=(smallCoords.width/bigCoords.width)*bigCoords.width;var endHeight=(smallCoords.height/bigCoords.height)*bigCoords.height;container.setStyles({"-moz-box-shadow":"none","-webkit-box-shadow":"none"});if(this.options.close){new Fx.Morph(close,{transition:this.options.transition,duration:this.options.duration,onComplete:function(){close.setStyles({"top":-99999,"left":-99999})}}).start({width:1,height:1,opacity:0,top:smallCoords.top,left:smallCoords.left})}new Fx.Morph(container,{transition:this.options.transition,duration:this.options.duration,onComplete:function(){container.setStyles({"top":-99999,"left":-99999})}}).start({width:endWidth,height:endHeight,opacity:0,top:smallCoords.top,left:smallCoords.left});e.stopPropagation()}.bind(this);container.addEvent("click",closeEvent);if(this.options.close){close.addEvent("click",closeEvent)}}});

/*MooTools, My Object Oriented Javascript Tools. Copyright (c) 2006-2007 Valerio Proietti, <http://mad4milk.net>, MIT Style License.||Clientcide Copyright (c) 2006-2008, http://www.clientcide.com/wiki/cnet-libraries#license*/
var Clientcide={version:'812',setAssetLocation:function(baseHref){if(window.StickyWin&&StickyWin.ui){StickyWin.UI.refactor({options:{baseHref:baseHref+'/stickyWinHTML/'}});if(StickyWin.alert){var CGFsimpleErrorPopup=StickyWin.alert.bind(window);StickyWin.alert=function(msghdr,msg,base){return CGFsimpleErrorPopup(msghdr,msg,base||baseHref+"/simple.error.popup")}}if(StickyWin.UI.Pointy){StickyWin.UI.Pointy.refactor({options:{baseHref:baseHref+'/PointyTip/'}})}}if(window.TagMaker){TagMaker=TagMaker.refactor({options:{baseHref:baseHref+'/tips/'}})}if(window.ProductPicker){ProductPicker.refactor({options:{baseHref:baseHref+'/Picker'}})}if(window.Autocompleter){var AcClientcide={options:{baseHref:baseHref+'/autocompleter/'}};Autocompleter.Base.refactor(AcClientcide);if(Autocompleter.Ajax){["Base","Xhtml","Json"].each(function(c){if(Autocompleter.Ajax[c])Autocompleter.Ajax[c].refactor(AcClientcide)})}if(Autocompleter.Local)Autocompleter.Local.refactor(AcClientcide);if(Autocompleter.JsonP)Autocompleter.JsonP.refactor(AcClientcide)}if(window.Lightbox){Lightbox.refactor({options:{assetBaseUrl:baseHref+'/slimbox/'}})}if(window.Waiter){Waiter.refactor({options:{baseHref:baseHref+'/waiter/'}})}},preLoadCss:function(){if(window.DatePicker)new DatePicker();if(window.ProductPicker)new ProductPicker();if(window.TagMaker)new TagMaker();if(window.StickyWin&&StickyWin.ui)StickyWin.ui();if(window.StickyWin&&StickyWin.pointy)StickyWin.pointy();Clientcide.preloaded=true;return true},preloaded:false};(function(){if(!window.addEvent)return;var preload=function(){if(window.dbug)dbug.log('preloading clientcide css');if(!Clientcide.preloaded)Clientcide.preLoadCss()};window.addEvent('domready',preload);window.addEvent('load',preload)})();setCNETAssetBaseHref=Clientcide.setAssetLocation;var dbug={logged:[],timers:{},firebug:false,enabled:false,log:function(){dbug.logged.push(arguments)},nolog:function(msg){dbug.logged.push(arguments)},time:function(name){dbug.timers[name]=new Date().getTime()},timeEnd:function(name){if(dbug.timers[name]){var end=new Date().getTime()-dbug.timers[name];dbug.timers[name]=false;dbug.log('%s: %s',name,end)}else dbug.log('no such timer: %s',name)},enable:function(silent){var con=window.firebug?firebug.d.console.cmd:window.console;if((!!window.console&&!!window.console.warn)||window.firebug){try{dbug.enabled=true;dbug.log=function(){(con.debug||con.log).apply(con,arguments)};dbug.time=function(){con.time.apply(con,arguments)};dbug.timeEnd=function(){con.timeEnd.apply(con,arguments)};if(!silent)dbug.log('enabling dbug');for(var i=0;i<dbug.logged.length;i++){dbug.log.apply(con,dbug.logged[i])}dbug.logged=[]}catch(e){dbug.enable.delay(400)}}},disable:function(){if(dbug.firebug)dbug.enabled=false;dbug.log=dbug.nolog;dbug.time=function(){};dbug.timeEnd=function(){}},cookie:function(set){var value=document.cookie.match('(?:^|;)\\s*jsdebug=([^;]*)');var debugCookie=value?unescape(value[1]):false;if((!$defined(set)&&debugCookie!='true')||($defined(set)&&set)){dbug.enable();dbug.log('setting debugging cookie');var date=new Date();date.setTime(date.getTime()+(24*60*60*1000));document.cookie='jsdebug=true;expires='+date.toGMTString()+';path=/;'}else dbug.disableCookie()},disableCookie:function(){dbug.log('disabling debugging cookie');document.cookie='jsdebug=false;path=/;'}};(function(){var fb=!!window.console||!!window.firebug;var con=window.firebug?window.firebug.d.console.cmd:window.console;var debugMethods=['debug','info','warn','error','assert','dir','dirxml'];var otherMethods=['trace','group','groupEnd','profile','profileEnd','count'];function set(methodList,defaultFunction){for(var i=0;i<methodList.length;i++){dbug[methodList[i]]=(fb&&con[methodList[i]])?con[methodList[i]]:defaultFunction}};set(debugMethods,dbug.log);set(otherMethods,function(){})})();if((!!window.console&&!!window.console.warn)||window.firebug){dbug.firebug=true;var value=document.cookie.match('(?:^|;)\\s*jsdebug=([^;]*)');var debugCookie=value?unescape(value[1]):false;if(window.location.href.indexOf("jsdebug=true")>0||debugCookie=='true')dbug.enable();if(debugCookie=='true')dbug.log('debugging cookie enabled');if(window.location.href.indexOf("jsdebugCookie=true")>0){dbug.cookie();if(!dbug.enabled)dbug.enable()}if(window.location.href.indexOf("jsdebugCookie=false")>0)dbug.disableCookie()}Element.implement({measure:function(fn){var restore=this.expose();var result=fn.apply(this);restore();return result},expose:function(){if(this.getStyle('display')!='none')return $empty;var before={};var styles={visibility:'hidden',display:'block',position:'absolute'};$each(styles,function(value,style){before[style]=this.style[style]||''},this);this.setStyles(styles);return(function(){this.setStyles(before)}).bind(this)},getDimensions:function(options){options=$merge({computeSize:false},options);var dim={};function getSize(el,options){return(options.computeSize)?el.getComputedSize(options):el.getSize()};if(this.getStyle('display')=='none'){var restore=this.expose();dim=getSize(this,options);restore()}else{try{dim=getSize(this,options)}catch(e){}}return $chk(dim.x)?$extend(dim,{width:dim.x,height:dim.y}):$extend(dim,{x:dim.width,y:dim.height})},getComputedSize:function(options){options=$merge({styles:['padding','border'],plains:{height:['top','bottom'],width:['left','right']},mode:'both'},options);var size={width:0,height:0};switch(options.mode){case'vertical':delete size.width;delete options.plains.width;break;case'horizontal':delete size.height;delete options.plains.height;break};var getStyles=[];$each(options.plains,function(plain,key){plain.each(function(edge){options.styles.each(function(style){getStyles.push((style=="border")?style+'-'+edge+'-'+'width':style+'-'+edge)})})});var styles=this.getStyles.apply(this,getStyles);var subtracted=[];$each(options.plains,function(plain,key){size['total'+key.capitalize()]=0;size['computed'+key.capitalize()]=0;plain.each(function(edge){size['computed'+edge.capitalize()]=0;getStyles.each(function(style,i){if(style.test(edge)){styles[style]=styles[style].toInt();if(isNaN(styles[style]))styles[style]=0;size['total'+key.capitalize()]=size['total'+key.capitalize()]+styles[style];size['computed'+edge.capitalize()]=size['computed'+edge.capitalize()]+styles[style]}if(style.test(edge)&&key!=style&&(style.test('border')||style.test('padding'))&&!subtracted.contains(style)){subtracted.push(style);size['computed'+key.capitalize()]=size['computed'+key.capitalize()]-styles[style]}})})});if($chk(size.width)){size.width=size.width+this.offsetWidth+size.computedWidth;size.totalWidth=size.width+size.totalWidth;delete size.computedWidth}if($chk(size.height)){size.height=size.height+this.offsetHeight+size.computedHeight;size.totalHeight=size.height+size.totalHeight;delete size.computedHeight}return $extend(styles,size)}});Element.implement({isVisible:function(){return this.getStyle('display')!='none'},toggle:function(){return this[this.isVisible()?'hide':'show']()},hide:function(){var d;try{if('none'!=this.getStyle('display'))d=this.getStyle('display')}catch(e){}this.store('originalDisplay',d||'block');this.setStyle('display','none');return this},show:function(display){original=this.retrieve('originalDisplay')?this.retrieve('originalDisplay'):this.get('originalDisplay');this.setStyle('display',(display||original||'block'));return this},swapClass:function(remove,add){return this.removeClass(remove).addClass(add)},fxOpacityOk:function(){return!Browser.Engine.trident4}});Fx.Reveal=new Class({Extends:Fx.Morph,options:{styles:['padding','border','margin'],transitionOpacity:true,mode:'vertical',heightOverride:null,widthOverride:null},dissolve:function(){try{if(!this.hiding&&!this.showing){if(this.element.getStyle('display')!='none'){this.hiding=true;this.showing=false;this.hidden=true;var startStyles=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});var setToAuto=this.element.style.height===""||this.element.style.height=="auto";this.element.setStyle('display','block');if(this.element.fxOpacityOk()&&this.options.transitionOpacity)startStyles.opacity=1;var zero={};$each(startStyles,function(style,name){zero[name]=[style,0]},this);var overflowBefore=this.element.getStyle('overflow');this.element.setStyle('overflow','hidden');this.$chain=this.$chain||[];this.$chain.unshift(function(){if(this.hidden){this.hiding=false;$each(startStyles,function(style,name){startStyles[name]=style},this);this.element.setStyles($merge({display:'none',overflow:overflowBefore},startStyles));if(setToAuto)this.element.setStyle('height','auto')}this.fireEvent('onHide',this.element);this.callChain()}.bind(this));this.start(zero)}else{this.callChain.delay(10,this);this.fireEvent('onComplete',this.element);this.fireEvent('onHide',this.element)}}else if(this.options.link=="chain"){this.chain(this.dissolve.bind(this))}else if(this.options.link=="cancel"&&!this.hiding){this.cancel();this.dissolve()}}catch(e){this.hiding=false;this.element.hide();this.callChain.delay(10,this);this.fireEvent('onComplete',this.element);this.fireEvent('onHide',this.element)}return this},reveal:function(){try{if(!this.showing&&!this.hiding){if(this.element.getStyle('display')=="none"||this.element.getStyle('visiblity')=="hidden"||this.element.getStyle('opacity')==0){this.showing=true;this.hiding=false;this.hidden=false;var before=this.element.getStyles('visibility','display','position');this.element.setStyles({visibility:'hidden',display:'block',position:'absolute'});var setToAuto=this.element.style.height===""||this.element.style.height=="auto";if(this.element.fxOpacityOk()&&this.options.transitionOpacity)this.element.setStyle('opacity',0);var startStyles=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});this.element.setStyles(before);$each(startStyles,function(style,name){startStyles[name]=style},this);if($chk(this.options.heightOverride))startStyles['height']=this.options.heightOverride.toInt();if($chk(this.options.widthOverride))startStyles['width']=this.options.widthOverride.toInt();if(this.element.fxOpacityOk()&&this.options.transitionOpacity)startStyles.opacity=1;var zero={height:0,display:'block'};$each(startStyles,function(style,name){zero[name]=0},this);var overflowBefore=this.element.getStyle('overflow');this.element.setStyles($merge(zero,{overflow:'hidden'}));this.start(startStyles);if(!this.$chain)this.$chain=[];this.$chain.unshift(function(){this.element.setStyle('overflow',overflowBefore);if(!this.options.heightOverride&&setToAuto){if(["vertical","both"].contains(this.options.mode))this.element.setStyle('height','auto');if(["width","both"].contains(this.options.mode))this.element.setStyle('width','auto')}if(!this.hidden)this.showing=false;this.callChain();this.fireEvent('onShow',this.element)}.bind(this))}else{this.callChain();this.fireEvent('onComplete',this.element);this.fireEvent('onShow',this.element)}}else if(this.options.link=="chain"){this.chain(this.reveal.bind(this))}else if(this.options.link=="cancel"&&!this.showing){this.cancel();this.reveal()}}catch(e){this.element.setStyles({display:'block',visiblity:'visible',opacity:1});this.showing=false;this.callChain.delay(10,this);this.fireEvent('onComplete',this.element);this.fireEvent('onShow',this.element)}return this},toggle:function(){try{if(this.element.getStyle('display')=="none"||this.element.getStyle('visiblity')=="hidden"||this.element.getStyle('opacity')==0){this.reveal()}else{this.dissolve()}}catch(e){this.show()}return this}});Element.Properties.reveal={set:function(options){var reveal=this.retrieve('reveal');if(reveal)reveal.cancel();return this.eliminate('reveal').store('reveal:options',$extend({link:'cancel'},options))},get:function(options){if(options||!this.retrieve('reveal')){if(options||!this.retrieve('reveal:options'))this.set('reveal',options);this.store('reveal',new Fx.Reveal(this,this.retrieve('reveal:options')))}return this.retrieve('reveal')}};Element.Properties.dissolve=Element.Properties.reveal;Element.implement({reveal:function(options){this.get('reveal',options).reveal();return this},dissolve:function(options){this.get('reveal',options).dissolve();return this},nix:function(){var params=Array.link(arguments,{destroy:Boolean.type,options:Object.type});this.get('reveal',params.options).dissolve().chain(function(){this[params.destroy?'destroy':'dispose']()}.bind(this));return this}});
