function __ws__(id)
{
document.write(id.innerHTML); id.id="";
}


/* ie 6.0 background »ç¿ë½Ã flicker Çö»ó ¹æÁö */
try {
  document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

// »ó´ÜÀ¸·Î Æ÷Ä¿½Ì
function pageUp()
{
	document.body.scrollTop = 0 ;
}

function goTop(orix,oriy,desx,desy) {
	var Timer;
	var winHeight = document.body.scrollTop;
	if(Timer) clearTimeout(Timer);
	startx = 0;
	starty = winHeight;
	if(!orix || orix < 0) orix = 0;
	if(!oriy || oriy < 0) oriy = 0;
	var speed = 7;
	if(!desx) desx = 0 + startx;
	if(!desy) desy = 0 + starty;
	desx += (orix - startx) / speed;
	if (desx < 0) desx = 0;
	desy += (oriy - starty) / speed;
	if (desy < 0) desy = 0;
	var posX = Math.ceil(desx);
	var posY = Math.ceil(desy);
	window.scrollTo(posX, posY);
	if((Math.floor(Math.abs(startx - orix)) < 1) && (Math.floor(Math.abs(starty - oriy)) < 1)){
		clearTimeout(Timer);
		window.scroll(orix,oriy);
	}else if(posX != orix || posY != oriy){
		Timer = setTimeout("goTop("+orix+","+oriy+","+desx+","+desy+")",15);
	}else{
		clearTimeout(Timer);
	}
}

/**
 * TOP ¹è³Ê ½ºÅ©¸³Æ®
 */
var stmnLEFT = 966; // ½ºÅ©·Ñ¸Þ´ºÀÇ ÁÂÃø À§Ä¡
var stmnGAP1 = 248; // ÆäÀÌÁö Çì´õºÎºÐÀÇ ¿©¹é (ÀÌº¸´Ù À§·Î´Â ¿Ã¶ó°¡Áö ¾ÊÀ½)
var stmnGAP2 = 0; // ½ºÅ©·Ñ½Ã ºê¶ó¿ìÀú »ó´Ü°ú ¾à°£ ¶ç¿ò. ÇÊ¿ä¾øÀ¸¸é 0À¸·Î ¼¼ÆÃ
var stmnBASE = 600; // ½ºÅ©·Ñ¸Þ´º ÃÊ±â ½ÃÀÛÀ§Ä¡ (¾Æ¹«·¸°Ô³ª ÇØµµ »ó°üÀº ¾øÁö¸¸ stmnGAP1°ú ¾à°£ Â÷ÀÌ¸¦ ÁÖ´Â°Ô º¸±â ÁÁÀ½)
var stmnActivateSpeed = 10; // ¿òÁ÷ÀÓÀ» °¨ÁöÇÏ´Â ¼Óµµ (¼ýÀÚ°¡ Å¬¼ö·Ï ´Ê°Ô ¾Ë¾ÆÂ÷¸²)
var stmnScrollSpeed = 5; // ½ºÅ©·ÑµÇ´Â ¼Óµµ (Å¬¼ö·Ï ´Ê°Ô ¿òÁ÷ÀÓ)
function Refreshdiv_top()
{
  var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;

  stmnStartPoint = parseInt(div_top.style.top, 10);
  stmnEndPoint = document.body.scrollTop + document.body.clientHeight-435; // ³ôÀÌ°¡ ³ôÀº¸Þ´ºÀÌ¸é -µÇ´Â °ªÀ» Áõ°¡½ÃÅ°¼¼¿ä
  if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;

  if ( stmnStartPoint != stmnEndPoint ) {
    stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
    div_top.style.top = parseInt(div_top.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
    stmnRefreshTimer = stmnScrollSpeed;
  }
         else {
    stmnRefreshTimer = stmnActivateSpeed;
  }

  setTimeout ("Refreshdiv_top();", stmnRefreshTimer);
}

function Initializediv_top()
{

  div_top.style.top =document.body.scrollTop - stmnBASE;
  Refreshdiv_top();
  div_top.style.left = stmnLEFT;
}

/**
 * ¿ÞÂÊ¸Þ´º ÆîÄ§±â´É */

var old_menu ="";
function menuLeft(submenu) {
    if(old_menu != submenu) {
	    if(old_menu !=""){
	        old_menu.style.display="none";
		}
	    submenu.style.display="block";
	    old_menu = submenu;
    }else{
        submenu.style.display="none";
        old_menu="";
    }
}


/**
 * ½ºÅ©·¦
*/
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_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; }
}

