var subfolder = "";

var GLOBAL_STATUS = 'mypage';
var iframeState = "login";

function SetGlobal_Status(val)
{
    GLOBAL_STATUS = val;
}

function iframe_close()
{
	var main = thisMovie("index");
	main.setClose();
	
	hidenframe();
}

function stateLogout()
{
	alert("로그인이 필요합니다.");
}

function sendQuestion()
{
	alert("등록되었습니다. 답변은 메일로 발송됩니다.");
}

function sendFalse()
{
	alert("등록되지 않았습니다. 다시 등록해주세요.");
}

function sendUndefine()
{
	alert("세부사항을 입력해주세요.");
}

function copyMovie()	//admovie 소스코드 복사하기
{
	var code = "<object width='560' height='349'><param name='movie' value='http://www.youtube.com/v/C4Vj_NvKx7w?fs=1&amp;hl=ko_KR&amp;rel=0'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/C4Vj_NvKx7w?fs=1&amp;hl=ko_KR&amp;rel=0' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='560' height='349'></embed></object>";
	var IE = (document.all) ? true: false;
	if(IE)
	{
		window.clipboardData.setData('Text',code);
		alert("ADMOVIE영상 소스코드 클립보드로 복사되었습니다.\n\nCtrl+V를 눌러 원하는 곳에 붙여 넣으세요.");
	}
	else
	{
		temp = prompt('ADMOVIE영상 소스코드 입니다.\n\nCtrl+C를 눌러 복사하신후 원하는에서 붙여주세요.',code);
	}
}

function copySocialCode()	//admovie 소셜웹사이트 소스코드 복사하기
{
	var code = "http://youtu.be/C4Vj_NvKx7w";
	var IE = (document.all) ? true: false;
	if(IE)
	{
		window.clipboardData.setData('Text',code);
		alert("ADMOVIE영상 소스코드 클립보드로 복사되었습니다.\n\nCtrl+V를 눌러 원하는 곳에 붙여 넣으세요.");
	}
	else
	{
		temp = prompt('ADMOVIE영상 소스코드 입니다.\n\nCtrl+C를 눌러 복사하신후 원하는에서 붙여주세요.',code);
	}
}



function login(urlHistory,urlType)
{
    var url = subfolder+ "/member/login.jsp?urlHistory="+urlHistory+"&urlType="+urlType;
    var arr = getPosition("login");
	iframeState = "login";

	var wLeft = ((document.body.clientWidth - arr.width) /2)+"px";
	var wTop = ((document.body.clientHeight - arr.height) /2)+"px";
	//alert("width:"+wLeft+" height:"+wTop);
    //width, height, top, left
    showFrame(url, arr.width+"px", arr.height+"px", wTop , wLeft);
}

function join()
{   
    var url = subfolder+ "/member/join01.jsp";
    var arr = getPosition("join01");
	iframeState = "join01";


	var wLeft = ((document.body.clientWidth - arr.width) /2)+"px";
	var wTop = ((document.body.clientHeight - arr.height) /2)+"px";

	 //width, height, top, left
    showFrame(url, arr.width+"px", arr.height+"px", wTop , wLeft);
}

function idSearch()
{   
    var url = subfolder+ "/member/idSearch.jsp";
   
    var arr = getPosition("idSerch");
	iframeState = "idSerch";
	var wLeft = ((document.body.clientWidth - arr.width) /2)+"px";
	var wTop = ((document.body.clientHeight - arr.height) /2)+"px";

	 //width, height, top, left
    showFrame(url, arr.width+"px", arr.height+"px", wTop, wLeft);
}

function pwdSearch()
{   
    var url = subfolder+ "/member/pwdSearch.jsp";
   
    var arr = getPosition("pwdSerch");
	iframeState = "pwdSerch";
	var wLeft = ((document.body.clientWidth - arr.width) /2)+"px";
	var wTop = ((document.body.clientHeight - arr.height) /2)+"px";

	 //width, height, top, left
    showFrame(url, arr.width+"px", arr.height+"px", wTop, wLeft);
}

function mypage()
{
    var url = subfolder+ "/mypage/myPage.jsp";
    var arr = getPosition("mypage");
	iframeState = "mypage";
	var wLeft = ((document.body.clientWidth - arr.width) /2)+"px";
	var wTop = ((document.body.clientHeight - arr.height) /2)+"px";

	 //width, height, top, left
    showFrame(url, arr.width+"px", arr.height+"px", wTop, wLeft);
}

function shopinfo()
{
    var url = subfolder+ "/shop/shopInfo.jsp";
    var arr = getPosition("shopinfo");
	iframeState = "shopinfo";
	var wLeft = ((document.body.clientWidth - arr.width) /2)+"px";
	var wTop = ((document.body.clientHeight - arr.height) /2)+"px";

	 //width, height, top, left
    showFrame(url, arr.width+"px", arr.height+"px", wTop, wLeft);
}

function download()
{
    var url = subfolder+ "/download/10_fw_dawnload.html";
    var arr = getPosition("download");
	iframeState = "download";
	var wLeft = ((document.body.clientWidth - arr.width) /2)+"px";
	var wTop = ((document.body.clientHeight - arr.height) /2)+"px";

	 //width, height, top, left
    showFrame(url, arr.width+"px", arr.height+"px", wTop, wLeft);
}

