/*Top °¡±â */
function fix(){
  var a = document.body.scrollTop+160;
  bar.style.top = a;
}

function golink(URL){
	document.location.href = URL;
}

/* Window open */
var aWindow = null;
function openWind(a,w,h,s) {
   if(aWindow != null){
     aWindow.close();
   }
   
   aWindow = window.open(a,"", "width="+w+",scrollbars="+s+",height="+h);
   return;
}

/* A tag Å×µÎ¸® ¾Èº¸ÀÌ°Ô */
function allblur() {
  for (i = 0; i < document.links.length; i++) {
    var obj = document.links[i];
    if(obj.addEventListener) obj.addEventListener("focus", oneblur, false);
    else if(obj.attachEvent) obj.attachEvent("onfocus", oneblur);
  }
}
 
function oneblur(e) {
  var evt = e ? e : window.event;
  if(evt.target) evt.target.blur();
  else if(evt.srcElement) evt.srcElement.blur();
}

window.onload = function(){
	allblur();
}

/* img over */
function imgRollover() {
	var imgarr     = document.getElementsByTagName('img');
	var imgSrc     = new Array();
	var imgClass   = new Array();
	
	for (i=0;i<imgarr.length;i++){
		if (imgarr[i].className.indexOf('imgclass')!=-1) {	// Å¬·¡½º³×ÀÓ¿¡ ...°¡(ÀÌ) ÀÖ´Ù¸é...
			imgSrc[i]=imgarr[i].getAttribute('src');		// ÀÌ¹ÌÁö °æ·Î¸¦ ±¸ÇØ¿Â´Ù.
			imgClass[i]=imgarr[i].className;				//imgClass ¹è¿­¿¡ Å¬·¡½º ³×ÀÓÀ» ´ëÀÔÇÑ´Ù.
			
			imgarr[i].setAttribute('xsrc', imgSrc[i]);
			
			imgarr[i].onmouseover=function(){
				this.setAttribute('src',this.className.match(/ (\S+)/)[1])
			}
			
			imgarr[i].onmouseout=function(){
				this.setAttribute('src',this.getAttribute('xsrc'))
			}
		}
	}
}


if(document.attachEvent) {
	window.attachEvent("onload",imgRollover);
	//window.attachEvent("onscroll",fix);
} else if(document.addEventListener) {
	window.addEventListener("load",imgRollover,false);
	//window.addEventListener("scroll",fix,false);
}






/*div show & hidden*/
function divdisplay(showelement, hiddenelement){
	if( hiddenelement == null ) {
		if( document.all[showelement].style.display == 'none' ){
			document.all[showelement].style.display = 'block';
		} else {
			document.all[showelement].style.display = 'none';
		}
	} else if( hiddenelement != null ) {
		if( document.all[showelement].style.display == 'none' ){
			document.all[showelement].style.display = 'block';
			document.all[hiddenelement].style.display = 'none';
		} else {
			document.all[showelement].style.display = 'block';
			document.all[hiddenelement].style.display = 'none';
		}
	}
}

function showhideDisplay(showelement, hiddenelement){
	var str = hiddenelement.split(",");
	if( document.all[showelement].style.display == 'none' ){
		document.all[showelement].style.display = 'block';
		for(i=0; i<str.length; i++){
			document.all[str[i]].style.display = 'none';
		}
	}
}

// ÇÃ·¡½¬ º¸¿©ÁÖ±â
function viewFlash(flag) {
  document.write(flag);
}


function Print_Mainflash(strSwfFileName) {
	viewFlash('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="395" height="565" id="" align="middle">');
	viewFlash('<param name="allowScriptAccess" value="sameDomain" />');
	viewFlash('<param name="movie" value="/user/img/' + strSwfFileName + '" />');
	viewFlash('<param name="quality" value="high" />');
	viewFlash('<param name="wmode" value="transparent" />');
	viewFlash('<embed src="/user/img/' + strSwfFileName + '" wmode="transparent" quality="high" bgcolor="#ffffff" width="395" height="565" name="" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	viewFlash('</object>');
}

function Print_Topmenu(strSwfFileName) {
	viewFlash('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="543" height="105" id="" align="middle">');
	viewFlash('<param name="allowScriptAccess" value="sameDomain" />');
	viewFlash('<param name="movie" value="/user/img/' + strSwfFileName + '" />');
	viewFlash('<param name="quality" value="high" />');
	viewFlash('<param name="wmode" value="transparent" />');
	viewFlash('<embed src="/user/img/' + strSwfFileName + '" wmode="transparent" quality="high" bgcolor="#ffffff" width="543" height="105" name="" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	viewFlash('</object>');
}

function Print_Mainquick(strSwfFileName) {
	viewFlash('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="543" height="90" id="" align="middle">');
	viewFlash('<param name="allowScriptAccess" value="sameDomain" />');
	viewFlash('<param name="movie" value="/user/img/' + strSwfFileName + '" />');
	viewFlash('<param name="quality" value="high" />');
	viewFlash('<param name="wmode" value="transparent" />');
	viewFlash('<embed src="/user/img/' + strSwfFileName + '" wmode="transparent" quality="high" bgcolor="#ffffff" width="543" height="90" name="" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	viewFlash('</object>');
}
