function $(id) { return document.getElementById(id); }

try { 
 document.execCommand("BackgroundImageCache", false, true); 
} catch(err) {} 


var wIN=null; 
function zPop(URL,W,H,S,R,N){ // 0ÀÏ¶§´Â NO 1ÀÏ¶§´Â YES 
	var wINWIDTH = (screen.width-W)/2; 
	var wINHEIGHT = (screen.height-H)/2; 
	var PopSet  ='width='+W+','; // °¡·Î
	PopSet  +='height='+H+','; // ¼¼·Î
	PopSet  +='top='+wINHEIGHT+','; 
	PopSet  +='left='+wINWIDTH+','; 
	PopSet  +='scrollbars='+S+','; // ½ºÅ©·Ñ¹Ù
	PopSet  +='resizable='+R; // ¸®»çÀÌÁî
	wIN=window.open(URL,'_zPopWindow'+N,PopSet); 
	if(parseInt(navigator.appVersion) >= 4){wIN.window.focus();} 
} 



var loadedobjects="";var rootdomain="http://"+window.location.hostname;function ajaxload(url,containerid){var page_request=false;if(window.XMLHttpRequest){page_request=new XMLHttpRequest();}else{if(window.ActiveXObject){try{page_request=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{page_request=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}else{return false;}}page_request.onreadystatechange=function(){loadpage(page_request,containerid);};url=url+"&rnd="+Math.random();page_request.open("GET",url,true);page_request.send(null);}function loadpage(page_request,containerid){if(page_request.readyState==4&&(page_request.status==200||window.location.href.indexOf("http")==-1)){document.getElementById(containerid).innerHTML=page_request.responseText;}}function loadobjs(){if(!document.getElementById){return ;}for(i=0;i<arguments.length;i++){var file=arguments[i];var fileref="";if(loadedobjects.indexOf(file)==-1){if(file.indexOf(".js")!=-1){fileref=document.createElement("script");fileref.setAttribute("type","text/javascript");fileref.setAttribute("src",file);}else{if(file.indexOf(".css")!=-1){fileref=document.createElement("link");fileref.setAttribute("rel","stylesheet");fileref.setAttribute("type","text/css");fileref.setAttribute("href",file);}}}if(fileref!=""){document.getElementsByTagName("head").item(0).appendChild(fileref);loadedobjects+=file+" ";}}}


function inSwf(div_id, sn, sm, sw, sh, sf, tnc, ccolor){ // div ¾ÆÀÌµð, ÀÌ¸§, ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, FlashVars, ¹è°æ(t=Åõ¸í, c=bgcolor), t°¡ ¾Æ´Ò¶§ »ö»ó¼±ÅÃ(¿¹ : #ffffff)
    if(tnc=='t'){
        bgc1='<param name="wmode" value="transparent">';
        bgc2='wmode="transparent"';
    }else{
        bgc1='<param name="bgcolor" value="'+ccolor+'">';
        bgc2='bgcolor="'+ccolor+'"';
    }

    in_f='';
    in_f+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="'+sn+'" name="'+sn+'" width="'+sw+'" height="'+sh+'">';
    in_f+='<param name="movie" value="'+sm+'">';
    in_f+='<param name="quality" value="high">';
    in_f+=bgc1;
    in_f+='<param name="FlashVars" value="'+sf+'">';
    in_f+='<embed src="'+sm+'" id="'+sn+'" name="'+sn+'" width="'+sw+'" height="'+sh+'" quality="high" FlashVars="'+sf+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" '+bgc2+'></embed>';
    in_f+='</object>';

    document.getElementById(div_id).innerHTML = in_f;
    //alert(sn);
}


function flashMax(){ // for top flash menu
	document.getElementById('flashArea').style.height = 300+"px";
}
function flashMin(){
	document.getElementById('flashArea').style.height = 40+"px";
}

function userW(){ 
	var winwidth = screen.width; 
	var winheight = screen.height; 

	if(winwidth < 1030){
		$('ct1').style.top = -5000+"px"; 
		$('ct2').style.top = -5000+"px"; 
	}
} 

function d_sub_Bn(bn_no){ // ¼­ºê ÇÃ·¡½Ã¸Þ´ºÀÇ ¹è³Ê(°ÔÀÓÇÑÆÇ) Å¬¸¯½Ã
	if(bn_no=='1'){
		zPop('/romans/kromans_games/', '700', '650', '0', '0', 'dGame');
	}
}

function d_sub_pp(bn_no){ // ¼­ºê ÇÃ·¡½Ã¸Þ´ºÀÇ ÆË¾÷Ã³¸®
	if(bn_no=='1'){
		zPop('/romans/or_ver/ggame/g_game.php', '800', '650', '0', '0', 'bbb');
	}else{
		zPop('http://chat.cafe24.com/kroman', '800', '650', '0', '0', 'pChat');
	}
}

String.prototype.toInteger = function() {
	return this.replace(/[^0-9]/g, '') * 1;
}

function floatScroll(div_id, origin_top, limit_top, margin_top) {
	var d, t, s, g, target_height;
	origin_top *= 1;
	limit_top *= 1;
	margin_top *= 1;

	d = document.getElementById(div_id);
	//s = document.documentElement.scrollTop + "";
	s = document.body.scrollTop + "";
	

	target_height = s.toInteger() + margin_top;
	if(target_height < limit_top) {
		target_height = origin_top;
	}

	t = d.style.top.toInteger();
	if(t != target_height) {
		g = Math.ceil((t - target_height) / 5);
		if(g > 1000) {
			g = 1000;
		}
		else if (g < -1000) {
			g = -1000;
		}
		d.style.top = (t - g) + "px";
	}
	setTimeout("floatScroll('" + div_id + "', " + origin_top + ", " + limit_top + ", " + margin_top + ")", 1);
}

function quick() {
	b = document.getElementById("floatmenu");
	floatScroll("floatmenu", 128, 128, 10); //ÃÊ±âÀ§Ä¡, ½ºÅ©·ÑÈÄ À§Ä¡, 10Àº ½ºÅ©·ÑÈÄ ÃÖ»óÀ§¿ÍÀÇ °£°Ý
}


// http://www.alik.info/work/slb2.html
var SLB_cnt=0;function SLB(url,type)
{var a=document.getElementById('SLB_film');var b=document.getElementById('SLB_content');var c=document.getElementById('SLB_loading');if(url){a.style.top=0;a.style.left=0;a.style.display="";if(document.documentElement.scrollHeight>document.body.scrollHeight){a.style.height=document.documentElement.scrollHeight+'px';}else{a.style.height=document.body.scrollHeight+'px';}
c.style.display="block";SLB_setCenter(c,true);if(type=='image'){b.innerHTML="<img src="+url+" class='SLB_center' onload='SLB_setCenter(this);' />";if(arguments[2])a.onclick=function(){SLB()};if(arguments[3])b.innerHTML+="<div class='SLB_caption'>"+arguments[3]+"</div>";;}else if(type=='iframe'){b.innerHTML="<iframe id='SLB_iframe' src="+url+" width="+arguments[2]+" height="+arguments[3]+" class='SLB_center' marginwidth='0' marginheight='0' frameborder='0' vspace='0' hspace='0' onload='tryReHeight("+arguments[5]+");'/></iframe>";if(arguments[4]){b.innerHTML+="<div class='SLB_close' onclick='SLB();' title='??'>close</div>";}
b.onclick='';b.firstChild.style.cursor='default';}else if(type='html'){b.innerHTML=url;SLB_setCenter(b.firstChild);if(arguments[2])b.onclick='';}
hideSelect();}else{a.onclick='';a.style.display="none";a.style.height='100%';a.style.width='100%';b.innerHTML="";b.onclick=function(){SLB()};c.style.display="none";showSelect();SLB_cnt=0;}}
function SLB_setCenter(obj){if(obj){var h=(window.innerHeight||self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight);var w=(window.innerWidth||self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);var l=((window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft)+((w-(obj.width||parseInt(obj.style.width)||obj.offsetWidth))/2));var t=((window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)+((h-(obj.height||parseInt(obj.style.height)||obj.offsetHeight))/2));if((obj.width||parseInt(obj.style.width)||obj.offsetWidth)>=w)l=0;if((obj.height||parseInt(obj.style.height)||obj.offsetHeight)>=h)t=(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop);if(!arguments[2]){if(obj.tagName!="IFRAME"&&obj.tagName!="IMG"){document.getElementById('SLB_content').style.left=l+"px";}else{document.getElementById('SLB_content').style.left=w/2+"px";}}
if(SLB_cnt==0){if(arguments[2]||(obj.tagName!="IFRAME"&&obj.tagName!="IMG")){document.getElementById('SLB_content').style.top=t+"px";}else{document.getElementById('SLB_content').style.top=h/2+"px";}
if(document.getElementById('SLB_content').offsetHeight>=h-20){SLB_cnt++;}
if(obj.nextSibling&&(obj.nextSibling.className=='SLB_close'||obj.nextSibling.className=='SLB_caption')){obj.nextSibling.style.display='block';if((t-(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop))>(obj.nextSibling.offsetHeight/2)){document.getElementById('SLB_content').style.top=parseInt(document.getElementById('SLB_content').style.top)-(obj.nextSibling.offsetHeight/2)+"px";}}}
if(!arguments[1]){document.getElementById('SLB_loading').style.display="none";}else{obj.style.left=l+"px";obj.style.top=t+"px";}
if(!arguments[2]&&(obj.tagName=="IFRAME"||obj.tagName=="IMG")){var finalx=(obj.width||parseInt(obj.style.width)||obj.offsetWidth);var finaly=(obj.height||parseInt(obj.style.height)||obj.offsetHeight);obj.width=0;obj.height=0}
obj.style.visibility='visible';if(!arguments[2]&&(obj.tagName=="IFRAME"||obj.tagName=="IMG")){elemResize(obj,[0,0],[finalx,finaly],1,1,1,1);elemMove(document.getElementById('SLB_content'),[w/2,h/2+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)],[l,t],1,1,1);}}}
function hideSelect(){var windows=window.frames.length;var selects=document.getElementsByTagName("SELECT");for(i=0;i<selects.length;i++)
{selects[i].style.visibility="hidden";}
if(windows>0){for(i=0;i<windows;i++){try{var selects=window.frames[i].document.getElementsByTagName("SELECT");for(j=0;j<selects.length;j++)
{selects[j].style.visibility="hidden";}}catch(e){}}}}
function showSelect(){var windows=window.frames.length;var selects=document.getElementsByTagName("SELECT");for(i=0;i<selects.length;i++)
{selects[i].style.visibility="visible";}
if(windows>0){for(i=0;i<windows;i++){try{var selects=window.frames[i].document.getElementsByTagName("SELECT");for(j=0;j<selects.length;j++)
{selects[j].style.visibility="visible";}}catch(e){}}}}
function tryReHeight(sign){var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1];var FFextraHeight=parseFloat(getFFVersion)>=0.1?16:0;var currentfr=document.getElementById('SLB_iframe');if(sign==true){try{if(currentfr.contentDocument&&currentfr.contentDocument.body.offsetHeight){setIframeSize(currentfr.contentDocument.body.offsetHeight+FFextraHeight);}else if(currentfr.Document&&currentfr.Document.body.scrollHeight){setIframeSize(currentfr.Document.body.scrollHeight);}}catch(e){}}else{SLB_setCenter(currentfr);}}
function setIframeSize(h,w){SLB_cnt=0;var ifr=currentfr=document.getElementById('SLB_iframe');if(ifr){if(w){ifr.width=w;}
if(h){ifr.height=h;}
SLB_setCenter(ifr);}}
function elemMove(elem,startPos,endPos,steps,intervals,powr){if(elem.posChangeMemInt)window.clearInterval(elem.posChangeMemInt);var actStep=0;elem.posChangeMemInt=window.setInterval(function(){elem.currentPos=[changeValue(startPos[0],endPos[0],steps,actStep,powr),changeValue(startPos[1],endPos[1],steps,actStep,powr)];elem.style.left=elem.currentPos[0]+"px";elem.style.top=elem.currentPos[1]+"px";actStep++;if(actStep>steps)window.clearInterval(elem.posChangeMemInt);},intervals);}
function elemResize(elem,startDim,endDim,steps,intervals,powr,mode){if(elem.dimChangeMemInt)window.clearInterval(elem.dimChangeMemInt);var actStep=0;elem.dimChangeMemInt=window.setInterval(function(){elem.currentDim=[changeValue(startDim[0],endDim[0],steps,actStep,powr),changeValue(startDim[1],endDim[1],steps,actStep,powr)];if(mode==1){elem.width=elem.currentDim[0];elem.height=elem.currentDim[1];}else{elem.style.width=elem.currentDim[0]+"px";elem.style.height=elem.currentDim[1]+"px";}
actStep++;if(actStep>steps)window.clearInterval(elem.dimChangeMemInt);},intervals);}
function changeValue(minValue,maxValue,totalSteps,actualStep,powr){totalSteps=Math.max(totalSteps,1)
var delta=maxValue-minValue;var stepp=minValue+(Math.pow(((1/totalSteps)*actualStep),powr)*delta);return Math.ceil(stepp)}
var prevOnScroll=window.onscroll;window.onscroll=function(){if(prevOnScroll!=undefined)prevOnScroll();if(document.documentElement.scrollHeight>document.body.scrollHeight){document.getElementById('SLB_film').style.height=document.documentElement.scrollHeight+'px';}else{document.getElementById('SLB_film').style.height=document.body.scrollHeight+'px';}
document.getElementById('SLB_film').style.width=document.body.scrollWidth+'px';SLB_setCenter(document.getElementById('SLB_content').firstChild,false,true);changeopacity('SLB_film',10);}
var prevOnResize=window.onresize;window.onresize=function(){if(prevOnResize!=undefined)prevOnResize();if(document.documentElement.scrollHeight>document.body.scrollHeight){document.getElementById('SLB_film').style.height=document.documentElement.scrollHeight+'px';}else{document.getElementById('SLB_film').style.height=document.body.scrollHeight+'px';}
document.getElementById('SLB_film').style.width=document.body.offsetWidth+'px';SLB_setCenter(document.getElementById('SLB_content').firstChild,false,true);}
//////

function changeopacity(obdiv_id, opacity) {
	var obdiv = document.getElementById(obdiv_id);
	obdiv.style.opacity = (opacity/100);
	obdiv.style.MozOpacity = (opacity /100);
	obdiv.style.KhtmlOpacity = (opacity/100);
	obdiv.style.filter = "alpha(opacity="+ opacity +")";
}
//////

function mOpen(){
window.open('http://www.kromans.com/romans/member_memo.php','memo', 'width=700px, height=500px, left=100px, top=50px, scrollbars=yes, resizable=no, status=no, menubar=0'); }
