var werd;
function openopen(linkk,name,w_,h_){
	linkk='/popwin.php?link='+linkk+'&dir='+name;
	var up_=100;
	var left_=100;
	param = 'top='+up_+',left='+left_+',width='+w_+',height='+h_;
	if (werd==null||werd.closed){
		werd=window.open(linkk,name, param+',status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no');
	}
	else{
		werd.close();
		werd=window.open(linkk,name, param+',status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no');
	}
	werd.focus();
}
function open_win(links,name){
	un_window=window.open('http://'+links,name);
	un_window.focus();
}
var nam;
function dok0(url,h,w){
	if (nam!=null && !nam.closed)nam.close();
	tops(h,w);
	nam=window.open(url,null,"height="+h+",width="+w+",status=no,toolbar=no,menubar=no,location=no,top="+top_+",left="+left_+",scrollbars=no,resizable=yes");
	nam.focus();
}
function tops(h,w){
	if (navigator.appName == "Netscape") {
		top_=window.innerHeight/2-h/2;
		left_=window.innerWidth/2-w/2;
	}
	else {
		top_=document.body.clientHeight/2-h/2;
		left_=document.body.clientWidth/2-w/2;
	}
}
function get_cur_date(b){
	a=new Date();
	year=a.getYear();
	if(year<2000)year+=1900;
	if((a.getMonth()+1+b)>12)return "01/01/"+(year+1);
	return "01/"+(a.getMonth()+1+b)+"/"+year;
}
function get_cur_date_year(b){
	a=new Date();
	year=a.getYear();
	if(year<2000)year+=1900;
	return (year-b)+"-01-01";
}
function set_color(num){//,a,b,c
	if(!document.getElementById || !dhtml_objects["div_submenu"])return;
	//if(cl_menu!=num)
	clear_color();
		//var _a=document.getElementById("t"+(num-1));
	//var _b=document.getElementById("t"+num);
		//var _b_=document.getElementById("t_"+num);
		//var _c=document.getElementById("t"+(num+1));
	var _link=document.getElementById("a"+num);
	var _link_activ=document.getElementById("a"+cl_menu);
	c_num=num;
		//c_back["t"+(num-1)]=_b.style.backgroundColor;
	//c_back["t"+num]=_b.style.backgroundColor;
		//c_back["t_"+num]=_b_.style.backgroundColor;
		//c_back["t"+(num+1)]=_b.style.backgroundColor;
	c_back["a"+num]=_link.style.color;
	c_back["abg"+num]=_link.style.backgroundColor;
	//_b.style.backgroundColor='#c4efc4';
		//_b_.style.backgroundColor='#FFF200';
		//_c.style.backgroundColor='#ffffff';
		//_a.style.backgroundColor='#ffffff';//c4efc4
	
		_link.style.color='#000000';
		_link.style.backgroundColor='#FFF200';
	if(cl_menu!=num && _link_activ){	
		_link_activ.style.color='#000000';
		_link_activ.style.backgroundColor='#c4efc4';
	}
		//if(cl_menu!=num)invert_activ(true);
	if(typeof(submenu[num])=='undefined')submenu[num]='';
	dhtml_objects["div_submenu"].set_html(submenu[num]);
	
}
function clear_color(){
	if(!document.getElementById || !c_num || cl_menu==c_num)return;
		//document.getElementById("t"+(c_num-1)).style.backgroundColor=c_back["t"+(c_num-1)];
		//document.getElementById("t"+(c_num+1)).style.backgroundColor=c_back["t"+(c_num+1)];
	//document.getElementById("t"+c_num).style.backgroundColor=c_back["t"+c_num];
		//document.getElementById("t_"+c_num).style.backgroundColor=c_back["t_"+c_num];
	document.getElementById("a"+c_num).style.color=c_back["a"+c_num];
	document.getElementById("a"+c_num).style.backgroundColor=c_back["abg"+c_num];
}
function invert_activ(a){
	/*document.getElementById("t"+(cl_menu-1)).style.backgroundColor=(a?'#009E58':'#ffffff');
	document.getElementById("t"+(cl_menu+1)).style.backgroundColor=(a?'#009E58':'#ffffff');
	document.getElementById("t"+cl_menu).style.backgroundColor=(a?'#C13102':'#FFF200');
	document.getElementById("t_"+cl_menu).style.backgroundColor=(a?'#ffffff':'#FFF200');
	document.getElementById("a"+cl_menu).style.color=(a?'#ffffff':'#000000');*/
	document.getElementById("t"+(cl_menu-1)).style.backgroundColor=(a?'#009E58':'#ffffff');
	document.getElementById("t"+(cl_menu+1)).style.backgroundColor=(a?'#009E58':'#ffffff');
	document.getElementById("t"+cl_menu).style.backgroundColor=(a?'#009E58':'#FFF200');
	document.getElementById("t_"+cl_menu).style.backgroundColor=(a?'#ffffff':'#FFF200');
	document.getElementById("a"+cl_menu).style.color=(a?'#FFF200':'#000000');
}
function default_menu(){
	if(!document.getElementById)return;
	clear_color();
	//invert_activ(false);
	if(document.getElementById("a"+cl_menu)){
		document.getElementById("a"+cl_menu).style.color='#000000';
		document.getElementById("a"+cl_menu).style.backgroundColor='#FFF200';
	}
	if(typeof(submenu[cl_menu])=='undefined')submenu[cl_menu]='';
	dhtml_objects["div_submenu"].set_html(submenu[cl_menu]);
}
function set_timeout(){
	timeout=setTimeout("default_menu()",500);
}
function clear_timeout(){
	clearTimeout(timeout);
	//
	clearTimeout(timeout1);
}
function clear_timeout1(){
	clearTimeout(timeout1);
}
