
//***** ÀÌ¹ÌÁö³ª ¸µÅ©½Ã ¹ß»ýÇÏ´Â Á¡¼±Å×µÎ¸® ¾ø¾Ö±â *****
function allblur() {
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
}
document.onfocusin = allblur;


// title = "¾ÆÁÖ¹Ì¼ú°üÀº Ç×»ó ¿©·¯ºÐ °ç¿¡ ÀÖ½À´Ï´Ù";	//ÆäÀÌÁö Å¸ÀÌÆ²



// ÇÃ·¡½Ã
function setEmbed() {
	var obj = new String;
	var parameter = new String;
	var embed = new String;
	var html = new String;
	var allParameter = new String;
	var clsid = new String;
	var codebase = new String;
	var pluginspace = new String;
	var embedType = new String;
	var src = new String;
	var width = new String;
	var height = new String;

	this.init = function( getType , s ,w , h ) {
		if ( getType == "flash" ) {
			clsid = "D27CDB6E-AE6D-11cf-96B8-444553540000";
			codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0";
			pluginspage = "http://www.macromedia.com/go/getflashplayer";
			embedType = "application/x-shockwave-flash";
		}
		/* type Ãß°¡
		else if ( ) {
		}
		*/
		parameter += "<param name='movie' value='"+ s + "'>\n";
		parameter += "<param name='quality' value='high'>\n";

		src = s;
		width = w;
		height = h;
	}

	this.parameter = function( parm , value ) {
		parameter += "<param name='"+parm +"' value='"+ value + "'>\n";
		allParameter += " "+parm + "='"+ value+"'";
	}

	this.show = function() {
		if ( clsid ) {
			obj = "<object classid=\"clsid:"+ clsid +"\" codebase=\""+ codebase +"\" width='"+ width +"' height='"+ height +"'>\n";
		}

		embed = "<embed src='" + src + "' pluginspage='"+ pluginspage + "' type='"+ embedType + "' width='"+ width + "' height='"+ height +"'"+ allParameter +" ></embed>\n";

		if ( obj ) {
			embed += "</object>\n";
		}

		html = obj + parameter + embed;

		document.write( html );
	}
}


