//メニューの表示制御（システム）
function LoginPanel(parent, top, left, layerIsVisible) {
	//Member data
	this.ownerLayer = parent;
	this.ownerTop = top;
	this.ownerLeft = left;
	this.nowShowing = 0;
	this.ownerID = this.ownerLayer.id;
	this.eventRectIE = new Array();
	this.hBalloonTimer = null;
	this.balloonNode = null;
//	this.selectButtonID = "__select_button__";
	this.closeButtonID = "__close_button__";
	this.moveOffset = -1;
	this.backupOffset = -1;
	this.moveLength = 0;
	//Member method
//	this.moveLeft = moveLeft;
//	this.moveRight = moveRight;
//	this.moveSelect = moveSelect;
	this.onBalloon = onBalloon;
	this.offBalloon = offBalloon;
	this.openPanel = openPropertyPanel;
	this.closePanel = closePropertyPanel;
//	this.setOffset = moveOffsetSet;
//	this.getOffset = moveOffsetGet;
//	this.getBackupOffset = backupOffsetGet;
//	this.setMoveLength = moveLengthSet;
//	this.getMoveLength = moveLengthGet;
//	this.eventMouseMove = eventMouseMove;
//	this.eventMouseDown = eventMouseDown;
//	this.eventMouseUp = eventMouseUp;
	this.resetChild = resetChildLayerPosition;
	//init method
	this.setupChild = setupChildLayer;
	this.createCB = createCloseButton;
//	this.createSB = createSelectButton;
	
	var agentValue = navigator.userAgent.toLowerCase();
	var majorVersion = parseInt(navigator.appVersion);
	var minorVersion = parseFloat(navigator.appVersion);
	this.isIE  = agentValue.indexOf("msie") > 0;
	this.isFirefox = agentValue.indexOf("firefox") > 0;
//	this.isIE6 = this.isIE && majorVersion == 4 && agentValue.indexOf("msie 6.")!=-1;

	this.ownerLayer.style.top = this.ownerTop+"px";
	this.ownerLayer.style.left = this.ownerLeft+"px";
	if (this.isIE) {
		this.ownerLayer.style.width = document.documentElement.scrollLeft + document.documentElement.clientWidth - this.ownerLeft - 5 + "px";
		this.ownerLayer.style.height = document.documentElement.scrollTop + document.documentElement.clientHeight - this.ownerTop - 5 + "px";
	}else{
		this.ownerLayer.style.width = innerWidth-this.ownerLeft-5+"px";
		this.ownerLayer.style.height = innerHeight-this.ownerTop-5+"px";
	}
	if(layerIsVisible) {
		this.ownerLayer.style.visibility = 'visible';
	}else{
		this.ownerLayer.style.visibility = 'hidden';
	}

	this.balloonNode = document.createElement("div");
	var balloonStyle = document.createAttribute("style");
	if(this.isIE) {
		this.balloonNode.setAttributeNode(balloonStyle);
		this.balloonNode.style.cssText = 'visibility:hidden;position:absolute;width:180px;height:80px;left:0px;top:0px;filter:alpha(opacity=95);-moz-opacity:0.95;opacity:0.95;';
	}else{
		balloonStyle.value = 'visibility:hidden;position:absolute;width:180px;height:80px;left:0px;top:0px;filter:alpha(opacity=95);-moz-opacity:0.95;opacity:0.95;';
		this.balloonNode.setAttributeNode(balloonStyle);
	}
	document.body.appendChild(this.balloonNode);	
	
	this.childlength = this.ownerLayer.childNodes.length;
/*	var childCount = 0;
	for(var i=0;i<this.childlength;i++) {
		//Delegate method
		var childID = this.ownerLayer.childNodes[i].id;
		if(childID != null && (childID.substring(0, this.ownerID.length) == this.ownerID)) {
			if(this.isIE) {
//				this.ownerLayer.childNodes[i].onmousemove   = ___throwEventIE;
//				this.ownerLayer.childNodes[i].onmouseup = ___throwEventIE;
//				this.ownerLayer.childNodes[i].onmousedown  = ___throwEventIE;
			}else{
				var moveEvent = document.createAttribute("onmousemove");
				moveEvent.value = 'javascript:Function.prototype.__LoginPanel.eventMouseMove(event, '+childCount+');';
				this.ownerLayer.childNodes[i].setAttributeNode(moveEvent);
				var upEvent = document.createAttribute("onmouseup");
				upEvent.value = 'javascript:Function.prototype.__LoginPanel.eventMouseUp(event, '+childCount+');';
				this.ownerLayer.childNodes[i].setAttributeNode(upEvent);
				var downEvent = document.createAttribute("onmousedown");
				downEvent.value = 'javascript:Function.prototype.__LoginPanel.eventMouseDown(event, '+childCount+');';
				this.ownerLayer.childNodes[i].setAttributeNode(downEvent);
			}
			childCount++;
		}
	}
*/
	Function.prototype.__LoginPanel = this;

	this.ownerLayer.style.position = 'absolute';
	this.ownerLayer.style.left     = this.ownerLeft+'px';
	this.ownerLayer.style.top      = this.ownerTop+'px';
	this.setupChild();
	this.createCB();
//	this.createSB(0);
	if(this.isIE) {
		this.ownerLayer.onmouseup   = ___mouseEventIE;
		this.ownerLayer.onmouseover = ___mouseEventIE;
		this.ownerLayer.onmouseout  = ___mouseEventIE;
	}
}
Function.prototype.__LoginPanel = null;

