// opens or closes objs //
function openDiv(id){
	obj=document.getElementById(id);
	if(obj.style.display=='none'){
		obj.style.display='';
	}else{
		obj.style.display='none';
	}
}




function delete_confirm(page) {
	if(confirm("Delete?")) {
		location.href = page;
	}
}

	
	
function News(id){
	obj0=document.getElementById('news_0');
	obj1=document.getElementById('news_1');
	obj2=document.getElementById('news_2');
	
	obj0.style.display='none';
	obj1.style.display='none';
	obj2.style.display='none';
	
	if(id!="x"){
		objC=document.getElementById('news_'+id);
			objC.style.display='';
	}

}	
	
	
function trTriger(){
this.trid = new Array();
this.imgid ='';
this.openimg ='';
this.closeimg ='';

this.setImg = function(id,openimg,closeimg){
	this.imgid = id;
	this.openimg =openimg;
	this.closeimg=closeimg;
}
this.trigerImg = function(state){
	obj=document.getElementById(this.imgid);

	if(state=='open'){
		obj.src=this.openimg;
	}else{
		obj.src=this.closeimg;
	}
}

this.add = function(id){
		this.trid[this.trid.length]=id;
	}
	
	this.open = function(){
	
		for(var i=0;i<=this.trid.length;i++){
			obj=document.getElementById(this.trid[i]);
			obj.style.display='';
		}
		
	}
	this.close = function(){
	
		for(var i=0;i<=this.trid.length;i++){
			obj=document.getElementById(this.trid[i]);
			obj.style.display='none';
		}
		
	}
	
	this.triger = function(){
	
		obj=document.getElementById(this.trid[0]);
		if(obj.style.display=='none'){
			doAction='open';
		}else{
			doAction='close';
		}
		
		for(var i=0;i<this.trid.length;i++){
			
			obj=document.getElementById(this.trid[i]);
			if(doAction=='open'){
				obj.style.display='';
			}else{
				obj.style.display='none';
			}
		}
		this.trigerImg(doAction);
		
	}

}	
	
	
	

