﻿$(document).ready(function () {
    /*    $("#showTxt").click(function () {
    if ($("#txtDivHiden").css('height') == "100px") {
    var h = $('#txtDivHiden').get(0).scrollHeight;
    $("#txtDivHiden").animate({ height: h}, 1000);
    $("#showTxt").text("Hide Details");
    $(this).toggleClass("active");

    } else {
    $("#txtDivHiden").animate({ height: '100px' }, 1000);
    $("#showTxt").text("Show Details");

    }
    });*/

    $('div').click(function () {
        if ($(this).attr('zaotv') == "DA") {
            $("#" + $(this).attr('id') + "H").animate({ height: 'toggle' }, 1000);
            if ($("#plus" + $(this).attr('ord') + $(this).attr('tip')).text() == "\u25bc") {
                $("#plus" + $(this).attr('ord') + $(this).attr('tip')).text("\u25b2");
            } else {
                $("#plus" + $(this).attr('ord') + $(this).attr('tip')).text("\u25bc");
            }
            $(this).toggleClass("active");

        }
    });

    $('a').click(function () {
        if ($(this).attr('zaexp') == "DA") {
            if ($("#" + $(this).attr('idexp')).css('height') == "100px") {
                var h = $("#" + $(this).attr('idexp')).get(0).scrollHeight;
                $("#" + $(this).attr('idexp')).animate({ height: h }, 1000);
                switch ($(this).attr('lang')) {
                    case "1":
                        $(this).text("Sakrij Detalje \u25b2");
                        break;
                    case "2":
                        $(this).text("Hide Details \u25b2");
                        break;
                    default:
                        alert("default")
                        $(this).text("Hide Details \u25b2");
                        break;
                }
                $(this).toggleClass("active");
            } else {
                $("#" + $(this).attr('idexp')).animate({ height: '100px' }, 1000);
                switch ($(this).attr('lang')) {
                    case "1":
                        $(this).text("Prikaži Detalje \u25bc");
                        break;
                    case "2":
                        $(this).text("Show Details \u25bc");
                        break;
                    default:
                        alert("default")
                        $(this).text("Show Details \u25bc");
                        break;
                }
            }
        }
    });

    /*
    var h =  $("#"+$(this).attr('idexp')).get(0).scrollHeight;
    $("#"+$(this).attr('idexp')).animate({ height: h}, 1000);
    $(this).text("Hide Details \u25b2");
    $(this).toggleClass("active");
    } else {
    $("#"+$(this).attr('idexp')).animate({ height: '100px' }, 1000);
    $(this).text("Show Details \u25bc"); }
    }
    });
    */
});
