window.addEvent('domready', function() {
	
	function fix_external_links() { 
	    $$('a').each(function(el) { 
	        if (el.getProperty('rel') == 'external') { 
				//alert(el.getProperty('rel'));
	            el.set('target',"new"); 
	        }     
	    }); 
	} 
 
	//fix_external_links();
	
	var myImages = new Asset.images([
		'/img/buttons/bbox-on.png',
		'/img/buttons/cbox-on.png',
		'/img/buttons/sbox-on.png',
		'/img/buttons/rbox-on.png'
	]);
	
	$$('.wiggly').each(function(el){
		el.addEvents({
			'mouseenter': function(){
				src= this.src;
				this.src= src.replace("off.","on.");
				if($('testie8').getAttribute("checked")=='checked'){
					this.set('morph', {
						duration: 250,
						link: 'cancel'
					}).morph('.wiggly-large');
				}
			},
			'mouseleave': function(){
				this.src= src.replace("on.","off.");
				if($('testie8').getAttribute("checked")=='checked'){
					this.set('morph', {
						duration: 'long',
						link: 'cancel',
						transition: 'bounce:out'
					}).morph('.wiggly');
				}
			}
		})
	})
	$$('.rollover').each(function(el){
		el.setStyle('opacity','0.6');
		el.addEvents({
			'mouseenter': function(){
				this.set('tween', {duration: 250}).tween('opacity','1');
			},
			'mouseleave': function(){
				this.set('tween', {duration: 250}).tween('opacity','0.6');
			}
		})
	})
});