/*--//퀵메뉴 높이 리사이징--*/

function layout(){
	var oMyty = document.getElementById("myty");
	if( oMyty )
		oMyty.style.height = (document.body.clientHeight);
	//alert(document.getElementById("myty").style.height+"::::"+ (document.body.clientHeight)); 
}

function mytyReset(){	
	var oMyty = document.getElementById("myty");
	var oMyty2 = document.getElementById("mytyin");
	if( oMyty )
		oMyty.style.height = document.documentElement.scrollHeight + "px";
		oMyty2.style.height = document.documentElement.scrollHeight + "px";
}

/*--//마우스위치에 레이어 띄우기--*/

/*달력(ie만 가능):버튼위치에 레이어 띄우기, 버튼위치에 상대적 위치*/
function calendarView(popCtrl, popCal,dd,cc)
{
  this.event.cancelBubble=true;
  //var btnCal = popCtrl,
  var VicPopCal = popCal;
  var leftvalue    = dd; /*버튼위치의 상대적X값*/
  var topvalue    = cc;  /*버튼위치의 상대적Y값*/
  var point = fGetXY(popCtrl);
  with (VicPopCal.style) 
  {
  	left = point.x-leftvalue;
	top  = point.y+popCtrl.offsetHeight-topvalue;	
  }
  //display = "block";
  // 
   
 if(VicPopCal.style.display == "none") {
	VicPopCal.style.display="block";
	VicPopCal.focus(); 
 }
 else {
	VicPopCal.style.display="none" 
	 }	 

}

function Point(iX, iY)
{
	this.x = iX;
	this.y = iY;
}

function fGetXY(aTag)
{
      var oTmp = aTag;
      var pt = new Point(0,0);
      do
      {
      	pt.x += oTmp.offsetLeft;
      	pt.y += oTmp.offsetTop;
      	oTmp = oTmp.offsetParent;
      }
      while(oTmp.tagName!="BODY");
      return pt;
}
/*//달력:버튼위치에 레이어 띄우기*/

/*--마우스위치에 레이어 띄우기:절대 좌표값 넣어줘야함--*/
/*사용예 a href="javascript:moveElementPosition('calendarSet',678,255);"*/
var mPosiX = 0;
var mPosiY = 0;
function addClickPositionListener() { 
 
 obj = document.getElementById('allHTML'); 
 if (!document.attachEvent) { 
     obj.addEventListener('mousedown', checkEvent,false); 
 } else { 
     obj.attachEvent('onmousedown',checkEvent); 
 } 
} 

function checkEvent(evt) { 
 if (!evt) { 
  evt = window.event; 
 } 
 if (evt.pageX) { 
  x = evt.pageX; 
  y = evt.pageY;  
 } else { 
  x = evt.clientX; 
  y = evt.clientY;  
 } 
 mPosiX =x;
 mPosiY =y;
 
 
} 

function getBrowserType(){
 var browserType = navigator.userAgent;
 
 if ( browserType.indexOf( 'MSIE' ) >= 0 ) {
    return "MS";
   }
   else if (browserType.indexOf( 'Firefox' )>= 0 ) {
    return "FOX";
   }
   else if (browserType.indexOf( 'Safari' )>= 0 ) {
    return "SF";
   }
   else {
    return "UD";
   }
  }
function isRightVer(type){
 retType= getBrowserType();
 if( type == retType ){
  return true;
 }else{
  return false;
 }
}

