﻿// JScript File

function stopEvent(myevent)
{
	agent = jQuery.browser;
	if(agent.msie) {
		event.cancelBubble = true;
	} else {
		myevent.stopPropagation();
	}
}

$(document).ready(function() {
   $('#menu a').each(function (i) {
   	$(this).mouseenter(function () {
			$('.submenu').hide();
			if ($('#sub'+$(this).attr('id')))
			{
				var p = $(this).position();
				
				$('#sub'+$(this).attr('id')).css({left: (parseInt(p.left)-10)+'px',top:(parseInt(p.top)-25)+'px','z-index':9999});
				$('#sub'+$(this).attr('id')).show();
			}
		});
	$(this).mousemove(function (e)  {
			stopEvent(e);
		});
   });
   
   $('.submenu').mousemove(function (e) {
   	stopEvent(e);
   });
   
   $('body').mousemove(function () {
	   	$('.submenu').hide();
	   });

 $('#menuextra a').each(function (i) {
   	$(this).mouseenter(function () {
			$('.submenu').hide();
			if ($('#subextra'+$(this).attr('id')))
			{
				var p = $(this).position();
				
				$('#subextra'+$(this).attr('id')).css({left: (parseInt(p.left)-10)+'px',top:(parseInt(p.top)-25)+'px','z-index':9999});
				$('#subextra'+$(this).attr('id')).show();
			}
		});
	$(this).mousemove(function (e)  {
			stopEvent(e);
		});
   });
   
   $('.submenu').mousemove(function (e) {
   	stopEvent(e);
   });
   
   $('body').mousemove(function () {
	   	$('.submenu').hide();
	   });

});
