var popup_date =  Array(20110110,20110111,20110111); 

var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			   string: navigator.userAgent,
			   subString: "iPhone",
			   identity: "iPhone/iPod"
	    },
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();



try {
  document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

/*

	펜타브리드의 front common js : Start

*/

//Element ID 불러쓰기
function dEI(elementID){
	return document.getElementById(elementID);
}

// roundBox Layout
function initLayout(layoutEl,childEl) {
	var layoutId = dEI(layoutEl);
	var contentsId = dEI(childEl);
		
	//create and build div structure
	var bodyTH = document.createElement('div');
	var bodyLV = document.createElement('div');
	var bodyRV = document.createElement('div');
	var bodyBH = document.createElement('div');
	var bodyTL = document.createElement('div');
	var bodyTR = document.createElement('div');
	var bodyBL = document.createElement('div');
	var bodyBR = document.createElement('div');
	bodyTH.className = "bodyTH";
	bodyLV.className = "bodyLV";
	bodyRV.className = "bodyRV";
	bodyBH.className = "bodyBH";
	bodyTL.className = "bodyTL";
	bodyTR.className = "bodyTR";
	bodyBL.className = "bodyBL";
	bodyBR.className = "bodyBR";
	layoutId.appendChild(bodyTH);
	bodyTH.appendChild(bodyLV);
	bodyLV.appendChild(bodyRV);
	bodyRV.appendChild(bodyBH);
	bodyBH.appendChild(bodyTL);
	bodyTL.appendChild(bodyTR);
	bodyTR.appendChild(bodyBL);
	bodyBL.appendChild(bodyBR);
	bodyBR.appendChild(contentsId);
}

//Images Btn_KSS
function BtnOn(imgEl){
	imgEl.src = imgEl.src.replace(".gif", "_on.gif");
}
function BtnOut(imgEl){
	imgEl.src = imgEl.src.replace("_on.gif", ".gif");
}

// first 예외처리 firstChild(블럭Id, 태그네임, 처리할 아이템 번호) // 아이템번호는 0번부터 반환
function firstChild(Elid, Etn, Num){
	if(Num==""){Num=0;}
	liEl = dEI(Elid).getElementsByTagName(Etn);
	if (liEl.item(Num)) {
		liEl.item(Num).className += " first-child";
	}
}

// first 예외처리 listFirst(블럭Id, 태그네임, 처리할 아이템 갯수) // 아이템번호는 0번부터 반환
function listFirst(Elid, Etn, Num){
	liEl = dEI(Elid).getElementsByTagName(Etn);
	for(i=0; liEl.length>i; i=i+Num){
		liEl.item(i) .className += " first";
	}
}

// first line 예외처리 firstLine(블럭Id, 태그네임, 처리할 아이템 갯수) // 아이템번호는 0번부터 반환
function firstLine(Elid, Etn, Num){
	liEl = dEI(Elid).getElementsByTagName(Etn);
	var checkNum = Num;
	if(liEl.length<Num){
		liEl.length = checkNum;
	}
	for(i=0; i<checkNum; i++){
	liEl.item(i) .className += " firstLine";
	}
}


/*

	펜타브리드의 front common js : End

*/


/*
 * @title : xmlLoad
 * @version : 1.0
 * @writer : 이희원
 * @what's new :
 */
function newXMLHttpRequest() { 

	if (window.XMLHttpRequest) { 
	  // Create XMLHttpRequest object in non-Microsoft browsers 
	  xmlreq = new XMLHttpRequest(); 
	} else if (window.ActiveXObject) { 
	  // Create XMLHttpRequest via MS ActiveX 
	  try { 
	  // Try to create XMLHttpRequest in later versions 
	  // of Internet Explorer 
	  xmlreq = new ActiveXObject("Msxml2.XMLHTTP"); 
	  browserType = "IE"; 
	  } catch (e1) { 
	  // Failed to create required ActiveXObject 
	  try { 
	    // Try version supported by older versions 
	    // of Internet Explorer 
	    xmlreq = new ActiveXObject("Microsoft.XMLHTTP"); 
	    browserType = "IE"; 
	  } catch (e2) { 
	    // Unable to create an XMLHttpRequest with ActiveX 
	  } 
	  } 
	} 
	return xmlreq; 
} 

function xmlLoad(filename,fn,stringType) {

	var xmlHttpReq= newXMLHttpRequest();
/*	if (window.XMLHttpRequest) {
	    xmlHttpReq = new XMLHttpRequest();
	    if(xmlHttpReq.overrideMimeType){  
	        xmlHttpReq.overrideMimeType('text/xml');
	    }
	}
	// IE6-
	else if (window.ActiveXObject) {
	    xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	}	
*/
	xmlHttpReq.onreadystatechange = handleStateChange;
	xmlHttpReq.open("GET", filename, true);
	xmlHttpReq.send(null);

	function handleStateChange() {
		if(xmlHttpReq.readyState == 4) {
			if(xmlHttpReq.status == 200) {
				maploadingComplete();
			}
		}
	}

	function maploadingComplete() {

		//alert(xmlHttpReq.getAllResponseHeaders())
		//var getmenuNode = xmlHttpReq.responseXML;
		//var getmenuNode = xmlHttpReq.responseXML;
		var getmenuNode;

		if(stringType) {
			getmenuNode = xmlHttpReq.responseText;
		} else {
			if (BrowserDetect.browser=="Explorer") { 
				getmenuNode = xmlHttpReq.responseText;
				getmenuNode = createXMLFromString(getmenuNode);
			} else {
				getmenuNode = xmlHttpReq.responseXML;
			}
		}

		//alert('Menu Data Loading Complete..');
		fn(getmenuNode);
		
		
	}
}


function createXMLFromString(string) {
   var xmlDocument;
   var xmlParser;
   if(window.ActiveXObject){   //IE일 경우
      xmlDocument = new ActiveXObject('Microsoft.XMLDOM');
      xmlDocument.async = false;
      xmlDocument.loadXML(string);
   } else if (window.XMLHttpRequest) {   //Firefox, Netscape일 경우
      xmlParser = new DOMParser();
      xmlDocument = xmlParser.parseFromString(string, 'text/xml');
   } else {
      return null;
   }
   return xmlDocument;
}



/*
	Dustin Diaz's getElementsByClass
 */
function getElementsByClass(searchClass,node,tag) {

        var classElements = new Array();
        if ( node == null )
                node = document;
        if ( tag == null )
                tag = '*';
        var els = node.getElementsByTagName(tag);
        var elsLen = els.length;
        var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
        for (i = 0, j = 0; i < elsLen; i++) {
                if ( pattern.test(els[i].className) ) {
                        classElements[j] = els[i];
                        j++;
                }
        }
        return classElements;
}




/*
 * @title : Node 계산시 ie를 제외한 브라우저에서 공백까지 노드로 포함시키는 것을 제거
 * @version : 1.0
 * @writer : 이희원
 * @what's new :
 */
function removeNullNode(obj) {
	for(k=0;k<obj.length;k++) {
		if(obj[k].nodeType != 1) obj[k].parentNode.removeChild(obj[k]);
	}

	return obj;
}


/* 동일노드상의 다음 element */
function nextNode(o) {
	o = o.nextSibling;
	while(o) {
		if(o.nodeType != 1) o = o.nextSibling;
		else break;
	}
	return o;
}


/* 동일노드상의 이전 element */
function prevNode(o) {
	o = o.previousSibling;
	while(o) {
		if(o.nodeType != 1) o = o.previousSibling;
		else break;
	}
	return o;
}

/*
 * @title : 이미지 대체
 * @version : 1.0
 * @writer :
 * @modify(date,writer) :
 * @what's new :
 */
function menuOn(imgEl) { if(imgEl.src.indexOf("_on") < 0) imgEl.src = imgEl.src.replace(".gif", "_on.gif"); }
function menuOut(imgEl) { imgEl.src = imgEl.src.replace("_on.gif", ".gif"); }

function pngOn(imgEl) { if(imgEl.src.indexOf("_on") < 0) imgEl.src = imgEl.src.replace(".png", "_on.png"); }
function pngOut(imgEl) { imgEl.src = imgEl.src.replace("_on.png", ".png"); }


/*
 * @title : object 통합생성관리
 * @version : 1.0
 * @writer : 09. 07. 16
 * @modify(date,writer) :
 * @what's new :
 */
function makeobject(path,w,h,id,vars,transparent,bg) {

	this.id = id;
	this.path = path;
	this.w = w;
	this.h = h;
	this.vars = (vars) ? vars : '';
	this.trnasparent = (transparent) ? transparent : 'transparent';
	this.bg = (bg) ? bg : '#ffffff';
	this.gettag = function() {
			this.classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
			this.codebase = 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,22,87';
			this.tag = "<object classid='"+this.classid+"' codebase='"+this.codebase+"' id='"+this.id+"' width='"+this.w+"' height='"+this.h+"'>";
			this.tag += "<param name='movie' value='"+this.path+"' />";
			this.tag += "<param name='allowScriptAccess' value='always' />";
			this.tag += "<param name='allowFullScreen' value='false' />";
			if(this.vars) this.tag += "<param name='FlashVars' value='"+this.vars+"' />";
			if(this.trnasparent) this.tag += "<param name='wmode' value='"+this.trnasparent+"' />";
			this.tag += "<param name='menu' value='false' />";
			this.tag += "<param name='quality' value='high' />"
			this.tag += "<param name='bgcolor' value='"+this.bg+"' />";
			this.tag += "<param value='"+this.path+"'>";
			this.tag += "<param name='base' value='.'>";
			this.tag += "<embed src='"+this.path+"'";
			if(this.vars) this.tag += " FlashVars='"+this.vars+"'";
			if(this.trnasparent) this.tag += " wmode='"+this.trnasparent+"'";
			this.tag += " width='"+this.w+"'";
			this.tag += " height='"+this.h+"'";
			this.tag += " bgcolor='"+this.bg+"'";
			this.tag += " name='"+this.id+"'";
			this.tag += " menu='false'";
			this.tag += " base='.'";
			this.tag += " quality='high'";
			this.tag += " allowScriptAccess='always'";
			this.tag += " allowFullScreen='false'";
			this.tag += " type='application/x-shockwave-flash'";
			this.tag += " pluginspage='http://www.macromedia.com/go/getflashplayer'";
			this.tag += " />";
			this.tag += "</object>";
			return this.tag;
	}
	this.writetag =
		function() {
			document.write(this.gettag());
			//Flash의 ExternalInterface가 Form Tag내에서 오류나는 버그를 해결하는 코드
			eval("window." + this.id + " = document.getElementById('" + this.id + "');");
			return false;
		}

}



/**
 * @title : 등가속 계산 알고리즘
 * @version : 1.0
 * @writer : 이희원
 * @modify(date,writer) :
 * @what's new :
 */
function speedCalculate(result,targetResult,speedPercent) {
	if(result>targetResult) {
		check = (((targetResult - result) * speedPercent) < -1) ? true : false;
	} else {
		check = (((targetResult - result) * speedPercent) > 1) ? true : false;
	}
	if(result==targetResult) {
		return targetResult;
	} else {
		if(check) {
			result += (targetResult - result) * speedPercent;
		} else {
			result = ((targetResult - result)>0) ? result+1 : result-1;
		}
		return parseInt(result);
	}
}


/*
 * @title : Element의 절대 위치,너비,높이값 알아내기
 * @version : 1.0
 * @writer : 이희원
 * @modify(date,writer) :
 * @what's new :
 */
function eMatrix(element) {
	var matrix = new Array();
	matrix.x = 0;
	matrix.y = 0;
	matrix.w = element.clientWidth;
	matrix.h = element.clientHeight;
	while(element) {
		matrix.x += element.offsetLeft;
		matrix.y += element.offsetTop;
		element = element.offsetParent;
	}
	return matrix;
}

function setPng24(obj) {

	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bpng24\b/i,'');
	obj.style.filter =
	"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
	obj.src='about:blank;';
	return '';

}

