$(document).ready(function() {
	// Load the img class fix for IE in the gallery
	$('#ieGal img').hover(
	function() {
		$(this).toggleClass('over');
	},
	function() {
		$(this).toggleClass('over');
	});
	
	// Footer Drawer Functionality
	$('#drawerControl a').click(function() {
		if ($('#drawerControl').hasClass('show'))
		{
			$('#drawerControl').removeClass('show');
			$('#drawerControl').addClass('hide');
		}
		else
		{
			$('#drawerControl').removeClass('hide');
			$('#drawerControl').addClass('show');
		}
		
		$('#drawer').slideToggle(400);
	});
});


function EnterSubmit(e, form) {
	// if the enter key is pressed, submit the form

	var key
	
	if(window.event) // IE
	{
		key = e.keyCode
	}
	else if(e.which) // Netscape/Firefox/Opera
	{
		key = e.which
	}
	
	if (key == 13) {
		form.submit();
	}
}

/* NewWindow popup functionality */
function NewWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
