﻿///////////////////////////////////////////////
// URL 이동, Target Frame 지정 가능
///////////////////////////////////////////////
function wgoto(url, targetstr)
{
  if (url == 'backward')
    history.back(1);
  else if (url == 'forward')
    history.forward(1);
  else {
    var frameobj = eval(targetstr);
    frameobj.location = url;
  }
}

//플레시 관련
function FlashOutput(objPath, objID, objWidth, objHeight, objAlign, objWMode)
{
	
		if(objAlign == "") 
			objAlign = "middle";
	
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width=" + objWidth + " height=" + objHeight + " id=" + objID +" align=" + objAlign+ ">");
	document.write("<param name=allowScriptAccess value=sameDomain />");
	document.write("<param name=movie value=" + objPath +" />");
	document.write("<param name=quality value=high />");
	document.write("<param name=loop value=false>"); 
    document.write("<param name=menu value=false>");
	if(objWMode) document.write("<param name=wmode value=transparent />");
	document.write("<param name=bgcolor value=#FFFFFF />");
	document.write("<embed src=" + objPath + " quality=high" );
	if(objWMode) 
		document.write("wmode=transparent" );
	document.write("bgcolor=#FFFFFF width=" + objWidth + " height=" + objHeight + " name=" + objID + " align=" + objAlign + " allowScriptAccess=sameDomain type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer />");
	document.write("</object>");
}


//새로운창(크기 조절 가능)
function nW0(desurl,wname,scflag,width,height)
{
  var newurl = desurl;
  window.open(newurl,wname,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scflag+',resizable=yes,copyhistory=no,width='+width+',height='+height+'');
}
//-->

//오버시 하단 글씨)
function a(txt) {
  self.status = txt
 }
 function b() {
  self.status = ""
 }

function FocusColor(This) { This.style.backgroundColor = "#FFF4DA"; }
function BlurColor(This) { This.style.backgroundColor = "#FFFFFF";}
function BlurColor2(This) { This.style.backgroundColor = "#EFEFEF";}
function BlurColor3(This) { This.style.backgroundColor = "#e6ffe6";}
function FocusColor9(This) { 
	This.style.backgroundColor = "#FFF4DA";

	if(document.forms[0].chk_cnt2) {
		document.forms[0].chk_cnt2.value=0;
	}

}
 //-->
 
 //=====한영 체크 로직 끝=============

function text_check(text,total){
	//  text : 문자 필드명 , total : 총 문자길이
	var obj = $(text);
	var len = obj.value.length;
	var count = 0;
	var one_ch="";
	var total2 = 0;
	for (i = 0; i < len ; i++){
    one_ch = obj.value.charAt(i);	   //한문자만 추출
    	if (escape(one_ch).length > 4) {
    	    count = count + 2;   //한글
    	}else {
    	    count = count + 1;   //영문
    	}
	}
	total2 = Math.floor(total/2);
	if (count > total) {
	    alert("입력하신 내용은 한글 "+total2+", 영문 "+total+"자까지 쓰실 수 있습니다.\n\n문자 수를 확인하여 주시기 바랍니다.");
		obj.value = obj.value.substr(0,total2);
		obj.focus();
		return false;
	}
}

function text_cut(text,total){
	//  text : 문자 필드명 , total : 총 문자길이
	var obj = eval(text)
	var len = obj.value.length;
	var count = 0;
	var one_ch="";
	var total2 = 0;
	for (i = 0; i < len ; i++){
    one_ch = obj.value.charAt(i);	   //한문자만 추출
    	if (escape(one_ch).length > 4) {
    	    count = count + 2;   //한글
    	}else {
    	    count = count + 1;   //영문
    	}
	}
	total2 = Math.floor(total/2);
	if (count > total) {
		return obj.value.substr(0,total2);
	}else{
	  return obj.value;
	}
}


function scroll_save(gubun,scroll){
  var obj =  eval("document.getElementById(\""+scroll+"\")");
  var db = (obj) ? 1 : 0; 
  var scroll = (obj.scrollTo) ? 1 : 0; 
  var x = (db) ? obj.scrollLeft : pageXOffset;
  var y = (db) ? obj.scrollTop : pageYOffset;
  if (gubun=="x"){
    return x ;
  } else { 
    return y ;
  }
}

function scroll_focus(gubun,xs,ys,scroll){
  var obj =  eval("document.getElementById(\""+scroll+"\")");
  var db = (obj) ? 1 : 0; 
  var scroll = (obj.scrollTo) ? 1 : 0; 
  if (gubun=="x"){
    obj.scrollLeft = xs;
  }else if(gubun=="y"){
    obj.scrollTop = ys;
  }else{
    obj.scrollLeft = xs;
    obj.scrollTop = ys;
  }
}

function $() {
   var elements = new Array();
   for (var i = 0; i < arguments.length; i++) {
      var element = arguments[i];
      if (typeof element == 'string')
         element = document.getElementById(element);
      if (arguments.length == 1)
         return element;
      elements.push(element);
   }
   return elements;
}

function $Name() {
   var elements = new Array();
   for (var i = 0; i < arguments.length; i++) {
      var element = arguments[i];
      if (typeof element == 'string')
         element = document.getElementsByName(element);
      if (arguments.length == 1)
         return element;
      elements.push(element);
   }
   return elements;
}
 //-->