function windowOpen(url,w,h,target,ae) {

	sStatus = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+w+',height='+h+',top=10,left=10'+ae;
	if(typeof(ae != undefined)) sStatus = sStatus + ae;
	window.open(url,target,sStatus);
	return false;

}



function addLoadEvent(func) {  

  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}


function findParentNode(o,e) {
	while(o) {
		o = o.parentNode;
		if(o.nodeName.toLowerCase() == e) break;
	}
	if(o) return o;
}


function documentSize() {
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) { //Non-IE

		myWidth = window.innerWidth; myHeight = window.innerHeight;

	}	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode'

			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;

	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible

			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
	}

	return {w:myWidth,h:myHeight}
}
	
				
function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}


/*
 * @title : Global Navigation Controller 
 * @version : 1.0
 * @writer : 이희원
 * @what's new :
 */

function navigationController(o) {

	var getObject = document.getElementById(o);
	var getMenuNode = removeNullNode(getObject.childNodes);
	var currentNode,activeCode,activeTimer;
	var getDevice = document.getElementById('deviceList');

	this.initialize = function() {

		var imageofListnode; 

		activeCode = this.activeCode.split('-');
		for(i=0,j=activeCode.length;i<j;i++) {
			activeCode[i] = parseInt(activeCode[i],10)-1;
		}
		
		for(i=0,j=getMenuNode.length;i<j;i++) {
			
			if(getMenuNode[i].nodeType != 1) continue;
			
			getMenuNode[i].onmouseover = function() { visibleMenu(this); }
			imageofListnode = getMenuNode[i].getElementsByTagName('div')[0].getElementsByTagName('ul')[0].getElementsByTagName('img');
			
			for(k=0,z=imageofListnode.length;k<z;k++) {
				imageofListnode[k].onmouseover = function() { menuOn(this); }
				imageofListnode[k].onmouseout = function() { menuOut(this); }
			}
		}
		
		getObject.onmouseout = function() {	
			layerActive(activeCode[0]); 
		}

		if(activeCode[0] < 0 || activeCode[0] > getMenuNode.length) return false;
 		tmpNode = removeNullNode(getMenuNode[activeCode[0]].getElementsByTagName('ul')[0].childNodes)[activeCode[1]];
 		tmpNode.className = "select";	
 		layerActive(activeCode[0]);

	}

	function killcode(n) {
		
	}
	
	function deviceHidden(o) {
		if(getDevice != null && getDevice != "null"){
			if(findParentNode(getDevice,'li') != o) getDevice.getElementsByTagName('div')[0].style.visibility = "hidden";
		}
	}

	function visibleMenu(targetNode) {

		if(activeTimer) clearTimeout(activeTimer);
		
		
		if(currentNode == targetNode) return false;
		if(typeof currentNode != 'undefined') hideMenu(currentNode);
		
		currentNode = (targetNode.nodeName.toLowerCase() == 'li') ? targetNode.getElementsByTagName('a')[0] : targetNode;
		if(currentNode != null) { // currentNode is null error
			var getCurrentImage = currentNode.getElementsByTagName('img')[0];
			pngOn(getCurrentImage);
			
			
			var activeTarget = nextNode(currentNode);
			
			if(activeTarget != null) { // activeTarget is null error
			activeTarget.style.visibility = "visible";
			}
			deviceHidden(currentNode.parentNode);
		}
	}

	function hideMenu(targetNode) {
		
		currentNode = (targetNode.nodeName.toLowerCase() == 'li') ? targetNode.getElementsByTagName('a')[0] : targetNode;
		var getCurrentImage = currentNode.getElementsByTagName('img')[0];
		pngOut(getCurrentImage);

		var activeTarget = nextNode(currentNode);
		if(activeTarget != null) { // activeTarget is null error
		activeTarget.style.visibility = "hidden";
		}
	}
	
	function layerActive(n) {
    
    if(activeTimer) clearTimeout(activeTimer);
 		if(n<0) {
			activeTimer = setTimeout(function() { hideMenu(currentNode) },500);
 		} else {
			activeTimer = setTimeout(function() { visibleMenu(getMenuNode[n]) },500);

  			// 서브메뉴 활성
	  		var getListNode = removeNullNode(getMenuNode[n].getElementsByTagName('div')[0].getElementsByTagName('ul')[0].childNodes);
	  		var getActiveImage = getListNode[activeCode[1]].getElementsByTagName('img')[0];
	  		getActiveImage.onmouseover();
	  		getActiveImage.onmouseout = function() { menuOn(this) }

		}	
	}


}


