function sendMsg() {$("#pop_message_table").fadeIn("30");document.getElementById('textisEmpty').style.display='none';$("#pop_dialog_table").fadeOut("30");$("#pop_rate_table").fadeOut("30");$("#pop_gift_table").fadeOut("30");document.getElementById('repo4ka').style.visibility='hidden'}
function closeMsg() {$("#pop_message_table").fadeOut("30");document.getElementById('repo4ka').style.visibility='visible'}
function addFri() {$("#pop_dialog_table").fadeIn("30");$("#pop_message_table").fadeOut("30");$("#pop_rate_table").fadeOut("30");$("#pop_gift_table").fadeOut("30");document.getElementById('repo4ka').style.visibility='hidden'}
function closeFri() {$("#pop_dialog_table").fadeOut("30");document.getElementById('repo4ka').style.visibility='visible'}
function openRate() {$("#pop_rate_table").fadeIn("30");$("#pop_dialog_table").fadeOut("30");$("#pop_message_table").fadeOut("30");$("#pop_gift_table").fadeOut("30")}
function closeRate() {$("#pop_rate_table").fadeOut("30")}
function openGolos() {$("#pop_golos_table").fadeIn("30");$("#pop_dialog_table").fadeOut("30");$("#pop_message_table").fadeOut("30");$("#pop_gift_table").fadeOut("30")}
function closeGolos() {$("#pop_golos_table").fadeOut("30")}
function openGift() {$("#pop_gift_table").fadeIn("30");$("#pop_dialog_table").fadeOut("30");$("#pop_message_table").fadeOut("30");$("#pop_rate_table").fadeOut("30");document.getElementById('repo4ka').style.visibility='hidden'}
function closeGift() {$("#pop_gift_table").fadeOut("30");document.getElementById('repo4ka').style.visibility='visible'}

function look(type){
param=document.getElementById(type);
if(param.style.display == "none") param.style.display = "block";
else param.style.display = "none"
}

window.addEvent('domready',function() {
/* hide using opacity on page load */
$('fb-modal').setStyles({
opacity:0,
display:'block'
});
/* hiders */
$('fb-close').addEvent('click',function(e) { $('fb-modal').fade('out'); });
window.addEvent('keypress',function(e) { if(e.key == 'esc') { $('fb-modal').fade('out'); } });
$(document.body).addEvent('click',function(e) {
if($('fb-modal').get('opacity') == 1 && !e.target.getParent('.generic_dialog')) {
$('fb-modal').fade('out');
}
});
/* click to show */
$('fb-trigger').addEvent('click',function() {
$('fb-modal').fade('in');
});
});

function empty_form ()
{
var text1 = document.getElementById('write_box_text').value;
var text2 = document.getElementById('write_box_tema').value;
if (!(text1 && text2))
 {
 document.getElementById('textisEmpty').style.display='block';
 return false;
 } 
 document.getElementById('textisEmpty').style.display='none';document.getElementById('buttonsDialMsg').style.display='none';document.getElementById('gosendMsgto').style.display='none';document.getElementById('loadtoMessage').style.display='block';settimer()
 return true;
}

function toValue (toId, toVal) {document.getElementById(toId).value=toVal;}
function toSrc (toIdSrc, toSrcSrc) {document.getElementById(toIdSrc).src=toSrcSrc;}
function toHide (toHideId) {document.getElementById(toHideId).style.display='none'}
function toShow (toShowId) {document.getElementById(toShowId).style.display='block'}
function toShowLine (toShowLineId) {document.getElementById(toShowLineId).style.display='inline'}
function plusValue (plusValueId, plusValueMsg) {document.getElementById(plusValueId).value=document.getElementById(plusValueId).value+plusValueMsg}
function mypage(mypageid) {document.location.href='/index/8-'+mypageid}