// ¸ÞÀÎ È­¸é ¶ç¿ì±â, ±âÁ¸ È­¸é³»¿¡ ·ÎµùµÇ´Â ³»¿ëµé
function openMainContents(url)
{
	var left = 0;
	var top = 180;
	var width = 1021;
	var height = 530;
	var feature = 'toolbar=yes,location=no,directories=no,status=yes,resizable=yes,menubar=no,scrollbars=yes,top=' + top + ',left=' + left + ',width=' + width + ',height=' + height;
	MM_openBrWindow(url,'maincontents', feature);
}
// »õ¼Ò½Ä ¿­±â
function news_popup(sn)
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,width=430,height=300,resizable=no,menubar=no,scrollbars=yes';
	MM_openBrWindow('/main/newsp.aspx?sn=' + sn, 'news', feature);
}

// ÆÐ¹Ð¸®»çÀÌÆ® ¿­±â
function openFamilysite()
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,resizable=yes,menubar=no,scrollbars=yes,width=210,height=183';
	MM_openBrWindow('/main/familysite.aspx','familysite', feature);
}
// ·Î±×ÀÎÃ¢ ¶ç¿ì±â
function login_popup()
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,resizable=no,menubar=no,scrollbars=no,width=408,height=189';
	var win = window.open('https://www.wamis.go.kr/main/memlogin.aspx','login', feature);
	win.focus();
}
// »ç¿ëÀÚ µî·ÏÃ¢ ¶ç¿ì±â
function regist_popup()
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,width=529,height=464,top=10,left=10,resizable=no,menubar=no,scrollbars=no';
	MM_openBrWindow('https://www.wamis.go.kr/main/memagree.aspx','agree', feature);
}
// »ç¿ëÀÚ Á¤º¸ ¼öÁ¤Ã¢ ¶ç¿ì±â
function edituserinfo_popup()
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,width=533,height=452,resizable=yes,menubar=no,scrollbars=no';
	MM_openBrWindow('/main/memedit.aspx', 'edituserinfo', feature);
}
// Á¢¼ÓÇöÈ²Ã¢ ¶ç¿ì±â
function connstatus_popup()
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,width=567,height=520,resizable=no,menubar=no,scrollbars=yes';
	MM_openBrWindow('/main/conn_status.aspx', 'main_content', feature);
}

// ÁöµµÈ­¸é ¶ç¿ì±â
function openMap(url)
{
	var feature = "status=yes,menubar=no,toolbar=no,location=no,directory=no,resizable=no,scrollbars=no,width=1015,height=710,left=0,top=0";
	// var base = 'http://basin.kowaco.or.kr/';
	var base = 'http://www.wamis.go.kr/';
	//var base = 'http://localhost:99/';
	var turl = '/main/logincheck.aspx?gourl=' + escape(base + url);
	var objWin = window.open(turl, "map", feature);
	objWin.focus();
}
// ÁöµµÈ­¸é ¶ç¿ì±â
function goTimeSeries(url)
{
	var feature = "status=yes,menubar=no,toolbar=no,location=no,directory=no,resizable=no,scrollbars=no,width=418,height=239,left=0,top=0";
	// var base = 'http://basin.kowaco.or.kr/';
	var base = 'http://www.wamis.go.kr/';
	//var base = 'http://localhost:99/';
	var turl = '/main/logincheck.aspx?target=self&gourl=' + escape(base + url);	
	var objWin = window.open(turl, "map", feature);
	objWin.focus();
}




//#########################################################################################
// Åë°è¿¬º¸ ¶ç¿ì±â
function openStcpbt()
{
	//openMainContents('/main/stcpbt.aspx');	
	location.href = '/main/stcpbt.aspx';
}
// ¹°ÁöµµÃ¢ ¶ç¿ì±â
function openWatermap()
{
	//openMainContents('/watermap/cmsmain.aspx');
	location.href = '/watermap/cmsmain.aspx';
}
// µµ¿ì¹Ì
function openHelp()
{
	location.href = '/main/help_hydro.aspx';	
}
//#########################################################################################
// ¸ð¹ÙÀÏ ½ÃÇè¼­ºñ½º Ã¢
function openMobile()
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,width=482,height=440,resizable=no,menubar=no,scrollbars=no';
	MM_openBrWindow('/mobile/mobile.aspx', 'mobile', feature);
}
// IP Ã¢ ¶ç¿ì±â
function openIp()
{
	openMainContents('/ip/ip_index.aspx');
}

