isDOM=document.getElementById //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
isMSIE=document.all && document.all.item //Microsoft Internet Explorer 4+
isNetscape4=document.layers //Netscape 4.*
isOpera=window.opera //Opera
isOpera5=isOpera && isDOM //Opera 5+
isMSIE5=isDOM && isMSIE && !isOpera //MSIE 5+
isMozilla=isNetscape6=isDOM && !isMSIE && !isOpera


function nw_friend(view_user_id)
{
 what = "div_new_window";
 nw_width = 200; nw_height = 50;
 send1Request("scripts/ajax/nw_friend.php?nw_width="+nw_width+"&nw_height="+nw_height+"&view_user_id="+view_user_id, what, get1Request);
 window_show_static(what,nw_width,nw_height)
}

function open_dialog(dialog_view_user_id)
{
 what = "div_new_window";
 dialog_width = 450; dialog_height = 400;
 send1Request("scripts/ajax/dialog.php?dialog_width="+dialog_width+"&dialog_height="+dialog_height+"&dialog_view_user_id="+dialog_view_user_id, what, get1Request);
 window_show_static(what,dialog_width,dialog_height)
}



function nw_img(img_src,nw_width,nw_height,event)
{
 what = "div_new_window";
 send1Request("scripts/ajax/nw_img.php?img_src="+img_src+"&nw_width="+nw_width+"&nw_height="+nw_height, what, get1Request);
 window_show(what,event)
}



function nw_foto_edit_name(who,number)
{
 what = "div_new_window";
 nw_width = 450; nw_height = 10;
 send1Request("scripts/ajax/nw_foto_edit_name.php?who="+who+"&number="+number+"&nw_width="+nw_width+"&nw_height="+nw_height, what, get1Request);
 window_show_static(what,nw_width,nw_height)
}
function nw_fotoprikol_edit_name(number)
{
 what = "div_new_window";
 nw_width = 450; nw_height = 10;
 send1Request("scripts/ajax/raznoe/nw_fotoprikol_edit_name.php?number="+number+"&nw_width="+nw_width+"&nw_height="+nw_height, what, get1Request);
 window_show_static(what,nw_width,nw_height)
}
function nw_veseliska_foto_edit_description(veseliska_number,foto_what,number)
{
 what = "div_new_window";
 nw_width = 450; nw_height = 10;
 send1Request("scripts/ajax/veseliska/nw_veseliska_foto_edit_description.php?veseliska_number="+veseliska_number+"&foto_what="+foto_what+"&number="+number+"&nw_width="+nw_width+"&nw_height="+nw_height, what, get1Request);
 window_show_static(what,nw_width,nw_height)
}



function nw_veseliska_content(script,nw_width,nw_height,number,empty)
{
 what = "div_new_window";
 send1Request("scripts/ajax/nw_veseliska_content.php?script="+script+"&nw_width="+nw_width+"&nw_height="+nw_height+"&number="+number+"&empty="+empty, what, get1Request);
 window_show_static(what,nw_width,nw_height)
}



function nw_videoprikol_edit(number)
{
 what = "div_new_window";
 nw_width = 570; nw_height = 300;
 send1Request("scripts/ajax/nw_videoprikol_edit.php?number="+number, what, get1Request);
 window_show_static(what,nw_width,nw_height)
}

function nw_sms(what_sms_content,what_sms_id)
{
 what = "div_new_window";
 nw_width = 640; nw_height = 300;
 send1Request("scripts/ajax/dop/nw_sms.php?what_sms_content="+what_sms_content+"&what_sms_id="+what_sms_id, what, get1Request);
 window_show_static(what,nw_width,nw_height)
}



var nw;

function window_show_static(what,nw_width,nw_height)
{
 if(isMSIE5)
 {
  wrk_width = 18;
  wrk_height = 60;
 }
 else
 {
  wrk_width = 5;
  wrk_height = 70;
 }

 pagexoff = document.body.scrollLeft;
 pageyoff = document.body.scrollTop;

 point_x = screen.width/2 - nw_width/2 - wrk_width + pagexoff + 75;
 point_y = screen.height/2 - nw_height/2 - wrk_height - nw_height/4 + pageyoff;

 nw = document.getElementById(what).style;
 nw.left = point_x +"px";
 nw.top = point_y +"px";
 nw.visibility = 'visible';
}

function window_show(what,event)
{
 if(isMSIE5)
 {
  wrk_width = 18;
  wrk_height = 60;
 }
 else
 {
  wrk_width = 5;
  wrk_height = 70;
 }

 mousex = event.clientX;
 mousey = event.clientY;
 if(isOpera)
 {
  mousex = event.pageX;
  mousey = event.pageY;
 }
 pagexoff = document.body.scrollLeft;
 pageyoff = document.body.scrollTop;

 nw = document.getElementById(what).style;
 leftoff = mousex-pagexoff;
 nw.left = (mousex+pagexoff);
 topoff = mousey-pageyoff;
 if(isOpera && topoff <= 30){nw.top = mousey;}
 else if(mousey <= 30){nw.top = mousey + pageyoff;}
 else if(isOpera){nw.top = mousey;}
 else{nw.top = mousey + pageyoff;}

 nw.visibility = 'visible';
}

function close_new_window()
{
 nw.visibility = 'hidden';
}