var textEffects = Class.create({
	initialize : function(){
		Cufon.replace('h3');
		
		Cufon.replace('h1', { fontFamily: 'GothamBook' })('h2', { fontFamily: 'GothamBook' });;
		this.addExpanders();
	},
	addExpanders : function(){
		var expanders = $$('.expander');
		
		if(expanders != ''){
			expanders.each(function(ele,index){
				ele.observe('click', function(event){
					if(!ele.isDown){
						Effect.BlindDown(ele.next(), {duration:.15});
						ele.isDown = true;
						ele.className="expanded";
					}else{
						Effect.BlindUp(ele.next(), {duration:.15});
						ele.isDown = false;
						ele.className="expander";						
					}
				})
			})
		}
	}
});



// Hover Behaviour for Nav etc.
var HoverBehavior = Class.create();
HoverBehavior.prototype = {
   initialize: function() {
       $A(document.styleSheets).each( function(stylesheet) {
       $A(stylesheet.rules).each( function(rule) {
       if( rule.selectorText.match(/:hover/i) ) {
           stylesheet.addRule( rule.selectorText.replace(/:hover/ig, '.hover'), rule.style.cssText );
       }
       });
   });

   $A(arguments).each( function(arg) {
       $$(arg).each( function(tag) {
           Event.observe(tag, 'mouseenter', function() { Element.addClassName(tag, 'hover'); }, true);
           Event.observe(tag, 'mouseleave', function() { Element.removeClassName(tag, 'hover'); }, true);
           });
       });
   }
};



var qlStatus=false;
var tf = null;
Event.observe(window, 'load', function() {
	tf  = new textEffects();
	var navHover = new HoverBehavior("#nav li");

});	