if(Browser.Plugins.Flash.version>=6)$$('h2,ins').each(function(el,w,h){$try(function(){
	var h=el.getStyle('lineHeight').toInt()+6,swiff=new Swiff('code/js/akagi.'+(h==25?'semibold':'book')+'.swf',{
		width:w=el.getParent().offsetWidth,
		height:h,
		vars:{
			w:w,h:h,txt:el.get('text'),
			textcolor:el.getStyle('color')
		}
	});
	if(el.get('tag')=='ins'&&el.getNext().get('tag')=='br'){
		var next=$$(el.getParent().getNext()),html=next.get('html').join('').trim();
		$(swiff).setStyle('marginBottom',h==25?5:10);el.getNext().destroy();
		if(html.indexOf('<br')==0||html.indexOf('<')!=0)next.each(function(el){
			new Element('br').inject(el,'top');
		});
	}
	el.empty().adopt(swiff);
})});

$$('a:not([class])').set({tween:{property:'color',duration:100},styles:{color:'#ed1c24'}}).addEvents({
	mouseenter:function(){this.tween('#000')},
	mouseleave:function(){this.tween('#ed1c24')}
});

$$('label').set({tween:{duration:100},opacity:0.5}).addEvents({
	mouseenter:function(){this.store('over',1).fade(1)},
	mouseleave:function(){this.store('over',0).retrieve('focus')||this.fade(0.5)}
});

$$('input[type="text"],textarea').addEvents({
	focus:function(){this.set('value',this.removeClass('required').value==this.title?'':this.value).getParent().store('focus',1).fade(1)},
	blur:function(){this.set('value',this.value||this.title).getParent().store('focus',0).retrieve('over')||this.getParent().fade(0.5)}
});

$$('form').addEvent('submit',function(e,stop){
	this.getElements('input[type=text]').each(function(el){
		if(!el.value||el.value==el.title)stop=!!el.addClass('required');
	});
	return !(stop?new Event(e).stop():stop);
});

setTimeout(function(){
	new Fx.Tween(document.getElement('.quotes img'),{
		onComplete:function(){
			if(this.element.getStyle('opacity').toInt())return this.start.delay(4000,this,0);
			var m=Math.round(this.element.getStyle('marginLeft').toInt()-337),m=(m*-1)<this.element.offsetWidth?m:0;
			this.start(1).element.setStyle('marginLeft',m);
		},
		property:'opacity',
		duration:1000
	}).start(0);
},4000);

new Fx.SmoothScroll({offset:{y:-20,x:0}});