﻿//Cookies Start
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function set_cookie(cook_name,cook_value) {
var exp = new Date();
var cook_time = exp.getTime() + (365*24*60*60*1000);
exp.setTime (cook_time);
document.cookie=cook_name+'=' + cook_value + '; expires=' + exp.toGMTString() + '; path=/; domain=' + location.host + ';';
}
//Cookies End

//MChat Start
function MChat() {
var myname_cook='FPMChat';
myname_value=get_cookie(myname_cook);
if(myname_value == '1') window.onload = MChat_open;
}
MChat();

function MChat_open() {
openLayerB('MChat',0,'/src/js/mchat_elfox.xml','Чат',400,350,1);
var scrw=(window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
var scrh=(window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
return false;
}

function MChat_ELFOX_open() {
openLayerB('MChat',0,'/src/js/mchat_teatronic.xml','Чат','400','350','1','','',0,'center');
var scrw=(window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
var scrh=(window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
return false;
}

function user_favorit_open() {
openLayerB('MChat',0,'/src/js/user_favorit.xml','Мои фавориты','400','350','1','','',0,'center');
var scrw=(window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
var scrh=(window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
return false;
}

function user_photo_open() {
openLayerB('MChat',0,'/src/js/user_photo.xml','Мои фотоальбом','550','350','1','','',0,'center');
var scrw=(window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
var scrh=(window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
return false;
}
//MChat End