﻿///NEWLETTER SCRIPT


function confirmnewcus() {
var txtname = document.getElementById("ctl00_newsletter_name");
var txtmail = document.getElementById("ctl00_newsletter_mail");
    if (txtmail.value == "" || txtname.value == "") 
    {
        if (txtname.value == "") {
            alert("חובה למלא שם פרטי");
        }
        if (txtmail.value == "") {
            alert("חובה למלא מייל תקין");
        }
    }
    else if (txtmail.value != "" && txtname.value != "") 
    {
    var str = txtmail.value;
    var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
    if (filter.test(str)) {
        $('#ctl00_ImageButton1').click();
    }
    else {
        alert("חובה להקליד מייל תקין!");
       
    }
       
    }
    
}



/////END

$(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
    }
  
);
    ///סוף

    //בחירת כפתור ניווט עכשווי
    if (ulop != "0") {
        $("#menu #outtopli" + ulop + " a.menulink img").removeClass('off').addClass('corrent');
        var src = $("#menu #outtopli" + ulop + " a.menulink img.corrent").attr("src").match(/[^\.]+/) + "_on.jpg";
        $("#menu #outtopli" + ulop + " a.menulink img.corrent").attr("src", src);
    }
});


    //תפריט ראשי שינוי תמונה במעבר עכבר
$(function() {
    $("#menu li img.off")
        .mouseover(function() {
            var src = $(this).attr("src").match(/[^\.]+/) + "_on.jpg";
            $(this).attr("src", src);
        })
        .mouseout(function() {
            var src = $(this).attr("src").replace("_on", "");
            $(this).attr("src", src);
        });




    ///סוף


    $('#ctl00_tbsearch').addClass('text-label');
    $('#ctl00_tbsearch').focus(function() {
        this.value = $(this).attr('title');
        $(this).addClass('text-label');
        if (this.value == $(this).attr('title')) {
            this.value = '';
            $(this).removeClass('text-label');

        }

    });

    $('#ctl00_tbsearch').blur(function() {
        if (this.value == '') {
            this.value = $(this).attr('title');
            $(this).addClass('text-label');
        }
    });

   
        

});
//עמוד הבית תאי ניווט בטבלה
    function selecttd(currentDell, color) {
        currentDell.style.background = color;
    }
    function leavetd(currentDell, color) {
        currentDell.style.background = color;
    }
    function selectFirsttd(currentDell, color, fcolor) {
        currentDell.style.background = color;
        document.getElementById("flink").style.color = fcolor;


    }
    function leaveFirsttd(currentDell, color, fcolor) {
        currentDell.style.background = color;
        document.getElementById("flink").style.color = fcolor;
    }

    


//דף קבצים להורדה
//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();
//}



    
