// JavaScript Document

//document.oncontextmenu = function() {return false};
//document.ondragstart = function() {return false};
//document.onselectstart = function() {return false};

//flash Script
function CHHDFlash(Url,Width,Height){
  document.writeln("<object  id=\"flash_movie\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"" + Width + "\" height=\"" + Height + "\">");
  document.writeln("<param name=\"movie\" value=\"" + Url + "\">");
  document.writeln("<param name=\"quality\" value=\"high\" />");
  document.writeln("<param name=\"wmode\" value=\"transparent\">");
  document.writeln("<param name=\"menu\" value=\"false\">");
  document.writeln("<param name=\"FlashVars\" value=\"<?=$num_f?>\">");
  document.writeln("<embed src=\"" + Url + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + Width + "\"  height=\"" + Height + "\">");
  document.writeln("</object>");
}

function leftFlash(Url,Width,Height){
  document.writeln("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" + Width + "' height='" + Height + "'>");
  document.writeln("<param name='movie' value='" + Url + "'>");
  document.writeln("<param name='quality' value='high' />");
  document.writeln("<param name='wmode' value='transparent'>");
  document.writeln("<param name='menu' value='false'>");
  document.writeln("<param name='FlashVars' value='<?=$num_f?>'>");
  document.writeln("<embed src='" + Url + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + Width + "'  height='" + Height + "'>");
  document.writeln("</object>");
}


//Focus Blur
function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;

//
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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function MM_openBrWindow2( fileName, winName, winWidth, winHeight, scroll ) {
	var	winPosLeft = (screen.width - winWidth) / 2;
	var	winPosTop = (screen.height - winHeight) / 2;
	var	winOpt = "width="+ winWidth +", height="+ winHeight +", top="+ winPosTop +", left="+ winPosLeft +", scrollbars="+ scroll +", menubar=No, resizable=No, status=No, toolbar=No";
	var	Wins = window.open(fileName, winName, winOpt + "");

	Wins.focus();

}

function ShowHideItem(key_value, item_name){
	if(key_value=="0"){
		document.getElementById(item_name).style.display="none";
	}else{
		document.getElementById(item_name).style.display="";
	}
}




function joinreload() {
	document.signform.reset();
	return false;
}


function ZipWindow(ref,what) {
      var window_left = (screen.width-640)/2;
      var window_top = (screen.height-480)/2;
      ref = ref + "?what=" + what;
      window.open(ref,"zipWin",'width=550,height=200,status=no,top=' + window_top + ',left=' + window_left + '');
}

function onlyNumber() {
   if((event.keyCode<48)||(event.keyCode>57))
   event.returnValue=false;
}

//Áßº¹ ÁÖ¹Î¹øÈ£ Ã¼Å©
function Check_JUMIN() {
	var theForm = window.document.signform;
	var ID1 = window.document.signform.jumin1;
	var ID2 = window.document.signform.jumin2;

	if (!ID1.value) {
		alert('ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ½Å ÈÄ¿¡ È®ÀÎÇÏ¼¼¿ä!');
		ID1.focus();
		return;
	}
	else if (!ID2.value) {
		alert('ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ½Å ÈÄ¿¡ È®ÀÎÇÏ¼¼¿ä!');
		ID2.focus();
		return;
	}
}

function MoveNext() {
	var theForm = window.document.signform;

	if (theForm.jumin1.value.length == 6) {
		theForm.jumin2.focus() ;
	}
}








