	/**
* Inven Ad Output Function for Nitmus
*/
// ÃÊ±âÈ­
	var INVEN = window.INVEN || {};
	INVEN.Ad = window.INVEN.Ad || {};
	INVEN.Ad.site = window.INVEN.Ad.site || '';
	INVEN.Ad.applySectionList = window.INVEN.Ad.applySectionList || new Array();
	INVEN.Ad.applyRollingList = window.INVEN.Ad.applyRollingList || new Array();

// ¼³Á¤°ª
	INVEN.Ad.tiMode = 'iframe'; // copy (º¹»ç¹æ½Ä), iframe (IFRAME ³ëÃâ)

// »çÀÌÆ® ¼³Á¤
	INVEN.Ad.setSite = function(site) {
		INVEN.Ad.site = site;
	}

// ±¤°í ±×·ì
	INVEN.Ad.changeSection = function(posNum, site) {
		switch (site+"@"+posNum) {
			case "tera@300x300":
				result_site = "none";
				break;
			case "webzine@80x150":
				result_site = site;
				break;
			default:
				result_site = "all";
		}
		//Áß´Ü Á¦°Å
			//if (posNum == "300x70") { result_site = "none"; }

		if (INVEN.Ad.applySectionList) {
			var n = INVEN.Ad.applySectionList.length;
			for (var i = 0; i < n ; i++) {
				result_site = INVEN.Ad.applySectionList[i](posNum, site, result_site);
			}
		}
		return result_site;
	}

// ·Ñ¸µ È½¼ö °è»ê
	INVEN.Ad.getRollingCount = function(posNum) {
		var site = INVEN.Ad.site;
		var rollingCount = 7; // "n" ÀÌ¸é °íÁ¤
		switch (posNum) {
			//case 'TopLeft': rollingCount = 30; break;
			//case 'TopRight': rollingCount = 8; break;
			//case 'Sky': rollingCount = 8; break;
			//case 'MidLeft': rollingCount = 20; break;
			//case 'MidRight': rollingCount = 20; break;
			//case 'Slide': rollingCount = 5; break;
			case 'Ti': rollingCount = 3; break;
		}
		/*
		switch (site+"@"+posNum) {
			case "aion@248x88":
				rollingCount = 2;
				break;
		}
		switch (site) {
			case '_____mhf':
				rollingCount = 2;
				break;
		}
		*/
		if (INVEN.Ad.Env && INVEN.Ad.Env.BaseRolling) {
			switch (posNum) {
				case 'TopLeft': rollingCount = INVEN.Ad.Env.BaseRolling.TopLeft || rollingCount; break;
				case 'TopRight': rollingCount = INVEN.Ad.Env.BaseRolling.TopRight || rollingCount; break;
				case 'Sky': rollingCount = INVEN.Ad.Env.BaseRolling.Sky || rollingCount; break;
				case 'MidLeft': rollingCount = INVEN.Ad.Env.BaseRolling.MidLeft || rollingCount; break;
				case 'MidRight': rollingCount = INVEN.Ad.Env.BaseRolling.MidRight || rollingCount; break;
				case 'Slide': rollingCount = INVEN.Ad.Env.BaseRolling.Slide || rollingCount; break;
				case 'Ti': rollingCount = INVEN.Ad.Env.BaseRolling.Ti || rollingCount; break;
			}
		}
		if (INVEN.Ad.applyRollingList) {
			var n = INVEN.Ad.applyRollingList.length;
			for (var i = 0; i < n ; i++) {
				rollingCount = INVEN.Ad.applyRollingList[i](posNum, site, rollingCount);
			}
		}
		return rollingCount;
	}

// ÆäÀÌÁö Á¾·ù °è»ê
	INVEN.Ad.getBodyType = function() {
		var obj = document.body;
		var cname = "b800";
		if ((obj.className.search(new RegExp("^"+cname+"|"+cname+"$","g")) > -1) || (obj.className.search(new RegExp(" "+cname+" ","g")) > -1)) {
			return 1;
		} else {
			return 2;
		}
	}
// ³ëÃâ¿©ºÎ °è»ê
	INVEN.Ad.isPrint = function(pos) {
		var obj = document.body;
		var cname = 'bAd' + pos + 'Hide';
			return true; //¸ù¶¥ ³ª¿À°Ô
		if ((obj.className.search(new RegExp("^"+cname+"|"+cname+"$","g")) > -1) || (obj.className.search(new RegExp(" "+cname+" ","g")) > -1)) {
			return false;
		} else {
			return true;
		}
	}

