//for the reimderbox
var originalReminderHtml;

//ajaxify code
$("#menu a").livequery(function(){
    
    $(this).ajaxify({
        animateOut:{
            opacity:'0'
        },
        animateOutSpeed:300,
        animateIn:{
            opacity:'1'
        },
        animateInSpeed:300,
        target: '#content',
        tagToload: '#content div#menu_box_whead, #content div#content_box',
        loading_img:'images/orangeloading.gif',
        onComplete:function(){
            resetHeight();
            setLongest();
        }
    });

    //the active submenu is underlined
    $(this).mousedown(function () {
        $("#menu a").css({
            "background-image":"none"
        });
        $(this).css({
            "background-image":"url(../images/actmenu.jpg)",
            "background-repeat":"repeat-x",
            "background-position":"bottom"
        });
    });
    

});

    $(document).ready(function(){
        resetHeight();
        setLongest();
        //setTimeout("resetHeight();setLongest();",1000)
    });

    $(document).ready(function() {
        storeReminder();//we store the div#rememberPasswd content
    });

    $(document).ready(function() {

        $('#togglerLink').click(function(){//toggle the passwd reminder layer
            $('#rememberPasswd').toggle("slow");
            $('#googleSearch').fadeOut("fast");
        });
        $('#closeLink').click(function(){//watchting for close button
            $('#rememberPasswd').fadeOut("slow");
        });

        // bind form using ajaxForm JQuery plugin
        $('#passwdReminder').ajaxForm({
            // target identifies the element(s) to update with the server response
            target: '#resultMsg',

            // success identifies the function to invoke when the server response
            // has been received; here we apply a fade-in effect to the new content
            success: function() {
                $('#resultMsg').fadeIn('slow').css("border-color","red");
                //$('#resultMsg').show();
            }
        });

        $('#searchLink').click(function(){//toggle the passwd reminder layer
            $('#googleSearch').toggle("slow");
            $('#rememberPasswd').fadeOut("fast");
        });
        $('#closeGoogleSearch').click(function(){//watchting for close button
            $('#googleSearch').fadeOut("slow");
        });
    });

function storeReminder(){
    originalReminderHtml = document.getElementById("rememberPasswd").innerHTML;
}

function rebuildReminer(){
    document.getElementById("rememberPasswd").innerHTML = originalReminderHtml;
}


