var nam_1=null;
var top_=0;
var left_=0;
function dok(url,h,w){
	if (navigator.userAgent.toLowerCase().indexOf("opera")==-1 && nam_1!=null && !nam_1.closed)nam_1.close();
	tops(h,w);
	nam_1=window.open(url,'',"height="+h+",width="+w+",status=yes,toolbar=no,menubar=yes,location=no,top="+top_+",left="+left_+",scrollbars=yes,resizable=yes");
	nam_1.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;
	}
}
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();
}
var un_window;
function open_win(links,name,h,w){
	if (un_window!=null && !un_window.closed)un_window.close();
	tops(h,w);
	un_window=window.open(links,name,"height="+h+",width="+w+",status=no,toolbar=no,menubar=no,location=no,top="+top_+",left="+left_+",scrollbars=no,resizable=yes");
	un_window.focus();
}

var a_old=0;
function show_alt(a){
	if(a_old && document.getElementById("alt_channel_"+a_old)){
		document.getElementById("alt_channel_"+a_old).style.display='none';
		//document.getElementById("channel_"+a_old).style.zIndex=1;
		a_old=0;
	}
	if(document.getElementById("alt_channel_"+a)){
		document.getElementById("alt_channel_"+a).style.display='block';
		//document.getElementById("channel_"+a).style.zIndex=1000;
		a_old=a;
	}
}
function show_alt_mouse(ev,a){
	if(a_old && document.getElementById("alt_channel_"+a_old)){
		document.getElementById("alt_channel_"+a_old).style.display='none';
		//document.getElementById("channel_"+a_old).style.zIndex=1;
		a_old=0;
	}
	if(document.getElementById("alt_channel_"+a)){
		var align=0;
		var hsdvig=5;
		var mouse_x=get_mouse_x(ev);
		var mouse_y=get_mouse_y(ev);
		var es=document.getElementById("alt_channel_"+a).style;
		if(its_ie4plus || its_opera)es.left=mouse_x-150;
		else es.left=mouse_x;
		var _scrol=get_client_scroll_top();
		var _body=es.height;
		if(align==1)es.top=mouse_y - hsdvig + _scrol - _body;
		else es.top=mouse_y + hsdvig + _scrol;
		es.display='block';
		//document.getElementById("alt_channel_"+a).style.display='block';
		//document.getElementById("channel_"+a).style.zIndex=1000;
		a_old=a;
	}
}
if (document.all){}
else if (document.getElementById)document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = mousedown_handler;
function mousedown_handler(){
	if(!a_old)return;
	if(document.getElementById("alt_channel_"+a_old) && document.getElementById("alt_channel_"+a_old).style.display!='none'){
		setTimeout("hide_alt("+a_old+")",200);
	}
}
function hide_alt(a) {
   if(document.getElementById("alt_channel_"+a) && document.getElementById("alt_channel_"+a).style.display!='none'){
		document.getElementById("alt_channel_"+a).style.display='none';
		//document.getElementById("channel_"+a).style.zIndex=1;
		a_old=0;
	}
}



/*--------------*/
function get_client_scroll_top() {
	if (its_mozilla)return 0;
	if (its_ie4plus || its_opera)return document.body.scrollTop;
	if (its_ns4plus)return pageYOffset;
	return null;
}
function get_mouse_x(c) {
	if (its_ie4plus || its_opera)return event.clientX;
	if (its_ns4plus || its_mozilla)return c.pageX;
	return null;
}
function get_mouse_y(c) {
	if (its_ie4plus || its_opera)return event.clientY;
	if (its_ns4plus || its_mozilla)return c.pageY;
	return null;
}