/*****************************************************************************
* ファイル名：header.js
* 
* アプリケーション名：All Application
*
*****************************************************************************/

//------------------------------------------------------------------------------
// 関数名:	getStyleObject
// 
// 機能：	
// 
// 戻り値：	なし
// 
// 引数：
// 		varQuestYear
//		varQuestID
//		varPageNo
// 
// 機能説明：	
//------------------------------------------------------------------------------

// ************************
// layer utility routines *
// ************************
//	document.layer for NS4
//	document.getElementById for IE5 & NS6
//	document.all && !(document.getElementById) for IE4

function getStyleObject(objectId) {
	// NN 4 DOM.. note: this won't find nested layers
	if (document.layers && document.layers[objectId]) {
		return document.layers[objectId];
	} 

	// W3C DOM :IE5 & NS6
	else if(document.getElementById && document.getElementById(objectId)) {
		return document.getElementById(objectId).style;
	} 

	// MSIE 4 DOM
	else if (document.all && document.all(objectId)) {
		return document.all(objectId).style;
	} 
	else {
		return false;
	}
} // getStyleObject

function changeObjectVisibility(objectId, newVisibility) {
	// get a reference to the cross-browser style object and make sure the object exists
	var styleObject = getStyleObject(objectId);
	if(styleObject) {
		styleObject.visibility = newVisibility;
		return true;
	} 
	else {
		// we couldn't find the object, so we can't change its visibility
		return false;
	}
} // changeObjectVisibility

function moveObject(objectId, newXCoordinate, newYCoordinate) {
	// get a reference to the cross-browser style object and make sure the object exists
	var styleObject = getStyleObject(objectId);
	if(styleObject) {
		styleObject.left = newXCoordinate;
		styleObject.top = newYCoordinate;
		return true;
	} 
	else {
		// we couldn't find the object, so we can't very well move it
		return false;
	}
} // moveObject

function showMenu(menuNumber, eventObj) {
	hideAllMenus();
	var menuId = 'menu' + menuNumber;
	if(changeObjectVisibility(menuId, 'visible')) {
		moveObject(menuId, (menuNumber-1)*86+70, 90);
		return true;
	} 
	else {
		return false;
	}
}

function hideAllMenus() {
	var numMenus = 6;
	for(counter = 1; counter <= numMenus; counter++) {
		changeObjectVisibility('menu' + counter, 'hidden');
	}
}

function nothing() {
}
document.onclick = hideAllMenus;