/**
* iframe ¸®»çÀÌÁî
*/
function boardIframeResize()
{
	if (window.navigator.appName.indexOf("Explorer") < 0){	
		try{
		resizeIfr(parent.document.all["scienceallboard"],10);	
	}catch(ee){ }	
	}else{	
	if (parent.document.all["scienceallboard"])
		parent.document.all["scienceallboard"].style.height = document.body.scrollHeight;
	}
}
function iframeResize(framename)
{
	if (window.navigator.appName.indexOf("Explorer") < 0){	
		//resizeIfr(parent.document.all[framename],10);	
		try{
		resizeIfr(parent.document.getElementById(framename),10);	
		}catch(ee){   }	
	}else{	
	if (parent.document.all[framename])
		parent.document.all[framename].style.height = document.body.scrollHeight;
	}
}


function resizeIfr(obj, minHeight) {
	minHeight = minHeight || 10;
	try {
		var getHeightByElement = function(body) {
			var last = body.lastChild;
			try {
				while (last && last.nodeType != 1 || !last.offsetTop) last = last.previousSibling;
				return last.offsetTop+last.offsetHeight;
			} catch(e) {
				return 0;
			}

		}

		var doc = obj.contentDocument || obj.contentWindow.document;
		if (doc.location.href == 'about:blank') {
			obj.style.height = minHeight+'px';
			return;
		}

		//var h = Math.max(doc.body.scrollHeight,getHeightByElement(doc.body));
		//var h = doc.body.scrollHeight;
		if (/MSIE/.test(navigator.userAgent)) {
			var h = doc.body.scrollHeight;
			// ie8¿¡¼± ie7°ú ºñ±³½Ã ¾à 15px ´õ Àû°Ô °ªÀÌ Àû¿ëµÊ. if(window.JSON) h+=15;
		} else {
			var s = doc.body.appendChild(document.createElement('DIV'))
			s.style.clear = 'both';

			var h = s.offsetTop;
			s.parentNode.removeChild(s);
		}

		//if (/MSIE/.test(navigator.userAgent)) h += doc.body.offsetHeight - doc.body.clientHeight;
		if (h < minHeight) h = minHeight;

		obj.style.height = h + 'px';
		if (typeof resizeIfr.check == 'undefined') resizeIfr.check = 0;
		if (typeof obj._check == 'undefined') obj._check = 0;

		if (obj._check < 5) {
			obj._check++;
			//setTimeout(function(){ resizeIfr(obj,minHeight) }, 200); // check 5 times for IE bug
		} else {
			obj._check = 0;
		}
	} catch (e) {
		//alert(e);
	}
}

