var JQ = jQuery.noConflict();
var curShow = 0;

function getDocHeight() {
	var db = document.body;
	var dde = document.documentElement;
 
	var docHeight = Math.max((JQ("#content").height()+180),db.scrollHeight, dde.scrollHeight, db.offsetHeight, dde.offsetHeight, db.clientHeight, dde.clientHeight)
    return docHeight;

}

function navigation(){
	document.getElementById("navigation").style.height =  getDocHeight()+'px';
	return;
	if(typeof( window.innerWidth ) != 'number'){
		var screen_height = (document.documentElement.clientHeight>600)?document.documentElement.clientHeight:600;
		//showDebug(screen_height);
		$('#navigation').style.height = screen_height+'px';//.tween('height', screen_height);
	}
	else{
		var screen_height = (window.innerHeight>600)?window.innerHeight:600;
		//showDebug(screen_height);
		$('#navigation').style.height = screen_height+'px';//.tween('height', screen_height);
	}
}

function show1() {
	if(curShow == 1){
		closeAll(1);
		return;
	}
	closeAll(2);
	
	curShow = 1;
	$('description').tween('height','300px');
	//$('desc1').tween('height','300px');
	$('desc1').style.display = 'block';
	$('img1').className = 'imageselected';
}

function show2() {
	if(curShow == 2){
		closeAll(1);
		return;
	}
	closeAll(2);
	
	curShow = 2;
	$('description').tween('height','300px');
	//$('desc2').tween('height','300px');
	$('desc2').style.display = 'block';
	$('img2').className = 'imageselected';
}

function show3() {
	if(curShow == 3){
		closeAll(1);
		return;
	}
	closeAll(2);
	
	curShow = 3;
	$('description').tween('height','300px');
	//$('desc3').tween('height','250px');
	$('desc3').style.display = 'block';
	$('img3').className = 'imageselected';
}

function closeAll(n){
	curShow = 0;
	$('description').tween('height','1px');
	$('img1').className = 'image';
	$('img2').className = 'image';
	$('img3').className = 'image';
	//$('desc1').tween('height','1px');
	//$('desc2').tween('height','1px');
	//$('desc3').tween('height','1px');
	if(n==2){
		$('desc1').style.display = 'none';
		$('desc2').style.display = 'none';
		$('desc3').style.display = 'none';
		
		//$('desc1').style.overflow = 'hidden';
		//$('desc2').style.overflow = 'hidden';
		//$('desc3').style.overflow = 'hidden';
	}
}

var forMSIE;
window.addEvent('domready', function(){
	if(navigator.userAgent.match(/MSIE/i) != null){
		window.addEvents({
			'resize': function(){
					$('content').style.right = "101";
					$('content').style.right = "100";
				}
		});
	}
	
	navigation();
	
		
	window.addEvents({
		'resize': function(){
			navigation();
		}
	});

});
/*
window.addEvent('domready', function(){
	//document.body.clientHeight	
	if(typeof( window.innerWidth ) != 'number'){
		var screen_height = document.documentElement.clientHeight;
		var screen_width = (document.documentElement.clientWidth>1000)?document.documentElement.clientWidth:1000;
				setBG(screen_width,screen_height);
		//$('show_screen').tween('height', screen_height);
	}
	else{
		var screen_height = window.innerHeight;
		var screen_width = (window.innerWidth>1000)?window.innerWidth:1000;
		showDebug(screen_width+ ", "+screen_height);
				setBG(screen_width,screen_height);
		//$('show_screen').tween('height', screen_height);
	}
	
	window.addEvents({
		'resize': function(){
			if(typeof( window.innerWidth ) != 'number'){
				var screen_height = document.documentElement.clientHeight;
				var screen_width = (document.documentElement.clientWidth>1000)?document.documentElement.clientWidth:1000;
				setBG(screen_width,screen_height);
				//$('show_screen').tween('height', screen_height);
			}
			else{
				var screen_height = window.innerHeight;
				var screen_width = (window.innerWidth>1000)?window.innerWidth:1000;
				setBG(screen_width,screen_height);
				//$('show_screen').tween('height', screen_height);
			}
		}
	});
});

var oriHeight = 0;

function setBG(width,height){
	if(oriHeight == 0){
		oriHeight = document.height;
	}
	
	var autobgObj = document.getElementById('navigation');
	autobgObj.style.height = oriHeight;
	autobgObj.style.height = document.height;
	
	//1000 * 625
	var t1 = width * 625;
	var t2 = height * 1000;
	if(t2 < t1){
		//isWidth = true;
		//isHeight = false;
		//if(!isWidth || isHeight){
			var autobgObj = document.getElementById('autobg');
			autobgObj.style.minHeight = "auto";
			autobgObj.style.minWidth = width + "px";
			
		//}
	}
	else{
		//isWidth = false;
		//isHeight = true;
		//if(isWidth || !isHeight){
			var autobgObj = document.getElementById('autobg');
			autobgObj.style.minHeight = "100%";
			autobgObj.style.minWidth = width + "px";
			
		//}
	}
}

function showDebug(data){
	var obj = document.getElementById("debug");
	//obj.innerHTML = data;
}
*/