/*
 * @title : Path Indicator 생성기
 * @version : 1.0
 * @writer : 이희원
 * @what's new :
 */
function createpathIndicator(getStr) {
	
	var depth01,depth02,depth03,tmpNodeLi,tmpNodeA,objectValue,homedata;
	var data = {}
	var activeCode = getNavigate.activeCode.split('-');
	for(i=0,j=activeCode.length;i<j;i++) {
		activeCode[i] = parseInt(activeCode[i],10)-1;
	}

	var xmlData = getStr;
	var homeData = xmlData.getElementsByTagName('nav')[0].getElementsByTagName('first')[0];
	var getparentNode = removeNullNode(xmlData.getElementsByTagName('nav')[0].getElementsByTagName('first')[0].childNodes);
	

	homeData = {
		name : "홈",
		linkValue : homeData.getAttribute('href')
	}

	if(activeCode[0] == 69) { // 기타페이지

		var getETCNode = removeNullNode(xmlData.getElementsByTagName('etc'));
		depth01 = getETCNode[activeCode[1]];

		data.parse01 = {
			name : depth01.firstChild.nodeValue,
			linkValue : depth01.getAttribute('href')
		}

	
	} else {

		depth01 = getparentNode[activeCode[0]];
		data.parse01 = {
			name : depth01.firstChild.nodeValue,
			linkValue : depth01.getAttribute('href')
		}

		if(depth01.getElementsByTagName('second').length) {
			depth02 = removeNullNode(depth01.getElementsByTagName('second')[0].childNodes)[activeCode[1]];
			data.parse02 = {
				name : depth02.firstChild.nodeValue,
				linkValue : depth02.getAttribute('href')
			}

			if(depth02.getElementsByTagName('third').length) {
				depth03 = removeNullNode(depth02.getElementsByTagName('third')[0].childNodes)[activeCode[2]];
				data.parse03 = {
					name : depth03.firstChild.nodeValue,
					linkValue : depth03.getAttribute('href')
				}
			}
		}

	}

	/* 
		<div id="pathIndicator" class="pathIndicator">
			<ul>
				<li><a href="#">위치정보 서비스</a></li>
				<li class="last"><a href="#">위치정보 수집 내역</a></li>
			</ul>
		</div>
	*/
	
	function dataInsert(str,hrefresh,dataClass) {

		tmpNodeLi = document.createElement('li');
		if(dataClass) tmpNodeLi.className = dataClass;
		ulNode.appendChild(tmpNodeLi);

		tmpNodeA = document.createElement('a');
		tmpNodeA.href = hrefresh;
		tmpNodeA.innerHTML = str;
		tmpNodeLi.appendChild(tmpNodeA);

	}


	var ulNode = document.createElement('ul');
	dataInsert(homeData.name,homeData.linkValue,'home');
	

	for(objectValue in data) {
		dataInsert(data[objectValue].name,data[objectValue].linkValue);
	}

	document.getElementById('pathIndicator').innerHTML = '';
	document.getElementById('pathIndicator').appendChild(ulNode);
	document.getElementById('pathIndicator').className = "pathIndicator";
	var tmpstyle = removeNullNode(ulNode.childNodes);
	tmpstyle[tmpstyle.length-1].className = "last"

}


