function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function trim(inputString ) {
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   
   var strongTrim = trim.arguments[1];
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   
   if ( strongTrim == true ) 
   {
   	while (ch == " " || ch == "." ) { // Check for spaces at the beginning of the string
   	   retValue = retValue.substring(1, retValue.length);
   	   ch = retValue.substring(0, 1);
   	}
   	ch = retValue.substring(retValue.length-1, retValue.length);
   	while (ch == " " || ch == "." ) { // Check for spaces at the end of the string
   	   retValue = retValue.substring(0, retValue.length-1);
   	   ch = retValue.substring(retValue.length-1, retValue.length);
   	}
   	while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
   	   retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   	}
   }
   else
   {
   	while (ch == " ") { // Check for spaces at the beginning of the string
   	   retValue = retValue.substring(1, retValue.length);
   	   ch = retValue.substring(0, 1);
   	}
   	ch = retValue.substring(retValue.length-1, retValue.length);
   	while (ch == " ") { // Check for spaces at the end of the string
   	   retValue = retValue.substring(0, retValue.length-1);
   	   ch = retValue.substring(retValue.length-1, retValue.length);
   	}
   	while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
   	   retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   	}
   }
   return retValue; // Return the trimmed string back to the user
} 

function multiAnsChk( ) {

	var userTyped = (multiAnsChk.arguments[0] != null) ? multiAnsChk.arguments[0] : "" ;
	var ans = (multiAnsChk.arguments[1] != null) ? multiAnsChk.arguments[1] : "" ;
	var type = (multiAnsChk.arguments[2] != null) ? multiAnsChk.arguments[2] : "0" ;

	if ( trim(ans) == trim(userTyped,true) )
		return true;
				
	ans = replaceElement(ans);
	var ansAry = ans.split(",");
	var subAnsAry = "";
	var tmp , cnt = ansAry.length ; 
	
	for ( i = 0 ; i < cnt ; i++ )
	{
		if ( trim(ansAry[i]) == "" )
		{
			ansAry = ansAry.slice(i) ; 
		}
	}
	
	//$ansAry = array_splice($ansAry, array_search('', $ansAry) , 1);
	
	for ( i=0 ; i < ansAry.length ; i++ )
	{
		if ( type=="0" )
		{
			if ( trim(ansAry[i],true) == trim(userTyped,true) )
				return true;
		}
		else
		{
			tmp = trim(ansAry[i],true) ;
			subAnsAry = tmp.split(" ");
			tmp = ( subAnsAry.length >= 2 ) ? subAnsAry[1] : subAnsAry[0] ;
			if ( trim(tmp,true)==trim(userTyped,true) )
				return true;
			
		}
	}
	return false ;
}

function replaceElement()
{
	var tar = (replaceElement.arguments[0] != null) ? replaceElement.arguments[0] : "" ;
	
	var reg1 = /\./g ;
	tar = tar.replace(reg1,"");

	reg1 = /\[/g; 
	tar = tar.replace(reg1,",[");

	reg1 = /\(.*\)/g; 
	tar = tar.replace(reg1,"");
	
	reg1 = /(\[.*\])/g; 
	tar = tar.replace(reg1,",");

	return tar; 
}

function reSize()
{
	//try{
	
	if ( window.ifrm != null ) 
	{
	    var objBody	    =	ifrm.document.body;
	    var objFrame    =   document.all["ifrm"];


	    objFrame.style.height = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight)
	    objFrame.style.width = objBody.scrollWidth + (objBody.offsetWidth - objBody.clientWidth)
	    //objFrame.style.width = '100%'
	}


	//}
	//An error is raised if the IFrame domain != its container's domain
	/*catch(e)
	{
	    err_handle(e);
	}*/
}

function frame_init()
{
	var isShop = frame_init.arguments[0];
    //try{
	    parent.reSize();
	    var locate = parent.document.location.href;
	    
	    if ( isShop == true ) 
	    	if ( locate.indexOf('#') == -1) parent.document.location.href = parent.document.location.href + '#';
	    else parent.document.location.href = parent.document.location.href;
	//}
	/*catch(e)
	{
	    err_handle(e);
	}*/
}