// »ó´ÜÁÂÃø
	// type : 1 (Main), 2 (Sub), 3(Popup)
	INVEN.Ad.showTopLeft = function(site, type) {
		if (INVEN.Ad.isPrint('Top')) {
			if (!type) { type = INVEN.Ad.getBodyType(); }
			switch (type) {
				case 1: // Main
					site = INVEN.Ad.changeSection("248x88", site);
					document.write ("<iframe id=\"comAdTopLeft\" name=\"comAdTopLeft\" src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@248x88' width='248' height='88' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe>");
					break;
				case 2:  // Sub
					site = INVEN.Ad.changeSection("248x88", site);
					document.write ("<iframe id=\"comAdTopLeft\" name=\"comAdTopLeft\" src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@248x88' width='248' height='88' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe>");
					break;
			}
		}
	}

// »ó´Ü¿ìÃø
	// type : 1 (Main), 2 (Sub), 3(Popup)
	INVEN.Ad.showTopRight = function(site, type) {
		if (INVEN.Ad.isPrint('Top')) {
			if (!type) { type = INVEN.Ad.getBodyType(); }
			switch (type) {
				case 1: // Main
					site = INVEN.Ad.changeSection("538x88", site);
					document.write ("<iframe id=\"comAdTopRight\" name=\"comAdTopRight\" src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@538x88' width='548' height='88' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe>");
					break;
				case 2:  // Sub
					site = INVEN.Ad.changeSection("663x88", site);
					document.write ("<iframe id=\"comAdTopRight\" name=\"comAdTopRight\" src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@663x88' width='663' height='88' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe>");
					break;
			}
		}
	}

// ¤¡ÀÚ ±¤°í
	INVEN.Ad.showSky = function(site) {
		site = INVEN.Ad.changeSection("120x180", site);
		document.write("<iframe id=\"comAdSky\" name=\"comAdSky\" src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@120x180' width='120' height='180' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe>");
	}

// Äü¸µÅ© ±¤°í
	INVEN.Ad.showQuick = function(site) {
		site = INVEN.Ad.changeSection("120x120", site);
		document.write("<iframe id=\"comAdQuick\" name=\"comAdQuick\" src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@120x120' width='120' height='120' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe>");
	}

// ½½¶óÀÌµå ±¤°í
	INVEN.Ad.showSlide = function(site, type, sliding) {
		site = INVEN.Ad.changeSection("80x150", site);
		document.write("<iframe id=\"comAdSlide\" name=\"comAdSlide\" src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@80x150' width='80' height='150' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0' style='left:0px;top:0px;' allowTransparency='true'></iframe>");
		if (sliding) {
			INVEN.FloatStatic.addFloat("comAdSlide", false, true, 0, 0);
		}
	}

// Áß´Ü ÁÂÃø ±¤°í
	INVEN.Ad.showMidLeft = function(site) {
		site = INVEN.Ad.changeSection("300x70", site);
		document.write("<iframe id=\"comAdMidLeft\" name=\"comAdMidLeft\" src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@300x70L' width='300' height='70' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe>");
		if (site == "none") {
			var tempName = INVEN.Ad.site + 'AdMidLeft';
			getObj(tempName).parentNode.style.visibility = "hidden";
			getObj(tempName).parentNode.style.position = "absolute";
		}
	}

// Áß´Ü ¿ìÃø ±¤°í
	INVEN.Ad.showMidRight = function(site) {
		site = INVEN.Ad.changeSection("300x70", site);
		document.write("<iframe id=\"comAdMidRight\" name=\"comAdMidRight\" src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@300x70R' width='300' height='70' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe>");
	}

// ·Î±×ÀÎÆäÀÌÁö ±¤°í (220x270)
	INVEN.Ad.showLogin = function(site) {
		site = INVEN.Ad.changeSection("220x270", site);
		document.write ("<iframe id=\"comAdLogin\" name=\"comAdLogin\" ='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@220x270' width='220' height='270' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0' style='background : url(http://img.inven.co.kr/image/board/outlogin/common/inven2.gif) left top no-repeat;'></iframe>");
	}