function showroom()
{
    var url = subfolder+ "/showroom/showroom.html";
    var arr = getPosition("showroom");
	iframeState = "showroom";

	var wLeft = ((document.body.clientWidth - arr.width) /2)+"px";
	var wTop = ((document.body.clientHeight - arr.height) /2)+"px";

	 //width, height, top, left
    showFrame(url, arr.width+"px", arr.height+"px", wTop, wLeft);
}

function news()
{
    var url = subfolder+ "/brand/news/newsList.jsp";
    var arr = getPosition("news");
	iframeState = "news";

	var wLeft = ((document.body.clientWidth - arr.width) /2)+"px";
	var wTop = ((document.body.clientHeight - arr.height) /2)+"px";


	 //width, height, top, left
    showFrame(url, arr.width+"px", arr.height+"px", wTop, wLeft);
}

function notice()
{
    var url = subfolder+ "/brand/notice/noticeList.jsp";
    var arr = getPosition("notice");
	iframeState = "notice";

	var wLeft = ((document.body.clientWidth - arr.width) /2)+"px";
	var wTop = ((document.body.clientHeight - arr.height) /2)+"px";

	 //width, height, top, left
    showFrame(url, arr.width+"px", arr.height+"px", wTop, wLeft);
}

function look()
{
	alert("이벤트 준비중입니다.");
	/*
    var url = subfolder+ "/event/event.jsp";
    var arr = getPosition("look");
	iframeState = "look";

	var wLeft = ((document.body.clientWidth - arr.width) /2)+"px";
	var wTop = ((document.body.clientHeight - arr.height) /2)+"px";

	 //width, height, top, left
    showFrame(url, arr.width+"px", arr.height+"px", wTop, wLeft);
	*/
}

function event()
{
    var url = subfolder+ "/event/event.jsp";
    var arr = getPosition("event");
	iframeState = "event";

	var wLeft = ((document.body.clientWidth - arr.width) /2)+"px";
	var wTop = ((document.body.clientHeight - arr.height) /2)+"px";

    showFrame(url, arr.width+"px", arr.height+"px", wTop, wLeft);
}

function faq()
{
    var url = subfolder+ "./faq/faq.jsp";
    var arr = getPosition("faq");
	iframeState = "faq";

	var wLeft = ((document.body.clientWidth - arr.width) /2)+"px";
	var wTop = ((document.body.clientHeight - arr.height) /2)+"px";

	 //width, height, top, left
    showFrame(url, arr.width+"px", arr.height+"px", wTop, wLeft);
}

function qna()
{
    var url = subfolder+ "./qna/qna.jsp";
    var arr = getPosition("qna");
	iframeState = "qna";

	var wLeft = ((document.body.clientWidth - arr.width) /2)+"px";
	var wTop = ((document.body.clientHeight - arr.height) /2)+"px";

	 //width, height, top, left
    showFrame(url, arr.width+"px", arr.height+"px", wTop, wLeft);
}


function log_out()
{
    var url = subfolder+ "/blank.jsp";
    //width, height, top, left
	document.location.href="/member/loginOut.jsp";
    showFrame(url, 0, 0, 0, 0);
}

var objTemp;
function showFrame(url, width, height, top, left)
{
    var obj = document.getElementById("contents");
	var obj_wall = document.getElementById('wall');
    
	if(!obj) {return;}		
	hidenframe();
	
	obj.style.width = width;
	obj.style.height = height;
	obj.style.top = top;
	obj.style.left = left;
	obj.src=url;
	obj.style.display="block"
	obj.focus();
	objTemp = obj;

	obj_wall.style.opacity="0.7";
	obj_wall.style.visibility  = 'visible';
	//obj_wall.style.display  = 'block';
	obj_wall.style.zIndex   = '3';
}

function hidenframe()
{
	var obj_wall = document.getElementById('wall');

	if(!objTemp) 
	{
	    objTemp = document.getElementById("contents");
	    //alert('a');
	    //return;
	}
	objTemp.blur();
	objTemp.src = "/blank.jsp";
	objTemp.style.width = 0;
	objTemp.style.height = 0;	
	//objTemp.src = "about:blank";
	objTemp.style.display="none";

	//wall
	//obj_wall.style.display   = 'none';
	obj_wall.style.visibility  = 'hidden';
	obj_wall.style.zIndex   = '1';
}



function thisMovie(moveName)
{
    if (navigator.appName.indexOf("Microsoft") != -1)
	{
        return window[moveName];
	}
    else
	{
        return document[moveName];
	}
}


var httpRequest = null;
	
function getXMLHttpRequest() 
{
	if (window.ActiveXObject) 
	{
		try 
		{
			return new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch(e) 
		{
			try 
			{
				return new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(e1) 
			{
				return null;
			}
		}
	} 
	else if (window.XMLHttpRequest) 
	{
		return new XMLHttpRequest();
	} 
	else 
	{
		return null;
	}
}

function chgStore() 
{
	var loc = document.getElementById("loc").value;
	var board = document.getElementById("store");
	board.innerHTML = " ";

	httpRequest = getXMLHttpRequest();
	httpRequest.onreadystatechange = storeMessage;
	httpRequest.open("GET",'./store.jsp?loc='+loc, true);
	httpRequest.send(null);
}

function storeMessage() 
{
	if (httpRequest.readyState == 4) 
	{
		if (httpRequest.status == 200) 
		{
			var board = document.getElementById("store");
			board.innerHTML = httpRequest.responseText;
		} else 
		{
		}
	}
}
