﻿$(document).ready(function() {
$("#ctl00_ContentPlaceHolder1_ulfiles li:nth-child(1) span").css("color", "#EE690D");
//display news when ready - prevent ie8 problem
$("#ctl00_newslist").css("display", "block");


    $('#ctl00_ContentPlaceHolder1_ulfiles li').hover(
    function() {
    $(this).css({ color: '#EE690D' }); //mouseover
    },
    function() {
        $(this).css({ color: '#646464' }); // mouseout
    }
);

    $('.contact_txtbox').focus(function() {
        this.value = $(this).attr('title');
        if (this.value == $(this).attr('title')) {
            this.value = '';
        }
       
    });

    $('.contact_txtbox').blur(function() {
        if (this.value == '') {
            this.value = $(this).attr('title');
        }
    });


    $('.contact_txterea').focus(function() {
        this.value = $(this).attr('title');
        if (this.value == $(this).attr('title')) {
            this.value = '';
        }

    });

    $('.contact_txterea').blur(function() {
        if (this.value == '') {
            this.value = $(this).attr('title');
        }
    });
    if (menuloca == "1") {
        if (liop != "0") {
            $("#in" + ulop).css("display", "block");
            $("#in" + ulop + " li:nth-child(" + liop + ") a").addClass("corrent");
            $("#outli" + ulop + " a.outul").css("color", "#b8e082");

        }
        else if (ulop != "0") {
        $("#outli" + ulop + " a.outul").css("color", "#b8e082");
        $("#outli" + ulop + " a").addClass("corrent");
        }
    }
    else {
        if (liop != "0") {
            $("#glowmenu #outtopli" + ulop + " a.outul").addClass("correntbtn");
            $("#glowmenu #outtopli" + ulop + " a.outul").css("color", "#C75CB5");

        }
        else if (ulop != "0") {
        $("#glowmenu #outtopli" + ulop + " a.outul").css("color", "#C75CB5");
        $("#glowmenu #outtopli" + ulop + " a.outul").addClass("correntbtn");
        }
    }
});

function reg_news() {

        var features = "width=320,height=280,scrollbars=no,menubar=no,directories=no,resizable=no,toolbar=no,status=no,location=no,titlebar=no";
        window.open("/en/newsletter.htm", "mywindow", features);

}

function changsrc(src, urlfile, lid) {

    $(".imgfile").attr("src", "../userfiles/t3/" + src);
    $(".imgfile").attr("alt", $("#ctl00_ContentPlaceHolder1_ulfiles li:nth-child(" + lid + ") span").text());
    $('#ctl00_ContentPlaceHolder1_ulfiles li span').removeAttr("style");
    $("#ctl00_ContentPlaceHolder1_ulfiles li:nth-child(" + lid + ") span").css("color", "#EE690D");
    $("#linktofile").attr("href", "../userfiles/t3/" + urlfile);
    $("#linktofile").attr("href", "../userfiles/t3/" + urlfile);
}

                    function fbs_click() {
                        u = location.href;
                        if (u.indexOf("aspx") == -1) {
                            if (u.indexOf("?") == -1) {
                                u += ".aspx";
                            }
                            else {
                                var newurl = u.split("?");
                                u = newurl[0] + ".aspx?" + newurl[1];
                            }
                           
                        }
                    t=document.title;
                   window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
                   return false;
                    }
//                    function tweetershareIn() {
//                        var u = location.href;
//                        window.open('http://twitter.com/share?url=' + encodeURIComponent(u), 'sharer', 'toolbar=0,status=0,width=626,height=436');
//                        return false;
//                    }


//COMMENTS
function opencomm(id) {
    var commid = "comm" + id + "m";
    if (document.getElementById(commid).style.display == "block") {
        //                document.getElementById(commid).style.visibility = "hidden";
        //                document.getElementById(commid).style.display = "none";
        $("#comm" + id + "n").css("display", "none");
        $("#closelbl" + id).slideToggle(500);
        $("#comm" + id + "m").slideToggle(700);
        $("#comm" + id + "m").css("background-color", "#ffffff");
        $("#comm" + id + "b").css("background-color", "#ffffff");
        $("#comm" + id + "b").css("margin-bottom", "0px");
    }
    else {
        //                document.getElementById(commid).style.visibility = "visible";
        //                document.getElementById(commid).style.display = "block";
        // $("#comm" + id + "n").css("display", "block");
        $("#comm" + id + "n").slideToggle(500);
        $("#closelbl" + id).slideToggle(500);
        $("#comm" + id + "m").slideToggle(700);
        $("#comm" + id + "m").css("background-color", "#ffffff");
        $("#comm" + id + "b").css("background-color", "#ffffff");
        $("#comm" + id + "b").css("margin-bottom", "5px");

    }
}
function backcomm(pario, messid) {

    document.getElementById("addcommtitle").innerHTML = "אתה מגיב לתגובה מספר   - " + pario;
    document.getElementById("ctl00_ContentPlaceHolder1_hdnmessid").value = messid;
    centerPopup();
    loadPopup();

}
function newcomm() {
    document.getElementById("addcommtitle").innerHTML = "הוספת תגובה חדשה";
    document.getElementById("ctl00_ContentPlaceHolder1_hdnmessid").value = "";
    centerPopup();
    loadPopup();
}



