function ToggleSurveyWindow(bDoShow)
{
    if(!bDoShow)
    {
        $("SurveyContainer").style.display = "none";
        $("SurveyBgFiller").style.display = "none";
    }
    else
    {
        $("SurveyContentContainer").innerHTML = '<iframe src="/modules/survey/start.php?sID='+iSurveyID+'" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" name="SurveyWin" width="400" height="365"></iframe>';
    }

    return;
}
function getFillerDimension()
{
    iBodyHeight = JoeDex.Base.getBodyDimensions().height;
    iViewportHeight = document.viewport.getHeight();
    iViewportWidth  = document.viewport.getWidth();

    if(iBodyHeight < iViewportHeight)
    {
        iBodyHeight = iViewportHeight;
    }

    return { height: iBodyHeight + "px", width: iViewportWidth  + "px" }
}

function CreateFiller()
{
    oFiller = document.createElement("div");
    oFiller.style.height            = getFillerDimension().height;
    oFiller.style.width             = getFillerDimension().width;
    oFiller.innerHTML               = "&nbsp;";

    $("SurveyBgFiller").appendChild(oFiller);

    return;
}
// next part handle the polls
function submitPollVote(iQuestionID, iSurveyID)
{
    // Grab all inputs in the polloptions container
    var arrInputs = $("polloptions").getElementsByTagName("input");

    // Figure out which one is selected... if any
    var strValue = "";
    for(var x = 0; x < arrInputs.length; x++)
    {
        if(arrInputs[x].checked)
        {
            strValue = arrInputs[x].value;
            break;
        }
    }

    if(strValue != "")
    {
        var oParam = {
            postBody : "action=vote&vote_reply=" + strValue + "&question_id=" + iQuestionID + "&survey_id=" + iSurveyID
        }
        new Ajax.Updater($("pollcontainer"), "/modules/survey/ajax/poll.php", oParam);
    }

    return;
}
