function chgLayer(vpan){
	var i = 0;
	var bpan = "";
	for(i = 1;i < 9;i++){		
		if(vpan == i){
			bpan = "block";			
		}else{
			bpan = "none";
		}
		eval("Layer" + i).style.display = bpan;
	}
}
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 rnGoMenu(bc, ca ,tpath){
	var go = './?act=list&boardCode=' + bc;
	if(ca != null){
		if(ca.indexOf("SK") != -1){
			go += '&scate=' + encodeURIComponent(ca);
		}else{
			go += '&scate=' + ca;
		}
	}
	document.location.href = go;
}


function rnViewContent(num,tpath){
	document.searchForm.act.value = 'list';
	document.searchForm.subpage.value = '';
	document.searchForm.num.value = num;
	document.searchForm.submit();
}

function rnWriteForm(tpath){
	document.searchForm.act.value = 'write';
	document.searchForm.submit();
}

var totalSlot = 1;
function addSlot(tnum){
	totalSlot = totalSlot + 1;
	if(totalSlot >= 26){
		window.alert('´õ ÀÌ»ó Ãß°¡ÇÒ ¼ö ¾ø½À´Ï´Ù.');
	}else{
		if('undefined' != typeof(eval("extraTab" + totalSlot))){
			eval("extraTab" + totalSlot).style.display = "block";
		}
	}
}

function modAddSlot(tnum,texsu){
	if(texsu >= totalSlot){
		totalSlot = Number(texsu);		
	}
	totalSlot = totalSlot + 1;
	if(totalSlot >= 26){
		window.alert('´õ ÀÌ»ó Ãß°¡ÇÒ ¼ö ¾ø½À´Ï´Ù.');
	}else{
		if('undefined' != typeof(eval("extraTab" + totalSlot))){
			eval("extraTab" + totalSlot).style.display = "block";
		}
	}
}

function rmvSlot(tnum){
	eval("extraTab" + tnum).style.display = "none";
}

function enlargeImg(tboardCode,tNum,trSu){
	window.open("/enlargeImg.inno?boardCode=" + tboardCode + "&num=" + tNum + "&rsu=" + trSu,"enlargeImgWin","width=150,height=150,top=0,left=0,");
}

function callQuestion(titlepan){
	window.open("/popup/question.inno?tp=" + titlepan,"question","width=350,height=320,left=0,top=0,scrollbars=no");
}


function switchShowOn(tlayerName){
	eval(tlayerName).style.display = "block";
}

function switchShowOff(tlayerName){
	eval(tlayerName).style.display = "none";
}

function levelInfoWin(){
	//window.open("/popup/levelInfoWin.inno","infowin","width=370,height=620,left=0,top=0,scrollbars=yes");
	location = "/rnBoard/?act=list&boardCode=10&num=45";
}

function openwindow(name, url, width, height, scrollbar, resizable, status) {
	scrollbar_str = scrollbar ? 'yes' : 'no';
	resizable_str = resizable ? 'yes' : 'no';
	status_str = status ? 'yes' : 'no';

	window.open(url, name, 'width='+width+',height='+height+',scrollbars='+scrollbar_str+',resizable='+resizable_str+',status='+status_str+',copyhistory=yes');
}


function imgPreview(imgform,imgid){
	var extchk = imgform.value.toLowerCase();
	if(extchk.indexOf(".jpg") != -1 || extchk.indexOf(".gif") != -1){
		eval(imgid).src = imgform.value;
	}else{
		window.alert('ÀÌ¹ÌÁö¸¸ ¾÷·Îµå°¡ °¡´ÉÇÕ´Ï´Ù.');
	}	
}

function extraCommentLoad(tform,imgid,timg,tmpimgSrc,tboxid,tboxPan,tchk){
	if(timg != ""){
		eval(tform + "." + imgid).src = tmpimgSrc;
	}
	if(tboxPan == "on"){		
		eval(tboxid).style.display = "block";
		eval(tform + "." + tchk).checked = false;
	}else{
		eval(tform + "." + tchk).checked = true;
	}
}