function moveOffsetSet(x, back) {
	this.moveOffset = x;
	this.backupOffset = back;
}

function moveOffsetGet() {
	return this.moveOffset;
}

function backupOffsetGet() {
	return this.backupOffset;
}

function moveLengthSet(len) {
	this.moveLength = len;
}

function moveLengthGet() {
	return this.moveLength;
}

function ___throwEventIE() {
	var event = window.event;
	var ownerNode = Function.prototype.__LoginPanel;
	var childIndex = 0;
	var targetID = ownerNode.ownerID + (childIndex+1);
	var targetNode = document.getElementById(targetID);
	while(targetNode) {
		if(targetNode.style.visibility == 'visible') {
			break;
		}else{
			childIndex++;
			targetID = ownerNode.ownerID + (childIndex+1);
			targetNode = document.getElementById(targetID);
		}
	}
	if(targetNode) {
		if(event.type.toLowerCase() == 'mousemove') {
			ownerNode.eventMouseMove(event, childIndex);
		}else
		if(event.type.toLowerCase() == 'mouseup') {
			ownerNode.eventMouseUp(event, childIndex);
		}else
		if(event.type.toLowerCase() == 'mousedown') {
			ownerNode.eventMouseDown(event, childIndex);
		}
	}
}

function ___mouseEventIE() {
	var event = window.event;
	var propPanel = Function.prototype.__LoginPanel;
	var length = propPanel.eventRectIE.length;
	for(var i=0;i<length;i++) {
		var rect = propPanel.eventRectIE[i];
		if(event.type.toLowerCase() == rect.getName() && 
		   (event.srcElement.tagName.toLowerCase() == 'shape' || event.srcElement.tagName.toLowerCase() == 'group')) {
			if(event.y >= rect.getTop() && event.y <= rect.getBottom() &&
			   event.x >= rect.getLeft() && event.x <= rect.getRight()) {
			   eval(rect.rectNameJp);
			   break;
			}
		}
	}
}

