

//DO NOT EDIT BELOW THIS LINE
//-------------------------------------
var tempY,tempX,initialized,X,Y;
var firstTableWidth;
var isShow = false;

zoomBoxHTML = "<div id=zoomBox style='position:absolute;left:0;top:0; z-index:10;visibility:hidden;display:none;width:300px;height:300px;z-index:1;background-image: url(./image/zoom_edge.gif);padding:50px 71px 69px 15px;'>";
zoomBoxHTML += "	<iframe src=\""+zoomsrc+"\" name=zoom id=zoom  frameborder=0 width=300 height=300  style=\"padding:0px;border:0px;\"></iframe>";
zoomBoxHTML += "</div>";



function hideCaption() {
	
	document.getElementById('vcms_showtext').style.display="none";
	
	if(parent.cnt != null) {
		parent.cnt.StopNow();
	}
}


function resize(e){
	//Ã¢Å©±â º¯°æ‰çÀ»¶§
		document.getElementById('zoomBox').style.left=0;
		document.getElementById('zoomBox').style.top=0;
		window.frames['zoom'].scrollTo(0,0);
		window.frames['zoom'].document.getElementsByTagName("HTML")[0].width=document.body.offsetWidth-55;
}


function disable(){

    document.body.onselectstart=new Function("return true")
	initialized=false;
}



function moveZoomBox(e){
	//ÀÌµ¿µÉ¶§

	var x;
	var y;
	if(window.event){ 
		x = event.x;
		y = event.y;
	} else {
		x = e.pageX;
		y = e.pageY;
	}

	if(initialized==true){
		 
		document.getElementById('zoomBox').style.left=tempX+x-X + document.documentElement.scrollLeft;
		document.getElementById('zoomBox').style.top=tempY+y-Y + document.documentElement.scrollTop;
		window.frames['zoom'].scrollTo(tempX+x-X + document.documentElement.scrollLeft,tempY+y-Y + document.documentElement.scrollTop);
		return false;
	}
}



function  initXY(e){
	//init
	if(window.event){ 
		//ÇöÀç ¸¶¿ì½º ÁÂÇ¥
		X=event.x; 
		Y=event.y;
	} else {
		X=e.pageX;
		Y=e.pageY;
	}
	
	document.body.onselectstart=new Function("return false")
	tempX=X - (document.getElementById('zoomBox').clientWidth-20);
	tempY=Y - document.getElementById('zoomBox').clientHeight+20;

	initialized=true;
	document.onmousemove=moveZoomBox;	
}



function zoomSetting(){
	
	//initPlay();
		//document.getElementById('mainFlash').style.visibility="hidden";
		
		var HTMLtoGrab = document.getElementsByTagName("HTML")[0].innerHTML;
		var HTMLtoWrite = HTMLtoGrab.replace(/<script language=\"JavaScript\" src=\"\/common\/js\/zoom.js\" type=\"text\/javascript\"><\/script>/i,"");
		var HTMLtoWrite = "<HTML>"+HTMLtoWrite+"</HTML>";
		


		window.frames['zoom'].document.getElementById('zoom_div').outerHTML = HTMLtoWrite;
		document.getElementById('zoomBox').style.visibility="hidden";
		window.frames['zoom'].document.body.scroll='no';	
		window.frames['zoom'].document.body.style.zoom=1.5;
		window.frames['zoom'].scrollTo(0,0);
		//window.frames['zoom'].document.onclick = EventFalse;
		//window.frames['zoom'].document.oncontextmenu = EventFalse;
		//jeong -- window.frames['zoom'].document.body.mergeAttributes(document.body);
		resize();
}







function EventFalse(e) {
	isShow = false;
	document.getElementById('zoomBox').style.visibility="hidden";
	document.getElementById('zoomBox').style.display="none";
	/*
	if(window.event){ 
		e = event;
	}
	//document.frames['zoom'].event.returnValue = false;
	e.returValue = false;
	*/
	return false;
}








function showhideZoomBox(e){

	zoomInit();
	if(window.event){ 
		e = event;
	}

	e.returnValue = false;

	if(isShow){
		//²ø¶§
		isShow = false;
		//document.getElementById('mainFlash').style.visibility="visible";
		document.getElementById('zoomBox').style.visibility="hidden";
		document.getElementById('zoomBox').style.display="none";

	} else{
		//Å³¶§
		//document.getElementById('mainFlash').style.visibility="hidden";
		
		isShow = true;//½ÇÇàÈÄ true·Î¹Ù²Û´Ù
		document.getElementById('zoomBox').style.visibility="visible";
		document.getElementById('zoomBox').style.display="";

		initXY(e);
	}

	return false;
}





function zoomInit() {	//À¥ÆäÀÌÁöÀÇ OnloadÀÌº¥Æ®¸¦ »©¾ÑÁö ¾Ê±â À§ÇØ¼­..
  
	var target = window.frames['zoom'].document.getElementById('zoom_div');
	if(target == null) {
		
		setTimeout("zoomInit()", 1000);
	} else {
		zoomSetting();
	}
}

if(document.all) {
	document.write(zoomBoxHTML);

	window.onresize=resize;
	document.onmouseup=disable;
	document.getElementById('zoomBox').onclick = EventFalse;
//	document.ondblclick=showhideZoomBox;
}