//
function moveElementPosition(layerId, leftMovePositionSize, rightMovePositionSize ){
 
 if( isRightVer('MS') ){
  GMessageLayerPosX = mPosiX + document.body.scrollLeft + document.documentElement.scrollLeft;
  GMessageLayerPosY = mPosiY + document.body.scrollTop + document.documentElement.scrollTop;
 }else {
  GMessageLayerPosX = mPosiX + document.body.scrollLeft;
  GMessageLayerPosY = mPosiY + document.body.scrollTop;
 }
  
//  alert(document.getElementById(layerId).style.left+"::::"+document.getElementById(layerId).style.top); 
 document.getElementById(layerId).style.left = ( GMessageLayerPosX + leftMovePositionSize )+'px'; 
 document.getElementById(layerId).style.top = ( GMessageLayerPosY + rightMovePositionSize )+'px';
 
 if(document.getElementById(layerId).style.display == "none") {
 	document.getElementById(layerId).style.display="block";
 }
 else {
	document.getElementById(layerId).style.display="none" 
	 }
 
 //alert(document.getElementById(layerId).style.left+"::::"+document.getElementById(layerId).style.top); 
 
}
/*--//마우스위치에 레이어 띄우기--*/



//마우스 포커스 이벤트---class변경
function clearbg(objcls) {

	document.getElementById("nameStr").className="bg_off";

	if (objcls == "1") {
		document.getElementById("nameStr").className="bg_off";		
		
	} else if (objcls == "2") {
		document.getElementById("cellStr").className="bg_off";
		
		if (document.oneClickFrm.nameStr.value=="") {
			document.getElementById("nameStr").className="bg_on";
		}
		
	}
}



/* 팝업창 관련 */


/*----------------------------------------------------------------------
  Title  :	OpenWin
  Desc	 :	팝업창 Open (resize = no)
  Param  :	url - 팝업창 경로
			win - 팝업창 name
			w - Width
			h - Height
			s - scroll 여부
------------------------------------------------------------------------*/
function OpenWin(url,win, w,h,s)
{

	var win1=null;
	win1 = window.open(url, win ,'width='+w+', height='+h+',resizable=no, toolbar=no, scrollbars='+s+', menubar=no, top=3, left=3').focus();

}



/*----------------------------------------------------------------------
  Title  :	OpenWin2
  Desc	 :	팝업창 Open
  Param  :	url - 팝업창 경로
			win - 팝업창 name
			w - Width
			h - Height
			t - Top
			l - Left
			s - scroll 여부
------------------------------------------------------------------------*/
function OpenWin2(url,win, w,h,t,l,s)
{

	var win1=null;
	win1 = window.open(url, win ,'width='+w+', height='+h+',resizable=no, toolbar=no, scrollbars='+s+', menubar=no, top='+t+', left='+l ).focus();

}


/*----------------------------------------------------------------------
  Title  :	OpenWin3
  Desc	 :	팝업창 Open (resize = yes)
  Param  :	url - 팝업창 경로
			win - 팝업창 name
			w - Width
			h - Height
			s - scroll 여부
------------------------------------------------------------------------*/
function OpenWin3(url,win, w,h,s)
{

	var win1=null;
	win1 = window.open(url, win ,'width='+w+', height='+h+',resizable=yes, toolbar=no, scrollbars='+s+', menubar=no, top=3, left=3').focus();

}

/*----------------------------------------------------------------------
  Title  :	OpenWin4
  Desc	 :	팝업창 Open (resize = yes)
  Param  :	url - 팝업창 경로
			win - 팝업창 name
			w - Width
			h - Height
			t - Top
			l - Left
			s - scroll 여부
------------------------------------------------------------------------*/
function OpenWin4(url,win, w,h,t,l,s)
{

	var win4=null;
	win4 = window.open(url, win ,'width='+w+', height='+h+',resizable=no, toolbar=no, scrollbars='+s+', menubar=no, top='+t+', left='+l );
	win4.focus();
	win4=null;

}

/*
function changeto(highlightcolor){ 
source=event.srcElement if (source.tagName=="TR"||source.tagName=="TABLE") return; 
while(source.tagName!="TD") source=source.parentElement; 
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore") source.style.backgroundColor=highlightcolor;
} 

function changeback(originalcolor){
if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore") return;
if (event.toElement!=source) source.style.backgroundColor=originalcolor;
}
*/

function toggleObjDisplay(id) { 
var o = document.getElementById(id);
if(o.style.display == "none") o.style.display = "block"; 
else o.style.display = "none";
}