/*
 * @title : Frequency Answer Question 콘트롤러
 * @version : 1.0
 * @writer : 이희원
 * @what's new :
 */
function faqController(obj) {

	var targetObject = document.getElementById(obj);
	var targetNode = removeNullNode(targetObject.childNodes);
	var currentNode;

	this.initialize = function() {

		var tmpNode;

		for(i=0,j=targetNode.length;i<j;i++) {
			tmpNode = targetNode[i].getElementsByTagName('em')[0];
			tmpNode.onclick = function() { showAnswer(this) };
			hideAnswer(tmpNode);
		}
		
		targetNode[targetNode.length-1].className = "last";

	}

	function showAnswer(o) {
					
		if(currentNode && currentNode != o) hideAnswer(currentNode);
			
		if(nextNode(o).style.display == "none") nextNode(o).style.display = "block";
		else hideAnswer(o);
		
		currentNode = o;

	}

	function hideAnswer(o) {
		nextNode(o).style.display = "none";
	}

}


/*
 * @title : 탭메뉴 콘트롤러
 * @version : 1.0
 * @writer : 이희원
 * @what's new :
 */

function tabController(o) {

	var getAnchor,currentNode;
	var getobj = document.getElementById(o);
	var getobjNode = removeNullNode(getobj.getElementsByTagName('ul')[0].childNodes);

	this.initialize = function() {
		
		for(i=0,j=getobjNode.length;i<j;i++) {

			getAnchor = getobjNode[i].getElementsByTagName('a')[0];
			getobjNode[i].onclick = menuActive;
			getAnchor.onclick = function() { return false };

		}
		
		var activeCode = (this.activeCode) ? parseInt(this.activeCode,10)-1 : false;					

		if(activeCode !== false) getobjNode[activeCode].onclick();
		else getobjNode[0].onclick();

	}
	
	function disBlock(o) {
		
		var controlElement = o.getElementsByTagName('a')[0];
		var controlMenuImage = controlElement.getElementsByTagName('img')[0];
		var targetID = controlElement.getAttribute('href').split('#')[1];

		document.getElementById(targetID).style.display = "block";
		
		menuOn(controlMenuImage);
		
	}
	
	function disOut(o) {

		var controlElement = o.getElementsByTagName('a')[0];
		var controlMenuImage = controlElement.getElementsByTagName('img')[0];
		var targetID = controlElement.getAttribute('href').split('#')[1];

		document.getElementById(targetID).style.display = "none";
		
		menuOut(controlMenuImage);
		
	}

	function menuActive() {
		
		if(currentNode == this) return false; 
		if(currentNode) { menuReset(currentNode); }
		disBlock(this);
		currentNode = this;

	}

	function menuReset(o) {
		disOut(o);
	}

}

/*
 * @title : 서브 탭메뉴가 하나일때의 예외처리
 * @version : 1.0
 * @writer : 이희원
 * @what's new :
 */


function subTabMenuControll(id) {
	var t = document.getElementById(id);
	if(t.getElementsByTagName('li').length==1) {
		var tmpImage = t.getElementsByTagName('li')[0].getElementsByTagName('img')[0];
		var tmpName = tmpImage.src;
		if(tmpName.match('_on.gif')) tmpName = tmpName.replace('_on.gif','_solo.gif');
		else tmpName = tmpName.replace('.gif','_solo.gif');

		tmpImage.src = tmpName;
	}
}


/**
 * @title : INPUT 배경 이미지 토글
 * @version : 1.0
 * @writer : 이희원
 * @modify(date,writer) :
 * @what's new :
 */
 function inputBackgroundImageToggle(o) {

	if(window.getComputedStyle) property = window.getComputedStyle(o,null).getPropertyValue('background-image');
	else property = o.currentStyle.backgroundImage;

	if(property.match('_on.gif')) property = property.replace("_on.gif",".gif");
	else property = property.replace(".gif","_on.gif");

	if(o.value != '') o.style.backgroundImage = property.replace(".gif","_on.gif");
	else o.style.backgroundImage = property;

}


/**
 * @title : 좌우측 앨범형 롤링
 * @version : 1.0
 * @writer : 이희원
 * @modify(date,writer) :
 * @what's new :
 */