// ¸ð¹ÙÀÏ µµ¿ò¸» Ã¢
function mobilehelp_popup()
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,width=640,height=477,resizable=no,menubar=no,scrollbars=no';
	MM_openBrWindow('/mobile/help/intro.htm', 'mobilehelp', feature);
}
// ¼öÀ§¾Ë¶÷¼­ºñ½º µµ¿ò¸» Ã¢
function alarmhelp_popup()
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,width=640,height=477,resizable=no,menubar=no,scrollbars=no';
	MM_openBrWindow('/mobile/help/alarm_help.htm', 'alarmhelp', feature);
}
// °³ÀÎÁ¤º¸º¸È£Á¤Ã¥ ÆË¾÷Ã¢
function privacy_popup()
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,width=630,height=600,resizable=no,menubar=no,scrollbars=yes';
	MM_openBrWindow('/main/privacy.htm', 'privacy', feature);
}
// ÀüÀÚ¿ìÆí¹«´Ü¼öÁý°ÅºÎ ÆË¾÷Ã¢
function email_popup()
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,width=486,height=360,resizable=no,menubar=no,scrollbars=no';
	MM_openBrWindow('/main/email.htm', 'email', feature);
}
// È¨ÇÇ°³¼±ÀÇ°ß ÆË¾÷Ã¢
function impr_popup()
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,width=562,height=537,resizable=no,menubar=no,scrollbars=no';
	MM_openBrWindow('/main/sugopnlst.aspx', 'sug_opn', feature);
}
// »çÀÌ¹öÁ¤º¸ º¸±â
function cyberinfo_popup(sn)
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,width=402,height=500,resizable=no,menubar=no,scrollbars=yes';
	MM_openBrWindow('/main/dam_popup.aspx?code=' + sn, 'cyberinfo', feature)
}
// »çÀÌ¹öÆú °á°úº¸±â
function cyberpoll_popup(sn)
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,width=430,height=278,resizable=no,menubar=no,scrollbars=yes';
	MM_openBrWindow('/cyberpoll_popup.aspx?code=' + sn, 'cyberpoll', feature);
}
// ½Ã½ºÅÛ ¿À·ù ÆË¾÷Ã¢
function err_popup()
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,width=450,height=265,resizable=no,menubar=no,scrollbars=no';
	MM_openBrWindow('/err.htm', 'error', feature);
}
// Åë°è°£Çà¹° ¼¼ºÎÇ×¸ñ Á¶È¸ ÆË¾÷Ã¢ ¿­±â
function stcpbtdtl_popup(code)
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,width=250,height=265,resizable=no,menubar=no,scrollbars=yes';
	MM_openBrWindow('/main/stcpbtdtl.aspx?cd=' + code, 'stcpbtdtl', feature);
}
// ÀÚ·á½Ç ÆË¾÷Ã¢ ¿­±â
function openData(code)
{
	openMainContents('/main/data_view.aspx?sn=' + code);
}
// ÀÚ·á½Ç ¿­±â
function openData_self(code)
{
	location.href = '/main/data_view.aspx?sn=' + code;
}

// °øÁö»çÇ× ÆË¾÷Ã¢ ¿­±â
function announce_popup(code)
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,width=430,height=200,resizable=no,menubar=no,scrollbars=yes';
	MM_openBrWindow('/main/announce.aspx?code=' + code, 'announce', feature);
}

// °Ô½ÃÆÇ ÆË¾÷Ã¢ ¿­±â
function board_popup(code)
{
	openMainContents('/main/brd_dtl.aspx?cd=' + code);
}
// °Ô½ÃÆÇ ¿­±â
function board_self(code)
{
	location.href = '/main/brd_dtl.aspx?cd=' + code;
}

// ¸Ê ÆË¾÷ ¿­±â 
function openMapWindow(url) {	
	var stat = "menubar=no,toolbar=no,location=no,directory=no,scrollbars=yes,resizable=yes,width=1014,height=690";
	var objWin = window.open(url, "map", stat);
	objWin.focus();
}

//ÄíÅ°
function getCookie(name) { 
	//alert(name);
	var Found = false 
	var start, end 
	var i = 0 
	
	// cookie ¹®ÀÚ¿­ ÀüÃ¼¸¦ °Ë»ö 
	while(i <= document.cookie.length) { 
	start = i 
	end = start + name.length 
	// name°ú µ¿ÀÏÇÑ ¹®ÀÚ°¡ ÀÖ´Ù¸é 
	if(document.cookie.substring(start, end) == name) { 
	Found = true 
	break 
	} 
	i++ 
	} 
	
	// name ¹®ÀÚ¿­À» cookie¿¡¼­ Ã£¾Ò´Ù¸é 
	if(Found == true) { 
	start = end + 1 
	end = document.cookie.indexOf(";", start) 
	// ¸¶Áö¸· ºÎºÐÀÌ¶ó´Â °ÍÀ» ÀÇ¹Ì(¸¶Áö¸·¿¡´Â ";"°¡ ¾ø´Ù) 
	if(end < start) 
	end = document.cookie.length 
	// name¿¡ ÇØ´çÇÏ´Â value°ªÀ» ÃßÃâÇÏ¿© ¸®ÅÏÇÑ´Ù. 
	return document.cookie.substring(start, end) 
	} 
	// Ã£Áö ¸øÇß´Ù¸é 
	return "" 
} 

// ******************************************************************************************************************************
// 2006 WAMIS±â´ÉÈ®´ë ¹× ½Ã½ºÅÛ°³¼±
// ******************************************************************************************************************************
// ¾Ë¶÷¼­ºñ½º ·Î±×ÀÎÃ¢ ¶ç¿ì±â
function openAlarm(url)
{
	var feature = 'toolbar=no,location=no,directories=no,status=yes,resizable=no,menubar=no,scrollbars=no,width=408,height=189';
	// var base = 'http://basin.kowaco.or.kr/';
	// var base = 'http://localhost:90/';
	var turl = '/main/logincheck.aspx?gourl=' + escape(url);
	var objWin = window.open(turl, "alarm", feature);
  objWin.focus();
}
