/* DMR Javascript */

$(function() {
    if ($.fn.fullsize) {

        $('img').fullsize();

    }
    $(document).ready(function() {
        if ($("h1:first").text().trim() == "Mobile Access") {
            $("#mnuMobileAccess").addClass("selected");
        }
    });
    $(".searchBox input:text").attr("title", "Enter Keywords");
    $('#events,#conditions').tabs();
    $('#accordion').accordion({ autoHeight: false });
    $('.watermark').focus(function() {
        var self = $(this);
        self.removeClass('watermark');
        if (self.val() == self.attr('title')) {
            self.val('');
            self.select();
        }
    }).
		blur(function() {
		    var self = $(this);
		    if ($.trim(self.val()) == '') {
		        self.addClass('watermark').val(self.attr('title'));
		    }
		}).
		each(function() {
		    var self = $(this);
		    self.val(self.attr('title'));
		});
    $('#region select').change(function() {
        //		window.location = 'region1.html';
    });
    if (!$.browser.safari) {
        setCurrentPage();
    }
    $(window).resize(setCurrentPage);
});

function setCurrentPage() {
//    var item = $('.pageMenu li.selected');
//    if (item.length) {
//        var arrow = $('#arrow');
//        arrow.css({ display: 'block', left: item.outerWidth(),
//            top: item.offset().top - item.parents('.pageMenu').offset().top +
//			(item.outerHeight() - arrow.height()) / 2
//        });
//    }
}