function open_window( url , win_name ,width , height )
{
	window.open(url ,win_name ,"width="+ width +",height=" + height + ",resizable=yes,scrollbars=no");
}


function open_window_scroll( url , win_name ,width , height )
{
	window.open(url ,win_name ,"width="+ width +",height=" + height + ",resizable=yes,scrollbars=yes");
}
function open_type( sUrl )
{
	if (  open_type.arguments[1] != null ) 	
		window.open( sUrl,open_type.arguments[1],"width=400,height=400,resizable=no,scrollbars=no");
	else
		window.open( sUrl,"thedayType","width=620,height=520,resizable=no,scrollbars=no");
}
function open_resizable_no_window( url , win_name ,width , height )
{
	window.open(url ,win_name ,"width="+ width +",height=" + height + ",resizable=no,scrollbars=no");
}

function open_window_scroll( url , win_name ,width , height )
{
	window.open(url ,win_name ,"width="+ width +",height=" + height + ",resizable=no,scrollbars=yes");
}

function open_window_rtr( url , win_name ,width , height )
{
	return window.open(url ,win_name ,"width="+ width +",height=" + height + ",resizable=no,scrollbars=no");
}
function getFvarValue( fvar , column )
{
	idx  = fvar.indexOf( column ) ;
	tmp  = fvar.indexOf( "=" , idx );
	
	if ( idx >= 0 )
	{
		lIdx = fvar.indexOf( "&" , idx ) ;
		return fvar.substr( tmp+1 , (lIdx - tmp)-1 );
	}
	else return null;
}

function convertUnicode()
{
	uniStr = convertUnicode.arguments[0];
	if ( convertUnicode.arguments[1] != "" && convertUnicode.arguments[1] != null )
	{
		fontTag = "<font class=\"" + convertUnicode.arguments[1] + "\">"
	}
	else fontTag = "<font class=\"busuView\">";
	
	var idx  = 0 ;
	while( (idx=uniStr.indexOf('&#',idx )) >= 0 )
	{
		lIdx   = uniStr.indexOf(';',idx );
		strLen = ( lIdx - idx );
		if ( strLen == 7 )
		{
			str = uniStr.substr( idx , strLen );
			repStr = fontTag + str + "</font>";
			uniStr = uniStr.substring( 0 , idx ) + repStr + uniStr.substr( idx+8 );
			idx += repStr.length  ;
		}
		else idx += 2 ;
	}
	return uniStr;
}

function changeImg()
{
	selObj      = changeImg.arguments[0];
	forceSwitch = changeImg.arguments[1];
	
	switch( forceSwitch )
	{
		case "Y" : 
		  selObj.src   = selObj.onSrc;
		  selObj.state = "Y";
		  return ;
		  break;
		case "N" :
		  selObj.src   = selObj.offSrc;
		  selObj.state = "N";
		  return ;
		  break;
	}
}

function highLightCode()
{
	targetStr = highLightCode.arguments[0];
	if ( targetStr == "" ) return ""; 
	class_1 = ( highLightCode.arguments[1] == null )? "jpCode1" : highLightCode.arguments[1] ;
	class_2 = ( highLightCode.arguments[2] == null )? "jpCode2" : highLightCode.arguments[2] ;
	class_3 = ( highLightCode.arguments[3] == null )? "jpCode3" : highLightCode.arguments[3] ;
	
	var returnStr = "";
	
	returnStr += "<font class=\"" + class_1 + "\" >" + targetStr.substr( 0 , 1 ) + "</font>" ;
	returnStr += "<font class=\"" + class_2 + "\" >" + targetStr.substr( 1 , 1 ) + "</font>" ;
	returnStr += "<font class=\"" + class_3 + "\" >" + targetStr.substr( 2 ) + "</font>" ;

	return returnStr ;
}



var sc_yac_temp = null ; 