//°Ô½Ã¹°¿¡¼­ ³»¿ë ÀÌ¹ÌÁö ¸®»çÀÌÁî ½ÃÅ°±â
function img_resize(size){
	var fix_w = 615;
	if(size > 0)
		fix_w = size;
	var pre_img = document.all["upImg"];
	if(pre_img){
		if(pre_img.width>fix_w){
			pre_img.height = parseInt((fix_w * pre_img.height) / pre_img.width);
			pre_img.width=fix_w;
		}
		for(var i = 0;i<pre_img.length;i++){
			if(pre_img[i].width>fix_w){
				pre_img[i].height = parseInt((fix_w * pre_img[i].height) / pre_img[i].width);
				pre_img[i].width=fix_w;
			}
		}
	}

	pre_img = document.all["ThumbnailImg"];
	var fix_h = 82;
	if(pre_img){
		if(pre_img.height>fix_h){
			pre_img.width = parseInt((fix_h * pre_img.width) / pre_img.height);
			pre_img.height=fix_h;
		//	alert(pre_img.height);
		}
		for(var i = 0;i<pre_img.length;i++){
			if(pre_img[i].height>fix_h){
				pre_img[i].width = parseInt((fix_h * pre_img[i].width) / pre_img[i].height);
				pre_img[i].height=fix_h;
		//		alert(pre_img[i].height);
			}
		}
	}
}
function eolasview(obj) {
	document.write(obj);
}



/*
	2008.12.19 ÀÌº¥Æ®¸¦ À§ÇÑ ¼³Á¤ ½ÃÀÛ
	ÀÌº¥Æ®°¡ Á¾·ùµÇ¸é ¾ø¾îÁ®µµ µÊ.
*/

var evtAffairViewCnt = 0;
var evtAffairView = new Array();
evtAffairView[0] = {targetUrl:'/sa_frontier/knowledge.sca?todo=NskView&seqno=3320', targetTitle:'[½ÉÃþ±âÈ¹] ±âÈÄº¯È­ È¸ÀÇ·ÐÀÚÀÇ ÁÖÀå°ú ¹Ý¹Ú 10°¡Áö'};
evtAffairView[1] = {targetUrl:'/sa_frontier/knowledge.sca?todo=NskView&seqno=3310', targetTitle:'[½ÉÃþ±âÈ¹] ¹°°ú °Ç°­'};
evtAffairView[2] = {targetUrl:'/sa_frontier/knowledge.sca?todo=NskView&seqno=3309', targetTitle:'[½ÉÃþ±âÈ¹] ¿ÀÀÏÇÁ¸®, »ï¼è¼¶À» ¾Æ´Â°¡'};
evtAffairView[3] = {targetUrl:'/sa_frontier/knowledge.sca?todo=NskView&seqno=3313', targetTitle:'[½ÉÃþ±âÈ¹] GM ½ÄÇ°, °ú¿¬ ¾ÈÀüÇÑ°¡? '};
evtAffairView[4] = {targetUrl:'/sa_frontier/knowledge.sca?todo=NskView&seqno=3092', targetTitle:'[½ÉÃþ±âÈ¹] º´¿øÃ¼, ¾î¶»°Ô ´ëÀÀÇÒ °ÍÀÎ°¡?'};

function goAffairDepthForEvt(id) {
	var frm = document.f;

	var orgTodo = frm.todo.value;
	var orgAction = frm.action;

	frm.target = '_blank';
	frm.action = 'http://www.scienceall.com/sa_etc/issue.sca#affairViewMiddle';
	frm.todo.value = 'affairDepthPage';
	frm.isAffairView.value = 'Y';

	frm.viewUrl.value = evtAffairView[id].targetUrl;
	frm.viewTitle.value = evtAffairView[id].targetTitle;


	if(document.getElementById('evtAppCheck' + id).checked == false) {
		document.getElementById('evtAppCheck' + id).checked = true;
	}

	evtAffairViewCnt++;

	frm.submit();

	frm.action = orgAction;

	frm.todo.value = orgTodo;
	frm.target = '';
}

