

$(document).ready(function () {

    $(".footernav ul li:not(.footernav ul ul li)").addClass("firstlevel");
    $("li.firstlevel:eq(1)").addClass("deliver");

    $("#topnav ul li:last").addClass("last");
    $(".secnav ul li:last").addClass("last");

    //set search default values
    $("#searchinput").blur(function () {
        if ($(this).val().trim() == "") $(this).val("search ...");
    }).focus(function () {
        if ($(this).val() == "search ...") $(this).val("");
    });

    //search check
    $("#search-form").submit(function () {
        if ($("#searchinput").val() == "search ...") {
            return false;
        }
    });

    $(".slideshow")
    .before('<div id="bannernav">')
    .cycle({
        pause: 1,
        fx: "fade", //"scrollLeft,scrollDown,scrollRight,scrollUp, fade",
        //randomizeEffects: true,
        speed: '450',
        random: 0,
        timeout: 4500,
        pager: '#bannernav'
    });

    $(".cufonload").show();

    //$(".jhbview").hide();
    $("#showcapetown").addClass("active")

    $("#showcapetown").click(function () {
        $("#showcapetown").addClass("active")
        $("#showjhb").removeClass("active")
        $(".jhbview").hide();
        $(".capetownview").show();
        return false;
    });

    $("#showjhb").click(function () {
        $("#showjhb").addClass("active")
        $("#showcapetown").removeClass("active")
        $(".capetownview").hide();
        $(".jhbview").show();
        return false;
    });

    $('.scroll-pane').jScrollPane();

    $('#map1 *').tooltip({ 
    showURL: false
     });
    $("#map1 *").click(function () {
        return false;
    });

    $(function () {
        $('a[rel*=external]').click(function () {
            window.open(this.href);
            return false;
        });
    });

    $(document).ready(function () {
        // create xhtml strict friendly iframe
        $('a.mapiframe').each(
			function (i) {
			    $(this).replaceWith("<iframe src='" + this.getAttribute("href") + "' width='300' height='375' frameborder='0' scrolling='no'></iframe>");
			}
		);
    });

});

