
function init_public_site (){


if($("#login-submit").length == 1) $("#login-submit").bind("click",  check_login);

if($("#login-button").length == 1) {
         $("#login-button").click(function(){
                 $("#test").modal({
                 opacity: 80,
                 closeClass: 'login-close-button'
                 });
         });
}

if($("#logout-button").length == 1) $("#logout-button").bind("click", logout);

//init public main menu
$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)

        $("ul.topnav li span").click(function() { //When trigger is clicked...

                //Following events are applied to the subnav itself (moving subnav up and down)
                $(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
                $(this).parent().hover(function() {
                }, function(){
                        $(this).parent().find("ul.subnav").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
                });

                //Following events are applied to the trigger (Hover events for the trigger)
                }).hover(function() {
                        $(this).addClass("subhover"); //On hover over, add class "subhover"
                }, function(){        //On Hover Out
                        $(this).removeClass("subhover"); //On hover out, remove class "subhover"
        });


        $("ul.lang-menu li a").click(function() { //When trigger is clicked...

                //Following events are applied to the subnav itself (moving subnav up and down)
                $(this).parent().find("ul.sub-lang").fadeIn('fast').show(); //Drop down the subnav on click
                $(this).parent().hover(function() {
                }, function(){
                        $(this).parent().find("ul.sub-lang").fadeOut('fast'); //When the mouse hovers out of the subnav, move it back up
                });

        });
//end: init public main menu



if($(".social-bm-item").length > 0) {
         $(".social-bm-item").css("opacity", 0.5);
         $(".social-bm-item").bind("mouseover",  over_social_bm_item);
         $(".social-bm-item").bind("mouseout",  out_social_bm_item);
}

if($("#end-content-menu-back").length == 1) $("#end-content-menu-back").bind("click", browser_back);
if($("#end-content-menu-print").length == 1) $("#end-content-menu-print").bind("click", browser_print);


         //smooth scrolling
         $(function(){
                 $('a[href*=#]').click(function() {
                         if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
                         && location.hostname == this.hostname) {

                         var $target = $(this.hash);
                         $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
                         if ($target.length) {
                                 var targetOffset = $target.offset().top;
                                 $('html,body').animate({scrollTop: targetOffset}, 500);
                         return false;
                         }
                         }

                 });

         });


if($("#ing2biz-username").length == 1) {//init login form behaviour
         $("#ing2biz-username").focus(function() {
                 $(this).css("border", "solid 1px #404040");
         });
         $("#ing2biz-username").blur(function() {
                 $(this).css("border", "solid 1px #C0C0C0");
         });
         $("#ing2biz-password").focus(function() {
                 $(this).css("border", "solid 1px #404040");
         });
         $("#ing2biz-password").blur(function() {
                 $(this).css("border", "solid 1px #C0C0C0");
         });
}//end: init login form behaviour



}//init_public_site()
