var categoryXY = new Array();
categoryXY['category1'] = new Array(400,-265,100);
categoryXY['category2'] = new Array(400,-265,100);
categoryXY['category3'] = new Array(400,-265,100);
categoryXY['category4'] = new Array(400,-265,100);
categoryXY['category5'] = new Array(400,-265,100);
categoryXY['category6'] = new Array(400,-265,100);
categoryXY['category7'] = new Array(400,-265,100);
categoryXY['category8'] = new Array(400,-265,100);
categoryXY['category9'] = new Array(400,-265,100);

function showDIV(layName, e){

	var ua = navigator.userAgent;

	if(e){
	    if(document.all){
			var categoryTop = window.event.clientY + document.documentElement.scrollTop - 5;
		} else if(document.layers || $ ) {
			var categoryTop = e.pageY - 5;
		}

		if(getINNERWIDTH() > 800){
			var categoryLeft = parseInt(getINNERWIDTH()) / 2 + categoryXY[layName][1];
		} else {
			var categoryLeft = categoryXY[layName][2];
		}
		
		//$('copyright').innerHTML = goleft + ":" + gotop;
		if(document.getElementById){
			if(ua.indexOf('Netscape') == -1){
				setOpacity(layName, 0.8);
				$(layName).style.top = parseInt(categoryTop)+'px'
				$(layName).style.left = parseInt(categoryLeft)+'px'
			}
		} else if(document.all) {
			setOpacity(layName, 0.8);
			document.all(layName).style.top = parseInt(categoryTop)+'px';
			document.all(layName).style.left = parseInt(categoryLeft)+'px';
		}
	}

	if(document.getElementById){
		if(ua.indexOf('Netscape') == -1){
			setOpacity(layName, 0.8);
			$(layName).style.display = 'block'
		}
	} else if(document.all) {
		setOpacity(layName, 0.8);
		document.all(layName).style.display = 'block'
	}
	//$('copyright').innerHTML = e + ":" + categoryTop;
}

function hideDIV(layName){
	if(document.getElementById){
		$(layName).style.display = 'none'
	} else if(document.all){
		document.all(layName).style.display = 'none'
	}
}

//ブラウザの幅を取得
function getINNERWIDTH(){
	if(document.all)
		return document.body.clientWidth	//e4,e5,e6用
	else if(document.layers)
		return window.innerWidth			//n4用
	else if($)
		return window.innerWidth			//n6,n7,m1,s1用
	return null
}

//ブロックを半透明に
function setOpacity(layName,arg) {
	//arg は 0透明 1不透明
	//n4やmac-e4などopacity未対応は0以下で代替処理としてhiddenする
	var ua = navigator.userAgent

	if( window.opera ) return          //o6,o7
	if( document.layers )              //n4
		var oj = document.layers[layName]
	else if( document.all )            //e4,e5,e6
		var oj = document.all(layName).style
	else if( $ ) //n6,n7,m1,s1
		var oj =$(layName).style

	if(document.layers ||
		ua.indexOf('Mac_PowerPC') !=-1 && document.all ||
		ua.indexOf('Safari') !=-1 ) {   //n4,mac-e4,mac-e5,s1
		//opacityの使えないブラウザ用代替処理
		if(arg>0)			oj.visibility='visible'
		else if(arg<=0)	oj.visibility='hidden'
	} else if(document.all) {          //win-e4,win-e5,win-e6
		document.all(layName).style.filter="alpha(opacity=0)"
		document.all(layName).filters.alpha.Opacity  = (arg * 100)
	} else if(ua.indexOf('Gecko')!=-1) //n6,n7,m1
		$(layName).style.MozOpacity = arg
}

