
function windowOpenPopup(path, winName, width, height)
{
	shape  = "width=" + width + ",height=" + height + ",";
	shape += "toolbar=no,location=no,directories=no,status=no,";
	shape += "menubar=no,scrollbars=no,resizable=yes";
	var winOpen = window.open(path, winName, shape);
	winOpen.focus();
}

function open_popup_member(path, shape, win_name)
{
	shape += "toolbar=no,location=no,directories=no,status=no,";
	shape += "menubar=no,scrollbars=yes,resizable=no";
	var openWin = open(path, win_name, shape);
	openWin.focus();
}

function open_popup(path, shape, win_name)
{
	shape += "toolbar=no,location=no,directories=no,status=no,";
	shape += "menubar=no,scrollbars=auto,resizable=no";
	var openWin = open(path, win_name, shape);
	openWin.focus();
}

function loginInfoPop(chkNo)
{
	var path = "http://www.healthkorea.net/hkcommon/login/loginalert.aspx?user_id=" + chkNo;
	
	if(opener == "undefined" || opener == null || opener == "")
	{
		open_popup(path, 'width=530,height=570', 'popinfo');	
	}
	else
	{
		top.location.href = path;
	}
}

function open_modal(path, shape, win_name)
{
	shape	+= "dialogTop:40px;dialogLeft:20px;help=0;status=0;scroll=0;";
	var retVal	= window.showModalDialog(path, win_name, shape);
}

function open_modeless(path, shape, win_name)
{
	shape	+= "dialogTop:40px;dialogLeft:20px;help=0;status=0;scroll=0;";
	var retVal = window.showModelessDialog(path, win_name, shape);
}

function OpenContentsPopup(gbtype,sno,hsno)
{   
	/*
	2009-02-16 HK 1.5 ÀÌÀüÀ¸·Î ÀÓ½Ã Æ÷ÆÃ by yiromi
	*/
	/*
	alert(gbtype);
	
	if(gbtype == "6") // ÀÇ/¿Â ´ÚÅÍÄÃ·³
	{
	} 
	else if (gbtype == "3") // ÀÇ/¿Â 
	{
	} 
	*/
   var path = "/Contentsviewer.aspx?gbtype="+gbtype+"&num="+sno+"&hsno="+hsno;
   var width = window.screen.width-200;
   var height = window.screen.height-200;   
   var shape  = "width=" + width + ",height=" + height + ",";
	shape += "toolbar=yes,location=yes,directories=yes,status=yes,";
	shape += "menubar=yes,scrolling=yes,scrollbars=yes,resizable=yes";	
	window.open(path,'cpopup',shape); 	
}

var modelessWin = null;
function open_modelessReturn(path, shape, win_name)
{
	try 
	{
		if(modelessWin != null)
			modelessWin.popIframe.location.href = path;
		if(modelessWin == null)
			modelessWin = window.showModelessDialog(path, window, shape);
					
		modelessWin.focus();
	}
	catch(e)
	{
		modelessWin = null;
		modelessWin = window.showModelessDialog(path, window, shape);		
		modelessWin.focus();
	}
}

function modelessPageLoad()
{
	modelessWin.popIframe.location.href = viewHref;
}

function pause(numberMillis) 
{     
	var now = new Date();     
	var exitTime = now.getTime() + numberMillis;     
	while (true) 
	{          
		now = new Date();          
		if (now.getTime() > exitTime)              
			return;     
	}
}

function open_popup2(path, win_name)
{
	shape  = "width=790,height=620,";
	shape += "toolbar=no,location=no,directories=no,status=no,";
	shape += "menubar=no,scrollbars=no,resizable=no";
	var myWin = open(path, win_name, shape);
	myWin.focus();
}

function goPathLogin(aType, path)
{
	if(aType == "1")
	{
		if(confirm('°Ç°­»ùÈ¸¿ø¼­ºñ½ºÀÔ´Ï´Ù.\n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?'))
		{
			if(path != "")
				top.location.href = "/hkcommon/login/login.aspx?path=" + path;
			else
				top.location.href = "/hkcommon/login/login.aspx";
		}
		else
		{
			top.location.href = "/";
		}
	}
	else
	{
		if(path != "")
			top.location.href = "/hkcommon/login/login.aspx?path=" + path;
		else
			top.location.href = "/hkcommon/login/login.aspx";
	}
}

function goMyHealthPathLogin(path, mysno)
{
	if(mysno == "")
	{
		alert('ºÎÁ¤È®ÇÑ URL ÀÔ´Ï´Ù.\n\nÈ®ÀÎÈÄ »ç¿ëÇÏ¼¼¿ä.');
		self.close();
		return;
	}
	else
	{
		alert('°Ç°­»ùÈ¸¿ø¼­ºñ½ºÀÔ´Ï´Ù.\n\n·Î±×ÀÎÈÄ »ç¿ë°¡´ÉÇÕ´Ï´Ù.');
		top.location.href = "/MyHealth/main/index.aspx?mysno=" + mysno + "&kspid=MY001101&path=" + path;
		return;
	}
	/*
	if(confirm('°Ç°­»ùÈ¸¿ø¼­ºñ½ºÀÔ´Ï´Ù.\n\n·Î±×ÀÎÈÄ »ç¿ë°¡´ÉÇÕ´Ï´Ù.'))
	{
		if(path != "")
		{
			top.location.href = path;
		}
		else
		{
			alert('ºÎÁ¤È®ÇÑ URL ÀÔ´Ï´Ù.\n\nÈ®ÀÎÈÄ »ç¿ëÇÏ¼¼¿ä.');
			self.close();
			return;
		}
	}
	else
	{
		top.location.href = "http://myhealth.healthkorea.net/MyHealth/main/index.aspx?mysno=25&kspid=MY001101";
	}
	*/
}