function rollingEvent(id) {
	
	var perobjectUnit,xmldata,moveTimer,roupeTimer,loadTimer,currentNodeValue=0;
	var getObject = document.getElementById(id);
	var objectNode = removeNullNode(getObject.childNodes);

	var loadImage = objectNode[0];
	var leftFunc = objectNode[1];
	var rightFunc = objectNode[2];
	var listWrapper = getObject.getElementsByTagName('div')[0];
	var listNode;
	var nodeChildren;

	var targetValue;

	this.initialize = function() {

		function appendData(xmldata) {

			var newA,newImg,newSpan,liNode,aNode,imgNode,spanNode,ulNode,getData;
			var newList = removeNullNode(xmldata.getElementsByTagName('ul')[0].childNodes);
			
			listNode = getObject.getElementsByTagName('ul')[0];
			nodeChildren = 	removeNullNode(listNode.childNodes);

			ulNode = document.createElement('ul');

			for(i=0,j=newList.length;i<j;i++) {

				newA = newList[i].getElementsByTagName('a')[0];
				newImg = newList[i].getElementsByTagName('img')[0];
				newSpan = newList[i].getElementsByTagName('span')[0];

				liNode = document.createElement('li');
				aNode = document.createElement('a');
				aNode.href = newA.getAttribute('href');
				aNode.target = newA.getAttribute('target');

				imgNode = document.createElement('img');
				imgNode.src = newImg.getAttribute('src');
				imgNode.alt = newImg.getAttribute('alt');
				imgNode.className = newImg.getAttribute('class');

				spanNode = document.createElement('span');
				spanNode.innerHTML = newSpan.firstChild.nodeValue;

				aNode.appendChild(imgNode);
				aNode.appendChild(spanNode);

				liNode.appendChild(aNode);
				ulNode.appendChild(liNode);
			}
			
			listWrapper.removeChild(listNode);
			listWrapper.appendChild(ulNode);

			giveFunc();
		}

		if(this.xmlpath) { xmlLoad(this.xmlpath,appendData); }
		else { giveFunc() }

		var tmpAnode = listNode.getElementsByTagName('a');
		for(i=0,j=tmpAnode.length;i<j;i++) {
			tmpAnode[i].onclick = function() { return false; }
			tmpAnode[i].style.cursor = "text";
		}

	}



	function giveFunc() {

		listNode = getObject.getElementsByTagName('ul')[0];
		nodeChildren = 	removeNullNode(listNode.childNodes);

		perobjectUnit = nodeChildren[0].offsetWidth;

		listWrapper.style.width = perobjectUnit+"px";
		listNode.style.width = (perobjectUnit * nodeChildren.length) + "px";

		leftFunc.onclick = leftClick;
		rightFunc.onclick = rightClick;

		leftFunc.style.cursor = rightFunc.style.cursor = "pointer";

		getObject.onmouseover = function() {
			clearInterval(roupeTimer);	
		}

		getObject.onmouseout = motionRoping;

		var tmpAlhpa = 100;
		var alhpaCheck = false;
		if(loadTimer) clearInterval(loadTimer);

		loadTimer = setInterval(function() {
			tmpAlhpa = speedCalculate(tmpAlhpa,0,0.1);
			alphacontroll(loadImage,tmpAlhpa);
			if(tmpAlhpa == 0) alhpaCheck = true;

			if(alhpaCheck) {
				clearInterval(loadTimer);
				loadImage.style.display = "none";
				motionReady();
			}
		},10);

		function motionReady() {

			listWrapper.style.visibility = "visible";
			motionRoping();

		}

	}

	function motionRoping() {
		
		if(loadTimer) clearInterval(loadTimer);
		if(roupeTimer) clearInterval(roupeTimer);

		roupeTimer = setInterval(function() {
			rightFunc.onclick();
		},5000);
		
	}

	function leftClick() {

		if(currentNodeValue == 0 ) currentNodeValue = nodeChildren.length;
		if(roupeTimer) clearInterval(roupeTimer);	
		if(moveTimer) clearInterval(moveTimer);

		currentNodeValue--;
		moveContent(currentNodeValue*perobjectUnit);

	}

	function rightClick() {
		
		if(currentNodeValue == nodeChildren.length-1) currentNodeValue=-1;
		if(moveTimer) clearInterval(moveTimer);

		currentNodeValue++;
		moveContent(currentNodeValue*perobjectUnit);
	}
		

	function moveContent(targetValue) {

		linkchange();
		moveTimer = setInterval(function() {

			var margin;

			if(window.getComputedStyle) margin = (window.getComputedStyle(listNode,null).getPropertyValue("margin-left") == 'auto' ) ? 0 : parseInt(window.getComputedStyle(listNode,null).getPropertyValue("margin-left"),10);
			else margin = (listNode.currentStyle.marginLeft == 'auto' ) ? 0 : parseInt(listNode.currentStyle.marginLeft,10);

			if(margin == -targetValue) clearInterval(moveTimer);
			targetmoveCount = speedCalculate(-margin,targetValue,0.1);

			listNode.style.marginLeft = -targetmoveCount + "px";

		},10);
	}

	function linkchange() {
		
		var getLinker = nodeChildren[currentNodeValue].getElementsByTagName('a')[0];
		document.getElementById('deviceLink').href = getLinker.href;
	}
		
}


/**
 * @title : 위치정보 서비스 관리 email 컨트롤
 * @version : 1.0
 * @writer : 이희원
 * @modify(date,writer) :
 * @what's new :
 */
function emailCheckToggle(g,t,i01,i02) { 
	
	var getImage = document.getElementById(g);
	var getTarget = document.getElementById(t);
	
	getImage.onclick = showLayer;
	
	function hiddenLayer() {
		getTarget.style.display = "none";
		getImage.src = getImage.src.replace(i02,i01);
		
		getImage.onclick = showLayer;
	}
	
	function showLayer() {
		getTarget.style.display = "block";
		getImage.src = getImage.src.replace(i01,i02);
		getImage.onclick = hiddenLayer;
	}
	
}



/**
 * @title : SelectBOX 스타일
 * @version : 1.0
 * @writer : 이희원
 * @modify(date,writer) :
 * @what's new :
 */