function Viewcontent(n){
 var p = "toggle_cont_"+n; 
 var i = "toggle_btn_"+n; 

  if ( document.getElementById(p).style.display == "none" )
  {
    document.getElementById(p).style.display = "block";
    document.getElementById(i).src = "/image/common/toggle_btn_on.gif";

  } else
  {
    document.getElementById(p).style.display = "none";
    document.getElementById(i).src = "/image/common/toggle_btn_off.gif";
  }

}



/*show hide layer*/

function show_layer(param){
	var open_layer ="t_layer_"+param;
	var close_layer ="t2_layer_"+param;
	var content_layer="layer_"+param;

	var tlayer1 = document.getElementById(open_layer);
	var tlayer2 = document.getElementById(close_layer);
	var conlayer = document.getElementById(content_layer);

		if(conlayer.style.display == "none"){
			tlayer1.style.display="none";
			tlayer2.style.display="block";
			conlayer.style.display = "block";
		} else {			
			tlayer1.style.display="block";
			tlayer2.style.display="none";
			conlayer.style.display = "none";
		}
}

function tabLayer(imgname,boxname,num,leng){
	var idName
	for(var i=1;i<=leng;i++){
		var obj = document.getElementById(imgname+i);
		var obj1 = document.getElementById(boxname+i) ;
		if(i==num) {
			obj.src = obj.src.replace(".jpg", "_on.jpg");
			obj.src = obj.src.replace(".gif", "_on.gif");
			obj1.style.display = "block";
		}	else	{
			obj.src = obj.src.replace("_on.jpg", ".jpg")
			obj.src = obj.src.replace("_on.gif", ".gif");
			obj1.style.display = "none";
		}
	}
}

function imgOver(imgname,num,leng){	
	for(var i=1;i<=leng;i++){
		var obj = document.getElementById(imgname+i);
		if(i==num) {
			obj.src = obj.src.replace("_off.jpg", "_on.jpg");
			obj.src = obj.src.replace("_off.gif", "_on.gif");
		}	else	{
			obj.src = obj.src.replace("_on.jpg", "_off.jpg")
			obj.src = obj.src.replace("_on.gif", "_off.gif");
		}
	}
}

/*select layer option bgcolor */

 function optionOver(that){
		that.style.backgroundColor ="#f9f9f9";
	  }

  function optionOut(that){
	that.style.backgroundColor ="#ffffff";
  }


/* iframe resize */
/*a.htm*/
function updateIFrame( height ) { 
	var iframe = document.getElementById( 'myiframe' ); 
	iframe.setAttribute( 'height', height ); 
} 

/*b.htm
function rsize() 
{ 
      var iframe = document.getElementById( 'inneriframe' ); 
      var wrapper = document.getElementById( 'wrapper' ); 
      var height = Math.max( document.body.offsetHeight, document.body.scrollHeight ); 
      iframe.src = '/plus/a/auto_size.htm?height='+height;      
} 
*/


//flashUrl 절대경로포함 Url
//fwidth	플래시 width
//fheight 플래시 height
//wmode  설정값
function loadFlash( flashUrl , fwidth , fheight , wmode )
{
	var _fObject = "";
	_fObject += "<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='" + fwidth + "' height='" + fheight + "'>";
	_fObject += "	<param name='movie' value='" + flashUrl + "'>";
	if(wmode != "")
	{
	_fObject += "	<param name='wmode' value='" + wmode + "'>";
	}
	_fObject += "	<param name='quality' value='high'>";
	_fObject += "	<embed src='" + flashUrl + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + fwidth + "' height='" + fheight + "' wmode='" + wmode + "'></embed>";
	_fObject += "</object>";
		
	document.write( _fObject );
}


