﻿

$(document).ready(function ()
{
    var search = document.getElementById("search");

    if (search)
    {
        search.onkeydown = function (e)
        {
            var nKeyCode;
            if (!e)
                nKeyCode = window.event.keyCode;
            else
                nKeyCode = e.which;

            if (nKeyCode == "13")
                return SearchGo();
        }
    }

    function SearchGo()
    {
        if (document.getElementById("search").value.trim() != "")
            window.location = rbBaseUrl + "search.aspx?q=" + document.getElementById("search").value;
        return false;
    }

    $("#bookmark-divs").bookmark({
        icons: rbBaseUrl + 'images/bookmarks.gif',
        compact: false,
        sites: ['facebook', 'twitter', 'stumbleupon', 'myspace', 'bebo', 'more', 'google', 'digg', 'print'],
        addFavorite: true,  // True to add a 'add to favourites' link, false for none 
        favoriteText: 'Favorites',  // Display name for the favourites link 
        favoriteIcon: 0,  // Icon for the favourites link     
        popup: true,
        popupText: "Share"
    });

    $('a[href$="enquiry"]').fancybox({
        'href': rbBaseUrl + 'pages/enquiry.aspx',
        'width': 431,
        'height': 750,
        'autoDimensions': false,
        'type': 'iframe'
    });

});