function view_yak_score()
{
	var from , to ;
	
	from = parseInt(parent.yakDiv.style.top , 10); 
	to   = parent.document.body.scrollTop + parent.document.body.clientHeight/2 - 100 - 155;

	nextCheckTime = 800;
		
	if ( from > to ) 
	{
		var move = Math.ceil(Math.abs(from - to )/25);
		from = from - move ;
		nextCheckTime = 10 ;
	}
	if ( from < to ) 
	{
		var move = Math.ceil(Math.abs(to - from )/25);
		from = from + move;
		nextCheckTime = 10 ;
	}

	parent.yakDiv.style.top = from ; 
	
	sc_yac_temp=setTimeout("view_yak_score()",nextCheckTime )
}

function close_yak_layer()
{
	if ( top.yakDiv != null )
	{
		if ( top.yakDiv.style.display == 'block' )
		{
			top.yakDiv.style.display = 'none' ;
			top.yakDiv.innerHTML = "" ;
		}
	}
}


function view_yak_score_self()
{
	var from , to ;
	
	from = parseInt(parent.yakDiv.style.top , 10); 
	to   = parent.document.body.scrollTop ;

	nextCheckTime = 800;
		
	if ( from > to ) 
	{
		var move = Math.ceil(Math.abs(from - to )/25);
		from = from - move ;
		nextCheckTime = 10 ;
	}
	if ( from < to ) 
	{
		var move = Math.ceil(Math.abs(to - from )/25);
		from = from + move;
		nextCheckTime = 10 ;
	}

	yakDiv.style.top = from ; 
	
	sc_yac_temp=setTimeout("view_yak_score_self()",nextCheckTime )
}

function PreViewWindow()  // usage.. han_click( fvar , id , cnt , kind )
{
	fvar = PreViewWindow.arguments[0];

	if ( window.name == "ifrmWin" || window.name == "floatIframe" )
	{
		if ( parent.yakDiv == null )
		{
			parent.document.body.insertAdjacentHTML("beforeEnd","<div id='yakDiv' style='z-index:4;position:absolute;left:0;top:20;display:none' ></DIV>");
		}	

		parent.yakDiv.style.display = 'none' ;

		parent.yakDiv.innerHTML = "<IFRAME id='yakIframe' width=132 height=155 border=0 scrolling = no ></IFRAME>";
		parent.yakIframe.document.open();
		parent.yakIframe.document.write("<HTML><HEAD></HEAD><body BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0></body></html>");
		parent.yakIframe.document.close();
		if ( window.name == "floatIframe" )
			parent.yakIframe.document.body.innerHTML = document.body.innerHTML ;
		else
		{
			parent.yakIframe.document.body.innerHTML = layer_src.innerHTML;
			window.onunload = close_yak_layer;
		}
		parent.yakIframe.closeAnc.href = "javascript:parent.yakDiv.style.display='none'";
		parent.yakIframe.image1.width = 4  ;
		parent.yakIframe.image2.width = 4  ;
		parent.yakIframe.fla.innerHTML = "<EMBED type=application/x-shockwave-flash quality=High src=/flash_files/dan_search_yak_view.swf width=120 height=\"114\" FlashVars=" + fvar + " ><\/EMBED>";
		parent.yakIframe.width = 132 ;
		
		parent.yakDiv.style.display = 'block';

		if ( sc_yac_temp == null ) view_yak_score();
	}
	else
	{
		if ( window.yakDiv == null )
		{
			document.body.insertAdjacentHTML("beforeEnd","<div id='yakDiv' style='position:absolute;left:0;top:20;display:none' ></DIV>");
		}
		
		yakDiv.style.display = 'none' ;

		yakDiv.innerHTML = "<IFRAME id='yakIframe' width=132 height=155 border=0 scrolling = no ></IFRAME>";
		yakIframe.document.open();
		yakIframe.document.write("<HTML><head></HEAD><body BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0></body></html>");
		yakIframe.document.close();
		parent.yakIframe.document.body.innerHTML = layer_src.innerHTML;
		yakIframe.closeAnc.href = "javascript:parent.yakDiv.style.display='none'";
		yakIframe.image1.width = 4 ;
		yakIframe.image2.width = 4 ;
		yakIframe.fla.innerHTML = "<EMBED type=application/x-shockwave-flash quality=High src=/flash_files/dan_search_yak_view.swf width=120 height=\"114\" FlashVars=" + fvar + " ><\/EMBED>";
		yakIframe.width = 132 ;
		
		yakDiv.style.display = 'block';
		
		if ( sc_yac_temp == null ) view_yak_score_self();
	}
}

