﻿$.fn.dropList = function(showObj) {
	var showObj = $(showObj),leaveTimeOut,$this = this;
	this.hover( function() {
		clearTimeout(leaveTimeOut);
		showObj.show("fast");
		if ( !$(this).hasClass("act2") ) {
			$(this).addClass("act2");
		}
	} , function() {
		leaveMar();
	} );
	showObj.hover( function() {
		clearTimeout(leaveTimeOut);
	} , function() {
		leaveMar();
	} )
	function leaveMar() {
		leaveTimeOut = setTimeout( function() {
			showObj.hide(100,function() {
				if ( $this.hasClass("act2") ) {
					$this.removeClass("act2");
				}
			} );
		} , 100 );
	}
	return this;
};
$( function() {
	with ( $("#mainnav li:not(.act)") ) {
		eq(0).dropList(".po01");
		eq(1).dropList("#mainnav2");
		eq(2).dropList(".po02");
		eq(3).dropList(".po03");
	}
} );
