
// 

//var myAnchors=document.all.tags("A"); 

//function allblur() {

//    for (i=0;i<myAnchors.length;i++) { 

//        myAnchors[i].onfocus=new Function("myAnchors["+i+"].blur()");

//    } 

//}

// 
//Flash Write
function flashWrite(url,w,h,id,bg,vars,win){

	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	document.write(flashStr);
}

// Tab menu
function tab1Change(tab, layer, obj){
	var tabObj = document.getElementById(tab).getElementsByTagName("a");
	var layerObj = document.getElementById(layer);
	var selectIdx;
	var checkIdx=0;
	
	for(var i=0; i< tabObj.length; i++){
		if(obj == tabObj[i]){
			selectIdx = i;
			tabObj[i].className = "on";
		}else{
			tabObj[i].className = "";
		}
	}
	for(var i=0; i< layerObj.childNodes.length; i++){
		if(layerObj.childNodes[i].tagName == "DIV"){
			if(checkIdx==selectIdx){
				layerObj.childNodes[i].style.display = "block";
			}else{
				layerObj.childNodes[i].style.display = "none";
			}
			checkIdx++;
		}
	}
}

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
	thefield.value = "";
}

var sel;
function getView(obj){
	obj.className = "on";
	if(sel != null) sel.className = "";
	sel = obj;
}

// PNG - ie6
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='';  
    return ''; 
} 



