function OpenWin(url) {
 window.open(url,"lec_win",'toolbar=no,location=no,directory=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=502,height=402,background="#000000"');
}

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_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_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 allsearch()
{
	if(document.sfrm.allkey.value == "")
	{
		alert("°Ë»ö¾î¸¦ ³Ö¾îÁÖ¼¼¿ä.");
		return;
	}

	document.sfrm.submit();	
}

function goallsearch(val)
{
	if(val=="notice")
	{
		document.frm.action = "/renew/searchall/searchall_notice.asp";
	}
	else if(val=="news")
	{
		document.frm.action = "/renew/searchall/searchall_news.asp";
	}
	else if(val=="fooddb")
	{
		document.frm.action = "/renew/searchall/searchall_fooddb.asp";
	}
	else if(val=="foodworld")
	{
		document.frm.action = "/renew/searchall/searchall_foodworld.asp";
	}
	else if(val=="study")
	{
		document.frm.action = "/renew/searchall/searchall_study.asp";
	}
	else if(val=="consulting")
	{
		document.frm.action = "/renew/searchall/searchall_consulting.asp";
	}
	else if(val=="foodimall")
	{
		document.frm.action = "/renew/searchall/searchall_foodimall.asp";
	}



	document.frm.submit();
}

function writeflash(width,height,src){ 
 document.write("<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="+width+" height="+height+"><param name=movie value="+src+"><param name=quality value=high ><embed src="+src+" quality=high  pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width="+width+" height="+height+"><PARAM NAME=wmode VALUE=transparent></embed></object>");
}

// µû¶ó´Ù´Ï´Â ·¹ÀÌ¾î
function flevDivPositionValue(sDiv, sProperty) { // v2.1, Marja Ribbers-de Vroed, FlevOOware
	this.opera = (window.opera); // Opera 5+
	this.ns4 = (document.layers); // Netscape 4.x
	this.ns6 = (document.getElementById && !document.all && !this.opera); // Netscape 6+
	this.ie = (document.all);  // Internet Explorer 4+
    var sValue = ""; docObj = eval("MM_findObj('" + sDiv + "')"); if (docObj == null) {return 0;}
	if ((sProperty == "left") || (sProperty == "top")) {
		if (!this.ns4) {docObj = docObj.style;} 
		sValue = eval("docObj." + sProperty);
		if ((this.ie) && (sValue == "")) { // IE (on PC) bug with nested layers
			if (sProperty == "top") { sValue = eval(sDiv + ".offsetTop"); } 
			else { sValue = eval(sDiv + ".offsetLeft"); } 
		};
	}
	else {
		if (this.opera) {
			docObj = docObj.style;
			if (sProperty == "height") { sValue = docObj.pixelHeight; } 
			else if (sProperty == "width") { sValue = docObj.pixelWidth; } 
		}
		else if (this.ns4) {sValue = eval("docObj.clip." + sProperty);} 
		else if (this.ns6) {sValue = document.defaultView.getComputedStyle(docObj, "").getPropertyValue(sProperty); } 
	    else if (this.ie) { 
			if (sProperty == "width") { sValue = eval(sDiv + ".offsetWidth"); } 
			else if (sProperty == "height") { sValue = eval(sDiv + ".offsetHeight"); } 
		}
   	}
	sValue = (sValue == "") ? 0 : sValue; 
	if (isNaN(sValue)) { if (sValue.indexOf('px') > 0) { sValue = sValue.substring(0,sValue.indexOf('px')); } } 
	return parseInt(sValue); 
}