function setupChildLayer() {
	var ownerWidth  = this.ownerLayer.style.width.toLowerCase();
	var ownerHeight = this.ownerLayer.style.height.toLowerCase();
	ownerWidth  = ownerWidth.indexOf('px') > 0 ? new Number(ownerWidth.substring(0, ownerWidth.indexOf('px'))) : new Number(ownerWidth);
	ownerHeight = ownerHeight.indexOf('px') > 0 ? new Number(ownerHeight.substring(0, ownerHeight.indexOf('px'))) : new Number(ownerHeight);
	this.childlength = this.ownerLayer.childNodes.length;
	var layerCount=0;
	for(var i=0;i<this.childlength;i++) {
		var childID = this.ownerLayer.childNodes[i].id;
		if(childID != null && (childID.substring(0, this.ownerID.length) == this.ownerID)) {
			var width  = this.ownerLayer.childNodes[i].style.width.toLowerCase();
			var height = this.ownerLayer.childNodes[i].style.height.toLowerCase();
			width  = width.indexOf('px') > 0 ? new Number(width.substring(0, width.indexOf('px'))) : new Number(width);
			height = height.indexOf('px') > 0 ? new Number(height.substring(0, height.indexOf('px'))) : new Number(height);
			var left = ownerWidth / 2 - width / 2;
			var top  = ownerHeight / 2 - height / 2;
			this.ownerLayer.childNodes[i].style.position = 'absolute';
			this.ownerLayer.childNodes[i].style.left = left + 'px';
			this.ownerLayer.childNodes[i].style.top  = top + 'px';
			this.ownerLayer.childNodes[i].style.visibility  = 'hidden';
			layerCount++;
		}
	}
	this.childlength = layerCount;
}

function resetChildLayerPosition(childIndex) {
	var ownerWidth  = this.ownerLayer.style.width.toLowerCase();
	var ownerHeight = this.ownerLayer.style.height.toLowerCase();
	ownerWidth  = ownerWidth.indexOf('px') > 0 ? new Number(ownerWidth.substring(0, ownerWidth.indexOf('px'))) : new Number(ownerWidth);
	ownerHeight = ownerHeight.indexOf('px') > 0 ? new Number(ownerHeight.substring(0, ownerHeight.indexOf('px'))) : new Number(ownerHeight);
	var targetID = this.ownerID + (childIndex+1);
	var targetNode = document.getElementById(targetID);
	var width  = targetNode.style.width.toLowerCase();
	var height = targetNode.style.height.toLowerCase();
	width  = width.indexOf('px') > 0 ? new Number(width.substring(0, width.indexOf('px'))) : new Number(width);
	height = height.indexOf('px') > 0 ? new Number(height.substring(0, height.indexOf('px'))) : new Number(height);
	var left = ownerWidth / 2 - width / 2;
	var top  = ownerHeight / 2 - height / 2;
	targetNode.style.position = 'absolute';
	targetNode.style.left = left + 'px';
	targetNode.style.top  = top + 'px';
}

function createCloseButton() {
	var firstChildNode = document.getElementById(this.ownerID+"1");
	var top  = parseInt(firstChildNode.style.top) - 6;
	var left = parseInt(firstChildNode.style.left) - 6;

	var canvasLayer = document.createElement("div");
	var canvalLayerID = document.createAttribute("id");
	canvalLayerID.value = this.closeButtonID;
	canvasLayer.setAttributeNode(canvalLayerID);
	if(this.isIE) {
		var bottonTop  = top + this.ownerTop;
		var bottonLeft = left + this.ownerLeft;
		this.eventRectIE[this.eventRectIE.length] = new Rectangle("mouseup","Function.prototype.__LoginPanel.closePanel();",bottonLeft,bottonTop,bottonLeft+18,bottonTop+18);
	}else{
		var canvasLayerEvent = document.createAttribute("onmouseup");
		canvasLayerEvent.value = 'javascript:Function.prototype.__LoginPanel.closePanel();';
		canvasLayer.setAttributeNode(canvasLayerEvent);
	}
	var canvasLayerStyle = document.createAttribute("style");
	if(this.isIE) {
		canvasLayer.setAttributeNode(canvasLayerStyle);
		canvasLayer.style.cssText = 'position:absolute;width:18px;height:18px;left:'+left+'px;top:'+top+'px;';
	}else{
		canvasLayerStyle.value = 'position:absolute;width:18px;height:18px;left:'+left+'px;top:'+top+'px;';
		canvasLayer.setAttributeNode(canvasLayerStyle);
	}
	var canvasNode = document.createElement("canvas");
	var canvasNodeWidth = document.createAttribute("width");
	canvasNodeWidth.value = '18';
	canvasNode.setAttributeNode(canvasNodeWidth);
	var canvasNodeHeight = document.createAttribute("height");
	canvasNodeHeight.value = '18';
	canvasNode.setAttributeNode(canvasNodeHeight);
	canvasLayer.appendChild(canvasNode);
	if(this.isIE) {
		canvasNode = G_vmlCanvasManager.initElement(canvasNode);
	}
	this.ownerLayer.appendChild(canvasLayer);
	
	var context = canvasNode.getContext('2d');
	context.arc(8, 8, 8, 0, Math.PI*2, true);
	context.fillStyle = "#FFFFFF"
	context.fill();
	context.stroke();
	context.beginPath();
	context.moveTo(2,2);
	context.lineTo(14,14);
	context.closePath();
	context.stroke();
	context.beginPath();
	context.moveTo(2,14);
	context.lineTo(14,2);
	context.closePath();
	context.stroke();
}

