﻿/// <reference path="jquery/jquery-1.5.2-vsdoc.js"/>

$(document).ready(function() {
	/*
	Settings for curvy corners
	*/
	if (whichSite == 'com') {
		var settings = {
			tl: { radius: 12 },
			tr: { radius: 12 },
			bl: { radius: 12 },
			br: { radius: 12 },
			antiAlias: true,
			autoPad: false,
			validTags: ['div']
		}
		setTimeout(function() {
			curvyCorners(settings, '#pageBody');
		}, 100);
	}
	setMenuEvents();
});

function setMenuEvents() {
	$('.parentMenu').hover(
	//Enter
		function(ev) {
			if ( ! $(this).hasClass("selected")) {	//No cascade for selected menu item
				/*
				Hide the popup menu if it is showing
				*/
				$('#popMenu').css('visibility', 'hidden');
				/*
				Figure out what child menu to show
				*/
				var childId = $(this).attr('id');
				var pos = $(this).offset();
				if (theMenuHooks[childId]) {
					/*
					Show it
					*/
					$('#popMenu').
					html(theMenuHooks[childId].replace(/&amp;#39;/g, "&#39;")).
					css({
						'visibility': 'visible',
						'top': pos.top + 22,
						'left': pos.left + 10
					}).mouseleave(function() {
						$(this).css('visibility', 'hidden');
					})
				}
			}
		},
	//Out
		function(ev) {
			;
		});

		$('#backBody').mouseenter(null, function() {
			$('#popMenu').css('visibility', 'hidden');
		});
	}

	

