$t=jQuery.noConflict();
(function($t){
$t.fn.activeMenu = function(options){
	var defaults = {  
		idSwitch: 'active',
		defaultSite: null,
		defaultIndex: 0
	},  
	intialize = function(id){
		var op = $t.extend({},defaults,options);
		var loc = location.href;
		
		var activeCount = 0;
		$t(id).find('a').each(function(){
			var href = $t(this).attr('href');
			if(loc.search(href) != -1){
				$t('li a').attr('id', '');
				$t(this).attr('id', op.idSwitch);
				activeCount++;
			}
			else{
				$t(this).attr('id', '');
			}
			
			if(activeCount == 0){
				if(loc.search(op.defaultSite) != -1){
					$t(id).find('a').eq(0).attr('id', op.idSwitch);
				}
			}
		});
		
	}
	
	return this.each(function(){
		intialize(this);					  
	});
}
})(jQuery);
