﻿function ClickOnAskText(Obj) 
{
    if (Obj.value == "הקלד כאן שאלה") {
        Obj.value = "";
    }
}


function SubmitQuestion(Obj) 
{
    if (Obj.value == "הקלד כאן שאלה" || Obj.value == "" || Obj.value == "יש להזין שאלה")
    {
        Obj.value = "יש להזין שאלה";
        return (false);
    }

}



function GetSideCatQuestions(CatId , CatName , DisplayType,  QuestionsDivId , LoadingDivId) 
{

    var QuestionsDiv = document.getElementById(QuestionsDivId);
    var LoadingDiv = document.getElementById(LoadingDivId);
    LoadingDiv.innerHTML = '<span style="font-size:12px;"><img style="vertical-align:middle" src="/images/pie.gif" /> טוען שאלות..</span>';
    LoadingDiv.style.display = '';
    QuestionsDiv.innerHTML = '';
    var pageURL = "/ajax/GetCatSiteQuestions.aspx?CatId=" + encodeURI(CatId) + "&CatName=" + encodeURI(CatName) + "&DisplayType=" + encodeURI(DisplayType);

    var xObj = getHttpRequestObj();
    xObj.onreadystatechange = function() {
        if (xObj.readyState == 4) {
            QuestionsDiv.innerHTML = xObj.responseText;
            LoadingDiv.innerHTML = '';
            LoadingDiv.style.display = 'none';

            if (DisplayType == 1) {
                document.getElementById("QtabLast").className = 'tabOn';
                document.getElementById("QtabOpen").className = 'tabOff';
            }
            else {
                document.getElementById("QtabLast").className = 'tabOff';
                document.getElementById("QtabOpen").className = 'tabOn';
            }


        }
    }
    xObj.open("post", pageURL, true);
    xObj.send(null);
}



function ShowAnonymousPop(checkObj) 
{
    if (checkObj.checked) {

        var l = (screen.width / 2) - (350 / 2);
        var t = (screen.height / 2) - (250 / 2);
        window.open("/SiteQuestions/AnonymousPoP.aspx", "mywindow", "status=0,toolbar=0,width=350,height=250, Left="+l+", Top="+t);
    }

}