function doDisable()
{
	return false;
}

function doAble()
{
	return true;
}

function chnExSoundOut(args)
{
	if ( window.document.ChnVoice != null ) 
		window.document.ChnVoice.SetVariable("check_txt", args);
}

function playingEng( v_name , v_dir , v_repNum , v_repKind ) 
{
	if ( window.soundDiv == null ) 
	{
		document.body.insertAdjacentHTML("afterEnd","<div id='soundDiv' style='overflow:hidden;position:absolute; left:0px; top:0px; width:0px; height:0px; z-index:2'></div>");
	}
	var head = "<EMBED  width=200 height=200 swLiveConnect=true ID=myFlashNew NAME=myFlashNew type=application/x-shockwave-flash src=/flash_files/eng_play_1.swf ";
	var fvars= "eng_sound_name=" + v_name + "&" + "drectory_num=" + v_dir + "&" + "repet_num=" + v_repNum + "&" + "repet_kind=" + v_repKind;
	return head+ " flashvars=\"" + fvars + "\" > ";
}

function insertMynote() 
{
	var code = insertMynote.arguments[0];
	var kind = insertMynote.arguments[1];
	var result_panel = (insertMynote.arguments[2]==null)?"":insertMynote.arguments[2];
	
	if ( window.mynote != null ) 
	{
		if ( code == "" ||  kind == "" )
			return ; 
		mynote.code.value = code ; 
		mynote.serv_degree.value = kind ; 
		mynote.result_panel.value = result_panel ; 
		mynote.submit();
	}
}

function checkRadioButton( radioObj )
{
	if ( radioObj.length == null )
	{
		return ( radioObj.checked==true)?true:false;
	}
	else
	{
		for ( var i=0 ; i < radioObj.length ; i++ )
		{
			if ( radioObj[i].checked == true ) return true;
		}
		return false;
	}
}

function getRadioCheckIdx( radioObj )
{
	for ( var i=0 ; i < radioObj.length ; i++ )
	{
		if ( radioObj[i].checked == true ) return i;
	}
	return null;
}

function getRadioIdxByValue( radioObj,val )
{
	for ( var i=0 ; i < radioObj.length ; i++ )
	{
		if ( radioObj[i].value == val ) return i;
	}
	return null;
}

function isNoData()
{
	var msg = (isNoData.arguments[1] != null) ? isNoData.arguments[1] : "" ;
	var data = isNoData.arguments[0];
	
	if ( isNoData.arguments[2] == null ) 
	{
		if ( trim(data)=="" || trim(data)=="N" || trim(data)=="n" || trim(data)=="no" ) 
			return msg;
		else
			return data;
	}
	else
	{
		if ( trim(data)=="" || trim(data)=="N" || trim(data)=="n" || trim(data)=="no" ) 
			return true;
		else
			return false;
	}
}

function stripStr( str , sStr , eStr )
{
	var idx1=idx2=-1;
	var tmp = str.toLowerCase();
	var target="";
	var chkDanger="";
	
	while ( (idx1=tmp.indexOf( sStr )) != -1 ) 
	{
		if ( chkDanger == idx1 ) 
			break;
		else
			chkDanger = idx1;
		
		idx1 = tmp.indexOf( sStr );
		idx2 = tmp.indexOf( eStr , idx1 ) ;
		if ( parseInt(idx2) == -1 ) 
			str = str.replace( str.slice( idx1 , str.length ) , "" );
		else
			str = str.replace( str.slice( idx1 , idx2+eStr.length ) , "" );
		tmp = str.toLowerCase();
	}
	return str ; 
}

var connMainObj=-1 ;
var connMainTime=0 ;

function connMainTimer(){
	if ( connMainObj != -1 ) window.clearTimeout(connMainObj);
	connMainTime++;
	if ( (connMainTime%300)==0 ) connMaintain();
	connMainObj = window.setTimeout("connMainTimer()",1000);
}

