﻿       
    function clearTextproject(thefield)
    {
        if (thefield.defaultValue==thefield.value)
        thefield.value = "";
    }
    function resetTextproject(thefield)
    {
        thefield.value = "Search Projects";
    }
    function searchProject(thefield)
    {
        if(event.which || event.keyCode)
        {
            if ((event.which == 13) || (event.keyCode == 13)) 
            {
                document.getElementById(thefield).click();
                return false;
            }
        } 
        else 
        {
        return true;
        }
    }

    /*this function is used for donate amount dropdown*/

    var wrapperId = "";
    var currentId = "";

    //drop down script start
    $(function() {
        $("[id$='_dropdowndetail']").click(function() {

            currentId = $(this).attr("id");
            wrapperId = "#" + currentId;


            if ($(wrapperId).find('.project-dropdown-values').is(":visible") != "true") {
                $(wrapperId).find('.project-dropdown-values').show();
            }
            else {
                alert("else");
            }

        }).mouseleave(function() {
            $(this).find('.project-dropdown-values').hide();

        });

        $('.project-dropdown-values').mouseover(function() {
            $(this).show();

        }).mouseleave(function() {
            $('.project-dropdown-values').hide();
        });

        $(wrapperId + '.project-dropdown-values .ul span').click(function() {
            var str = $(this).text();
            $(wrapperId).find("[id$='_txtDonateAmount']").val(str);
        });
    });    

         function showLoader(arg) {
        var parentid = $(arg).parent();
        parentid.hide();
        $(parentid).parent().children()[0].style.display = '';
    }
   