function selectStyleComponent(id) {

	var scrolling,scrollStep,contentExpression,statusForm;

	var getObject = document.getElementById(id);
	var objectNode = removeNullNode(getObject.childNodes);
	var headline = objectNode[0];
	var listMother = objectNode[1];
	var listWrapper = listMother.getElementsByTagName('div')[0];
	var listNode;
	var nodeChildren;
	var close = removeNullNode(listMother.childNodes)[1];

	var timerNodeout,moveTimer;

	function nodeHover() {
		if(this.className == 'undefined') this.className = "";
		if(!this.className.match('hover')) { this.className = this.className + " hover"; }
	}

	function nodeOut() { this.className = this.className.replace(" hover",""); }
	function outArea() { listMother.style.visibility = "hidden";	}
	function inArea() { listMother.style.visibility = "visible";	}

	this.initialize = function() {

		scrolling = (this.scrolling) ? this.scrolling : false;
		scrollStep = (this.scrollStep) ? this.scrollStep : 1;
		statusForm = (this.statusForm) ? this.statusForm : 'x';
		contentExpression = (this.contentExpression) ? this.contentExpression : 4;

		setTimeout(function() {
			if(!listMother.getElementsByTagName('ul')[0]) {
				return false;
			}
			listNode = listMother.getElementsByTagName('ul')[0];
			nodeChildren = 	removeNullNode(listNode.childNodes);


			for(i=0,j=nodeChildren.length;i<j;i++) {

				nodeChildren[i].onmouseover = nodeHover;
				nodeChildren[i].onmouseout =  nodeOut;
			}

			//close.onclick = listMother.onmouseout = function() { timerNodeout = setTimeout(outArea,50) ; }
			close.onclick = function() { timerNodeout = setTimeout(outArea,50); }
			listMother.onmouseover = function() { if(timerNodeout) clearInterval(timerNodeout); }

			headline.style.cursor = "pointer";
			headline.onclick = inArea;

			if(scrolling) {
				
	/* 스크롤 markup
		<div class="selectStyle_01scrolling">
			<img src="/b2c-static/b2c/nkr_KR/front/images/common/selectStyle01_ancTop.gif" alt="위로" class="t" />
			<div class="s"><img src="/b2c-static/b2c/nkr_KR/front/images/common/selectStyle01_bar.gif" alt="" /></div>
			<img src="/b2c-static/b2c/nkr_KR/front/images/common/selectStyle01_ancBottom.gif" alt="아래로" class="b" />
		</div>
		<style type="text/css">
			.selectStyle_01scrolling { position:absolute; width:13px; right:1px; top:0; }
			.selectStyle_01scrolling .s { background-color:#1f2136; }
		</style>
	*/

				scollTagInsert(); // 태그 삽입

				/* 스크롤을 진행하기 위한 기본 세팅 */
				listWrapper.style.overflow = "hidden";
				
				scrollMother = removeNullNode(listMother.childNodes)[2];
				scrollMotherNode = removeNullNode(scrollMother.childNodes);

				scrollChildren = {
					top : scrollMotherNode[0],
					bar : scrollMotherNode[1],
					bottom : scrollMotherNode[2]
				}
				scrollChildren.movingobj = scrollChildren.bar.getElementsByTagName('img')[0];
				scrollChildren.movingobj.style.cursor = "pointer";
				
				if(statusForm == 'y') {
					
					listWrapper.style.height = ((nodeChildren[0].offsetHeight)*contentExpression)+"px";
					scrollChildren.useHeight = listMother.offsetHeight - (scrollChildren.top.clientHeight + scrollChildren.bottom.clientHeight) - 4;
					//alert(scrollChildren.useHeight);
					scrollChildren.bar.style.height = scrollChildren.useHeight+"px";	
					
					limitMatrix = scrollChildren.useHeight - scrollChildren.movingobj.offsetHeight;	
					ratio = (listNode.offsetHeight - listWrapper.offsetHeight)/(limitMatrix);
					

				} else {
					
					obj.general.style.width = baseinfo.w + "px";
					ratio = (baseinfo.currentw-baseinfo.w <=0) ? false : (baseinfo.currentw-baseinfo.w)/(baseinfo.w-scrollChildren.bar.w);
					limitMatrix = baseinfo.w - scrollChildren.bar.w;
					
				}

				if(nodeChildren.length <= contentExpression) {
					listWrapper.style.overflow = "visible";
					return false;
				}

				actionHandler();
			}
		},500);

	}

	function moveScroll(v,s) { // Moving Scroll

		if(statusForm == 'y') scrollChildren.movingobj.style.top = v + "px";
		else scrollChildren.movingobj.style.left = v + "px";

		v = v*ratio;
		clearInterval(moveTimer);
		moveContent(v,s);

	}

	function calculateMoving(s,m) { // s:처음위치, m:이동거리

		if(s+m > 0) {
			 if(s+m > limitMatrix) m = limitMatrix;
			 else m = s + m;
		} else {
			m = 0;
		}

		return m;
	}

	function moveContent(v,s) { // Moving Content

		var targetValue = parseInt(v,10);
		var margin;

		if(s == 'y') {
			if(statusForm == 'y') {
				moveTimer = setInterval(function() {

					if(window.getComputedStyle) margin = (window.getComputedStyle(listNode,null).getPropertyValue("margin-top") == 'auto' ) ? 0 : parseInt(window.getComputedStyle(listNode,null).getPropertyValue("margin-top"),10);
					else margin = (listNode.currentStyle.marginTop == 'auto' ) ? 0 : parseInt(listNode.currentStyle.marginTop,10);

					if(margin == -targetValue) clearInterval(moveTimer);
					targetmoveCount = speedCalculate(-margin,targetValue,0.3);

					listNode.style.marginTop = -targetmoveCount + "px";

				},10);
				
			} else {

				moveTimer = setInterval(function() {

					if(window.getComputedStyle) margin = (window.getComputedStyle(obj.content,null).getPropertyValue("margin-left") == 'auto' ) ? 0 : parseInt(window.getComputedStyle(obj.content,null).getPropertyValue("margin-left"),10);
					else margin = (listNode.currentStyle.marginLeft == 'auto' ) ? 0 : parseInt(listNode.currentStyle.marginLeft,10);

					if(margin == -targetValue) clearInterval(moveTimer);
					targetmoveCount = speedCalculate(-margin,targetValue,0.3);

					listNode.style.marginLeft = -targetmoveCount + "px";

				},10);
			}
		} else {
			if(statusForm == 'y') listNode.style.marginTop = -v + "px";
			else listNode.style.marginLeft = -v + "px";
		}

	}

	function mousemove(e) {

		clearInterval(moveTimer);

		if(!e) e = window.event;

		if(statusForm == 'y') moveCount = e.clientY;
		else moveCount = e.clientX;

		moveNumber = (moveCount - startMatrix); // 이동거리
		moveNumber = calculateMoving(origMatrix,moveNumber);

		moveScroll(moveNumber);
		
	}

	function getwhellData(e) {
		var wheelData;
		
		if(e.wheelDelta) {
			wheelData = e.wheelDelta/120; // Dom Cross
			if(window.opera) wheelVal = -wheelVal;
		} else if(e.detail) {
			wheelData = -e.detail/3;
		}
		
		return wheelData*(-1);
	}

	function wheelHandler(e) {

		clearInterval(moveTimer);

		if(!e) e = window.event;

		if(e.stopPropagation) e.stopPropagation();
		else e.cancelBubble = true;
		if(e.preventDefault) e.preventDefault();
		else e.returnValue = false;

		var wheelVal;

		wheelVal = getwhellData(e);
		
		wheelVal = ((wheelVal * nodeChildren[0].offsetHeight)/ratio)*scrollStep;	

		if(statusForm == 'y') wheelVal = calculateMoving(scrollChildren.movingobj.offsetTop,wheelVal);
		else wheelVal = calculateMoving(scrollChildren.movingobj.offsetLeft,wheelVal);

		moveScroll(wheelVal,'y');
	}

	function mousedown(e) {

		if(!e) e = window.event;
		if(document.addEventListener) {
			document.addEventListener("mousemove",mousemove,false);
			document.addEventListener("mouseup",upHandler,false);
		} else {
			scrollChildren.movingobj.setCapture();
			scrollChildren.movingobj.attachEvent("onmousemove",mousemove);
			document.attachEvent("onmouseup",upHandler);
		}

		if(e.stopPropagation) e.stopPropagation();
		else e.cancelBubble = true;
		if(e.preventDefault) e.preventDefault();
		else e.returnValue = false;

		if(statusForm == 'y') {
			startMatrix = e.clientY;
			origMatrix = scrollChildren.movingobj.offsetTop;
		} else {
			startMatrix = e.clientX;
			origMatrix = scrollChildren.movingobj.offsetLeft;
		}
	}

	function actionHandler() { // Event registration

		if(ratio == false) return false;
		if(document.addEventListener) {
			getObject.addEventListener("DOMMouseScroll",wheelHandler,false);
			scrollChildren.movingobj.addEventListener("mousedown",mousedown,false);
		} else {
			getObject.attachEvent("onmousewheel",wheelHandler);
			scrollChildren.movingobj.attachEvent("onmousedown",mousedown);
			scrollChildren.movingobj.attachEvent("onlosecapture",upHandler);
		}

	}

	function upHandler() { // Event delete.

		if(document.addEventListener) {
			document.removeEventListener("mousemove",mousemove,false);
			document.removeEventListener("mouseup",upHandler,false);
		} else {
			scrollChildren.movingobj.releaseCapture();
			scrollChildren.movingobj.detachEvent("onmousemove",mousemove);
			document.detachEvent("onmouseup",upHandler);
		}

	}


	function scollTagInsert() {

		var addElement = document.createElement('div');

		var top = document.createElement('img');
		top.setAttribute('src','http://static.bada.com/b2c/nko_KR/front/images/common/selectStyle01_ancTop.gif');
		top.setAttribute('alt','위로');
		top.setAttribute('class','t');
		top.className = "t";

		var bottom = document.createElement('img');
		bottom.setAttribute('src','http://static.bada.com/b2c/nko_KR/front/images/common/selectStyle01_ancBottom.gif');
		bottom.setAttribute('alt','아래로');
		bottom.setAttribute('class','b');
		bottom.style.className = "b";

		var scrollbar = document.createElement('img');
		scrollbar.setAttribute('src','http://static.bada.com/b2c/nko_KR/front/images/common/selectStyle01_bar.gif');
		//bottom.setAttribute('alt','');
		//bottom.setAttribute('class','');

		var scrollwrap = document.createElement('div');
		scrollwrap.setAttribute('class','s');
		scrollwrap.className = "s";

		var scrollWrapElement = document.createElement('div');
		scrollWrapElement.setAttribute('class','selectStyle_01scrolling');
		scrollWrapElement.className = "selectStyle_01scrolling";

		scrollwrap.appendChild(scrollbar);
		if(BrowserDetect.browser!="Chrome" && BrowserDetect.browser!="Firefox") { 
		scrollWrapElement.appendChild(top);
		
		    scrollWrapElement.appendChild(scrollwrap);
		
		scrollWrapElement.appendChild(bottom);
		}
		listMother.appendChild(scrollWrapElement);

	}
}

