var popup_alert="!!! В Вашем просмотрщике включена защита от всплывающих окон!!!\nАвторизация требует разрешения всплывающий окон.\nВключите в настройках просмотрщика или попросите знабщего человека.";

function create_new_message(threadid,board,user_name,subject)
{	
var popup0="Sources/editMess.php?board="+board+"&threadid="+threadid+"&mess_id=0&user_name="+user_name+"&subject="+subject+"";
var win=window.open(popup0,'autorisation','resizable,scrollbars=1' );
if(win) win.focus(); else alert(popup_alert);
}

function showHideDiv(id,pic)
{
if(document.all(id).style.visibility=="hidden")
{
document.all(id).style.visibility="visible";
document.all(id).style.display="";
document.images(pic).src="/sys_pic/minus.gif";
//alert(document.images(pic).src);
}
else
{
document.all(id).style.visibility="hidden";
document.all(id).style.display="none";
document.images(pic).src="/sys_pic/plus.gif";
}
}

///////////////////////////////////
var caution = false;
function autorisation()
{
var popup0="/autorization/autoriz.php?avtorisation_tipe=forum";
var top0 = document.body.clientHeight -400;
var left0 = document.body.clientWidth - 600;
var win=window.open(popup0,'autorisation','width=600,height=400,resizable,scrollbars=1, left='+left0+', top='+top0 );
if(win) win.focus(); else alert(popup_alert);
}

function restorming(name)
{
var popup0="/forum/raiting_form.php?user_name="+name;
var win=window.open(popup0,'restorming','resizable,scrollbars=1');
if(win) win.focus(); else alert(popup_alert);
}

function get_profile(user_id)
{
var popup0="/autorization/profile.php?avtorisation_tipe=forum&user_id="+user_id;
var top0 = document.body.clientHeight -400;
var left0 = document.body.clientWidth - 600;
var win=window.open(popup0,'autorisation','width=600,height=400,resizable,scrollbars=1, left='+left0+', top='+top0 );
if(win) win.focus(); else alert(popup_alert);
}
function user_profile(user_name)
{
var popup0="/autorization/profile.php?avtorisation_tipe=forum&user_name="+user_name;
var top0 = document.body.clientHeight -400;
var left0 = document.body.clientWidth - 600;
var win=window.open(popup0,'autorisation','width=600,height=400,resizable,scrollbars=1, left='+left0+', top='+top0 );
if(win) win.focus(); else alert(popup_alert);
}

function setCookie(name, value, path, domain, secure) 
{
var expDays = 30;
var expires = new Date(); 
expires.setTime(expires.getTime() + (expDays*24*60*60*1000));

 var curCookie = name + "=" + escape(value) +
  ((expires) ? "; expires=" + expires.toGMTString() : "") +
  ((path) ? "; path=" + path : "") +
  ((domain) ? "; domain=" + domain : "") +
  ((secure) ? "; secure" : "")
 if (!caution || (name + "=" + escape(value)).length <= 4000)
  document.cookie = curCookie
 else
  if (confirm("Cookie exceeds 4KB and will be cut!"))
   document.cookie = curCookie
}
function getCookie(name) 
{
 var prefix = name + "=";
 var cookieStartIndex = document.cookie.indexOf(prefix);
 if (cookieStartIndex == -1)
  return null;
 var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
 if (cookieEndIndex == -1)
  cookieEndIndex = document.cookie.length;
 return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}
///////////////////////////////////////////

function Searching(userName,path)
{
//alert(path); 
var popup0="../sys/forumx.php?path="+path+"&userName="+userName;
window.open(popup0,'Searching', 'resizable,scrollbars=1' );
}
function Caleydoscop(userName)
{
//alert(userName); 'Guest'
var popup0="../sys/mosaic.php?userName="+userName+"&firstRun=Y";
var win=window.open(popup0,'Searching', 'resizable,scrollbars=1' );
if(win) win.focus(); else alert(popup_alert);
}
function chart(userName,mail)
{
var popup1="../chart/chart.php?userName="+userName+"&mail="+mail+"&firstRun=Y";
var win=window.open(popup1,'chart', 'resizable,scrollbars=1, status=1' );
if(win) win.focus(); else alert(popup_alert);
}
function chatHistory()
{ 
var popup2="../chart/history.php?What=Y"
var win=window.open(popup2,'ChatHist', 'resizable,scrollbars=1' );
if(win) win.focus(); else alert(popup_alert);
}
function agreement()
{
var popup0="agreement.php";
var top0 = document.body.clientHeight -400;
var left0 = document.body.clientWidth - 600;
var win=window.open(popup0,'agreement','width=600,height=400,resizable,scrollbars=1, left='+left0+', top='+top0 );
if(win) win.focus(); else alert(popup_alert);
}

function thank_submit(href)
{
if(confirm("Благодарность автору от Вас будет показана внизу сообщения. Послать?")==true)
window.top.location.href =href;
}

var hOpenWindow=0;
function show_word(id)
{
var width=600;
var hihgt=400;

var win_name="show_description";

popup0="/dictionary/dictionary_show.php?id="+id;

hOpenWindow=window.open(popup0,win_name,'width='+width+',height='+hihgt+',resizable,scrollbars=1' );

var popup_alert="!!! В Вашем просмотрщике включена защита от всплывающих окон!!!\nСнимите это ограничение или спросите как это сделать у знающих людей.";
if(hOpenWindow) 
{
	hOpenWindow.focus();
}
else 
	alert(popup_alert);
}