function embedFlash(id, url, width, height, altText, flashVars, wmode) {
	if (!flashVars) flashVars = '';
	if (!wmode) wmode = 'window';
	if (!altText) altText = '';

	var str = '' +
	'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" width="' + width + '" height="' + height + '" id="' + id + '">' +
		'<param name="movie" value="' + url + '" />' +
		'<param name="wmode" value="' + wmode + '" />' +
		'<param name="FlashVars" value="' + flashVars + '" />' +
		'<!--[if !IE]>-->' +
		'<object type="application/x-shockwave-flash" data="' + url + '" width="' + width + '" height="' + height + '" name="' + id + '">' +
			'<param name="wmode" value="' + wmode + '" />' +
			'<param name="FlashVars" value="' + flashVars + '" />' +
		'<!--<![endif]-->' +
			'<div class="alt-content alt-' + id + '">' + altText + '</div>' +
		'<!--[if !IE]>-->' +
		'</object>' +
		'<!--<![endif]-->' +
	'</object>';
	document.write(str);
}


/**
* 플래시 메뉴 클릭 함수.
function bx_menu_click( link, arg1, arg2 ){
	
}
*/







/*토글레이어 처리*/
function toggleView(id) { 
var div01 = document.getElementById(id);
	if(	div01.style.display == "none") {
		div01.style.left = event.clientX + document.body.scrollLeft + 'px';
		div01.style.top = event.clientY +document.body.scrollTop + 'px';
		div01.style.display = "block";		

	} else {
		div01.style.display = "none";
	}
}




/* definition list toggle */
function initToggle(tabContainer) {
 triggers = tabContainer.getElementsByTagName("a");

 for(i = 0; i < triggers.length; i++) {
  if (triggers.item(i).href.split("#")[1])
   triggers.item(i).targetEl = document.getElementById(triggers.item(i).href.split("#")[1]);
   thismenu = triggers.item(i);

  if (!triggers.item(i).targetEl)
   continue;

  thismenu.imgEl = tabContainer.getElementsByTagName("img").item(i);
  triggers.item(i).targetEl.style.display = "none";
  triggers.item(i).onclick = function () {
   if (tabContainer.current == this) {
    this.targetEl.style.display = "none";
    tabContainer.current = null;

    if (this.imgEl) {
     this.imgEl.src = this.imgEl.src.replace("_on.gif", ".gif");
    } else {
     this.className = this.className.replace(" on", "");
    }    
    
   } else {
    if (tabContainer.current) {
     tabContainer.current.targetEl.style.display = "none";
     
    if (this.imgEl) {
     this.imgEl.src = this.imgEl.src.replace("_on.gif", ".gif");
    } else {
     this.className = this.className.replace(" on", "");
    }    

   }
    this.targetEl.style.display = "block";
     if (this.imgEl) {
      this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
     } else {
      this.className += " on";
     }    
    tabContainer.current = this;
    }
   return false;
  }
 }
}

// Message Window
function openMessageWindow(href) {
	var windowEl = document.createElement("iframe");
	windowEl.src = href;
	windowEl.frameBorder = 0;
	windowEl.scrolling = "no";
	windowEl.allowTransparency = "true";
	windowEl.style.zIndex = 1001;
	windowEl.style.position = 'absolute';
	document.getElementsByTagName("body").item(0).appendChild(windowEl);
	document.getElementsByTagName("body").item(0).popup = windowEl;

	var selects = document.getElementsByTagName("select");
	for (i = 0; i < selects.length; i++) {
		selects.item(i).hided = true;
		selects.item(i).style.visibility = "hidden";
	}

	var mask = document.createElement("div");
	mask.onclick = closeMessageWindow;
	mask.style.width = document.documentElement.clientWidth + "px";
	mask.style.height = document.documentElement.scrollHeight + "px";
	mask.style.position = 'absolute';
	mask.style.top = "0";
	mask.style.left = "0";
	mask.style.zIndex = 1000;
	mask.style.backgroundColor = "#fff";
	mask.style.opacity = "0.7";
	mask.style.filter = "alpha(opacity = 70)";
	document.getElementsByTagName("body").item(0).appendChild(mask);
	windowEl.mask = mask;
}

