function changeTitle(txt){
	if (txt == ''){
		document.getElementById('subtitle').innerHTML = '';
	}else{
		document.getElementById('subtitle').innerHTML = txt;
	}
}
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 && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		sw = document.body.scrollLeft;
		sh = document.body.scrollTop;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || 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('teleking').scrollLeft;
		sh = document.getElementById('teleking').scrollTop;		
	}	
	
  	return;

}
function showImage(dir,img){

	html = '<div class="largedisplay">';
	html += '<div class="largedisplayclose"><a href="javascript:hideImage()"><img src="/layout/close.gif"></div>';
	html += '<div class="largedisplayimage"><a href="javascript:hideImage()"><img src="/photo/'+ dir +'/'+ img +'.jpg" onload="styleImage(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;
	
	return;

}
function styleImage(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 hideImage(){
	document.getElementById('largeimage').innerHTML	= '';
	document.getElementById('largeimage').style.display = 'none';
}