// ¸ÞÀÎÈ®Àå ±¤°í (½ºÅ©¸³Æ®±¤°í¿ë ¸¶¿ì½º / ºê·£µù¹Ù)
	// ±¤°í »ç¿ëµÉ°æ¿ì¸¸ Àû¿ë.
	INVEN.Ad.showExtra = function(site) {
	//	if (getCookie("extra_ad") != "close") {
	//		site = INVEN.Ad.changeSection("ext", site);
	//		document.write ("<scr"+"ipt language='javascript' src='http://ad.inven.co.kr/NetInsight/js/inven/"+site+"/main@ext'></scr"+"ipt>");
	//	}
	}
	INVEN.Ad.closeExtra = function() {
		if (getCookie("extra_ad") != "close") {
			setCookie("extra_ad", "close", 6);
		}
	}


// TI °ü·Ã
	INVEN.Ad.tiDisabled = window.INVEN.Ad.tiDisabled || false;

	INVEN.Ad.showTi = function(site) {
		document.domain = "inven.co.kr";
		if (getCookie("floating_ad") != "close") {
			site = INVEN.Ad.changeSection("300x300", site);
			if (site == "none") return;
			if (INVEN.Ad.tiMode == "copy") {
				document.write('<div id="comAdTi"></div>');
				document.write('<iframe id="comAdTiFrame" name="comAdTiFrame" src="http://www.inven.co.kr/ad/adpage/ti_iframe_090720a.html?'+site+'" style="display:none;"></iframe>');
			} else {
				document.write('<iframe id="comAdTi" name="comAdTi" src="http://www.inven.co.kr/ad/adpage/ti_iframe_090720a.html?'+site+'" allowTransparency="true" frameborder="0" scrolling="no" ></iframe>');
			}

			INVEN.Ad.objTi = document.getElementById("comAdTi");
			INVEN.Ad.reposTi(300,300,0,0);
		}
	}

	INVEN.Ad.displayTi = function(value) {
		if (value) {
			if ((getCookie("floating_ad") != "close") && (!INVEN.Ad.tiDisabled)) {
				INVEN.Ad.objTi.style.display = "inline";
			}
		} else {
				INVEN.Ad.objTi.style.display = "none";
		}
	}

	INVEN.Ad.closeTi = function() {
		var closeTiHour = 4;
		if (INVEN.Ad.Env && INVEN.Ad.Env.BaseRolling) {
			closeTiHour = INVEN.Ad.Env.BaseRolling.closeTi || closeTiHour;
			if (closeTiHour=='n') { closeTiHour = 0;}
			closeTiHour = closeTiHour*1;
		}
		if (getCookie("floating_ad") != "close") {
			setCookie("floating_ad", "close", closeTiHour);
			INVEN.Ad.displayTi(false);
			document.getElementById("comAdTi").src = "about:blank";
		}
	}

	INVEN.Ad.reposTi = function(w,h,x,y) {
		INVEN.Ad.objTi.style.width = w;
		INVEN.Ad.objTi.style.height = h;
		INVEN.Ad.objTi.style.marginLeft = x;
		INVEN.Ad.objTi.style.marginTop = y;
	}

	INVEN.Ad.tiLoaded = function(iframeDoc) {
		if (INVEN.Ad.tiMode == "copy") {
			var obj = document.getElementById("comAdTi");
			obj.innerHTML = iframeDoc.getElementById("adTiWrap").innerHTML;
		}
		INVEN.Ad.displayTi(true);
	}

	INVEN.Ad.disableTi = function() {
		INVEN.Ad.tiDisabled = true;
		INVEN.Ad.displayTi(false);
	}

	INVEN.Ad.tiFinished = function() {
		INVEN.Ad.reposTi(300,300,0,0);
		INVEN.Ad.displayTi(false);
		INVEN.Ad.tiDisabled = false;
		//loc.reload(true);
	}