function closeMessageWindow() {
	var windowEl = parent.document.getElementsByTagName("body").item(0).popup;
	if (!windowEl)
		return false;

	var selects = parent.document.getElementsByTagName("select");
	for (i = 0; i < selects.length; i++) {
		if (selects.item(i).hided == true) {
			selects.item(i).style.visibility = "visible";
		}
	}

	windowEl.style.display = "none";
	windowEl.mask.parentNode.removeChild(windowEl.mask);
	windowEl.mask = null;
	
	//return true;
}
function positionMessageWindow() {
	if (!parent.document.getElementsByTagName("body").item(0).popup)
		return;

	var windowEl = parent.document.getElementsByTagName("body").item(0).popup;
	windowEl.style.height = "auto";
	windowEl.style.width = "auto";
	var windowElHeight = document.documentElement.scrollHeight;
	var windowElWidth = document.documentElement.scrollWidth;
	windowEl.style.height = windowElHeight + 5 + "px";
	windowEl.style.width = windowElWidth + "px";
	windowEl.style.top = parent.document.documentElement.scrollTop + (parent.document.documentElement.clientHeight - windowElHeight) / 2 + "px";
	windowEl.style.left = (parent.document.documentElement.clientWidth - windowElWidth) / 2 + "px";
}
// Message Popup Layer
function openMessagePopup(elId) {
	var windowEl = document.getElementById(elId.split("#")[1]);
	if (!windowEl)
		return true;

	windowEl.style.display = 'block';
	windowEl.style.zIndex = 1001;
	windowEl.style.position = 'absolute';
	windowEl.style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight - windowEl.offsetHeight) / 2 + "px";
	windowEl.style.left = (document.documentElement.clientWidth - windowEl.offsetWidth) / 2 + "px";

	var selects = document.getElementsByTagName("select");
	for (i = 0; i < selects.length; i++) {
		selects.item(i).hided = true;
		selects.item(i).style.visibility = "hidden";
	}

	var mask = document.createElement("div");
	mask.onclick = function () {
		closeMessagePopup(elId);
	}
	mask.style.width = document.documentElement.clientWidth + "px";
	mask.style.height = document.documentElement.scrollHeight + "px";
	mask.style.position = 'absolute';
	mask.style.top = "0";
	mask.style.left = "0";
	mask.style.zIndex = 1000;
	mask.style.backgroundColor = "#fff";
	mask.style.opacity = "0.7";
	mask.style.filter = "alpha(opacity = 70)";
	document.getElementsByTagName("body").item(0).appendChild(mask);
	windowEl.mask = mask;
}
function closeMessagePopup(elId) {
	var windowEl = document.getElementById(elId.split("#")[1]);
	if (!windowEl)
		return true;

	var selects = parent.document.getElementsByTagName("select");
	for (i = 0; i < selects.length; i++) {
		if (selects.item(i).hided == true) {
			selects.item(i).style.visibility = "visible";
		}
	}

	windowEl.style.display = "none";
	windowEl.mask.parentNode.removeChild(windowEl.mask);
	windowEl.mask = null;
}

function boardViewContent(list, seq) {
	var titles = list.getElementsByTagName("a");
	for (i = 0; i < titles.length; i++) {
		if (titles.item(i).className != "title")
			continue;
	
		titles.item(i).list = list;
		var target_id = titles.item(i).href.split("#")[1];
		if (target_id == "review-content-" + seq) {
			var current_el = titles.item(i);
		}
		titles.item(i).row_el = document.getElementById(target_id.replace("-content", ""));
		titles.item(i).target_el = document.getElementById(target_id);
		titles.item(i).target_el.style.display = 'none';
		titles.item(i).onclick = function() {
			function show(el) {
				el.row_el.className = 'on';
				el.target_el.style.display = '';
			}
			function hide(el) {
				el.row_el.className = null;
				el.target_el.style.display = 'none';
			}
			if (!this.list.current) {
				show(this);
				this.list.current = this;
			} else if (this.list.current == this) {
				hide(this);
				this.list.current = null;
			} else {
				show(this);
				hide(this.list.current);
				this.list.current = this;
			}
			return false;
		}
	}
	if (current_el) {
		current_el.onclick();
	}
}








