\n');
}
function GetMovieObj()
{
if (window.ActiveXObject)
{
if (document.getElementById) {
return document.getElementById('flash_im_obj');
} else
if (document.all) {
return document.all.flash_im_obj;
} else if (document.layers) {
return document.name.flash_im_obj;
}
}
else
{
if (document.getElementById) {
return document.getElementById('flash_im_emb');
} else
if (document.all) {
return document.all.flash_im_emb;
} else if (document.layers) {
return document.name.flash_im_emb;
}
};
return 0;
}
var cur_right_pos=1;
var default_width_right=200;
var min_width_right=190;
var default_width=600;
var min_width=560;
var default_height=700;
var min_height=410;
var diff_val_x = 0;
var diff_val_y = 0;
var diff_val_start_x = 0;
var diff_val_start_y = 0;
var old_w=0, old_h=0;
var post_window_resize_timer=0;
var save_window_position_timer=0;
function on_window_resize()
{
if (post_window_resize_timer)
{
clearInterval(post_window_resize_timer); post_window_resize_timer=0;
}
post_window_resize_timer = setInterval('post_window_resize()', 300);
};
function post_window_resize()
{
if (post_window_resize_timer)
{
clearInterval(post_window_resize_timer); post_window_resize_timer=0;
}
var expdate = new Date ();
FixCookieDate (expdate);
expdate.setTime (expdate.getTime() + (365 * 24 * 60 * 60 * 1000)); // 24 hrs from now
var w = window.document.body.scrollWidth;
var h = window.document.body.clientHeight;
//alert("Resize alert oldW: "+old_w+" W: "+w+" oldH: "+old_h+" H: "+h);
if ((old_w!=w)||(old_h!=h))
{
old_w=w; old_h=h;
SetCookie ("flash_im_width"+cur_right_pos, w, expdate,"/");
SetCookie ("flash_im_height", h, expdate,"/");
//alert("Resize RP: "+cur_right_pos+" W: "+w+" H: "+h);
}
};
function resize_form(right_pos)
{
if (cur_right_pos==1) save_current_window_position();
cur_right_pos=parseInt(""+right_pos);
var saved_width = GetCookie("flash_im_width"+right_pos);
var saved_height;
if (window.outerHeight) saved_height = window.outerHeight;
else saved_height = window.document.body.clientHeight;
if (saved_width==null) if (right_pos) saved_width=default_width_right;
else saved_width=default_width;
saved_width=parseInt(""+saved_width);
if (right_pos==1)
{
//alert("SW1: "+saved_width+" MW1: "+min_width);
if (saved_width0)||(diff_val_start_x<-20)) diff_val_start_x=0;
if ((diff_val_start_y>0)||(diff_val_start_y<-50)) diff_val_start_y=0;
};
};
var orig_w = window.document.body.scrollWidth;
var orig_h;
if (window.outerHeight) orig_h = window.outerHeight;
else orig_h = window.document.body.clientHeight;
self.resizeTo(orig_w,orig_h);
diff_val_x = orig_w-window.document.body.scrollWidth;
if (window.outerHeight) diff_val_y = orig_h-window.outerHeight;
else diff_val_y = orig_h-window.document.body.clientHeight;
self.resizeTo(orig_w+diff_val_x,orig_h+diff_val_y);
window.onresize=on_window_resize;
if (window.opera)
{ // Special save position timer for opera
save_window_position_timer = setInterval('save_current_window_position_timed()', 1500);
}
}
function flash_loading_finished()
{
//alert("Flash loading finished.");
}
function save_current_window_position_timed()
{
if (cur_right_pos==1) save_current_window_position();
};
function save_current_window_position()
{
var w_left=0, w_top=0;
if (window.screenLeft) w_left=window.screenLeft;
if (window.screenX) w_left=window.screenX;
if (window.screenTop) w_top=window.screenTop;
if (window.screenY) w_top=window.screenY;
w_left+=diff_val_start_x; w_top+=diff_val_start_y;
var expdate = new Date ();
FixCookieDate (expdate);
expdate.setTime (expdate.getTime() + (365 * 24 * 60 * 60 * 1000)); // 24 hrs from now
SetCookie ("flash_im_pos_x", w_left, expdate, "/");
SetCookie ("flash_im_pos_y", w_top, expdate, "/");
//alert("Left: "+w_left+" Top: "+w_top+" DX: "+diff_val_start_x+" DY: "+diff_val_start_y);
};
var logouted=0;
function flash_doLogout()
{
//alert("close");
if (cur_right_pos==1) save_current_window_position();
logouted=1;
if ((window.ActiveXObject)||(window.opera))
{
window.opener = "_";
}
else
{
window.open('','_parent','');
};
window.close();
};
function OpenInParent(url)
{
//alert(url);
if ((top.opener)&&(!top.opener.closed))
{
top.opener.document.location=url;
}
else
{
window.open(url,'_blank');
};
};
var ajaxObj = new XMLHTTP("/w_communicator/communicator.php");
function my_close_browser()
{
if (logouted!=0) return 0;
logouted=1;
if (cur_right_pos==1) save_current_window_position();
/*
if (logouted==0)
{
alert('Close sess');
window.open('/w_communicator/close_im.php','flash_chat_close','menubar=0, resizable=1, scrollbars=0,status=0,toolbar=0, width=100, height=100');
};
*/
//if ((logouted==0)&&(window.ActiveXObject))
{ // Ie Browser
var flash_obj = GetMovieObj();
flash_obj.parentNode.removeChild(flash_obj);
ajaxObj.format=0;
ajaxObj.async=0;
ajaxObj.method="GET";
ajaxObj.call("part=message&act=send&mess_count=1&mess_type0=6&mess_text0=ie_exit&auth_session=1&unchache_session_id="+Math.random(), ComResp);
}
};
function beforeunload()
{
//alert("Before");
my_close_browser();
};
function dounload()
{
//alert("Now unload");
//my_close_browser();
};
function ComResp(resp)
{
if(resp)
{
//alert("OK"+resp);
for(i=0; i<2000; i++) setTimeout('return;', 5000);
//alert("2");
//alert("OK"+resp);
}
else
{
//alert("FAILED");
}
}