function openEvtSerial() {
	if(evtAffairViewCnt < 2) {
		alert('Áö±¸¸¦ ÁöÅ°´Â ´Ù¼¸ °¡Áö Å×¸¶ Áß 2°³ ÀÌ»óÀÇ Story¸¦ ÀÐ¾îÁÖ¼¼¿ä.');
		return;
	}

	goEvent('http://www.scienceall.com/openevent.sca?todo=evtSerialForm&chasu=1', 'openEvtSerial', 429, 410, 'no');

	//windowOpen('http://www.scienceall.com/openevent.sca?todo=evtSerialForm&chasu=1', 'openEvtSerial', 429, 410, ',scrollbars=no ,personalbar=no ,resizable=no ,directories=no ,status=no ,menubar=no');
}
/*
	2008.12.19 ÀÌº¥Æ®¸¦ À§ÇÑ ¼³Á¤ ³¡
*/



var evtAffairViewCnt2 = 0;
var evtAffairView2 = new Array();
evtAffairView2[0] = {targetUrl:'/sa_frontier/knowledge.sca?todo=NskView&seqno=3424', targetTitle:'[±âÈÄº¯È­] ¼ÒÀÇ ¸ÞÅºÆ®¸²ÀÌ Áö±¸¿Â³­È­¸¦ ÀÏÀ¸Å²´Ù°í?'};
evtAffairView2[1] = {targetUrl:'/sa_frontier/knowledge.sca?todo=NskView&seqno=3339', targetTitle:'[¹°] ³²±Ø ºù»êÀ» »ç¿ìµð¾Æ¶óºñ¾Æ±îÁö ¿î¹ÝÇÏ´Â ¹æ¹ýÀº?'};
evtAffairView2[2] = {targetUrl:'/sa_frontier/knowledge.sca?todo=NskView&seqno=3464', targetTitle:'[¿¡³ÊÁö] ¿¡³ÊÁö ¼öÈ®, ÁØºñµÆ³ª¿ä?'};
evtAffairView2[3] = {targetUrl:'/sa_frontier/knowledge.sca?todo=NskView&seqno=3395', targetTitle:'[½Ä·®] ÀÎ±¸¿Í ½Ä·®ÀÇ ºÒ¾ÈÇÑ ¾ù¹ÚÀÚ '};
evtAffairView2[4] = {targetUrl:'/sa_frontier/knowledge.sca?todo=NskView&seqno=3193', targetTitle:'[Áúº´] ¾Ë·¹¸£±â¸¦ ÇâÇÑ »ý¹°ÇÐÀû ½Ã¼±'};

function goAffairDepthForEvt2(id) {
	var frm = document.f;

	var orgTodo = frm.todo.value;
	var orgAction = frm.action;

	frm.target = '_blank';
	frm.action = 'http://www.scienceall.com/sa_etc/issue.sca#affairViewMiddle';
	frm.todo.value = 'affairDepthPage';
	frm.isAffairView.value = 'Y';

	frm.viewUrl.value = evtAffairView2[id].targetUrl;
	frm.viewTitle.value = evtAffairView2[id].targetTitle;


	if(document.getElementById('evtAppCheck' + id).checked == false) {
		document.getElementById('evtAppCheck' + id).checked = true;
	}

	evtAffairViewCnt2++;

	frm.submit();

	frm.action = orgAction;

	frm.todo.value = orgTodo;
	frm.target = '';
}

function openEvtSerial2() {
	if(evtAffairViewCnt2 < 2) {
		alert('Áö±¸ ±¸Ãâ ´Ù¼¸ °¡Áö Å×¸¶ Áß 2°³ ÀÌ»óÀÇ Story¸¦ ÀÐ¾îÁÖ¼¼¿ä.');
		return;
	}

	goEvent('http://www.scienceall.com/openevent.sca?todo=evtSerialForm&chasu=2', 'openEvtSerial', 450, 425, 'no');

	//windowOpen('http://www.scienceall.com/openevent.sca?todo=evtSerialForm&chasu=1', 'openEvtSerial', 450, 425, ',scrollbars=no ,personalbar=no ,resizable=no ,directories=no ,status=no ,menubar=no');
}

function pollEvtPop(){
	javascript:windowOpen('/main0708/main.htm','pollevtPop',width=1000,height=648,'scrollbars=no');
}