function flevPersistentLayer() { // v3.1, Marja Ribbers-de Vroed, FlevOOware
	if (flevPersistentLayer.arguments.length < 7) {return;}
	// gather arguments
	var sDivID = arguments[0]; if (sDivID == "") {return;}
	var	docObj = eval("MM_findObj('" + sDivID + "')"); if (docObj == null) {return;}
	if (!document.layers) {docObj = docObj.style;} // not NS4.x 
	if (docObj.tmpTimeout != null) {clearTimeout(docObj.tmpTimeout);}
	var sXLeft = arguments[1], sXCenter = arguments[2], sXRight = arguments[3];
	var sYTop = arguments[4], sYCenter = arguments[5], sYBottom = arguments[6];
	var iSpeed = (arguments.length > 7) ? parseInt(arguments[7]) : 0;
	var iPx = (arguments.length > 8) ? parseInt(arguments[8]) : 0;
	var iTimeout = 10, sSuffix = "";
	// determine current document window size and scroll position
	var iWinWidth, iWinHeight, iScrollX, iScrollY;
	if (window.innerWidth) { // NS4, NS6 and Opera
		iWinWidth = window.innerWidth;
		iWinHeight = window.innerHeight;

		iScrollX = window.pageXOffset;
		iScrollY = window.pageYOffset;
		}
	else if (document.documentElement && document.documentElement.clientWidth) { // IE6 in standards compliant mode
		iWinWidth = document.documentElement.clientWidth; 
		iWinHeight = document.documentElement.clientHeight; 
		iScrollX = document.documentElement.scrollLeft;
		iScrollY = document.documentElement.scrollTop;
		}
	else if (document.body) { // IE4+
		iWinWidth = document.body.clientWidth; 
		iWinHeight = document.body.clientHeight; 
		iScrollX = document.body.scrollLeft;
		iScrollY = document.body.scrollTop;
		}
	else {return;}
	// determine current layer position
	var iCurX = iNewX = parseInt(docObj.left), iCurY = iNewY = parseInt(docObj.top);
	// calculate new X coordinate

	// XÃàÀº ÀÌµ¿ ÇÏÁö¾Ê±â À§ÇØ ¸·¾Æ³õÀº ½ºÅ©¸³Æ®
	//if (sXLeft != "") {iNewX = iScrollX + parseInt(sXLeft);}
	//else if (sXCenter != "") {iNewX = Math.round(iScrollX + (iWinWidth/2) - (flevDivPositionValue(sDivID, 'width')/2));}
	//else if (sXRight != "") {iNewX = iScrollX + iWinWidth - (flevDivPositionValue(sDivID, 'width') + parseInt(sXRight));}

	// calculate new Y coordinate
	if (sYTop != "") {iNewY = iScrollY + parseInt(sYTop);}
	else if (sYCenter != "") {iNewY = Math.round(iScrollY + (iWinHeight/2) - (flevDivPositionValue(sDivID, 'height')/2));}
	else if (sYBottom != "") {iNewY = iScrollY + (iWinHeight - flevDivPositionValue(sDivID, 'height') - parseInt(sYBottom));}
	// force persistency?
	if ((iCurX != iNewX) || (iCurY != iNewY)) {  // layer position needs to be adjusted
		if (iSpeed > 0) { // animated move
			if (iPx > 0) { // constant speed
				iTimeout = iSpeed;
				var iPxX = iPx, iPxY = iPx, iMoveX = Math.abs(iCurX - iNewX), iMoveY = Math.abs(iCurY - iNewY);
				// take care of diagonal movement
				if (iMoveX < iMoveY) {iPxY = (iMoveX != 0) ? ((iMoveY/iMoveX)*iPx) : iPx;}
				else {iPxX = (iMoveY != 0) ? ((iMoveX/iMoveY)*iPx) : iPx;}
				if (iPxX >= iMoveX) {iPxX = Math.min(Math.ceil(iPxX), iPx);}
				if (iPxY >= iMoveY) {iPxY = Math.min(Math.ceil(iPxY), iPx);}
				// calculate temporary X/Y coordinates
				if ((iCurX < iNewX) && (iCurX + iPxX < iNewX)) {iNewX = iCurX + iPxX;}
				if ((iCurX > iNewX) && (iCurX - iPxX > iNewX)) {iNewX = iCurX - iPxX;}
				if ((iCurY < iNewY) && (iCurY + iPxY < iNewY)) {iNewY = iCurY + iPxY;}
				if ((iCurY > iNewY) && (iCurY - iPxY > iNewY)) {iNewY = iCurY - iPxY;}
			}
			else { // gradually decreasing speed
				var iMoveX = ((iNewX - iCurX) / iSpeed); 
				iMoveX = (iMoveX > 0) ? Math.ceil(iMoveX) : Math.floor(iMoveX);
				iNewX = iCurX + iMoveX; 
				var iMoveY = ((iNewY - iCurY) / iSpeed); 
				iMoveY = (iMoveY > 0) ? Math.ceil(iMoveY) : Math.floor(iMoveY);
				iNewY = iCurY + iMoveY;
			}
		}
		// now actually move layer
		if ((parseInt(navigator.appVersion)>4 || navigator.userAgent.indexOf("MSIE")>-1) && (!window.opera)) {sSuffix="px";}
		if (iMoveX != 0) {eval("docObj.left = '" + iNewX + sSuffix + "'");}
		if (iMoveY != 0) {eval("docObj.top = '" + iNewY + sSuffix + "'");}
	}
	var sFunction = "flevPersistentLayer('" + sDivID + "','" + sXLeft + "','" + sXCenter + "','" + sXRight + "','" + sYTop + "','" + sYCenter + "','" + sYBottom + "'," + iSpeed + "," + iPx + ")";
	//if(typeof(docObj.tmpTimeout) != 'undefined')
		docObj.tmpTimeout = setTimeout(sFunction,10);
}

function flevInitPersistentLayer() { // v3.0, Marja Ribbers-de Vroed, FlevOOware
	if (arguments.length < 8) {return;}
	// gather arguments
	var sDivID = arguments[0]; if (sDivID == "") {return;}
	var	docObj = eval("MM_findObj('" + sDivID + "')"); if (docObj == null) {return;}
	var iCSS = parseInt(arguments[1]);
	var sXLeft = arguments[2], sXCenter = arguments[3], sXRight = arguments[4];
	var sYTop = arguments[5], sYCenter = arguments[6], sYBottom = arguments[7];
	var iSpeed = (arguments.length > 8) ? parseInt(arguments[8]) : 0;
	var iPx = (arguments.length > 9) ? parseInt(arguments[9]) : 0;
	// Position according to CSS style?
	if (iCSS != 0) { // maintain top/left position specified by CSS style
		if (!document.layers) {docObj = docObj.style;} // not NS4.x 
		sXLeft = parseInt(docObj.left), sYTop = parseInt(docObj.top);
	}
	var sFunction = "flevPersistentLayer('" + sDivID + "','" + sXLeft + "','" + sXCenter + "','" + sXRight + "','" + sYTop + "','" + sYCenter + "','" + sYBottom + "'," + iSpeed + "," + iPx + ")";
	eval(sFunction);
}


