﻿function showLogin() {
    document.getElementById("divLoginPopup").style.display = "";
}

function hideLogin() {
    document.getElementById("divLoginPopup").style.display = "none";
}

function setLikeJS(ResponseId, RecommendationId) {
    LikeWebService.setLike(ResponseId, null, null, null);
    document.getElementById("divResponseLike_" + ResponseId).innerHTML = RecivedTXT;
}

function setBookLikeJS(BookId) {
    LikeWebService.setBookLike(BookId, null, null, null);
    document.getElementById("divBookLike_" + BookId).innerHTML = RecivedTXT;
}

function setRecommendationLikeJS(RecommendationId) {
    LikeWebService.setRecommendationLike(RecommendationId, null, null, null);
    document.getElementById("divRecommendationLike_" + RecommendationId).innerHTML = RecivedTXT;
}

function showSendFirent() {
    document.getElementById("divSendFriend").style.display = "";
}

function openAnswer(id) {
    if (document.getElementById("divAnswer_" + id).style.display == "")
        document.getElementById("divAnswer_" + id).style.display = "none";
    else
        document.getElementById("divAnswer_" + id).style.display = "";
}

//replaceAll - function replaces char in a string
//It works exactly as ASP replace function.
function replaceAll(theString, searchChar, newChar) {
    var strTemp = new String(theString)
    return strTemp.split(searchChar).join(newChar);
}


function showLargeImage(img) {
    var win = window.open('','','');
    win.document.body.innerHTML = "<img src='" + replaceAll(img.src, "_thumb", "") + "' />"
}
