function showImage(path,w,h){
	displayLarge(path);
}
var bw = 0;
var bh = 0;
var sw = 0;
var sh = 0;
function getSizes(){

	if( typeof( window.innerWidth ) == 'number' ) {
		bw = window.innerWidth;
		bh = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		bw = document.documentElement.clientWidth;
		bh = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		bw = document.body.clientWidth;
		bh = document.body.clientHeight;
	}

	return;

}
function getScrollSizes() {
	
	/*if( typeof( window.pageYOffset ) == 'number' ) {
		sw = window.pageXOffset;
		sh = window.pageYOffset;
	} else if(document.body.scrollTop) {
		sw = document.body.scrollLeft;
		sh = document.body.scrollTop;
	} else if(document.documentElement.scrollTop) {
		sw = document.documentElement.scrollLeft;
		sh = document.documentElement.scrollTop;
	}*/
	if( typeof( window.pageYOffset ) == 'number' ) {
		sw = window.pageXOffset;
		sh = window.pageYOffset;
	} else {
		sw = document.getElementById('aikido_shodokan').scrollLeft;
		sh = document.getElementById('aikido_shodokan').scrollTop;		
	}		
	
 	return;

}
function displayLarge(path){

	html = '<div class="largedisplay">';
	html += '<div class="largedisplayclose"><a href="javascript:hideLarge()"><img src="/_layout/closeimage.gif"></div>';
	html += '<div class="largedisplayimage"><a href="javascript:hideLarge()"><img src="/files/'+ path +'.jpg" onload="styleLarge(this.width,this.height)"></a></div>';
	html += '</div>';

	document.getElementById('largeimage').style.display = '';
	document.getElementById('largeimage').style.visibility = 'hidden';
	document.getElementById('largeimage').style.top = '0px';
	document.getElementById('largeimage').style.left = '0px';
	document.getElementById('largeimage').innerHTML = html;

}
function styleLarge(w,h){

	getSizes();
	getScrollSizes();
	
	w = w + 54;
	h = h + 52;
	
	
	document.getElementById('largeimage').style.width = w + 'px';
	document.getElementById('largeimage').style.height = h + 'px';
	
	posx = (((bw - sw) - w) / 2);
	if (posx < 0)posx = 0;
	
	document.getElementById('largeimage').style.left = posx + 'px';	
	
	posy = ((bh + sh) - ((h + bh) / 2) + 52);
	if (posy < 10)posy = 10;
	
	document.getElementById('largeimage').style.top = posy + 'px';
	
	document.getElementById('largeimage').style.visibility = 'visible';
	
}
function hideLarge(){
	document.getElementById('largeimage').innerHTML	= '';
	document.getElementById('largeimage').style.display = 'none';
}
function hideImage(id){
	document.getElementById('pic'+id).innerHTML = '';
}
function showInfo(box,id){

	box = document.getElementById(box);
	id = document.getElementById(id);
	
    	if(box.checked == true){
    		id.style.visibility = "hidden";
    	}else{
		id.style.visibility = "visible";
	}
	
}
function showHide(show,hide){
	document.getElementById(show).style.display = '';
	document.getElementById(hide).style.display = 'none';
	document.getElementById(show + 'tab').style.backgroundColor = '#dddddd';
	document.getElementById(hide + 'tab').style.backgroundColor = '#ffffff';

}
