$(document).ready(function(){
	$('#topMenu li').hover(
		function(){
			$(this).find('ul').show()
				.find('li').hover(
					function(){ $(this).css({background:'#9b9b9b'}); },
					function(){ $(this).css({background:'transparent'}); }
				);
			var This = $(this);
			$(this).find('li').css({width:$(this).find('ul').width()+'px'}).hover( function(){ This.addClass('hovered'); }, function(){} );
		},
		function(){
			$(this).find('ul').hide();
			$(this).removeClass('hovered');
	});

});

function getCurrentData() {
	var theDate = new Date();
	var curYear = (theDate.getYear() < 2000) ? theDate.getYear()+1900 : theDate.getYear();
	document.getElementById('month').value = (theDate.getMonth() + 1);
	document.getElementById('year').value = curYear;
	document.getElementById('date').value = theDate.getDate();
}

function parseQuery ( query ) {
   var Params = {};
   if ( ! query ) {return Params;}// return empty object
   var Pairs = query.split(/[;&]/);
   for ( var i = 0; i < Pairs.length; i++ ) {
      var KeyVal = Pairs[i].split('=');
      if ( ! KeyVal || KeyVal.length != 2 ) {continue;}
      var key = unescape( KeyVal[0] );
      var val = unescape( KeyVal[1] );
      val = val.replace(/\+/g, ' ');
      Params[key] = val;
   }
   return Params;
}

function gup( name ){
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	var regexS = "[\\?&]"+name+"=([^&#]*)";
	var regex = new RegExp( regexS );
	var results = regex.exec( window.location.href );
	if( results == null )   return "";
	else    return results[1];
}