function makeWin(url, winname, width, height, scrolltype){
   xposition=0; yposition=0;
   if (parseInt(navigator.appVersion) >= 4){
      xposition = (screen.width - width) / 2;
      yposition = (screen.height - height) / 2;
   }
   args = "width=" + width + "," + "height=" + height + "," + "location=0," + "menubar=0," + "resizable=0,"
         + "scrollbars=" + scrolltype + "," + "status=0," + "titlebar=0," + "toolbar=0," + "hotkeys=0,"
		 + "screenx=" + xposition + ","  //NN Only
		 + "screeny=" + yposition + ","  //NN Only
		 + "left=" + xposition + ","     //IE Only
		 + "top=" + yposition;           //IE Only

   var newWin=window.open(url,winname,args)
   newWin.focus();
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//input not enter
function None_Submit()
{

if (event.keyCode ==13) { window.event.returnValue=false;}

}

// flash 
function callFlash(flashURL,flashVALUE, flashWIDTH, flashHEIGHT)
{
	document.writeln ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+' %>');
	document.writeln ('<PARAM NAME=movie VALUE="'+flashURL+'">');
	document.writeln ('<PARAM NAME=FlashVars VALUE="'+flashVALUE+'">');
	//document.writeln ('<PARAM NAME=wmode VALUE=transparent>');
	document.writeln ('<PARAM NAME=loop VALUE=true>');
	document.writeln ('<PARAM NAME=quality VALUE=high>');
	document.writeln ('<PARAM NAME=base VALUE=.>');
	document.writeln ('<PARAM NAME=allowScriptAccess VALUE=always>');
	document.writeln ('<EMBED base="."  src='+flashURL+' flashvars='+flashVALUE+' allowScriptAccess=always loop=true wmode=transparent quality=high swLiveConnect=FALSE WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
	document.writeln ('</OBJECT>');
}

 

// flash 
function callFlashById(flashURL,flashVALUE, flashWIDTH, flashHEIGHT, flashId )
{
	document.writeln ('<OBJECT name='+flashId+' id='+flashId+' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0" WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+' %>');
	document.writeln ('<PARAM NAME=movie VALUE="'+flashURL+'">');
	document.writeln ('<PARAM NAME=FlashVars VALUE="'+flashVALUE+'">');
	//document.writeln ('<PARAM NAME=wmode VALUE=transparent>');
	document.writeln ('<PARAM NAME=loop VALUE=true>');
	document.writeln ('<PARAM NAME=quality VALUE=high>');
	document.writeln ('<PARAM NAME=base VALUE=.>');
	document.writeln ('<PARAM NAME=allowScriptAccess VALUE="sameDomain">');
	document.writeln ('<EMBED name='+flashId+'  base="."  src='+flashURL+' flashvars='+flashVALUE+' allowScriptAccess="sameDomain" loop=true wmode=transparent quality=high swLiveConnect=FALSE WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
	document.writeln ('</OBJECT>');
}



function callFlashTrans(flashURL,flashVALUE, flashWIDTH, flashHEIGHT)
{
	document.writeln ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+' %>');
	document.writeln ('<PARAM NAME=movie VALUE="'+flashURL+'">');
	document.writeln ('<PARAM NAME=FlashVars VALUE="'+flashVALUE+'">');
	document.writeln ('<PARAM NAME=wmode VALUE=transparent>');
	document.writeln ('<PARAM NAME=loop VALUE=true>');
	document.writeln ('<PARAM NAME=quality VALUE=high>');
	document.writeln ('<PARAM NAME=base VALUE=.>');
	document.writeln ('<PARAM NAME=allowScriptAccess VALUE=always>');
	document.writeln ('<EMBED base="."  src='+flashURL+' flashvars='+flashVALUE+' allowScriptAccess=always loop=true wmode=transparent quality=high swLiveConnect=FALSE WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
	document.writeln ('</OBJECT>');
}

function Fun_Web_UrlMenu(menuNo){
	
	var go = window.top.document.location;
	if (menuNo == "00000") {go.href = UrlHttp;}
	//account
	if (menuNo == "01010") {go.href = UrlHttps + "/Member/Member.html";}
	if (menuNo == "01011") {go.href = UrlHttps + "/Member/Member_Edit_Step1.html";}
	if (menuNo == "01012") {go.href = UrlHttps + "/Member/Agree.html";}
	if (menuNo == "01013") {go.href = UrlHttps + "/Member/IdPwd.html";}
	if (menuNo == "01014") {go.href = UrlHttps + "/Member/Member_Finish.html";}
	if (menuNo == "01015") {go.href = UrlHttps + "/Member/Member_Finish_cp.html";}

	

	//support
	if (menuNo == "02010") {go.href = UrlHttp + "/Support/Faq/List.html";}
	if (menuNo == "02013") {go.href = UrlHttp + "/Support/Qna/Write.html";}
	if (menuNo == "02014") {go.href = UrlHttp + "/Support/Qna/Question.html";}

	//login-logout
	if (menuNo == "03010") {go.href = UrlHttps + "/Login/Login.html";}
	if (menuNo == "03011") {go.href = UrlHttps + "/Login/Logout.html";}
	if (menuNo == "03012") {go.href = UrlHttps + "/Login/Logout.html?retcode=login";}

	// game list
	if (menuNo == "04010") {go.href = UrlSeal;}
	if (menuNo == "04011") {go.href = UrlSting;}
	if (menuNo == "04012") {go.href = UrlCraypas;}
	if (menuNo == "04013") {go.href = UrlMir2;} //2010.04.23 add mir2 navi
	//if (menuNo == "04012") {alert('Comming Soon');}
	//news category

	if (menuNo == "05010") {go.href = UrlHttp + "/News/News.html";}
	if (menuNo == "05011") {go.href = UrlHttp + "/News/Announcement/List.html";}
	if (menuNo == "05012") {go.href = UrlHttp + "/News/Update/List.html";}
	if (menuNo == "05013") {go.href = UrlHttp + "/News/Event/List.html";}
	if (menuNo == "05014") {go.href = UrlHttp + "/News/Letter/List.html";}



	//cash
	if (menuNo == "06011") {go.href = UrlHttps + "/Blynk/BlynkAdd.html";}
	if (menuNo == "06012") {go.href = UrlHttps + "/Blynk/BlynkUsed.html";}
	if (menuNo == "06013") {go.href = UrlHttps + "/Blynk/BlynkAdded.html";}
	if (menuNo == "06014") {go.href = UrlHttps + "/Blynk/InComm.html";}


	//downloadMonday, August 24, 2009
	if (menuNo == "07011") {go.href = UrlHttp + "/Download/Downseal.html";}
	if (menuNo == "07012") {go.href = UrlHttp + "/Download/Downkos.html";}
	if (menuNo == "07013") {go.href = UrlHttp + "/Download/Downcraz.html";}
	if (menuNo == "07014") {go.href = UrlMir2 + "/download/index.aspx";} //2010.04.23 add mir2 navi
	
	if (menuNo == "08011") {go.href = UrlSeal+'/forum_action.asp';}
	if (menuNo == "08012") {go.href = UrlCraypas+'/forum_action.asp';} 
	if (menuNo == "08013") {go.href = UrlSting+'/forum_action.asp';}
	if (menuNo == "08014") {go.href = UrlMir2forum;} //2010.04.23 add mir2 navi

	//portal_flash_banner
	if (menuNo == "09011") {go.href = UrlSeal+'';}
	if (menuNo == "09021") {go.href = UrlSealShop+'/grabbit_start.html';}
	if (menuNo == "09012") {go.href = UrlCraypas+'';}
	if (menuNo == "09013") {go.href = UrlSting+'';}
	if (menuNo == "09014") {go.href = Urlrohan+'';}

	if (menuNo == "99999") {go.href = UrlHttp;}
	

}



function Fun_TextNull_Check(a,b)
{
	if(a.value == "")
	{
		alert(b);
		a.focus();

		
		return true;
	}
	else
	{
		
		return false;
	}
}





var __mouse_pos_x = 0;
var __mouse_pos_y = 0;
document.onmousemove=mtrack;
function mtrack(e) {
	var scrolledValue = getScrollXY();
 
	if ( typeof(window.screenLeft) == 'number' ) {
		__mouse_pos_x = event.screenX - window.screenLeft + scrolledValue[0];
		__mouse_pos_y = event.screenY - window.screenTop + scrolledValue[1];
	} else {
		if (typeof(event) != 'undefined'){
			__mouse_pos_x = event.clientX;
			__mouse_pos_y = event.clientY;
		} else {
			__mouse_pos_x = e.pageX;
			__mouse_pos_y = e.pageY;
		}
	}
}


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 ];
}



/* length check */
function CheckLength(input,len) 
  {
     var byteLength = 0;
     for (var inx = 0; inx < input.length; inx++) {
       var oneChar = escape(input.charAt(inx));
       if ( oneChar.length == 1 ) {
     byteLength ++;
    } else if (oneChar.indexOf("%u") != -1) {
         byteLength += 2;
    } else if (oneChar.indexOf("%") != -1) {
          byteLength += oneChar.length/3;
    }
   }     
   if(byteLength <= len) return true;
   else false;  
  } 


//special character check
function intcheckTF(sval){
	var i = 0;
	for(m=0;m<sval.length;m++){
		if((sval.charCodeAt(m)==37)){i++;}
		if((sval.charCodeAt(m)==39)){i++;}
		if((sval.charCodeAt(m)==59)){i++;}
		if((sval.charCodeAt(m)==61)){i++;}
	}
	if ( i > 0 ){	return true	;}
	else{	return false	;}

}



/* gif, jpg,zip check */
function validImageExt(filename) {
	filename = filename.toLowerCase();
	if(filename.match(".gif")!=null || filename.match(".jpg")!=null || filename.match(".zip")!=null) return true;
	else return false;
}


function logincheck()
{
	alert('Please Log in.');
}



function go_news()
{
document.fsearch.submit();
}


function CharInfo()
{
	makeWin('/clan/CharInfo.html', 'viewcharPop', 500, 710);
}

//###################################################################
// ) <iframe name="content" width="100%" onload="iframeResize(this)"></iframe>
//###################################################################

function iframeResize(ifrm) 
{
	if(ifrm) {
		try {
			//ifrm.style.height = eval(ifrm.name).document.body.scrollHeight;
			ifrm.setAttribute("height", eval(ifrm.name).document.body.scrollHeight);
		} catch(ex) {}
		document.body.scrollTop = 0;
	} else {
		var obj  = parent.document.getElementsByTagName("iframe");
		for(var i=0;i<obj.length;i++) {
			if(obj[i].name == window.name) {
			try {
				//obj[i].style.height = document.body.scrollHeight;
				obj[i].setAttribute("height", document.body.scrollHeight);
			} catch(ex) {}
			}
		}
	}
}