function connMaintain()
{
	if ( window.connMainDiv == null )
	{
		document.body.insertAdjacentHTML("beforeEnd","<IFRAME id='connMainDiv' style='display:none' src=\"/manage/connMain.html\" ></IFRAME>");
	}
	if ( window.connMainDiv != null ) connMainDiv.location.reload();
}

function effectString()
{
	var str = effectString.arguments[0];
	var fontClass = effectString.arguments[1];
	var sPos = effectString.arguments[2];
	var ePos = effectString.arguments[3];
	var hEffect = effectString.arguments[4];

	var re_1 = isSpecialCh(sPos)==true ? eval( "/\\"+sPos+"/g" ) : eval( "/"+sPos+"/g" ) ;
	var rtr = "";
	var hEffectStr = (hEffect !=null && hEffect == "Y" ) ? " onMouseOver=\"this.style.color='#FF8000'\" onMouseOut=\"this.style.color='#FFFFFF'\" " : "" ;
	
	if ( ePos != null )
	{
		var re_2 = isSpecialCh(ePos)==true ? eval( "/\\"+ePos+"/g" ) : eval( "/"+ePos+"/g" ) ;
		rtr = str.replace( re_1 , sPos + "<font class=" + fontClass +  hEffectStr + " >" );
		rtr = rtr.replace( re_2 , "</font>" + ePos );
	}
	else
		rtr = str.replace( re_1 , "<font class=" + fontClass + hEffectStr+ ">" + sPos + "</font>" );
		
	return rtr  ; 
}


function effect2ex( ) {
	
	var str = effect2ex.arguments[0];
	var fontClass = effect2ex.arguments[1];
	var hEffect = effect2ex.arguments[2] ;
	
	fontClass = ( fontClass==null ) ? "strEffKanji" : fontClass ;
	var rtr = effectString(  str  , fontClass , "(" , ")"  , hEffect );
	return rtr ;
}

function effect2dic( str , kanjiArr ) {
	
	var rtr = effectString( str , "strEffKanji" , "(" , ")"  );
	rtr = effectString( rtr , "strEffSndRead" , "[" , "]"  );

	re_1 = /a@/g
	re_2 = /@"/g
	rtr = rtr.replace( re_1 , "a(" );
	rtr = rtr.replace( re_2 , ")\"" );
/*
	for ( var i=0 ; i < kanjiArr.length ; i++ )	
		rtr = effectString( rtr , "strEffAccent" , kanjiArr[i]  );
*/
	return rtr ;
}

function writinghanja( kanjiCode ) 
{
	open_window_scroll( '/study/kanjiPrint.html?kanjiCode=' + kanjiCode , 'kanjiPrint' , 713 , 600 );
}

function pilsunhanja( kanjiCode ) 
{
	;
}

function isSpecialCh(str)
{
	var regSpCh = new Array( "$","(",")","*","+",".","[","]","?","\\","/","^","{","}","|" );
	
	for ( var i=0 ; i < regSpCh.length ; i++ )
		if ( str==regSpCh[i] ) return true ;
	
	return false;
}

function isHaveKanji(testStr)
{
	for ( i=0 ; i < testStr.length ; i++ )
	{
		if ( (testStr.charCodeAt(i) >= 0x4E00) && (testStr.charCodeAt(i) <= 0xFA2D) )
			return 1 ; 
	}
	return 0 ; 
}

function alwNextLevelMenu()
{
	var sid = alwNextLevelMenu.arguments[0];
	var mode = ( alwNextLevelMenu.arguments[1] == null )? "" : alwNextLevelMenu.arguments[1] ;	
	
	var urlNext = "/study/nextLevelMenu.html?sid="+sid+"&code=" + trim(firstCode) + "&servLevel=" + servLevel + "&checkNum=" + servLevel   +"&skinMode="+mode ;
	open_window(urlNext , "alwNext" , 572,344 );
}

function alwOptionMenu()
{
	var sid = alwOptionMenu.arguments[0];
	
	open_window("/study/stdOptionSet.html?sid="+sid , "alwOption" , 590,430 );
}