/**
*	메뉴 플래시 클릭 함수.

function bx_menu_click( link, arg1, arg2 ){
	alert( 'link='+link );
	location.href = link;
}
*/


// tab contents
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" on", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}


/* macromedia */
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_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_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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


/* submain */
function jsTabChange(num,leng){
	var idName
	for(var i=1;i<=leng;i++){
		var obj = document.getElementById("img-"+i);
		var obj1 = document.getElementById("boardList-"+i) ;
		if(i==num) {
			obj1.style.display = "block";
			obj.src = obj.src.replace("_off.gif", "_on.gif");
		}	else	{
			obj1.style.display = "none";
			obj.src = obj.src.replace("_on.gif", "_off.gif");
		}
	}
}


function jsTabChange2(num,leng){
	var idName
	for(var i=1;i<=leng;i++){
		var obj = document.getElementById("h2img-"+i);
		var obj1 = document.getElementById("noticeList-"+i) ;
		if(i==num) {
			obj1.style.display = "block";
			obj.src = obj.src.replace("_off.gif", "_on.gif");
		}	else	{
			obj1.style.display = "none";
			obj.src = obj.src.replace("_on.gif", "_off.gif");
		}
	}
}

/* 푸터레이어 */
function layer_show(num){
 var layer = document.getElementById("ft_policy_menu");
 layer.style.display = "block";
}
function layer_showClose(num){
 var layer = document.getElementById("ft_policy_menu");
 layer.style.display = "none";
}









/*=======================================================================================
*  파일명: flash_common.js
*
==========================================================================================*/


/**
*	flash 태그가 찍히도록 합니다.
*   GNB, LNB 등 플래시swf를 로드하는데 적합합니다.
*
*	param
*		swf:	swf 파일의 경로( ex: /pib/bank/inq/QuickInquiry.swf  or   ../inqQuickInquiry.swf )
*		width:	너비 ( px )
*		height: 높이 ( px )
*		bgcolor: 배경색 ( ex: #FFFFFF )
*		id:		<object 태그의 id값
*		flashvars:	플래시변수, 공백이어도 됩니다.
*		trans:	투명도관련변수.
*		
*/
function insertFlash(swf, width, height, bgcolor, id, flashvars,trans)
{
	//insertFlashWithVersion( swf, width, height, bgcolor, id, flashvars, trans, '8,0,0,0' );
	insertFlashWithVersion( swf, width, height, bgcolor, id, flashvars, trans, '9,0,124,0' );
}


/**
*	9버전의 플래시플레이어를 필요로하는 flash 태그가 찍히도록 합니다.
*   Flex 화면을 표시하는데는 이 함수를 써야 합니다.
*
*	param
*		위의 insertFlash() 와 동일
*
*/
function insertFlash9(swf, width, height, bgcolor, id, flashvars,trans)
{
	insertFlashWithVersion( swf, width, height, bgcolor, id, flashvars, trans, '9,0,124,0' );
}


