var sideTabs=function(){
	this.currentId=null;
}
sideTabs.prototype.init=function(qclass){
	var that=this;
	$(qclass).click(function(){
		that.toggleTab(this,true);
		return false;
	});
}
sideTabs.prototype.toggleTab=function(qel,qanimate){
	if(this.currentId){
		if(qanimate){
			$('#sidecontent_'+this.currentId).slideUp('slow');
		}else{
			$('#sidecontent_'+this.currentId).hide();
		}
		$('#sidetab_'+this.currentId).removeClass('sidetab_open');
	}
	
	var current=qel.id.split('sidetab_')[1];
	
	if(current!=this.currentId){
		this.currentId=current;
		if(qanimate){
			$('#sidecontent_'+this.currentId).slideDown('slow');
		}else{
			$('#sidecontent_'+this.currentId).show();
		}
		$('#sidetab_'+this.currentId).addClass('sidetab_open');
	}else{
		this.currentId=null;
	}
}
$('document').ready(function(){
	var tabs=new sideTabs();
	tabs.init('.sidetab');
	
	
	
});