function my_scroll(){

	this.row_height = 0;
	this.now_bottom = 0;
	this.next_bottom = 0;
	this.act_layer = "next";
	this.layer_name = "";
	this.row_name = "";

	this.exeCnt = 0;
	this.speed = 5;
	this.pausetime = 100;

	this.startPoint = 0;
	this.nextPoint = 0;
	this.next_ord = 1;
	this.ord = 1;
	this.mord = 0;
	this.pauseByMouse = false;
	this.pausePan = true;
	this.pauseCnt = 1;

	this.scr_main = my_scr;
	this.chg_layer = change_layer;
	this.scr_init = ready_scr;

}
function my_scr(){
	if(this.pausePan == true || this.pauseByMouse == true){
		if(this.pauseByMouse == false){
			this.pauseCnt++;
			if(this.pauseCnt == this.pausetime){
				this.chg_layer();
				this.pauseCnt = 1;
				this.pausePan = false;
				this.exeCnt = 0;
			}
		}
	}else{
		this.exeCnt++;			
		this.now_bottom++;
		this.next_bottom++;
		eval(this.layer_name + "_now").style.top = this.now_bottom;
		eval(this.layer_name + "_next").style.top = this.next_bottom;
	}		
	// Å×½ºÆ®¿ë Ä«¿îÆ®
	//myc.innerHTML = "su : " + this.exeCnt;	
	if(this.exeCnt == this.row_height){			
		this.pausePan = true;
	}
}

function change_layer(){	
	this.exeCnt = 0;		
	this.ord = this.next_ord;
	this.next_ord++;
	// ´ÙÀ½ Ãâ·Â
	if(this.next_ord > this.mord){
		this.next_ord = 1;
	}		
	if(this.act_layer == "next"){
		this.act_layer = "now";
		this.nextPoint = this.row_height - (this.row_height * 3);
		this.next_bottom = this.nextPoint;
		eval(this.layer_name + "_next").innerHTML = eval(this.row_name + this.next_ord).innerHTML;
		eval(this.layer_name + "_next").style.top = this.next_bottom;
	}else{						
		this.nextPoint = this.row_height - (this.row_height * 2);
		this.act_layer = "next";
		this.now_bottom = this.nextPoint;
		eval(this.layer_name + "_now").innerHTML = eval(this.row_name + this.next_ord).innerHTML;
		eval(this.layer_name + "_now").style.top = this.next_bottom;
	}
}

function ready_scr(twidth,theight,tmord,tlayer_name,trow_name){		
	this.mord = tmord;
	this.row_height = theight;
	this.layer_name = tlayer_name;
	this.row_name = trow_name;
	this.now_bottom = 0;
	this.next_bottom = theight - (theight * 3);
	this.startPoint = 0;
	this.nextPoint = this.next_bottom;
	this.exeCnt = 0;				

	eval(this.layer_name + "_now").style.top = this.now_bottom;	
	eval(this.layer_name + "_now").innerHTML = eval(this.row_name + this.ord).innerHTML;		
	
}

function chgbox(){
	var form = document.login;
	form.dumipass.style.display = 'none';
	form.passwd.style.display = 'block';
	form.passwd.focus();
}

function reloadList(){
	document.getElementById('model_list').reInitializeSelectBox();
}