function createSelectButton(childIndex) {
	var ownerWidth  = this.ownerLayer.style.width.toLowerCase();
	var ownerHeight = this.ownerLayer.style.height.toLowerCase();
	ownerWidth  = ownerWidth.indexOf('px') > 0 ? new Number(ownerWidth.substring(0, ownerWidth.indexOf('px'))) : new Number(ownerWidth);
	ownerHeight = ownerHeight.indexOf('px') > 0 ? new Number(ownerHeight.substring(0, ownerHeight.indexOf('px'))) : new Number(ownerHeight);

	var canvasLayer = document.createElement("div");
	var canvalLayerID = document.createAttribute("id");
	canvalLayerID.value = this.selectButtonID;
	canvasLayer.setAttributeNode(canvalLayerID);
	var canvalLayerWidth = document.createAttribute("width");
	var canvasWidth = (8 * this.childlength) + (8 * this.childlength -1)
	var canvasLayerStyle = document.createAttribute("style");
	var canvasTop = ownerHeight-18;
	var canvasLeft = ownerWidth / 2 - canvasWidth / 2;
	if(this.isIE) {
		canvasLayer.setAttributeNode(canvasLayerStyle);
		canvasLayer.style.cssText = 'position:absolute;left:'+canvasLeft+'px;top:'+canvasTop+'px;width:'+canvasWidth+'px;height:12px;';
	}else{
		canvasLayerStyle.value = 'position:absolute;left:'+canvasLeft+'px;top:'+canvasTop+'px;width:'+canvasWidth+'px;height:12px;';
		canvasLayer.setAttributeNode(canvasLayerStyle);
	}
	for(var i=0;i<this.childlength;i++) {
		var buttonLayer = document.createElement("div");
		var buttonLayerStyle = document.createAttribute("style");
		if(this.isIE) {
			buttonLayer.setAttributeNode(buttonLayerStyle);
			buttonLayer.style.cssText = 'position:absolute;left:'+(8*2*i)+'px;top:0px;width:8px;height:8px;';
		}else{
			buttonLayerStyle.value = 'position:absolute;left:'+(8*2*i)+'px;top:0px;width:8px;height:8px;';
			buttonLayer.setAttributeNode(buttonLayerStyle);
		}
		if(this.isIE) {
			var top = this.ownerTop + canvasTop + 4; //4=arc value
			var left = this.ownerLeft + canvasLeft + (8*2*i) + 2; //3=arc value
			var bottom = top + 8;
			var right = left + 8;
			this.eventRectIE[this.eventRectIE.length] = new Rectangle("mouseover","Function.prototype.__LoginPanel.onBalloon(null,"+i+");",left,top,right,bottom);
			this.eventRectIE[this.eventRectIE.length] = new Rectangle("mouseout","Function.prototype.__LoginPanel.offBalloon(null,"+i+");",left,top,right,bottom);
			this.eventRectIE[this.eventRectIE.length] = new Rectangle("mouseup","Function.prototype.__LoginPanel.moveSelect(null,"+i+");",left,top,right,bottom);
		}else{
			var buttonLayerOverEvent = document.createAttribute("onmouseover");
			buttonLayerOverEvent.value = 'Function.prototype.__LoginPanel.onBalloon(event, '+i+');';
			buttonLayer.setAttributeNode(buttonLayerOverEvent);
			var buttonLayerOutEvent = document.createAttribute("onmouseout");
			buttonLayerOutEvent.value = 'Function.prototype.__LoginPanel.offBalloon(event, '+i+');';
			buttonLayer.setAttributeNode(buttonLayerOutEvent);
			var buttonLayerUpEvent = document.createAttribute("onmouseup");
			buttonLayerUpEvent.value = 'Function.prototype.__LoginPanel.moveSelect(event, '+i+');';
			buttonLayer.setAttributeNode(buttonLayerUpEvent);
		}

		var canvasNode = document.createElement("canvas");
		var canvasNodeWidth = document.createAttribute("width");
		canvasNodeWidth.value = '8';
		canvasNode.setAttributeNode(canvasNodeWidth);
		var canvasNodeHeight = document.createAttribute("height");
		canvasNodeHeight.value = '8';
		canvasNode.setAttributeNode(canvasNodeHeight);
		buttonLayer.appendChild(canvasNode);
		
		var targetID = this.ownerID + (i+1);
		var targetNode = document.getElementById(targetID);
		var	enable = targetNode.getAttribute("enable");
		
		if(this.isIE) {
			canvasNode = G_vmlCanvasManager.initElement(canvasNode);
		}
		var context = canvasNode.getContext('2d');
		context.arc(4, 4, 3, 0, Math.PI*2, true);
		if(enable == 'true') {
			if(childIndex == i) {
				context.fillStyle = "#0000FF";
			}else{
				context.fillStyle = "#00FF00";
			}
		}else{
			context.fillStyle = "#FF0000";
		}
		context.fill();
		context.stroke();
		canvasLayer.appendChild(buttonLayer);
	}
	this.ownerLayer.appendChild(canvasLayer);
}

