window.addEvent('domready', function(){

/*

	//promoIcon
	if ($('promoIcon')){
		$('promoIcon').addEvents({
			'mouseenter': function(){
				this.getElement('span').setStyle('display', 'block');
				this.set('title', '');
			},
			'mouseleave': function(){
				this.getElement('span').setStyle('display', 'none');
			},
		});
	}


	//promoIcon
	if ($('littleArt')){
		$('littleArt').addEvents({
			'mouseenter': function(){
				this.addClass('active');
			},
			'mouseleave': function(){
				this.removeClass('active');
			},
		});
	}


	// littleicons
	if ($('tinyIcons')){
		$('tinyIcons').getElements('a').each(function(e){
			e.addEvents({
				'mouseenter': function(){
					this.getElement('span').setStyle('display', 'block');
					this.set('title', '');
				},
				'mouseleave': function(){
					this.getElement('span').setStyle('display', 'none');
				},
			});
		});
	}

*/

	// big silent words
	if ($('bigArtWords')){
	
		// hide at start
		$('bigArtWords').getElements('a').each(function(el){
				el.fade('hide');
		});
	
		var bigArt = $('bigArt').getElements('a');
			
		bigArt.each(function(el){
		
			el.addEvents({
				'mouseenter': function(){
					if (Browser.Engine.trident == true){
						$(this.get('class')).fade('show');
					} else {
						$(this.get('class')).fade('in');
					}
					$('zupzup').fade('out');
				},
				'mouseleave': function(){
					if (Browser.Engine.trident == true){
						$(this.get('class')).fade('hide');
					} else {
						$(this.get('class')).fade('out');
					}
					
				}				
			});
		
		});
		
	} // bigArtWords



	//iefailz
	if (Browser.Engine.trident != true){
		// navigation arrows
		$$('.navArrow').each(function(el){
			el.set('opacity', 0.3);
			
			el.addEvents({
				'mouseenter': function(){
					this.fade(1);
				},
				'mouseleave': function(){
					this.fade(0.3);
				}				
			});
				
		});

	}//iefailz


	// usage new InputMatcher(element, /^[a-z]*$/);
	var InputMatcher = new Class({

    initialize: function(input, matcher){
        this.input = $(input);
        this.value = this.input.get('value');
        this.matcher = RegExp.type(matcher) ? function(string, old) {
            return string.match(matcher) ? false : old;
        } : matcher;
        this.action.periodical(100, this);
    },
    
    action: function() {
        var value = this.input.get('value');
        if (this.value == value) return;
        var filtered = this.matcher(value, this.value);
        if (filtered !== false) {
            this.input.set('value', filtered);
            this.value = filtered;
        } else this.value = value;
    }
    
	});


	// promotion
	if ($('promoInput')){
		
		$('promoInput').addEvent('click', function(){
			if (this.get('value') == "Type your number here"){
				this.set('value', '');
			}
		});
		var promoInputMatch = new InputMatcher('promoInput', /^\d*$/);
	
	}
	
	
/*
	// checks for javascript on the home page
	if ($('javascriptTest')){
 
		$('javascriptTest').empty().grab($('javascriptContent'));
		
		var i = 30;
		var startGainPLz = 300;
		var myFx = new Fx.Tween('volumez', {duration:10});
		
		function loopIt(){
			myFx.start('left', i);
			if (i > -90) {i-=31;}
			else {i = 0;}
		
			// now wait for a while and do it again
			$clear(myPeriod);
			myPeriod = loopIt.periodical(startGainPLz);
		}
		
		// DO IT!
		var myPeriod = loopIt.periodical(startGainPLz);

		
 
	} //javascriptTest
*/

		
	if ($('bigArt')){
		
		$('bigArt').fade('hide').fade('in');
		$('theBrakePad').fade('hide').fade('in');
	
		// fade words
		(function(){
			$('theIntroPicture').fade('out');
		}).delay(2000);
	
		// fade words
		(function(){
			$('theBrakePad').fade('out');
		}).delay(3000);
	
		// explanation in
		(function(){
			$('zupzup').fade('in');
		}).delay(4500);	
	}		
});








