﻿// JScript File
var topicControlsWait;
window.onload = function()
{
    checkAutentication('true');
    //
    setSendButton();
    //
    waterUser();
}

function setSendButton()
{
    var EsperandoAlWindow;
    if($("txtTopicPost") != null)
    {
        $("txtTopicPost").onkeypress = function(){$("btnNewTopic").className = "input_botons"; $("btnNewTopic").disabled = false;};
        if(EsperandoAlWindow != null)
        {
            clearTimeout(EsperandoAlWindow);
        }
    }
    else
    {
        EsperandoAlWindow = setTimeout(setSendButton, 500);
    }
}

function loginTo()
{  
    Effect.Fade('divControlsContainer', { duration: 0.5 });
    showAddNewTopic();    
}

function showAddNewTopic()
{
    //----->
    if($('divControlsContainer').style.display == "none")
    {
        //-----> 
        __doPostBack('linkLogin','');
        Effect.Appear('divControlsContainer', { duration: 2.0 });        
    }
    else
    {
        topicControlsWait = setTimeout(showAddNewTopic, 1000);
    }
}

function goToNewTopic()
{
    //Llama a la funcion que está en SendMessage.js
    SendNewTopic();
} 

//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 showTipPM(id)
{
   Tip('You´ll be able to send messages', STICKY, false,FADEIN, 500,CLICKCLOSE, false, SHADOW, true, TITLE, 'Coming Soon', PADDING, 1); 
}

var SendNewTopicResponseWait;
//----->
function TopicResponse()
{
    Effect.BlindUp('divNewTopicResponse', { duration: 0.5 });
    clearTimeout(SendNewTopicResponseWait);
    $("btnNewTopic").className = "input_botons_off";
    $("btnNewTopic").disabled = true; 
}