function closePropertyPanel() {
	this.ownerLayer.style.visibility = "hidden";
	this.childlength = this.ownerLayer.childNodes.length;
	for(var i=0;i<this.childlength;i++) {
		var childID = this.ownerLayer.childNodes[i].id;
		if(childID != null && (childID.substring(0, this.ownerID.length) == this.ownerID)) {
			this.ownerLayer.childNodes[i].style.visibility  = 'hidden';
		}
	}
}

function openPropertyPanel(redraw) {
	this.ownerLayer.style.top = this.ownerTop+"px";
	this.ownerLayer.style.left = this.ownerLeft+"px";
	if (this.isIE) {
		this.ownerLayer.style.width = document.documentElement.scrollLeft + document.documentElement.clientWidth - this.ownerLeft + "px";
		this.ownerLayer.style.height = document.documentElement.scrollTop + document.documentElement.clientHeight - this.ownerTop + "px";
	}else{
		this.ownerLayer.style.width = innerWidth-this.ownerLeft+"px";
		this.ownerLayer.style.height = innerHeight-this.ownerTop+"px";
	}
	this.setupChild();
	this.ownerLayer.style.visibility = "visible";
	var childVisible = false;
	var childCount = 0;
	var childTarget = -1;
	for(var i=0;i<this.childlength;i++) {
		var targetID = this.ownerID + (i+1);
		var targetNode = document.getElementById(targetID);
		if(targetNode) {
			var	enable = targetNode.getAttribute("enable");
			if(enable == 'true' && !childVisible) {
				targetNode.style.visibility = 'visible';
				childVisible = true;
				childTarget = childCount;
			}else{
				targetNode.style.visibility = 'hidden';
			}
			childCount++;
		}
	}
	this.childlength = childCount;
//	var buttonNode = document.getElementById(this.selectButtonID);
//	while(buttonNode.childNodes.length > 0) {
//		buttonNode.removeChild(buttonNode.childNodes[0]);
//	}
//	this.ownerLayer.removeChild(buttonNode);
	var buttonNode = document.getElementById(this.closeButtonID);
	while(buttonNode.childNodes.length > 0) {
		buttonNode.removeChild(buttonNode.childNodes[0]);
	}
	this.ownerLayer.removeChild(buttonNode);

	this.createCB();
//	this.createSB(childTarget);
}