function myHealthAddMyDoctor(LinkMyHealth, mySno, sHid, viewType)
{
	if(confirm("ÁÖÄ¡ÀÇ·Î µî·ÏÇÏ½Ã°Ú½À´Ï±î?"))
	{
		path = "/healthcare/mydoctor/adddoctor.aspx?mySno=[mySno]&docID=[docID]";
		path = path.replace("[mySno]", mySno);
		path = path.replace("[docID]", sHid);
		
		top.location.href = path;
		//open_popup2(path, 'myHealth')
	}
}


function healthCareAddMyDoctor(sHid)
{
	if(confirm("ÁÖÄ¡ÀÇ·Î µî·ÏÇÏ½Ã°Ú½À´Ï±î?"))
	{
		path = "/HealthCare/MyDoctor/AddDoctor.aspx?docID=[docID]";
		path = path.replace("[docID]", sHid);
		top.location.href = path;
	}
}

function kHomePage(path)
{
	var openWin = window.open(path, "kHomepage", "");
	openWin.focus();
}

function myHealth(LinkMyHealth, mySno, viewType)
{
	path = LinkMyHealth + "myhealth/main/index.aspx?mySno=[mySno]&kspid=[kspid]&g=[g]";
	path = path.replace("[mySno]", mySno);
	
	if(viewType == "deptlist")		// ÁÖ¹®Áø º¸Á¶¹®Áø ¸®½ºÆ®
	{
		path = path.replace("[kspid]", "MY001204");
	}
	else if(viewType == "food")	// ½ÄÀÌ°ü¸®
	{
		path = path.replace("[kspid]", "MY001415");
		path = path.replace("[g]", "4");
	}
	else if(viewType == "ex")		// ¿îµ¿°ü¸®
	{
		path = path.replace("[kspid]", "MY001416");
		path = path.replace("[g]", "4");
	}
	else if(viewType == "nosmoke")	// ±Ý¿¬
	{
		path = path.replace("[kspid]", "MY001302");
	}
	else if(viewType == "rh")	// Ç÷´ç
	{
		path = path.replace("[kspid]", "MY001410&cat=1");
	}
	else if(viewType == "diabetes")	// ´ç´¢
	{
		path = path.replace("[kspid]", "MY001410&cat=2");
	}
	else if(viewType == "clinic")	// ³»¿øÁ¤º¸
	{
		path = path.replace("[kspid]", "MY001411");
	}
	else if(viewType == "drug")	// ¾à·ÂÁ¤º¸
	{
		path = path.replace("[kspid]", "MY001414");
	}
	else if(viewType == "weight")	// Ã¼Áß
	{
		path = path.replace("[kspid]", "MY001404");
	}
	else if(viewType == "body")	// ½ÅÃ¼Á¤º¸
	{
		path = path.replace("[kspid]", "MY001404");
	}
	else if(viewType == "info")	// °³ÀÎÁ¤º¸
	{
		path = path.replace("[kspid]", "MY001402");
	}
	else if(viewType == "disease")	// Áúº´·Â
	{
		path = path.replace("[kspid]", "MY001409");
	}
	else if(viewType == "healthcheck")	// °Ç°­ÃøÁ¤
	{
		path = path.replace("[kspid]", "MY001410");
	}
	else if(viewType == "hrecord")	// °ËÁø±â·Ï
	{
		path = path.replace("[kspid]", "MY001412");
	}
	else if(viewType == "setinfo")	// ¸ÂÃãÁ¤º¸ ¼³Á¤
	{
		path = path.replace("[kspid]", "MY001601");
	}
	else if(viewType == "myscrap")	// ³ªÀÇ ½ºÅ©·¦
	{
		path = path.replace("[kspid]", "MY001604");
	}
	else if(viewType == "mydoctor")	// ÁÖÄ¡ÀÇ ÆäÀÌÁö
	{
		path = path.replace("[kspid]", "MY001501");
	}
	else if(viewType == "userhrecord")	// °Ç°­±â·Ï
	{
		path = path.replace("[kspid]", "MY001401");
	}
	else if(viewType == "myConsultList")	// °Ç°­»ó´ã±â·Ï
	{
		path = path.replace("[kspid]", "MY001420");
		path = path.replace("[g]", "3");
	}
	else
	{
		path = path.replace("[kspid]", "MY001101");
	}
		
	//alert(path);
	open_popup2(path, 'myHealth')
}

function PersonInforPopup(serviceType, tagName, kspid)
{
	var shape = "dialogWidth:500px; dialogHeight:248px; help:no; scroll:no; status:no;";
	//var path = "/HKCommonRes/PersonInfor/PersonInfor_Popup.aspx?ServiceType=" + serviceType + "&GubunType=" + gubunType + "&TagName=" + tagName;
	var path = "/HKCommonRes/PersonInfor/PersonInfor_Popup.aspx?ServiceType=" + serviceType + "&TagName=" + tagName + "&Kspid=" + kspid;
	var retVal = window.showModalDialog(path, "PersonInfor", shape);
}

