// JavaScript Document
hxg = null;
StartMode = 2 ;
ImageDirUrl = './image/background';
TrealCol = 1;
ReSetBackColor = '';
ReSetFontColor = '';
hrwidth = "100%";
hrheight = "1";
submitch = "1";
hrcolor = "#8888ff";
var dragapproved=false ;
var z,x,y ;
function move(){
if (event.button==1&&dragapproved){
z.style.pixelLeft=temp1+event.clientX-x;
z.style.pixelTop=temp2+event.clientY-y;
return false;
}}
function drags(){
if (!document.all){
return;
}
if (event.srcElement.className=="drag"){
dragapproved=true;
z=event.srcElement;
temp1=z.style.pixelLeft;
temp2=z.style.pixelTop;
x=event.clientX;
y=event.clientY;
document.onmousemove=move;
}}
document.onmousedown=drags;
document.onmouseup=new Function("dragapproved=false");
function fork( type,Url ) {
if(type == "helf" ){ hxg = window.open('', 'hxgb', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=500,height=500');}
else if(type == "edit" ){hxg = window.open(Url, 'hxgd', 'toolbar=0,location=1,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=450,height=400');}
else if(type == "EdiHlp" ){hxg = window.open();}
else  alert("Fatal : in function fork()");
hxg.focus();
return;
}
function orgtypecall(){
ahxgb = window.open('./print.cgi?formimg=1','ahxgb','width=450,height=400,resizable=yes,scrollbars=yes');
ahxgb.focus();
}
function FormStyleSeting(){
StyleFFamily = 'font-family:±¼¸²; ';StyleFSize = 'font-size:9pt; ';StyleFColor = 'color:#000000; ';
StyleBackgr = "; ";StyleBWidth = 'border-width:1; ';StyleBColor = 'border-color:#555555; ';
StyleBColor2 =StyleBColor;StyleBStyle = 'border-style:solid; ';StylePageColor = "background-color:1; ; ";StyleFalign = '';
StyleFalign = 'text-align: ;';StyleLineHeight = 'line-height:150%;';}
function Changecolor(ColorValues,Target,RealColor,Repeatcom){WriteDoc = document.form;
if(Target == 6){FormStyleSeting();WriteDoc.color.value = ReSetBackColor;WriteDoc.textcol.value = ReSetFontColor;
WriteDoc.txtalign.value = '';TextAround.style.cssText = StylePageColor ;SideTextColor.style.display = "none";
}else if(Target == 36){StyleFalign = "text-align:"+ColorValues+"; ";WriteDoc.txtalign.value = ColorValues ;}
else if(Target == 3){if(ColorValues == 31){StyleFSize = 'font-size:9pt; ';StyleFFamily	= "font-family:±¼¸²; ";
}else{StyleFFamily	= "font-family:"+ColorValues+"; ";StyleFSize = 'font-size:10pt; ';}}else if(Target == 1){WriteDoc.color.value = ColorValues;
StyleBackgr	= "background-image:url('" +ImageDirUrl+"/"+ColorValues+ "'); ";if(Repeatcom == 1){StyleBackgr += " background-repeat:no-repeat; background-position:50% 50%; ";}
if(RealColor != 5){Backimgview.opened = false;Backimgview.style.visibility = 'hidden';}}
else if(Target == 11){WriteDoc.color.value = ColorValues;StyleBackgr		= "background-color:"+ColorValues+"; ";}
else if(Target == 19){WriteDoc.textcol.value = ColorValues;StyleFColor		= "color:"+ColorValues+"; ";}
else{return ;}ReStyleView();}
function ReStyleView(){document.form.comment.style.cssText =  StyleFFamily+StyleFSize+StyleFColor+StyleFalign+StyleBackgr+StyleBWidth+StyleBColor+StyleBStyle+StyleLineHeight+' width:100%; height:100%;';newnew();}
function EditModeTagin(readtag,tagsection){o=DesAreaDocnt.body;k=document.forms.form['comment'];k.value=o.innerHTML;
if(tagsection == 2){alert(" ");}
else if(tagsection == 3){alert("");}
else if(tagsection == 12){linkurl = prompt("");
if(linkurl != "http://" && linkurl){linkTextin = prompt("");
if(linkTextin){k.value += ("<a href=" + linkurl +">" + linkTextin + "</a>");o.innerHTML=k.value;o.focus();}
else{return;}}else{return;}}else if(tagsection == 13){imgurlL = prompt("");
if(imgurlL != "http://" && imgurlL){k.value += ("<img border=0 src=" + imgurlL +">");o.innerHTML=k.value;o.focus();}
else{return;}}else if(tagsection == 1){hrheight = prompt("¡Ý horizontal color.", hrheight);if(hrheight){
hrcolor = prompt("¡Ý horizontal color.", hrcolor);}else{return;}
if(hrcolor){k.value += ("<hr size=" + hrheight + "  width=" + hrwidth + "  color=" + hrcolor + ">");}
else{return;}o.innerHTML=k.value;o.focus();}else if(tagsection == 4){k.value += readtag ;o.innerHTML=k.value;o.focus();
Signtext.opened = false;Signtext.style.visibility = 'hidden';}
else{return;}return;}
function EditModeChan(rive)
{

if(rive == 'submit')
{if(submitch == 1){submitch += 1;}else{alert("");return false;}}
o=DesAreaDocnt.body;k=document.forms.form['comment'];if(StartMode == 2){StartMode = 1;var tempTags = '';
if(rive == ''){if(document.form.USE_HTM.value != '2'){for(x = 0; x < k.value.length ; x++){
chtagstr = k.value.substring(x,x+1);tempTags += chtagstr;if(chtagstr == "\n"){tempTags += "";}}k.value = tempTags;}
document.form.USE_HTM.value = '2' ;DisplayChanges('inline','none');}
o.innerHTML=k.value;remsize.focus();newnew();}else{StartMode = 2;if(rive == ''){DisplayChanges('none','inline');}
k.value=o.innerHTML;}document.form.scnmod.value=(screen.width+'x'+screen.height);}
function DisplayChanges(Pt,Hd){IframeForm.style.display = Pt ;TextAreaForm.style.display = Hd ;EditModeButton.style.display = Pt ;TextModeButton.style.display = Hd ;}
function newnew(){var Atemp = DesAreaDocnt.body.style;Atemp.fontSize='9pt';Atemp.cssText=document.form.comment.style.cssText;}
function MoveFormSize(Scroll){if(Scroll == 1){onlysize.style.pixelWidth += 35;}else if(Scroll == 2){	onlysize.style.pixelWidth -= 35;}
else if(Scroll == 3){	onlysize.style.pixelHeight += 30;}else if(Scroll == 4){	onlysize.style.pixelHeight -= 30;}
else if(Scroll == 6){onlysize.style.pixelWidth = 400;onlysize.style.pixelHeight = 170;}
else{return;}}function EditTextColorAction(ThisPt, Where , Cvale) {if(document.form.USE_HTM.value != '2'){alert(" 'HTML' .");return ;}
remsize.focus();var aTemp =DesignArea.document.selection.createRange();var bTemp = ThisPt != 'k' ? ThisPt : Cvale;
if(Where =='Nomal'){aTemp.execCommand(ThisPt);}else{aTemp.execCommand(Where, false, bTemp);}
if(ThisPt != 'k' ){ThisPt.selectedIndex=0;}}
var Color_Table = new Array(
'#FFFFFF','#FFF3EF','#FFFBEF','#FFFFEF','#FFFFEF','#EFFFF7','#EFFFFF','#EFFBFF','#EFF3FF','#FFEFFF','#FFEFFF','#FFEFFF','#FFEFFF',
'#EEEEEE','#FFD3CE','#FFEFCE','#FFFFCE','#EFFFCE','#CEFFD6','#CEFFF7','#CEF3FF','#CEDBFF','#E7CFFF','#EFCFFF','#FFCFFF','#FFCFEF',
'#BBBBBB','#FF8E84','#FFD384','#FFFF94','#CEFF84','#84FF8C','#84FFEF','#84E3FF','#849EFF','#BD86FF','#D686FF','#FF86FF','#FF86CE',
'#999999','#FF3421','#FFAE21','#FFFF21','#A5FF21','#21FF31','#21FFD6','#21CBFF','#2151FF','#8424FF','#AD24FF','#FF24FF','#FF24A5',
'#777777','#E70C00','#E79200','#E7E700','#84E700','#00E708','#00E7BD','#00AEE7','#0028E7','#6300E7','#9400E7','#E700E7','#E70084',
'#555555','#9C0800','#9C6100','#9C9E00','#5A9E00','#009E08','#009E84','#00799C','#001C9C','#42009C','#63009C','#9C009C','#9C005A',
'#303030','#5A0400','#5A3800','#5A5D00','#315D00','#005D00','#005D4A','#00495A','#00105A','#29005A','#39005A','#5A005A','#5A0031',
'#000000','#390000','#391800','#393C00','#213C00','#003C00','#003C31','#003039','#000C39','#180039','#210039','#390039','#390021');
document.write( '<div id=ColorTableview style="font-size:9px; border:1 solid black; ');
document.write( ' position:absolute; visibility:hidden; z-Index:10; padding:1; background-color:white;">' );
for( var i = 0; i < 104; i++ ){document.write( '<a href=javascript:void(0) onClick=Get_Color("'+ Color_Table[i] +'",1)  onMouseOver=Get_Color("'+Color_Table[i]+'",2)>' );
document.write( '<span style=background-color:'+ Color_Table[i] +';>&nbsp;    &nbsp;</span></a>' );
if( i % 13 == 12 ) document.write( '<br>' );}document.write( '</div>' );
SignArray = new Array('<li>');
document.write( '<div id=Signtext style="font-size:9px; border:1 solid #0000ff; ');
document.write( ' position:absolute; visibility:hidden; z-Index:10; padding:0;">' );
document.write( '<select onchange=EditModeTagin(value,4) onblur="this.selectedIndex=0;" class=inputtxt>' );
document.write( '<option value=""> - </option>' );
document.write("<option value=''></option><option value='<li>'>dot</option>");
for(i=1; i<SignArray.length; ++i){document.write("<option value='"+SignArray[i]+"'>"+SignArray[i]+"</option>");}
document.write( '</select>' );document.write( '</div>' );var Col_Mode = 0;function EditTableOpen(divid,scltop,sclleft,returnvol){
Col_Mode = returnvol;var DIV_ID = eval(divid);
if(DIV_ID.opened){DIV_ID.opened = false;DIV_ID.style.visibility = 'hidden';}
else{DIV_ID.opened = true;DIV_ID.style.pixelTop = event.clientY + document.body.scrollTop - parseInt(scltop);
DIV_ID.style.pixelLeft = event.clientX + document.body.scrollLeft + parseInt(sclleft);DIV_ID.style.visibility = 'visible';}}
function Get_Color(Colnum,iway){if(Col_Mode == 1){if(iway == 1){	Changecolor(Colnum,19);}else{Changecolor(Colnum,19,5); return;}}
else if(Col_Mode == 2){if(iway == 1){	Changecolor(Colnum,11);}else{Changecolor(Colnum,11,5); return;}}
else if(iway == 2){return;}else if(Col_Mode == 3){EditTextColorAction('k','ForeColor',Colnum)	;}
else if(Col_Mode == 4){EditTextColorAction('k','BackColor',Colnum)	;}else{}ColorTableview.opened = false;ColorTableview.style.visibility = 'hidden';
return;
}