function my_scroll2(){

	this.row_height = 0;
	this.now_bottom = 0;
	this.next_bottom = 0;
	this.act_layer = "next";
	this.layer_name = "";
	this.row_name = "";

	this.exeCnt = 0;
	this.speed = 5;
	this.pausetime = 100;

	this.startPoint = 0;
	this.nextPoint = 0;
	this.next_ord = 1;
	this.ord = 1;
	this.mord = 0;
	this.pauseByMouse = false;
	this.pausePan = true;
	this.pauseCnt = 1;

	this.scr_main = my_scr2;
	this.chg_layer = change_layer2;
	this.scr_init = ready_scr2;

}
function my_scr2(){
	if(this.pausePan == true || this.pauseByMouse == true){
		if(this.pauseByMouse == false){
			this.pauseCnt++;
			if(this.pauseCnt == this.pausetime){
				this.chg_layer();
				this.pauseCnt = 1;
				this.pausePan = false;
				this.exeCnt = 0;
			}
		}
	}else{
		this.exeCnt++;			
		this.now_bottom--;
		this.next_bottom--;
		eval(this.layer_name + "_now").style.top = this.now_bottom;
		eval(this.layer_name + "_next").style.top = this.next_bottom;
	}		
	// Å×½ºÆ®¿ë Ä«¿îÆ®
	//myc.innerHTML = "su : " + this.exeCnt;	
	if(this.exeCnt == this.row_height){			
		this.pausePan = true;
	}
}

function change_layer2(){	
	this.exeCnt = 0;		
	this.ord = this.next_ord;
	this.next_ord++;
	// ´ÙÀ½ Ãâ·Â
	if(this.next_ord > this.mord){
		this.next_ord = 1;
	}		
	if(this.act_layer == "next"){
		this.act_layer = "now";		
	
		this.nextPoint = this.row_height - this.row_height;	
		this.next_bottom = this.nextPoint;		
		eval(this.layer_name + "_next").innerHTML = eval(this.row_name + this.next_ord).innerHTML;
		eval(this.layer_name + "_next").style.top = this.next_bottom;
	}else{								
		this.nextPoint = this.row_height;		
		this.act_layer = "next";
		this.now_bottom = this.nextPoint;
		eval(this.layer_name + "_now").innerHTML = eval(this.row_name + this.next_ord).innerHTML;
		eval(this.layer_name + "_now").style.top = this.next_bottom;
	}
}

function ready_scr2(twidth,theight,tmord,tlayer_name,trow_name){		
	this.mord = tmord;
	this.row_height = theight;
	this.layer_name = tlayer_name;
	this.row_name = trow_name;
	this.now_bottom = 0;
	this.next_bottom = theight - (theight * 3);
	this.startPoint = 0;
	this.nextPoint = this.next_bottom;
	this.exeCnt = 0;				

	eval(this.layer_name + "_now").style.top = this.now_bottom;	
	eval(this.layer_name + "_now").innerHTML = eval(this.row_name + this.ord).innerHTML;		
	
}

function goLogBox2(groot){
	location = "/member/login/rnIndex.inno?rtndir=" + groot;
}


function chgView(sid){
	if(eval("article" + sid).style.display == "none"){
		eval("article" + sid).style.display = "block";
	}else{
		eval("article" + sid).style.display = "none";
	}
}

function chgMenuImg(fn,sid){

	var form = document.agForm;
	var i;
	var sp;
	var ep;
	var imgsrc = "";
	switch(fn){
		case "1":
			sp = 1;
			ep = 4;
		break;
		case "2":
			sp = 4;
			ep = 7;
		break;
		case "3":
			sp = 7;
			ep = 10;
		break;
		case "4":
			sp = 10;
			ep = 12;
		break;
	}
	
	for(i = sp;i < ep;i++){
		if(i >= 10){
			imgsrc = "safe_top_";
		}else{
			imgsrc = "safe_top_0";
		}
		if(sid == i){
		eval("form.menu" + i).src="http://image.pmping.com/renewal/market/" + imgsrc + i + ".gif";					
		eval("faqPg" + i).style.display = "block";
		}else{
		eval("form.menu" + i).src="http://image.pmping.com/renewal/market/" + imgsrc + i + "\_s.gif";
		eval("faqPg" + i).style.display = "none";
		}
	}

}

function callFaq(tfn,tfsn){
	window.open("/popup/safe_popup.inno","sp","width=600,height=600,top=0,left=0,scrollbars=yes");
}