/* 객체 Alpha 조절 */
function alphacontroll(o,v) { // o : target, v : value
	
	if (BrowserDetect.browser=="Explorer") { 
		o.style.filter = "alpha(opacity: "+v+")";
	} else o.style.opacity=v/100

}



/*
 * @title : 탭메뉴 성격의 tracker 메뉴 콘트롤러
 * @version : 1.0
 * @writer : 이희원
 * @what's new :
 */

function trackerMenu(o) {

	var activeCode,currentCode=2;
	var alphaTimer01,alphaTimer02,topTimer01;
	var currentAlhpa = 50; var endAlhpa = 100; 
	var currentNode;
	var getObj = {}
	getObj.motherNode = document.getElementById(o);
	getObj.nodeList = removeNullNode(getObj.motherNode.childNodes);

	var nodeChild = {
		
		bada : getObj.nodeList[0],
		android : getObj.nodeList[1]
		
	}


	this.initialize = function() {
		
		var targetNode;

		currentCode = (this.activeCode) ? parseInt(this.activeCode,10)-1 : currentCode;	

		for(i=0,j=getObj.nodeList.length;i<j;i++) {
			targetNode = document.getElementById(getObj.nodeList[i].getElementsByTagName('p')[0].getAttribute('name').split("#")[1]);
			targetNode.style.display = "none";
		}

		nodeChild.bada.onclick = runMotion;
		nodeChild.android.onclick = runMotion;

		if(currentCode == 0)	{		
			nodeChild.bada.onclick();
		} else {
			nodeChild.android.onclick();
		}

	}

	function runMotion() {

		var tmpNode;

		if(currentNode) {
			tmpNode = currentNode.getElementsByTagName('p')[0].getAttribute('name').split('#')[1];
			document.getElementById(tmpNode).style.display = "none";
		} 
		
		currentNode = this;

		tmpNode = currentNode.getElementsByTagName('p')[0].getAttribute('name').split('#')[1];

		document.getElementById(tmpNode).style.display = "block";

		if(alphaTimer01) clearInterval(alphaTimer01);
		if(alphaTimer02) clearInterval(alphaTimer02);
		if(topTimer01) clearInterval(topTimer01);
		
		function motionRule(t,s) {
			
			var targetImage = t.getElementsByTagName('p')[0].getElementsByTagName('img')[0];
			var targetImageText = t.getElementsByTagName('img')[0];
			
			var sourceImage = s.getElementsByTagName('p')[0].getElementsByTagName('img')[0];
			var sourceImageText = s.getElementsByTagName('img')[0];

			var currentAlhpa01 = 50, currentAlhpa02 = 100;
			var currentImageSize01 = 185, currentImageSize02 = 230;
			var currentTopSize01 = 0, currentTopSize02 = 30;
			var currentLeftSize01 = 0;

			var currentAlhpaCheck01 = currentAlhpaCheck02 = false;
			var currentImageCheck01 = currentImageCheck02 = false;
			var currentTopCheck01 = currentTopCheck02 = false;
			var currentLeftCheck01 = currentLeftCheck02 = false;

			alphaTimer01 = setInterval(function() {
				
				if(currentAlhpa01 != 100 && currentAlhpaCheck01 == false) { 
					currentAlhpa01 = speedCalculate(currentAlhpa01,100,0.5);
				} else currentAlhpaCheck01 = true;

				if(currentImageSize01+10 <= 230 && currentImageCheck01 == false) { 					
					currentImageSize01 = currentImageSize01+10;
				} else {
					currentImageSize01 = 230;
					currentImageCheck01 = true;
				}

				alphacontroll(targetImage,currentAlhpa01);
				targetImage.style.height = currentImageSize01+"px";

				if(currentAlhpaCheck01 == true && currentImageCheck01 == true) { clearInterval(alphaTimer01); }
				
			},20);

			alphaTimer02 = setInterval(function() {

				if(currentAlhpa02 != 50 && currentAlhpaCheck02 == false) { 
					currentAlhpa02 = speedCalculate(currentAlhpa02,50,0.1);
					alphacontroll(sourceImage,currentAlhpa02);	
		
				} else currentAlhpaCheck02 = true;

				if(currentImageSize02 >= 185) {
					//currentImageSize02 = speedCalculate(currentImageSize02,185,0.3);
					
				} else {
					currentImageSize02 = 185;
					currentImageCheck02 = true;
				}

				if(currentAlhpaCheck02 == true && currentImageCheck02 == true) { clearInterval(alphaTimer02); }
				else {
					sourceImage.style.height = currentImageSize02+"px";
					currentImageSize02 = currentImageSize02-11;
				}

			},20);

			topTimer01 = setInterval(function() {
				
				if(currentTopSize01 < 30) currentTopSize01 = currentTopSize01+6;
				else {
					currentTopSize01 = 30;
					currentTopCheck01 = true;

				}

				//if(currentTopSize02 != 0) currentTopSize02 = speedCalculate(currentTopSize02,0,0.1);
				if(currentTopSize02-8 > 0) currentTopSize02 = currentTopSize02-7;
				else {
					currentTopSize02 = 0;
					currentTopCheck02 = true;
				}

				s.style.top = currentTopSize01+"px";
				t.style.top = currentTopSize02+"px";

				if(currentTopCheck01 == true && currentTopCheck02 == true) { clearInterval(topTimer01); }

			},20);

			
			if(t == nodeChild.android) {
				targetImageText.style.right = "-200px";
				sourceImageText.style.left = "30px";
			} else {
				targetImageText.style.left = "-200px";
				sourceImageText.style.right = "30px";
			}

			t.style.zIndex = "10";
			s.style.zIndex = "1";

		}


		if(currentCode == 1) {
			
			motionRule(nodeChild.android,nodeChild.bada);
			nodeChild.android.onclick = function() { return; };
			nodeChild.bada.onclick = runMotion;

			currentCode = 2;
			return false; 

		} else {

			motionRule(nodeChild.bada,nodeChild.android);
			nodeChild.bada.onclick = function() { return; };
			nodeChild.android.onclick = runMotion;

			currentCode = 1;
			return false; 

		}
	}

}





