var textEffects = Class.create({
	initialize : function(){
		Cufon.set('fontFamily', 'HelveticaNeueBoldCondensed').replace('h1')('h2')('#banner-text blockquote')('#leftnav h3');
		Cufon.set('fontFamily', 'Helvetica Neue').replace('#banner-text cite');
		Cufon.set('fontFamily', 'Helvetica Neue').replace('#nav > ul > li > a',{hover:true});
		var pt = new PageTabs('subcontent');
		myLightWindow = new lightwindow();
		if($('banner-text') && $('banner-text').className == "animated"){
			$('banner-overlay').appear({duration:.5, to:.89, queue:'front'});
			$('banner-text').appear({duration:.5, to:1, queue:'end'});
		}
		if($('subtabs')){
			this.initTabs();
		}
		if($('link')){
			Event.observe($('link'), 'click', function(){
				if(qlStatus){
					$("link-dropdown").blindUp({
						duration:.15
					});
					qlStatus = false;
				}else{
					$("link-dropdown").blindDown({
						duration:.15
					});
					qlStatus = true;
				}
			});
		}
	},
	initTabs:function(){
		new Control.Tabs('subtabs');  
	}
});



// 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");
});	