function eventMouseMove(e, childIndex) {
	var ownerNode = Function.prototype.__LoginPanel;
	if(ownerNode.getBackupOffset() > 0) {
		var targetID = ownerNode.ownerID + (childIndex+1);
		var targetNode = document.getElementById(targetID);
		if (document.all) {
			targetNode.style.left = event.clientX - ownerNode.getOffset() + document.documentElement.scrollLeft;
		}else{
			targetNode.style.left = e.pageX - ownerNode.getOffset() + "px";
		}
	}
}

function eventMouseDown(e, childIndex) {
	var ownerNode = Function.prototype.__LoginPanel;
	var targetID = ownerNode.ownerID + (childIndex+1);
	var targetNode = document.getElementById(targetID);
	if (document.all) {
		ownerNode.setOffset(event.offsetX + 2, parseInt(targetNode.style.left));
	}else{
		ownerNode.setOffset(e.pageX - parseInt(targetNode.style.left), parseInt(targetNode.style.left));
	}
}

function eventMouseUp(e, childIndex) {
	var ownerNode = Function.prototype.__LoginPanel;
	var targetID = ownerNode.ownerID + (childIndex+1);
	var targetNode = document.getElementById(targetID);
	var movedLength = parseInt(targetNode.style.left) - ownerNode.getBackupOffset();
	if(Math.abs(movedLength) > 100) {
		if(movedLength > 0) {
			ownerNode.moveRight(childIndex);
		}else{
			ownerNode.moveLeft(childIndex);
		}
	}else{
		targetNode.style.left = ownerNode.getBackupOffset() + "px";
	}
	ownerNode.setOffset(-1, -1);
}

function moveLeft(childIndex) {
	var targetID = this.ownerID + (childIndex+1);
	var targetNode = document.getElementById(targetID);
	if(targetNode) {
		var searchCount = 2;
		while(true) {
			var targetIDNew = this.ownerID + (childIndex+searchCount);
			var targetNodeNew = document.getElementById(targetIDNew);
			if(targetNodeNew) {
				var enable = targetNodeNew.getAttribute("enable");
				if(enable == 'true') {
					targetNode.style.visibility = 'hidden';
					targetNodeNew.style.visibility = 'visible';
					var buttonNode = document.getElementById(this.selectButtonID);
					while(buttonNode.childNodes.length > 0) {
						buttonNode.removeChild(buttonNode.childNodes[0]);
					}
					this.createSB(childIndex+searchCount-1);
					break;
				}
				searchCount++;
			}else{
				break;
			}
		}
		targetNode.style.left = this.getBackupOffset() + "px";
	}
}

function moveRight(childIndex) {
	var targetID = this.ownerID + (childIndex+1);
	var targetNode = document.getElementById(targetID);
	if(targetNode) {
		if(childIndex > 0) {
			var searchCount = 0;
			while(true) {
				var targetIDNew = this.ownerID + (childIndex-searchCount);
				var targetNodeNew = document.getElementById(targetIDNew);
				if(targetNodeNew) {
					var enable = targetNodeNew.getAttribute("enable");
					if(enable == 'true') {
						targetNode.style.visibility = 'hidden';
						targetNodeNew.style.visibility = 'visible';
						var buttonNode = document.getElementById(this.selectButtonID);
						while(buttonNode.childNodes.length > 0) {
							buttonNode.removeChild(buttonNode.childNodes[0]);
						}
						this.createSB(childIndex-searchCount-1);
						break;
					}
					searchCount++;
				}else{
					break;
				}
			}
		}
		targetNode.style.left = this.getBackupOffset() + "px";
	}
}

