function popup(url,xsize,ysize)
{
	
   var xposit = (screen.width/2)-xsize/2;
	var yposit = (screen.height/2)-ysize/2; 
window.open (url, 'mykotlas', 'height='+ysize+', width='+xsize+', resizeable=no, left='+xposit+', top='+yposit+', status=no, toolbar=no, menubar=no, scrollbars=auto');
};

function popup2(url,xsize,ysize)
{
	
   var xposit = (screen.width/2)-xsize/2;
	var yposit = (screen.height/2)-ysize/2; 
window.open (url, 'mykotlas', 'height='+ysize+', width='+xsize+', resizeable=no, left='+xposit+', top='+yposit+', status=no, toolbar=no, menubar=no, scrollbars=yes');
};

function openmess()
{
   var nick_n = window.document.forms.newmess.nick.value;
   var xposit = (screen.width/2)-620/2;
   var yposit = (screen.height/2)-500/2; 
window.open ('private/chat.php?nick='+nick_n, 'messwin', 'height='+500+', width='+620+', resizeable=no, left='+xposit+', top='+yposit+', status=no, toolbar=no, menubar=no, scrollbars=auto');
};

function popup1(url,xsize,ysize)
{
	
   var xposit = (screen.width/2)-xsize/2;
	var yposit = (screen.height/2)-ysize/2; 
window.open (url, 'mykotlas1', 'height='+ysize+', width='+xsize+', resizeable=no, left='+xposit+', top='+yposit+', status=no, toolbar=no, menubar=no, scrollbars=auto');

};

function additem(content)
{
window.opener.document.forms.newmess.nick.value=content;
self.close();
};

function fcommon(xsize,ysize,cval)
{
   var xposit = (screen.width/2)-xsize/2;
	var yposit = (screen.height/2)-ysize/2; 
	var sobj = document.getElementById('fsect');
	var url='../admin/albadmin.php?act='+cval+'&sid='+sobj.options[sobj.selectedIndex].value;
window.open (url, 'mykotlas', 'height='+ysize+', width='+xsize+', resizeable=no, left='+xposit+', top='+yposit+', status=no, toolbar=no, menubar=no, scrollbars=auto');

};

function fgetsel(fid)
{
 
	var sobj = document.forms['fsectf'].fsect;
	
	var url='?main=fotoalbum&fpage=move&fid='+fid+'&sid='+sobj.options[sobj.selectedIndex].value;
	
	document.location.href=url;

};

function s_search(page)
{
 
	var sobj = document.forms['s_form'].s_str;
	
	var url='?main=users&fpage=show_users&s_str='+sobj.value;
	
	document.location.href=url;

};

function oblivion (uid)
{
	var url='?main=admin&fpage=oblivion&uid='+uid;
	if (confirm("Это действие приведет к полному и БЕЗВОЗВРАТНОМУ удалению всей деятельности пользователя на сайте. Вы уверены что хотите продолжить ? "))
	{
	document.location.href=url;	
	};
	
};


function fn_resize(e, intWidth, intHeigth) {
  var newW;
  newW = (intWidth == null || intWidth == '' || isNaN(parseInt(intWidth))) ? 800 : parseInt(intWidth);
  var newL = Math.round(screen.width/2 - newW);
  var newH;
  newH = (intHeight == null || intHeight == '' || isNaN(parseInt(intHeight))) ? 800 : parseInt(intHeight);
  var newT = Math.round(screen.height/2 - newH);
  if (e.sizeToContent) {
    e.sizeToContent(); // изменить размер по содержимому (для FireFox,Mozilla)
  } else {
    e.resizeTo(newW,newH); // изменить размер окна на предустановленные значения
  }
  e.moveTo(newT,newL); // переместить окно в середину экрана
}
function startchat() {
	
    var nick = document.input.username.value;
    var channel = "#Kotlas";

    if (channel != "" && nick != "") {
	var url = "chat/chat.php?username="+nick+"&channel="+channel;
	
	    window.open(url, 'chat', 'height=450,width=720,location=no,menubar=no,toolbar=no,scrollbars=auto');
	
    }
}