function roadToAlw()
{
  var servLevel = roadToAlw.arguments[0];
  var alwGoUrl = roadToAlw.arguments[1] == null ? "" : roadToAlw.arguments[1] ;
	var studyCheck =roadToAlw.arguments[2];
  
  
  var roadUrl = "/alwaystop/roadToAlw.html?servLevel=" + servLevel + "&alwGoUrl=" + alwGoUrl + "&studyCheck=" + studyCheck;
  
  open_window( roadUrl , "alwRoad" , 5,5 );
}


function runAlwStudy( )
{
	var workDoc=null;
	var userID = runAlwStudy.arguments[0];
	var cur_sess = runAlwStudy.arguments[1];
  var alwGoUrl = runAlwStudy.arguments[2];
  
  var alwRunUrl = "http://www.yamyamjpn.com/alwaystop/runAlways.html?userID=" + userID + "&cur_sess=" + cur_sess ;
	var alwUrl    = "http://www.yamyamjpn.com/study/" + alwGoUrl ;
  
  var runContents = "<OBJECT CLASSID=\"clsid:5220cb21-c88d-11cf-b347-00aa00a28331\"><PARAM NAME=\"LPKPath\" VALUE=\"http://www.yamyamjpn.com/activexNew/webdown.lpk\"></OBJECT><OBJECT ID=\"alwaystop\" CLASSID=\"CLSID:01A8364D-C5F7-46D6-B5D8-D3E0F972C09E\" CODEBASE=\"http://www.yamyamjpn.com/activexNew/webdown.cab#version=1,0,0,0\"><PARAM NAME=\"AlwaysRunUrl\" VALUE=\""+alwRunUrl+"\"><PARAM NAME=\"AlwaysTopUrl\" VALUE=\""+alwUrl+"\"><PARAM NAME=\"VerSionCheck_Web\" VALUE=\"1\"><PARAM NAME=\"Down_Url\" VALUE=\"http://www.yamyamjpn.com/activexNew/AlwaysInstall.exe\"></OBJECT>";

	workDoc=opener;
	
	if ( workDoc.yamAlwRun == null )
	{
		workDoc.document.body.insertAdjacentHTML("beforeEnd","<div id='yamAlwRun' style='position:absolute;left:-1;top:-1;display:none' ></DIV>");
	}
	workDoc.yamAlwRun.style.display = 'block' ;

	workDoc.yamAlwRun.innerHTML = "<IFRAME id='yamAlwIframe' width=5 height=5 border=0 scrolling = no ></IFRAME>";
	workDoc.yamAlwIframe.document.open();
	workDoc.yamAlwIframe.document.write("<HTML><head></HEAD><body  BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>"+runContents+"</body></html>");
	workDoc.yamAlwIframe.document.close();
	
	window.close();
}