function insertFlashWithVersion(swf, width, height, bgcolor, id, flashvars, trans, verstr)
{
	var strFlashTag = new String();

	if (navigator.appName.indexOf("Microsoft") >= 0)
	{
		strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
		strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+verstr+'" ';
		strFlashTag += 'id="' + id + '" width="' + width + '" height="' + height + '">';
		strFlashTag += '<param name="movie" value="' + swf + '"/>';

		if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
		strFlashTag += '<param name="quality" value="best"/>';
		strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
		strFlashTag += '<param name="menu" value="false"/>';
		strFlashTag += '<param name="salign" value="LT"/>';
		strFlashTag += '<param name="scale" value="noscale"/>';
		strFlashTag += '<param name="wmode" value="' + trans + '"/>';
		strFlashTag += '<param name="allowScriptAccess" value="always"/>';
		strFlashTag += '</object>';
	}
	else
	{
		strFlashTag += '<embed src="' + swf + '" ';
		strFlashTag += 'quality="best" ';
		strFlashTag += 'bgcolor="' + bgcolor + '" ';
		strFlashTag += 'width="' + width + '" ';
		strFlashTag += 'height="' + height + '" ';
		strFlashTag += 'menu="false" ';
		strFlashTag += 'scale="noscale" ';
		strFlashTag += 'id="' + id + '" ';
		strFlashTag += 'salign="LT" ';
		strFlashTag += 'wmode="' + trans + '" ';
		strFlashTag += 'allowScriptAccess="always" ';
		if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
		strFlashTag += 'type="application/x-shockwave-flash" ';
		strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
		strFlashTag += '</embed>';
	}

	document.write(strFlashTag);
	

		
		// Form Tag안에 있는 Flash는 객체 id가 없다는 에러에 대한 수정
//		var obj = document.getElementById(id);
//		document.body.appendChild(obj);
//		obj.outerHTML = "";
}



function cleanup() 
{
	__flash_unloadHandler = function(){
		externalProbSet = true;
		obj = document.getElementsByTagName('OBJECT');
		for (i=0;i<obj.length;i++){
			var theObj = eval(obj[i]);
			theObj.style.display = "none";

			try{	
				for (var prop in theObj){
					if (typeof(theObj[prop]) == "function"){
						theObj[prop]=null
					}
				}
			}catch( ignored ){}	// /com/wccom011_01s.jsp 에서 '요소가 없습니다.' 오류가 나서 묶었음.

		}
	}
	if (window.onunload != __flash_unloadHandler){
		__flash_savedUnloadHandler = window.onunload;
		window.onunload = __flash_unloadHandler;
	}
}
//window.onbeforeunload=cleanup;

/**
*	플래시 객체 얻어오기.
*/
function getFlashObject( objectid ){
	if (navigator.appName.indexOf("Microsoft") >= 0 ){	
		oFlash = window[objectid]
	}else{	
		if( navigator.appVersion.indexOf('Chrome') >= 0 ){
			oFlash = window[objectid]
		}else{
			oFlash = document[objectid]
		}
	}
	return oFlash;	
}

/**
 * 디버깅용 함수정보 alert
 */
function defaultAlert( args ){
	var fstr = String(args.callee);
	var s = fstr.substring(0, fstr.indexOf('(') );
	s += ' ('
	for( var i = 0 ; i < args.length ; i++ ){
		if( i > 0 )
			s += ',';
		s += "'"+args[i]+"'";
	}
	s += ' )'
	alert( s );
}

/**
*	메뉴 플래시 클릭 함수.
*/
function bx_menu_click( link, arg1, arg2 ){
if(arg1 == 'Y' ){
	webcheck(link);
	
	}else{	
	location.href= link ; 
      }	

}	

/**
*	서브 탑메뉴 height 조정 함수.
*/
function bx_sub_top_menu_height( h ){
//	defaultAlert( arguments );
	getFlashObject('SubTopMenu').height = h;
}

/**
*	서브 레프트 메뉴 height 조정 함수.
*/
function bx_sub_left_menu_height( h ){
//	defaultAlert( arguments );
	getFlashObject('SubLeftMenu').height = h;
}

/**
* 인터넷 창구 
* xecureSubmit 주소 분기 및 인터넷 창구 회원 함수.
*
*/

function bangkinSubmit(link){
bangkingcheck(link);
}


function goXecureSubmit(link){

document.formXe.action= link;
XecureSubmit(formXe);

}

function Kpsubmit(link){
kpcheck(link);
}
/**
* xecureLink
*
*/

function goXecureLink(arg1){


}

/**
* xecureNavigate
*
*/
function goXecureNavigate(url,feature){
XecureNavigate(url,_self,feature);
}

