$(document).ready(function()
{
	if (typeof $.browser.SafariMobile != 'undefined' && $.browser.SafariMobile != null)
	{
		$('#content .rgt').html('<h1 style="padding-top: 12px;">This system is not compatible with iPhones or iPads</h1></p>');
	}

	if ($.browser.msie && $.browser.version == '6.0')
	{
		$('#content .rgt').html('<h1 style="padding-top: 12px;">Please upgrade your browser</h1><br /><p><a href="http://www.getfirefox.com/">The version of your browser isn\'t supported by this system</a></p>');
	}

	$('.new-window').live('click', function () { return !window.open($(this).attr('href')); });
	$('form').validate();
	$('.form-submit').live('click', function()
	{
		$form = $(this).parent().parent().parent();
    if ($form){
      if (!$form.valid())
        return false;
			$form.submit();
		}
	});
	$('input').live('keypress',function(e){
		if (e.keyCode == '13')
			$(this).parent().parent().parent().parent().submit();
	});
});

jQuery.extend(jQuery.browser,{SafariMobile:navigator.userAgent.toLowerCase().match(/iP(hone|ad)/i)});

