$(document).ready(function() {

    $('input[type=file]').each(function() {
        var uploadbuttonlabeltext = $(this).attr('title');
        if (uploadbuttonlabeltext == '') {
            var uploadbuttonlabeltext = 'Browse';
        }
        $(this).addClass('file').css('opacity', 0);
        var uploadbutton = '<input type="button" class="browseButton" value="' + uploadbuttonlabeltext + '" />';
        $(this).wrap('<div class="fileinputs"></div>');

        $(this).parent().append($('<div class="fakefile" />').append($('<input type="text" class="fileInput"/>').attr('id', $(this).attr('id') + '__fake')).append(uploadbutton));

        $(this).bind('change', function() {
            $('#' + $(this).attr('id') + '__fake').val($(this).val()); ;
        });
        $(this).bind('mouseout', function() {
            $('#' + $(this).attr('id') + '__fake').val($(this).val()); ;
        });
    });

    if ($('#map_canvas').length > 0) {
        initialise();
    }
    if ($(".hideShow").length) {
        faq();
    }
});

function faq() {
    $(".hideShow .toggle").addClass("hidden");
    $('.hideShow').addClass('plus');
    $(".hideShow .head").each(function(i) {
        $(".hideShow .head").eq(i).toggle(function() {
        $(this).parent().addClass('minus');
            $(this).parent().find('.toggle').removeClass("hidden");
            //$(this).parent().children("div").addClass("visible").removeClass("hidden");
        }, function() {
        $(this).parent().removeClass('minus');
            $(this).parent().find('.toggle').addClass("hidden");
            //$(this).parent().children("div").removeClass("visible").addClass("hidden");
        });
    });
} 

function initialise() {
    var latlng = new google.maps.LatLng(54.989683, -1.597821);
    var myOptions = {
        zoom: 15,
        center: latlng,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    var marker = new google.maps.Marker({
        position: latlng,
        map: map,
        title: "Shout.  We're on the second floor."
    });
}