// 전체보기 버튼
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var NS4 = (bName == "Netscape" && bVer >= 4);
var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
var NS3 = (bName == "Netscape" && bVer < 4);
var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);


var arrHeight = new Array();
var arrDirection = new Array();
var oXposition;
var slidedownActive = false;
var cHeight = false;
var slidedownSpeed = 15; 	// 큰번호가 빠름
var slidedownTimer = 1;	// 작은 번호가 빠름
var StartPosition = 660; //시작 높이



if( navigator.appName.indexOf("Microsoft") > -1 ){ // 마이크로소프트 익스플로러인지 확인
	if( navigator.appVersion.indexOf("MSIE 6") > -1){ // 익스플로러이면 버전 6인지 확인
		slidedownSpeed=20;
	}else if(navigator.appVersion.indexOf("MSIE 7") > -1){  // 익스 플로러이면 버전 7인지 확인
		slidedownSpeed=20;
	}
}else{ // 익스플로러가 아닐 경우
	slidedownSpeed1=20;
	slidedownSpeed=350;
    StartPosition =660;
}


function mOver_contentView(divID, subDivs)
{

	//document.getElementById('defaulthidden').style.display='block';
	document.getElementById('mainContent').style.display='none';
	//document.getElementById('allContentView').style.display='block';
	document.getElementById('contentViewImg').style.display='none';

	arrDirection[divID] = 1;
	arrHeight[divID] = 0;

	if(arrHeight[divID]==0)
		arrDirection[divID]=10; 
	else 
		arrDirection[divID] = slidedownSpeed*-1;
	
	divContent = document.getElementById(divID);
	sdContent = document.getElementById(subDivs);
	
	if (NS4)  // 파폭
	{
		cHeight	 = sdContent.offsetHeight;
	}
	else   // 익스
	{
		cHeight = sdContent.offsetHeight;
	}

	//alert("cHeight = "+cHeight);
	divContent.style.visibility='visible';
	slidedownActive = true;

	sd_Start(divContent,sdContent);
}

function sd_Start(divContent,sdContent)
{
	
	//document.getElementById('sub_content1').style.visibility='hidden';
	//document.getElementById('sub_content2').style.visibility='hidden';
	//document.getElementById('contentViewImg').style.visibility='hidden';


	if(!slidedownActive) return;
	arrHeight[divContent.id] = arrHeight[divContent.id]/1 + arrDirection[divContent.id];
	
	if(arrHeight[divContent.id] <= 0){
		slidedownActive = false;	
		divContent.style.visibility='hidden';
		arrHeight[divContent.id] = 0;
	}
	if(arrHeight[divContent.id]>cHeight){
		slidedownActive = false;	
	}


	divContent.style.height = arrHeight[divContent.id] + 'px';
	sdContent.style.top = arrHeight[divContent.id] - cHeight + 'px';
	divContent.style.top = StartPosition - arrHeight[divContent.id] + 'px';

	//alert("divContent.id = " + divContent.style.height);
	//alert("divContent.style.height = " + divContent.style.height );


	setTimeout('sd_Start(document.getElementById("' + divContent.id + '"),document.getElementById("' + sdContent.id + '"))',slidedownTimer);	// Choose a lower value than 10 to make the script move faster
}

function div_ShowHide(divID, subDivs)
{

	arrDirection[divID] = 1;
	arrHeight[divID] = 0;

	
	if(arrHeight[divID]==0)
		arrDirection[divID]=slidedownSpeed; 
	else 
		arrDirection[divID] = slidedownSpeed*-1;
	
	divContent = document.getElementById(divID);
	sdContent = document.getElementById(subDivs);

	cHeight = sdContent.offsetHeight;

	divContent.style.visibility='visible';
	slidedownActive = true;

	sd_Start(divContent,sdContent);
}

function mOver_contentDown()
{
	//document.getElementById('defaulthidden').style.display='none';
	document.getElementById('allContentView').style.visibility='hidden';
	document.getElementById('mainContent').style.display='block';
	document.getElementById('contentViewImg').style.display='block';
}


