﻿// JScript File


var oHiddens=new hiddenDatas;
function hiddenDatas()
{
	this.datas=new Array;
	this.hidden_span='<span class="hiddennote">';
	this.hidden_div='<div class="hiddenDiv" id='//"runcodatxl">'
	this.hidden_span_='</span>'
	this.hidden_div_='</div></p>'
	this.add=function(link_name,picture,hidden_note)
	{
		var objX=new hiddenData;
		objX.link_name=link_name;
		if(picture!='')
		{
		if(picture.indexOf('wmv')>-1)
		objX.picture='<embed src="images/'+picture+'">';
		else
		objX.picture='<img src="images/'+picture+'">';
		}
		objX.hidden_note=hidden_note;
		this.datas[this.datas.length]=objX;
	}
	this.getScrollTop=function(oX)
	{
		var oM=oX;
		var lT=0;
		while(oM.parentNode.tagName!='BODY')
		{
			lT+=oM.offsetTop;
			oM=oM.parentNode;
		}
		
		return lT;
	}
	
	this.getHiddenData=function(sLink)
	{	/*
		try
			{
				if(member_varified==true){}
			}
			catch(e)
			{
				window.location='<%=sol.url%>?stage=first_checkpassword&viewonly=yes';
				return false;
			}*/
		var lTop=this.getScrollTop(event.srcElement)
		document.body.scrollTop=lTop;
			
		var oContainer=document.getElementById(sLink+'_');
		if(oContainer.innerHTML!=''){oContainer.innerHTML='';return false;}
		var oDiv_=document.getElementsByTagName('DIV')
		for(var j=0;j<oDiv_.length;j++)
		{
			if(oDiv_[j].id.indexOf('_')>-1)
			oDiv_[j].innerHTML='';
		}
		var sT=this.hidden_div;
		for(var i=0;i<this.datas.length;i++)
		if(this.datas[i].link_name==sLink)
		{
			sT+=this.datas[i].link_name+'">';
			sT+=this.datas[i].picture;
			sT+=this.hidden_span;
			sT+=this.datas[i].hidden_note;
			sT+=this.hidden_span_+this.hidden_div_;
		}
		oContainer.innerHTML=sT;
	}
}
function hiddenData()
{
	this.link_name='';
	this.picture='';
	this.hidden_note='';
}

function showNavigatorNote(sX)
{
	var oNoteBox=document.getElementById('navigatorNoteBox');
	oNoteBox.style.fontWeight='normal'
	oNoteBox.style.fontSize='11pt';
	if(event.srcElement.parentNode.className=='firstcell')
	oNoteBox.innerHTML='이전 10페이지';
	else if(event.srcElement.parentNode.className=='lastcell')
	oNoteBox.innerHTML='다음 10페이지';
	else
	oNoteBox.innerHTML=sX+ "페이지로 이동";

}
function clearNavigatorNote()
{
	var oNoteBox=document.getElementById('navigatorNoteBox');
	oNoteBox.innerHTML='';
}

//function slideShow(sDir,oX,iMax)
function slideShow(sDir,sBoxId,oX,iMax)
{
    var currentLocationNum=document.getElementById(sBoxId+'currentNum').value;
   
	if(oX.className=='deactive')return false;
	var iX=0;
	var picBox=document.getElementsByTagName('DIV');
	if(sDir=='last'){currentLocationNum=iMax;}
	if(sDir=='first'){currentLocationNum=1;}
	if(sDir=='+')currentLocationNum++;
	if(sDir=='-')currentLocationNum--;
    document.getElementById(sBoxId+'currentNum').value=currentLocationNum;
	for(var i=0;i<picBox.length;i++){
	    if(picBox[i].id.indexOf(sBoxId+'_Box_')>-1)
	    {
    	    picBox[i].style.display='none';
	        if(sDir=='+')
	        {
		        if(currentLocationNum==iMax)
		        {
			        oX.className='deactive';
			        oX.nextSibling.className='deactive';
		        }
		        else
		        {
			        oX.parentNode.firstChild.className='active';
			        oX.parentNode.childNodes[1].className='active';
			     }
	          }
	        else if(sDir=='last')
	        {
		        oX.className='deactive';
		        oX.previousSibling.className='deactive';
		        oX.parentNode.firstChild.className='active';
		        oX.parentNode.childNodes[1].className='active';
		      }
	        else if(sDir=='first')
	        {
		        oX.className='deactive';
		        oX.nextSibling.className='deactive';
		        oX.parentNode.childNodes[2].className='active';
		        oX.parentNode.childNodes[3].className='active';
	          }
	        else
	        {
		        if(currentLocationNum==1)
		          {
			            oX.className='deactive';
			            oX.parentNode.childNodes[0].className='deactive';
			            oX.parentNode.childNodes[2].className='active';
			            oX.parentNode.childNodes[3].className='active';
			        }
		        else
		            {
			            oX.parentNode.childNodes[0].className='active';
			            oX.parentNode.childNodes[1].className='active';
			            oX.parentNode.childNodes[2].className='active';
			            oX.parentNode.childNodes[3].className='active';
		            }
		          }
	       }/*if valid div loop */
	  }/*end for*/
	document.getElementById(sBoxId+'_Box_'+currentLocationNum).style.display='block';
	document.getElementById(sBoxId+'_status').innerHTML=currentLocationNum +" Of "+iMax;
	oX.blur();
}



