var UA=navigator.userAgent;
	is_gecko=/gecko/i.test(UA);
	is_opera=/opera/i.test(UA);
	is_mac=/mac_powerpc/i.test(UA);
	is_ie=/msie/i.test(UA)&&!is_opera&&!is_gecko&&!is_mac;
	is_nn4=(document.layers)?true:false;

function menuon(itm)
{
	var el=document.getElementById('m'+itm);
	if(el)
	{
		el.className='tmenua';
	}
}

function menuoff(itm)
{
	var el=document.getElementById('m'+itm);
	if(el)
	{
		el.className='tmenup';
	}

}

function goTo(where) {
	 document.location.reload(where);
	 return false;
}

function closebtn()
{
	if(opener) opener.focus();
	window.close();
}

function closerefresh()
{
	if(opener)
	{
	opener.document.location.assign(opener.document.location);
	opener.focus();
	}
	window.close();
}

function acceptfrend(id,accept,pth,l)
{
	if(accept==1)
	popupWindow(pth+'inc/accept_draugs.php?draugs='+id+'&acceptfrnd=1&lang'+l,'adddraugs',670,340,'0',true);
	else
	popupWindow(pth+'inc/accept_draugs.php?draugs='+id+'&noacceptfrnd=1&lang='+l,'adddraugs',670,340,'0',true);
	return false;
	//document.execCommand('refresh');
}

function gotourl(adres)
{
	document.location.assign(adres);
	return false;
}

function popupWindow(goLocation,wname,wdth,hght,toolbr,info)
{
 var v=parseInt(navigator.appVersion);
 isNetscape=navigator.appName.indexOf('Netscape')>=0;
 isExplorer=navigator.appName.indexOf('Explorer')>=0;

 var ww = wdth;
 var wh = hght;

 positionCode='';

 if(v>=4)
 {
  if(isExplorer) positionCode='left='+(screen.width/2-ww/2)+',top=40';
  if(isNetscape) positionCode='screenX='+(screen.width/2-ww/2)+',screenY=40';
 }

 newWindow=window.open(goLocation,wname,
 'width='+ww+',height='+wh+','+
 positionCode+
 'location=0,'+
 'toolbar='+toolbr+','+
 'scrollbars=1,'+
 'status=1,'+
 'resizable=1');
  if(v>=3) newWindow.focus();
  return false;
}

function send(obj,m1,m2)
{
	obj.href='mailto:'+m1+'@'+m2;
}
function snd2(obj,m1,m2)
{
	obj.href='mailto:'+m1+'@'+m2+'.'+'lv';
}

function votejbtn(frm)
{
	if(document.forms(frm).vote.options[document.forms(frm).vote.selectedIndex].value==0) return false;
}