function gameIsDuplicate( arr , val )
{
	var cnt = arr.length ; 
	
	for ( var i = 0 ; i < cnt ; i++ )
	{
		if ( trim(arr[i]) == trim(val) )
			return 1 ; 
	}
	
	return 0;
}

	function getAbsoluteTop(oNode){
		var oCurrentNode=oNode;
		var iTop=0;
		while(oCurrentNode.tagName!="BODY"){
			iTop+=oCurrentNode.offsetTop;
			oCurrentNode=oCurrentNode.offsetParent;
		}
		return iTop;
	}

	function getAbsoluteLeft(oNode){
		var oCurrentNode=oNode;
		var iLeft=0;
		while(oCurrentNode.tagName!="BODY"){
			iLeft+=oCurrentNode.offsetLeft;
			oCurrentNode=oCurrentNode.offsetParent;
		}
		return iLeft;
	}

	function addSlashes(tar)
	{
		var tmp = new String(tar);
		return tmp.replace(/'/g , "\\'" );
	}
	
	function stripSlashes(tar)
	{
		var tmp = new String(tar);
		return tmp.replace(/\\'/g , "" );
	}
	
function makeWordList( idx1 , idx2 , idx3 )
{
	var rtr = "",idx1str="",idx2str="",idx3str=""; 
	var curRecPos = myPlanTst.recordset.AbsolutePosition ;
	
	for ( var i=1 ; i <= myPlanTst.recordset.RecordCount ; i++ )
	{
		myPlanTst.recordset.AbsolutePosition = i ;
		
		idx1str = idx1==-1? "" : addSlashes(myPlanTst.recordset.Fields(idx1)); 
		idx2str = idx2==-1? "" : addSlashes(myPlanTst.recordset.Fields(idx2)); 
		idx3str = idx3==-1? "" : addSlashes(myPlanTst.recordset.Fields(idx3)); 
		
		rtr += "<div id=a_record_"+i+" NOWRAP style=\"overflow-x:hidden;position:relative\" onmouseout=\"fadeLayer()\" onmouseover=\"dispListLayer(this,'"+ idx1str +"','"+  idx2str +"','"+  idx3str +"')\" ><a href=javascript:goToRecord("+i+")><font class=wordListPre>" + stripSlashes(idx1str) + "</font></a></div>" ;
	}
	
	myPlanTst.recordset.AbsolutePosition = curRecPos ; 
	v_quickMenu.innerHTML = rtr ; 
	
	highLightRecord();
}

var beforeObj = null ;

function highLightRecord()
{
	var tmp = null ; 
	var myObj = eval( "window.a_record_" + myPlan.recordset.AbsolutePosition ); 
	if ( myObj != null  )
	{
		if ( beforeObj != null ) beforeObj.style.background = '#FFFFFF'; 
		myObj.offsetParent.scrollTop = myObj.offsetTop  - myObj.offsetHeight*3 ;
		myObj.style.background = '#FF9999' ;
		beforeObj = myObj;
	}
}

function goToRecord(record)
{
	if ( !(record < 1 || record > myPlan.recordset.recordCount) )
	{
		isTrigger = false;
		curTime = 0;
		myPlan.recordset.AbsolutePosition = record ;
	}
}

function dispListLayer(obj,src1,src2,src3)
{
	if ( window.v_wordListLayer != null )
	{
		v_wordListLayer.style.display = 'block';
		v_wordListLayer.innerHTML = makeListLayerSrc(src1,src2,src3);
		v_wordListLayer.style.top  = getAbsoluteTop(obj.offsetParent)+obj.offsetHeight ;
		v_wordListLayer.style.left = getAbsoluteLeft(obj) -( v_wordListLayer.offsetWidth + 8 ) ;
	}
}

function fadeLayer()
{
	if ( window.v_wordListLayer != null )
	{
		v_wordListLayer.style.display = 'none';
	}
}

	function getDocHeight(doc) {
	  var docHt = 0, sh, oh;
	
	  if (doc.height) docHt = doc.height;
	  if (doc.body) {
		if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;      
		if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;  
		if (sh && oh) docHt = Math.max(sh, oh);
	  }
	  return docHt;
	}
	
function winResize() 
{ 
var Dwidth = parseInt(document.body.scrollWidth); 
var Dheight = parseInt(document.body.scrollHeight); 
var divEl = document.createElement("div"); 
divEl.style.position = "absolute"; 
divEl.style.left = "0px"; 
divEl.style.top = "0px"; 
divEl.style.width = "100%"; 
divEl.style.height = "100%"; 

document.body.appendChild(divEl); 

window.resizeBy(Dwidth-divEl.offsetWidth, Dheight-divEl.offsetHeight); 
document.body.removeChild(divEl); 
} 

function winResizeHeight(hgt) 
{ 
var Dwidth = parseInt(document.body.scrollWidth); 
var Dheight = parseInt(hgt); 
var divEl = document.createElement("div"); 
divEl.style.position = "absolute"; 
divEl.style.left = "0px"; 
divEl.style.top = "0px"; 
divEl.style.width = "100%"; 
divEl.style.height = "100%"; 

document.body.appendChild(divEl); 

window.resizeBy(Dwidth-divEl.offsetWidth, Dheight-divEl.offsetHeight); 
document.body.removeChild(divEl); 
}

document.oncontextmenu = doDisable;
//document.ondragover =  doDisable;
//document.ondragend =  doDisable;

/// ÀÏ½ÃÁ¤Áö½ÃÄÑ³õÀº°Í 
document.onselectstart =  doDisable;
document.ondragstart =  doDisable;
document.ondragleave  =  doDisable;

