// JavaScript Document



jQuery(function($) {
 
	Engine = {
		utils : {
			links : function(){
				$('a[@rel*=external]').attr('target','_blank');
			},
			mails : function(){
				$('a[@href^=mailto:]').each(function(){
					var mail = $(this).attr('href').replace('mailto:','');
					var replaced = mail.replace('/at/','@');
					$(this).attr('href','mailto:'+replaced);
					if($(this).text() == mail) $(this).text(replaced);
				});
			}
//		},
//		design : {
//			featured : {
//				init : function(speed,fade){
//					if($('#largeHPBlock ul li').size() < 2) return;
//					if($.browser.msie && parseInt($.browser.version) === 6) $('#largeHPBlock ul li:first').show();
//					this.speed 	= speed;
//					this.fade 	= fade;
//					this.cycle();
//				},
//				next : function(){
//					var root = this;
//					var visible = $('#largeHPBlock ul li:visible');
//					var next = $('#largeHPBlock ul li:visible').next('li');
//					if(next.size() == 0) next = $('#largeHPBlock ul li:first');
//					visible.fadeOut(root.fade,function(){
//						next.fadeIn(root.fade,function(){
//							root.cycle();
//						});
//					});
//				},
//				cycle : function(){
//					this.timeout = setTimeout('Engine.design.featured.next()',this.speed);
//				}
//			}
		},
		fixes : {
			activeNav : function(){				
				$('div#nav div ul li a').each(function(){
					
					var path = document.location.href; 
					var current_href = this.getAttribute('href',2);

					if (path.split(".com")[1] == current_href) {
					  $(this).addClass("active");
					}
				});
				$('div.tabs-a div ul li a').each(function(){
					
					var path = document.location.href; 
					var current_href = this.getAttribute('href',2);

					if (path.split(".com")[1] == current_href) {
					  $(this).addClass("active");
					}
				});
			},
			general : function(){ 		
				
			}
			
		}
	}
	

	Engine.utils.links();
	Engine.utils.mails();
	//Engine.design.featured.init(5000,1000);
	Engine.fixes.activeNav();
	Engine.fixes.general();
	
});