/**************************** ¸ÞÀÎ Æ÷Æ®Æú¸®¿À Èê·¯°¡±â start ***************************************/
function eScroll()
{

	var thisObj = this;
	this.timeObj = null;

	/*** ¼³Á¤º¯¼ö ***/
	this.mode = "top";				// ½ºÅ©·Ñ ¹æÇâ (top|left)
	this.width = "100%";			// ¶óÀÎ´ç °¡·Î°ª (pixel)
	this.height = 20;				// ¶óÀÎ´ç ³ôÀÌ°ª (pixel)
	this.line = 1;					// Ãâ·Â ¶óÀÎ¼ö
	this.delay = 50;				// ½ºÅ©·ÑÈÄ µô·¹ÀÌ ½Ã°£
	this.speed = 1;					// ½ºÅ©·Ñ ¼Óµµ (ÀÛÀ»¼ö·Ï ºü¸§)
	this.id = 'obj_eScroll';		// °´Ã¼ id (Å¬·¡½º ´ÙÁß »ç¿ë½Ã id ´Ù¸£°Ô ÁöÁ¤ ¿ä¸Á)
	this.contents = new Array();	// Ãâ·Â ³»¿ë (¹è¿­·Î ³»¿ë ÁöÁ¤ ¿ä¸Á)
	this.align = "left";			// ³»¿ë aligne
	this.valign = "middle";			// ³»¿ë valigne

	/*** ³»Àåº¯¼ö ***/
	this.gap = 0;
	this.direction = 1;

	this.add = add;
	this.exec = exec;
	this.start = start;
	this.stop = stop;
	this.scroll = scroll;
	this.direct = direct;
	this.go = go;

	function add(str)
	{
		this.contents[this.contents.length] = str;
	}

	function exec()
	{
		this.basis = (this.mode == "left") ? this.width : this.height;
		var outWidth = this.width * ((this.mode == "left") ? this.line : 1);
		var outHeight = this.height * ((this.mode == "top") ? this.line : 1);

		var outline = "<div id=" + this.id + " style='overflow:hidden;width:" + outWidth + ";height:" + outHeight + "'><table></table></div>";
		document.write(outline);
		this.obj = document.getElementById(this.id);

		var tb = this.obj.appendChild(document.createElement("table"));
		var tbody = tb.appendChild(document.createElement("tbody"));
		tb.cellPadding = 0 ;
		tb.cellSpacing = 0 ;
		tb.onmouseover = function(){thisObj.stop()};
		tb.onmouseout = function(){thisObj.start()};

		if (this.mode=="left") var tr = tbody.appendChild(document.createElement("tr"));
		for (k in this.contents){
			if (this.mode=="top") var tr = tbody.appendChild(document.createElement("tr"));
			var td = tr.appendChild(document.createElement("td"));
			td.noWrap = true;
			td.style.width = this.width;
			td.style.height = this.height;
			td.style.textAlign = this.align;
			td.style.verticalAlign = this.valign;
			td.innerHTML = this.contents[k];
		}

		var len = (this.contents.length<this.line) ? this.contents.length : this.line;
		for (i=0;i<len;i++){
			if (this.mode=="top") var tr = tbody.appendChild(document.createElement("tr"));
			td = tr.appendChild(document.createElement("td"));
			td.noWrap = true;
			td.style.width = this.width;
			td.style.height = this.height;
			td.style.textAlign = this.align;
			td.style.verticalAlign = this.valign;
			td.innerHTML = this.contents[i];
		}

		this.obj.parent = this;
		this.tpoint = this.basis * this.contents.length;
		this.start();
	}

	function scroll()
	{
		var out = (this.mode=="left") ? this.obj.scrollLeft : this.obj.scrollTop;
		if (out%this.basis==0){
			this.gap++;
			if (this.gap>=this.delay) this.gap = 0;
		}
		if (!this.gap){
			var ret = (out==this.tpoint) ? this.direction : out + this.direction;
			if (ret<0) ret = this.tpoint + ret;
			if (this.mode=="left") this.obj.scrollLeft = ret;
			else this.obj.scrollTop = ret;
		}
	}

	function start()
	{
		this.timeObj = window.setInterval("(document.getElementById('" + this.id + "')).parent.scroll()",this.speed);
	}

	function stop()
	{
		clearTimeout(this.timeObj);
	}

	function direct(d)
	{
		this.direction = d;
	}

	function go()
	{
		this.stop();
		var out = (this.mode=="left") ? this.obj.scrollLeft : this.obj.scrollTop;
		var ret = (parseInt(out / this.basis) + this.direction) * this.basis;
		if (ret<0) ret = this.tpoint + ret;
		if (ret>this.tpoint) ret = this.basis;
		if (this.mode=="left") this.obj.scrollLeft = ret;
		else this.obj.scrollTop = ret;
	}

}
/**************************** ¸ÞÀÎ Æ÷Æ®Æú¸®¿À Èê·¯°¡±â end ***************************************/
