var dirty = undefined;
var MAXWIDTH = 20;
var ShareButton = false;
//var CommunityID = 0;
function ExtendShare()
{
    if (ShareButton == false)
    {
        var e = document.getElementById('inptbtn');
        if (e != undefined)
            e.style.display = 'block';
        //e.src = '<?php print $URL; ?>/Images/Buttons/ShareButton.png';
        //$('#inpt').css('width','500px');

        $('#inpt').animate({width: (MAXWIDTH * 14) + 'px'}, 100, function(){$('#inpt').select();});
        $('#TalkingAvatar').fadeIn();
        ShareButton = true;
    }
    //$('#inpt').select();
}

function AdjustShareBox()
{
    var text_area = document.getElementById('inpt');
    if($.browser == "msie") {
        text_area.style.height = (text_area.scrollHeight) + "px";
    } else {
        text_area.style.height = 0;
        text_area.style.height = (text_area.scrollHeight) + "px";
        //$('#inpt').animate({height: (text_area.scrollHeight + 2) + 'px'}, 1000);
    }
}

function AdjustSpecificBox(id)
{
    var text_area = document.getElementById(id);
    if($.browser == "msie")
        text_area.style.height = text_area.scrollHeight + "px";
    else
    {
        text_area.style.height = 0;
        text_area.style.height = (text_area.scrollHeight + 10) + "px";
    }
}

var ta = null;
var timer = null;
function Stretching()
{
     if (!ta)
         ta = document.getElementById('inpt');

     if (ta)
     {
        $('#feed_ll_stretch').css('width', (parseInt(ta.style.width) + 2));
     }
}

function StartStretch()
{
    EndStretch();
    timer = setInterval("Stretching()", 10);
    //Stretching();
    //timer.start();
}

function EndStretch()
{
    if (timer)
    {
        //timer.stop();
        clearTimeout(timer);
        timer = null;
    }
}

var DirtyLike = new Array();
var DirtyComm = new Array();
function PostMessage(a,b,c,d)
{
    //alert(d);

     $('#inpt').val();

     ajax.httpExecute(SuccessEvent_MessagePosted, POSTMESSAGE, [a,b,c,d]);
}