// ±¤°í³» »ç¿ë ½ºÅ©¸³Æ® (º¹»ç¹æ½ÄÀÏ¶§)
	function ti_roll() {
		INVEN.Ad.tiFinished();
		if (INVEN.Ad.tiMode == "copy") {
			document.getElementById("comAdTiFrame").contentWindow.document.location.reload(true);
		} else {
			document.getElementById("comAdTi").contentWindow.document.location.reload(true);
		}
	}
	function ti_close() {
		INVEN.Ad.closeTi();
	}
	//function nis_reload() {
		//ti_roll();
	//}
	function reposTi(w,h,x,y) {
		// IFRAME ³»ÀÇ ÇÔ¼ö È£Ãâ¸¸ Çã¿ë
	}

	// ±âÁ¸ ÇÔ¼ö ¿À¹ö
	function posTi(x,y) {
		if (INVEN.Ad.objTi) {
			var w = 300 - (x * 2);
			var y = 300 - (y * 2);
			INVEN.Ad.reposTi(w,h,x,y);
		} else {
			nis_floatAD.style.left = tiBaseLeft + tileft;
			nis_floatAD.style.top = tiBaseTop + titop;
			tiFloatControl("floatingAD", "inline");
		}
	}

	function changeSection(posiNum, site) {
		switch (site+posiNum) {
		case "huxley300x300":
			break;
		default:
			site = "all";
		}
		return site;
	}


	function roll_left (site) {
		site = changeSection("248x88", site);
		document.write ("<iframe src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@248x88' width='248' height='88' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe>");
	}

	function roll_sub_left (site) {
		site = changeSection("248x88", site);
		document.write ("<iframe src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@248x88' width='248' height='88' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe>");
	}



	function roll_sky (site,sl,st) {
		site = changeSection("120x180", site);
		document.write("<div id='sad1' style='position:absolute;left:" + sl + "px;top:" + st + "px;z-index:1;display:inline'><iframe src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@120x180' width='120' height='180' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe></div>");
	}


	function roll_slide_old (site,sl,st) {
		site = changeSection("80x150", site);
	//  document.write("<scr"+"ipt type=\"text/javascript\">var startX = " + sl + "\n var startY = " + st + "\n</scr"+"ipt>");
	//  document.write("<scr"+"ipt type=\"text/javascript\" src=\"http://ads.inven.co.kr/ad/ac_0708071/slide_ad.js\"></scr"+"ipt>");
	  document.write("<div id='topbar' style='position:absolute;left:"+sl+"px;top:"+st+"px;'><iframe src='http://ad.inven.co.kr/NetInsight/html/inven/all/main@80x150' width='80' height='150' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe></div>");
	}
	function roll_slide (site) {
		site = changeSection("80x150", site);
	  document.write("<iframe src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@80x150' width='80' height='150' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe>");
	}


	function roll_right (site) {
		site = changeSection("538x88", site);
		document.write ("<iframe src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@538x88' width='538' height='88' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe>");
	}
					
	function roll_sub_right (site) {
		site = changeSection("663x88", site);
		document.write ("<iframe src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@663x88' width='663' height='88' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe>");
	}

	function roll_middle (site) {
		site = changeSection("300x70", site);
		document.write("<iframe src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@300x70L' width='300' height='70' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0' style='display:inline;float:left;margin:4px;'></iframe>");
		document.write("<iframe src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@300x70R' width='300' height='70' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0' style='display:inline;float:left;margin:4px;'></iframe>");
	}

	function roll_mid_left (site) {
		site = changeSection("300x70", site);
		document.write("<iframe src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@300x70L' width='300' height='70' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe>");
	}

	function roll_mid_right (site) {
		site = changeSection("300x70", site);
		document.write("<iframe src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@300x70R' width='300' height='70' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0'></iframe>");
	}

	function roll_special_mid (site) {
	//±¤°í¼­¹ö¿¡ À§Ä¡ Àû¿ëÈÄ »ç¿ë
	}

	function roll_quick_menu (site) {
	//±¤°í¼­¹ö¿¡ À§Ä¡ Àû¿ëÈÄ »ç¿ë
	}

	function ti(site) {
	// nis_ti.js ÆÄÀÏ»ç¿ë
	}

	// ·Î±×ÀÎÆäÀÌÁö¿ë ±¤°í_220x270
	function roll_login (site) {
		site = changeSection("220x270", site);
		document.write ("<iframe src='http://ad.inven.co.kr/NetInsight/html/inven/"+site+"/main@220x270' width='220' height='270' frameborder='0' scrolling='no' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0' style='background : url(http://img.inven.co.kr/image/board/outlogin/common/inven2.gif) left top no-repeat;'></iframe>");
	}