//***************************


function changeme(sFile)
{
    /*var oDiv=document.getElementById("membercheckDiv")
    //alert(sFile)
    if(blnRegister){
        document.location= sFile
    }
    else{
    
    oDiv.innerHTML="<iframe  FRAMEBORDER=0 SCROLLING=NO src='memberregister.aspx"+sFile +"' />"
    window.moveTo(0,0);
    oDiv.style.display='block';
    
    }*/
  
    //window.open("http://uno21.com/aspnet/memberregister.aspx"+sFile,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=400,height=200")
   //window.open("http://uno21.com/aspnet/memberregister.aspx"+sFile)
   //document.location="http://uno21.com/aspnet/register.aspx"+sFile
   
   //sFile=sFile.replace('|||','');
   //sFile=sFile.replace('?what=','xl_files/')+'.xls';
   //alert(sFile)
   document.location=sFile
    
    
}
function navigator_movePage(sPath)
{


	if(sPath.indexOf('aspx')>-1)
	{
		window.location=sPath;
	}
	else
	{
		var sNewFile='';
		var oTDs=event.srcElement.parentNode.parentNode.childNodes
		if(sPath=='next'){
			sNewFile=oTDs[oTDs.length-2].innerHTML;}
		else{
			sNewFile=oTDs[1].innerHTML;}
			
		sNewFile=sNewFile.substr(sNewFile.indexOf('.aspx')-3,8).split('.')[0];
		sNewFile=sNewFile.replace(/0/,'')
		
		
		if(sNewFile=='11')
			sNewFile='001.aspx';
		else
		{
		   
			if(sNewFile.length==2)
				if(sPath=='next'){
					sNewFile='0'+(eval(sNewFile.substr(0,1))+'1.aspx');}
				else{
					sNewFile='0'+(eval(sNewFile.substr(0,1))-1+'1.aspx');
					   
					}
			else
				switch(sNewFile.substr(1,1))
				{
					case '9':sNewFile=parseInt(sNewFile.substr(0,1))+1+'00.aspx';break;
					default:sNewFile=sNewFile.substr(0,1)+parseInt(sNewFile.substr(1,1))+1+'0.aspx';break;
				}
		}
		     
			window.location=sNewFile;
	
	}
}
function showNavigatorNote(sX)
{
	var oNoteBox=document.getElementById('navigatorNoteBox');
	oNoteBox.style.fontWeight='normal'
	oNoteBox.style.fontSize='11pt';
	if(event.srcElement.parentNode.className=='firstcell')
	oNoteBox.innerHTML='이전 10페이지';
	else if(event.srcElement.parentNode.className=='lastcell')
	oNoteBox.innerHTML='다음 10페이지';
	else
	oNoteBox.innerHTML=sX+ "페이지로 이동";

}
function clearNavigatorNote()
{
	var oNoteBox=document.getElementById('navigatorNoteBox');
	oNoteBox.innerHTML='';
}

function shuffle(arrX){
for (var i = 1; i < arrX.length; i++) {
            var j = Math.floor(Math.random() * (arrX.length - i));
            var contents  = arrX[i - 1];
            arrX[i - 1] = arrX[j];
            arrX[j]     = contents;
        }

        return arrX;
}