function moveSelect(e, childIndex) {
	var length = this.ownerLayer.childNodes.length;
	var targetID = this.ownerID + (childIndex+1);
	var	enable = document.getElementById(targetID).getAttribute("enable");
	for(var i=0;i<this.childlength && enable == 'true';i++) {
		targetID = this.ownerID + (i+1);
		var targetNode = document.getElementById(targetID);
		if(i == childIndex && targetNode) {
			targetNode.style.visibility = 'visible';
			this.resetChild(childIndex);
			this.createSB(childIndex);
		}else
		if(targetNode){
			targetNode.style.visibility = 'hidden';
		}
	}
}

function onBalloon(e, childIndex) {
	if(this.hBalloonTimer == null) {
		if(this.isIE) {
			e = event;
		}
		var canvasNode = document.createElement("canvas");
		var canvasNodeWidth = document.createAttribute("width");
		canvasNodeWidth.value = '180';
		canvasNode.setAttributeNode(canvasNodeWidth);
		var canvasNodeHeight = document.createAttribute("height");
		canvasNodeHeight.value = '80';
		canvasNode.setAttributeNode(canvasNodeHeight);
		this.balloonNode.appendChild(canvasNode);
		if(this.isIE) {
			canvasNode = G_vmlCanvasManager.initElement(canvasNode);
		}
		var context = canvasNode.getContext('2d');
		context.beginPath();
		context.moveTo(90,1);
		context.bezierCurveTo(2,1,2,1,2,35);
		context.bezierCurveTo(2,70,2,70,10,70);
		context.bezierCurveTo(10,80,10,80,7,80);
		context.bezierCurveTo(13,80,13,80,18,70);
		context.bezierCurveTo(178,70,178,70,178,35);
		context.bezierCurveTo(178,1,178,1,90,1);
		context.fillStyle = "#FFFFFF";
		context.fill();

		var targetID = this.ownerID + (childIndex+1);
		var	title = document.getElementById(targetID).title;
		
		var titleNode = document.createElement("div");
		var textNode = document.createTextNode(title);
		titleNode.appendChild(textNode);
		var balloonStyle = document.createAttribute("style");
		if(this.isIE) {
			titleNode.setAttributeNode(balloonStyle);
			titleNode.style.cssText = 'position:absolute;width:180x;height:80px;left:18px;top:17px;filter:alpha(opacity=100);-moz-opacity:100;opacity:100;font-size:18px;color:#222222;text-align:left;line-height:45px;';
		}else{
			balloonStyle.value = 'position:absolute;width:180x;height:80px;left:18px;top:17px;filter:alpha(opacity=100);-moz-opacity:100;opacity:100;font-size:18px;color:#222222;text-align:left;line-height:45px;';
			titleNode.setAttributeNode(balloonStyle);
		}
		this.balloonNode.appendChild(titleNode);
		var top = this.isIE ? e.y-85 : e.pageY-85;
		var left = this.isIE ? e.x-5 : e.pageX-5;
		this.balloonNode.style.top = top+'px';
		this.balloonNode.style.left = left+'px';
		this.balloonNode.style.visibility = 'visible';
		this.hBalloonTimer = setInterval("Function.prototype.__LoginPanel.offBalloon(null)", 2000);
	}
}

function offBalloon(e, childIndex) {
	if(this.hBalloonTimer) {
		if(this.isIE) {
			e = event;
		}
		this.balloonNode.style.visibility = 'hidden';
		while(this.balloonNode.childNodes.length > 0) {
			this.balloonNode.removeChild(this.balloonNode.childNodes[0]);
		}
		clearInterval(this.hBalloonTimer);
		this.hBalloonTimer = null;
	}
}