// JavaScript Document
/*search */
	function find(){
		var os = document.getElementsByName("os")[0].value;
		var input = document.getElementsByName("input")[0].value;
		var output = document.getElementsByName("output")[0].value;
		document.find.action = document.find.action + os + "/" + input + "/" + output + ".html";
		document.find.submit();
	}
	
	
/*left menu effect*/
function buildsubmenus() {
	for (var i = 0; i < menuids.length; i++) {
		var ultags = document.getElementById(menuids[i])
				.getElementsByTagName("ul");

		for (var t = 0; t < ultags.length; t++) {
			ultags[t].parentNode.getElementsByTagName("a")[0].className = "subfolderstyle";

			ultags[t].parentNode.onmouseover = function() {
				var $item = $(this.getElementsByTagName("ul")[0]);
				var $parent = $(this);
				var height = document.documentElement.clientHeight == 0
						? document.body.clientHeight
						: document.documentElement.clientHeight;
				height += $(document).scrollTop();
				if ($parent.offset().top + $item.height() > height) {
					var position = height
							- ($parent.offset().top + $item.height());
					$item.css('top', position + 'px');
				} else {
					$item.css('top', '0px');
				}

				$item.show();

			}

			ultags[t].parentNode.onmouseout = function() {
				$(this.getElementsByTagName("ul")[0]).hide();
			}
		}
	}
}

function showsubmenus(mainId, value, flg, size,obj) {
	var submenuId = mainId.replace("main", "sub");
	var $parent = $('#' + mainId);
	var y;
	if (flg == '1') {
		y = 46 + value * 30;
	} else {
		y = value * 30;
	}
 	var height = document.documentElement.clientHeight == 0? document.body.clientHeight	: document.documentElement.clientHeight;
	height = (height + $(document).scrollTop());
	var position;
	if ( $parent.offset().top+$("#" + submenuId).height() > height) {
		position = y + height - (($("#" + submenuId).height())+$parent.offset().top);
		$("#" + submenuId).css('top', position + 'px');
	} else {
		position = y;
		$("#" + submenuId).css('top', position + 'px');
	}
	document.getElementById(submenuId).style.display = "block";
}

function hidesubmenus(mainId) {
	var submenuId = mainId.replace("main", "sub");
	document.getElementById(submenuId).style.display = "none";
}

$(document).ready(function(){
	$('.bimOther').bind('mouseleave',function(e){
		var top = $(this).offset().top;
		var left = $(this).offset().left;
		var height = $(this).height();
		var width = $(this).width();
		var pageX = e.pageX;
		var pageY = e.pageY;
		if((pageY >= top + height) ||
			(pageY <= top) ||
			(pageX >= left + width) ||
			(pageX <= left)){
			$('.bimOther').hide();
		}
		
	});
	
	$('.bimOther').bind('mouseover',function(e){
		$(this).show();
	});
});




function showme(obj) {
	obj.style.display = "block";
	
}

function hideme(obj) {
	obj.style.display = "none";
}