//***** ±Û·Î¹ú ¸Þ´º¸µÅ© *****
function winOpen(num) {
   
  var path="/web/";
   if(num == 000) {								// ¸ÞÀÎ
      document.location.href = "/index.php?pageNum=" + num;
   }

   if(num == 100) {								// Àü½Ã¾È³»
      document.location.href = "/exhibition/sub01.php?pageNum=" + num +"&contents=contents_201004";
   }
		if(num == 110) {					    // ÇöÀçÀü½Ã
		document.location.href ="/exhibition/sub01.php?pageNum=" + num +"&contents=contents_201004";
		}
		if(num == 120) {					    // ¿¹Á¤Àü½Ã
		document.location.href ="/exhibition/sub02.php?pageNum=" + num;
		}
		if(num == 130) {					    // Áö³­Àü½Ã
		document.location.href ="/exhibition/sub03.php?pageNum=" + num +"&mode=list";
		}

   if(num == 200) {								// ¼ÒÀåÀÛÇ°
      document.location.href ="/board/gallery.php?pageNum=" + num +"&board_Type=collection";
   }
		if(num == 210) {					    // ¼ÒÀåÀÛÇ°
		document.location.href ="/board/gallery.php?pageNum=" + num +"&board_Type=collection";
		}

   if(num == 300) {								// ±³À°¹®È­
      document.location.href ="/academy/sub01.php?pageNum=" + num +"&programID=kids2010&mode=view&contents=kids2010_2";
   }
		if(num == 310) {					    // ±³À°ÇÁ·Î±×·¥
		document.location.href ="/academy/sub01.php?pageNum=" + num +"&programID=kids2010&mode=view&contents=kids2010_2";
		}
		if(num == 320) {					    // ¹®È­Çà»ç
		document.location.href ="/academy/sub02.php?pageNum=" + num +"&programID=event2010&mode=list";
		}
		if(num == 330) {					    // Æ÷Åä°¶·¯¸®
		document.location.href ="/board/gallery.php?pageNum=" + num +"&board_Type=gallery";
		}

   if(num == 400) {								// ¹Ì¼ú°ü¼Ò½Ä
      document.location.href ="/board/list.php?pageNum=" + num +"&board_Type=notice";
   }
		if(num == 410) {					    // °øÁö»çÇ×
		document.location.href ="/board/list.php?pageNum=" + num +"&board_Type=notice";
		}
		if(num == 420) {					    // º¸µµÀÚ·á
		document.location.href ="/board/list.php?pageNum=" + num +"&board_Type=prnews";
		}
		if(num == 430) {					    // ´º½º·¹ÅÍ
		document.location.href ="/board/list.php?pageNum=" + num +"&board_Type=newsletter";
		}

   if(num == 500) {								// °ü¶÷¹®ÀÇ
      document.location.href ="/board/list.php?pageNum=520&board_Type=freeboard";
   }
		if(num == 510) {					    // ÀÚÁÖ¹¯´ÂÁú¹®
		document.location.href ="/board/faq.php?pageNum=" + num +"&board_Type=faq";
		}
		if(num == 520) {					    // ÀÚÀ¯°Ô½ÃÆÇ
		document.location.href ="/board/list.php?pageNum=" + num +"&board_Type=freeboard";
		}
		if(num == 530) {					    // Æ÷ÅäÁ¦´Ð
		document.location.href ="/board/gallery.php?pageNum=" + num +"&board_Type=photogenic";
		}

   if(num == 600) {								// ¹Ì¼ú°ü¼Ò°³
      document.location.href ="/asiamuseum/sub01.php?pageNum=" + num;
   }
		if(num == 610) {					    // È¯¿µÀÎ»ç¸»
		document.location.href ="/asiamuseum/sub01.php?pageNum=" + num;
		}
		if(num == 620) {					    // °ü¶÷¾È³»
		document.location.href ="/asiamuseum/sub02.php?pageNum=" + num;
		}
		if(num == 630) {					    // ºÎ´ë½Ã¼³
		document.location.href ="/asiamuseum/sub03.php?pageNum=" + num;
		}
		if(num == 640) {					    // Ã£¾Æ¿À½Ã´Â ±æ
		document.location.href ="/asiamuseum/sub04.php?pageNum=" + num;
		}
   if(num == 700) {								// ¹Ì¼ú°ü¼Ò°³
      //window.open("/exhibition/sub02_1.php", "exhibition", 'width=678,height=660,left=0,top=0,alwaysraised=yes,dependent=yes,scrollbars=yes');
      window.open("http://www.frescoart.co.kr/", "exhibition", '');
   }
}




// scrolling layer
function initMoving(target, position, topLimit, btmLimit) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = position;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;

	if (typeof(window.pageYOffset) == "number") {
		obj.getTop = function() {
			return window.pageYOffset;
		}
	} else if (typeof(document.documentElement.scrollTop) == "number") {
		obj.getTop = function() {
			return document.documentElement.scrollTop;
		}
	} else {
		obj.getTop = function() {
			return 0;
		}
	}

	if (self.innerHeight) {
		obj.getHeight = function() {
			return self.innerHeight;
		}
	} else if(document.documentElement.clientHeight) {
		obj.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	} else {
		obj.getHeight = function() {
			return 650;
		}
	}

	obj.move = setInterval(function() {
		if (obj.initTop > 0) {
			pos = obj.getTop() + obj.initTop;
		} else {
			pos = obj.getTop() + obj.getHeight() + obj.initTop;
			//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		}

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit;
		if (pos < obj.topLimit)
			pos = obj.topLimit;

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 30)
}
//scrolling layer end


/* topBtn ¸ÞÀÎÁ¦¾î */
function topBtnView(){
	if(document.body.id=="main"){
		document.getElementById("quickArea").style.display="none";
	}else{
		initMoving(document.getElementById("quickArea"), -155, 0, 75);
	}
}



// ¸¶¿ì½º¿À¹ö¾Æ¿ô
function imgOver(imgEl) { imgEl.src = imgEl.src.replace(".gif", "_on.gif"); }
function imgOut(imgEl) { imgEl.src = imgEl.src.replace("_on.gif", ".gif"); }
