// JavaScript Document
window.addEvent('domready', function(){
/* IE6 Found 
if(Browser.Engine.trident4)
  { //PERFORM IE6 FIXES
    //alert('dert');
  }
/* END: IE6 Found and end IE6 period! */
/* remove focus outline */
	var aLinks = $$('a');
	aLinks.each(function(el){
		el.addEvent('focus', function(e){
			if(this.blur)this.blur();
		});
	});
	
	//var aTags = $$('div.taggers a');
	
/* END: remove focus outline */	
/* Navigation */
	$$('.mainnav a', 'div.postTitle h2 a').each(function(el){
			el.addEvents({
				'mouseenter': function(e){
					this.morph('.mainnavOn');
					},
				'mouseleave': function(e){
					this.morph('.mainnavOff');
					}
			});
	});
	$$('div.taggers a').each(function(el){
			el.addEvents({
				'mouseenter': function(e){
					this.morph('.aTagOn');
					},
				'mouseleave': function(e){
					this.morph('.aTagOff');
					}
			});
	});
	$$('a.more-link').each(function(el){
			el.addEvents({
				'mouseenter': function(e){
					this.morph('.moreOn');
					},
				'mouseleave': function(e){
					this.morph('.moreOff');
					}
			});
	});
		$$('li ul li').each(function(el){
			el.addEvents({
				'mouseenter': function(e){
					this.morph('.sidebarOn');
          if(this.getElement('a')){
					this.getElement('a').morph('.sidebarAOn');
          }
					},
				'mouseleave': function(e){
					this.morph('.sidebarOff');
				if(this.getElement('a')){
        this.getElement('a').morph('.sidebarAOff');
        }
					}
			});
	});
		/* $$('div.ngg-gallery-thumbnail a').each(function(el){
			var inlargeIco = new Element('div', {
					'class': 'inlargeIco'
			});			
			inlargeIco.inject(el);
			el.addEvents({
				'mouseenter': function(e){
					this.morph('.galthumbOn');
					this.getElement('img').morph('.galthumbImgOn');
					},
				'mouseleave': function(e){
					this.morph('.galthumbOff');
					this.getElement('img').morph('.galthumbImgOff');
					}
			});
	}); */
/* END: Navigation */
/* SHARE LOVE STUFF */
	if($$('.shareLove'))
	{	
		$$('.shareLove').each(function(el){
		var theLovers = el.getElement('div.shareLovers')
											.set({'opacity': 0})
											.addEvents({
												'mouseenter': function(){
													this.morph({'opacity': 1});													
												},
												'mouseleave': function(){													
														this.morph({'opacity': 0});													
												}
											});
			
			el.getElement('div.shareLoveBtn').addEvents({
				'mouseenter': function(){					
					theLovers.morph({'opacity': 1});
				},
				'mouseleave': function(){
						theLovers.morph({'opacity': 0});
				}
			});
		});
	}
/* END: SHARE LOVE STUFF */
/* FORUM STUFF */
	if($$('.fader'))
	{	
		$$('.fader').each(function(el){
			el.addEvents({
				'mouseenter': function(e){
					this.morph('.faderOn');
					},
				'mouseleave': function(e){
					this.morph('.faderOff');
					}
			});
	});
	}
/* END: FADER STUFF */
/* SET UP input ANIMATION */
	if($$('input'))
	{	
		var inputs = $$('input','textarea');
		inputs.each(function(el){
			el.addEvents({
				'focus': function(e){
					el.morph('.inputFocus');
					},
				'mouseenter': function(e){
					el.morph('.inputOn');
					},
				'mouseleave': function(e){
					el.morph('.inputOff');	
				}
			});
		});
	}
/* END: SET UP input ANIMATION */
/* BOOKING CONTACT */
	if($('booking'))
	{	
		$('booking').addEvent('click', function(e){
			parent.location='mailto:booking@esoterichiphop.com';
		});
	}
/* END: BOOKING CONTACT */
/* PRODUCT THUMBS */
	if($$('a.thickbox'))
	{	
		$$('a.thickbox').each(function(el) {
		var inlargeIco = new Element('div', {
				'class': 'inlargeIco'
		});
			
		inlargeIco.inject(el);
		el.addEvents({
				'mouseenter': function(e){
          if(el.hasClass('preview_link')){
            el.morph('.faderOn');
          }else{
            this.morph('.galthumbOn');
            this.getElement('img').morph('.galthumbImgOn');
          }
        },
				'mouseleave': function(e){
          if(el.hasClass('preview_link')){
            el.morph('.faderOff');
          }else{
            this.morph('.galthumbOff');
            this.getElement('img').morph('.galthumbImgOff');
          }
        }
			});																								
		});
	}
/* END: PRODUCT THUMBS */

});
