﻿// JScript File
var postControlsWait;
window.onload = function()
{
    //
    setSendButton();
}

function setSendButton()
{
    var EsperandoAlWindow;
    if($("txtPostMessage") != null)
    {
        $("txtPostMessage").onkeypress = function(){$("btnSendPost").className = "input_botons"; $("btnSendPost").disabled = false;};
        if(EsperandoAlWindow != null)
        {
            clearTimeout(EsperandoAlWindow);
        }
    }
    else
    {
        EsperandoAlWindow = setTimeout(setSendButton, 500);
    }
}

function loginTo()
{  
    Effect.Fade('divControlsContainer', { duration: 0.5 });
    showAddNewPost();    
}

function showAddNewPost()
{
    //----->
    if($('divControlsContainer').style.display == "none")
    {
        //-----> 
        __doPostBack('linkLogin','');
        Effect.Appear('divControlsContainer', { duration: 2.0 });        
    }
    else
    {
        postControlsWait = setTimeout(showAddNewPost, 1000);
    }
}

function goToSendPost()
{
    //Llama a la funcion que está en SendMessage.js
    SendForumPost();
} 

//Creo los Tips
function showTipAbuse(id)
{
    Tip('Let us know if you believe <br />this content is not appropiate', STICKY, false,FADEIN, 500,CLICKCLOSE, false, SHADOW, true, TITLE, 'Report Abuse', PADDING, 1);
}

function goToProfile(user, this_href){
    if((user_id > 0) && (user != 'anonymouse')){ window.location = this_href; }
    else{return false;}
}

var PostResponseWait;
//----->
function TopicResponse()
{
    Effect.BlindUp('divPostResponse', { duration: 0.5 });
    clearTimeout(PostResponseWait);
    $("btnSendPost").className = "input_botons_off";
    $("btnSendPost").disabled = true; 
}