/*
 * @title : 반투명 레이어 활성
 * @version : 1.0
 * @writer : 이희원
 * @what's new :
 */

function dimLyaerMove(targetElement) {
	dimLayerFixLocation(targetElement);
}

function dimLayerShow(o) {
		
		var targetElement = document.getElementById(o);

		document.getElementById(o).parentNode.removeChild(document.getElementById(o));
		document.body.insertBefore(targetElement,document.getElementById('wrapper'));
		
		var tmpDivision = document.createElement('div');
		tmpDivision.setAttribute('id',"dimBlank");
		//tmpDivision.onclick = function() { dimLayerClose(targetElement); }


		document.body.insertBefore(tmpDivision,document.getElementById('wrapper'));
		tmpDivision.style.display = "block";
		
		tmpDivision.className = "dimBackgroundStyle";
		tmpDivision.style.width = "100%";

//alert(document.getElementsByTagName('wrap').scrollTop);
		//tmpDivision.style.height = document.getElementById('cntWrap').clientHeight +"px";
		if(document.getElementById('cntWrap').clientHeight > document.getElementById('wrapper').clientHeight){
			tmpDivision.style.height = document.getElementById('cntWrap').clientHeight +"px";
			var type='cnt';
		}else{
			tmpDivision.style.height = document.getElementById('wrapper').clientHeight +"px";
			var type='wrapper';
		}
		//alert(tmpDivision.style.height+'/'+type)

//		if(BrowserDetect.browser=="Explorer" && BrowserDetect.version <8 ) {
//			tmpDivision.style.height = document.getElementById('cntWrap').offsetHeight +18 + "px";
//			tmpDivision.style.height = document.body.clientHeight +18 + "px";
//		} else {
//			tmpDivision.style.height = document.body.clientHeight +"px";
//			//tmpDivision.style.height = document.getElementById('cntWrap').offsetHeight +"px";
//		}

		
		tmpDivision.style.visibility = "visible";
		tmpDivision.style.display = "block";
		
		var targetElement = document.getElementById(o);
		if(!targetElement.className.match("layerStyle")) targetElement.className =  targetElement.className + " layerStyle";

		targetElement.style.visibility = "hidden";
		targetElement.style.display = "block";
		
		dimLayerFixLocation(targetElement); 
		targetElement.style.visibility = "visible";
		
		window.onscroll = window.onresize = function(e) { dimLyaerMove(targetElement) }
		
		var selectRefresh = targetElement.getElementsByTagName('select');
		fakeselect.initialize();
		for(i=0,j=selectRefresh.length;i<j;i++) {
			selectRefresh[i].reset();
		}


	
}

function dimLayerFixLocation(targetElement) {

	var targetXmatrix = parseInt(targetElement.offsetWidth,10);
	var targetYmatrix = parseInt(targetElement.offsetHeight,10);

	var originX = parseInt(document.documentElement.clientWidth,10);
	var originY = parseInt(document.documentElement.clientHeight,10);
	
	var finalX = (originX - targetXmatrix)/2;
	var finalY = (originY - targetYmatrix)/2;
	
	targetElement.style.left = finalX + "px";
	var getmoveScroll;

	if(BrowserDetect.browser=="Chrome") { 
		getmoveScroll = document.body.scrollTop;
	} else {
		getmoveScroll = document.documentElement.scrollTop;
	}
	targetElement.style.top = finalY + getmoveScroll + "px";
	
}


function dimLayerClose(targetElement) {
	
	var dimLayerElement = document.getElementById('dimBlank');
	dimLayerElement.style.display = "none";
	document.body.removeChild(dimLayerElement);
	targetElement.style.display = "none";
	
}


/*
	마우스 좌표 얻기
*/
function getMouseMatrix(e){

	if(!e) e = window.event;
	var matrix = new Array();

	var x = document.all ? event.clientX : document.layers ? e.x : e.clientX ? e.x : e.pageX;;
	var y = document.all ? event.clientY : document.layers ? e.y : e.clientY ? e.x : e.pageX;;

	matrix['x'] = x;
	matrix['y'] = y;
	return matrix;
	
}
