﻿function GoApplyLink(applyLink)
{
 if (confirm('수강신청하시겠습니까?')) { document.location.href = applyLink ; } return false;;
}
function openRemoteServiceHelper()
{
    
    window.open("http://hdsr.hmc.co.kr");    
}
function openALP()
{
   //window.open("../home/OtherSystemOutGate.aspx?targetApp=ALP");
}
function openLinkHiDS(no,authorityCode,targetCode)
{
    var height = screen.height; 
	var width = screen.width;
	var shopweb = window.open("../knowledge/LinkHiDS.aspx?LinkMode="+no+"&authorityCode="+authorityCode+"&targetCode="+targetCode,"shopweb","left=0,top=0,width="+width+",height="+height+",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	shopweb.focus();
	
	if(no=="4" || no=="5" || no=="6" || no=="7")
	{
	 shopweb.resizeTo(width,height);
	 shopweb.moveTo(0,0);
	}
}

function openGDS()
{
    // GDS 아이콘을 클릭할 경우 호출된다.
    // Local 파일 체크 (C:\\GVCI\\default.asp) 
    // 파일이 존재할 경우 http://localhost/default.asp를 open 한다.

    try
    {
        var filepath = "C:\\GVCI\\default.asp";    
       
        var fso = new ActiveXObject("Scripting.FileSystemObject");
        
       
        
        if (fso.FileExists(filepath))
        {
            window.open("http://localhost/default.asp");
        }
        else
        {
            alert("로컬 시스템에 GDS가 설치되어 있지 않습니다.");
        }
    }
    catch(e)
    {
       alert("로컬 시스템에 GDS를 먼저 설치해 주십시요. 만약 설치되었다면\r[도구][인터넷옵션][보안/인터넷/사용자지정수준]\r[안전하지 않는 것으로 표시된 ActiveX 컨트롤 초기화 및 스크립트]항목을 [사용]으로 선택해 주십시요.");
    }     
    
   
}

function openShopWeb(authorityCode,targetCode)	//지침서
{	
	//var shopweb = window.open("../knowledge/LinkHiDS.aspx?LinkMode=1","shopweb","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes");
	//shopweb.focus();
	var height = screen.height; 
	var width = screen.width;
	var shopweb = window.open("../knowledge/LinkHiDS.aspx?LinkMode=1&authorityCode="+authorityCode+"&targetCode="+targetCode,"shopweb","left=0,top=0,width="+width+",height="+height+",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	shopweb.focus();
	//shopweb.resizeTo(width,height);
	//shopweb.moveTo(0,0)
}

function openShopWeb1()	//정비사례
{	
	var shopweb = window.open("../knowledge/LinkHiDS.aspx?LinkMode=2","shopweb","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	shopweb.focus();
}

function openShopWeb2()	//정비 통신
{	
	var height = screen.availheight; 
	var width = screen.availWidth;
	var shopweb = window.open("../knowledge/LinkHiDS.aspx?LinkMode=3","shopweb","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	shopweb.focus();
	shopweb.resizeTo(width,height);
	shopweb.moveTo(0,0)
}

function openAutoWay() //Autoway
{
	var shopweb = window.open("http://autoway.hmc.co.kr","shopweb","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	shopweb.focus();
}

function openLTS() //LTS
{
	//var height = screen.availheight; 
	//var width = screen.availWidth;
	var shopweb = window.open("../knowledge/GoLTS.aspx","shopweb","left=0,top=0,width=980,height=760,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	shopweb.focus();
//	shopweb.resizeTo(width,height);
//	shopweb.moveTo(0,0)
}

function openDTC(authorityCode,targetCode) // DTC
{
//	var height = screen.availheight; 
//	var width = screen.availWidth; 
//	var shopweb = window.open("../knowledge/LinkHiDS.aspx?LinkMode=8","shopweb","toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,resizable=yes");
//	shopweb.focus();
//	shopweb.resizeTo(width,height);
//	shopweb.moveTo(0,0);

	var height = screen.height; 
	var width = screen.width;
	var shopweb = window.open("../knowledge/LinkHiDS.aspx?LinkMode=8&authorityCode="+authorityCode+"&targetCode="+targetCode,"shopweb","left=0,top=0,width="+width+",height="+height+",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	shopweb.focus();
}
function openETM(authorityCode,targetCode) // ETM (회로도)
{
//	var height = screen.availheight; 
//	var width = screen.availWidth; 
//	var shopweb = window.open("../knowledge/LinkHiDS.aspx?LinkMode=8","shopweb","toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,resizable=yes");
//	shopweb.focus();
//	shopweb.resizeTo(width,height);
//	shopweb.moveTo(0,0);

	var height = screen.height; 
	var width = screen.width;
	var shopweb = window.open("../knowledge/LinkHiDS.aspx?LinkMode=9&authorityCode="+authorityCode+"&targetCode="+targetCode,"shopweb","left=0,top=0,width="+width+",height="+height+",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	shopweb.focus();
}
function openModuleLecture()
{
  var height = screen.height; 
	var width = screen.width;
	var shopweb = window.open("../knowledge/LinkHiDS.aspx?LinkMode=10","shopweb","left=0,top=0,width="+width+",height="+height+",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	shopweb.focus();
}

function openRemote() //원격진단
{
	var height = screen.availheight; 
	var width = screen.availWidth; 
	var shopweb = window.open("../knowledge/LinkHiDS.aspx?LinkMode=4","shopweb","toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,resizable=yes");
	shopweb.focus();
	shopweb.resizeTo(width,height);
	shopweb.moveTo(0,0);			
}

function openNewTech() // 신기술신상식
{
	var height = screen.availheight; 
	var width = screen.availWidth; 
	var shopweb = window.open("../knowledge/LinkHiDS.aspx?LinkMode=6","shopweb","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	shopweb.focus();
	shopweb.resizeTo(width,height);
	shopweb.moveTo(0,0)
}

function openCircuit() // 회로도업데이트

{
	var height = screen.availheight; 
	var width = screen.availWidth; 
	var shopweb = window.open("../knowledge/LinkHiDS.aspx?LinkMode=7","shopweb","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	shopweb.focus();
	shopweb.resizeTo(width,height);
	shopweb.moveTo(0,0)
}

function openInfoway()
{
	var height = screen.availheight; 
	var width = screen.availWidth; 
	var shopweb = window.open("../knowledge/LinkHiDS.aspx?LinkMode=5","shopweb","toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,resizable=yes");
	shopweb.focus();
	shopweb.resizeTo(width,height);
	shopweb.moveTo(0,0);	
}
function OpenHelpOffline()
{
	var wnd = window.open('Lecture/HelpOffline/Default.aspx?Site=Front','wndHelp','width=900, height=570');
	wnd.focus();
}
function OpenTechTipsView(seqNo)
{
	window.open("../knowledge/TechTipsView.aspx?SeqNo="+seqNo,"_blank","top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+ (window.screen.width-10) + ",height=" + (window.screen.height-57));
}	
function OpenCaseBankView(seqNo)
{
	window.open("../community/CaseBankView.aspx?SeqNo="+seqNo,"_blank","top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=1,width="+ (window.screen.width-10) + ",height=" + (window.screen.height-57));	 
}
function OpenCyberCallView(seqNo)
{
	window.open("../community/CyberCallView.aspx?SeqNo="+seqNo,"_blank","top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=1,width="+ (window.screen.width-10) + ",height=" + (window.screen.height-57));	 
}
function OpenRepairComView(seqNo)
{
	window.open("http://www.hi-ds.net/know/jungbicom_readonly/board_view.asp?CurrentPage=1&docu_no="+seqNo,"_blank","top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=1,width="+ (window.screen.width-10) + ",height=" + (window.screen.height-57));	 
}
function OpenFreeBoardView(seqNo)
{
	document.location.href = "../community/mainhome_2007.aspx?contents=FreeView&SeqNo=" + seqNo;
}
function OpenArgueView(seqNo)
{
	document.location.href = "../community/mainhome_2007.aspx?contents=ArgueAllView&SeqNo=" + seqNo;
}
function OpenNewTechView(docu_no)
{
    window.open("../knowledge/NewTechCommonView.aspx?Type=&SeqNo="+docu_no,"_blank","top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+ (window.screen.width-10) + ",height=" + (window.screen.height-57));
}
function OpenJungbiComView(docu_no)
{
    window.open("../Knowledge/JungbiComView.aspx?ProdNo="+docu_no,"_blank","top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width="+ (window.screen.width-10) + ",height=" + (window.screen.height-57));
}
function PageMove(target, location)
{
	if(location == null || location == "")
		if(target == null || target == "")
			document.location.href='MainHome_2007.aspx';
		else
			document.location.href='mainhome_2007.aspx?contents=' + target;
	else
		if(target == null || target == "")
			document.location.href='../' + location + '/MainHome_2007.aspx';
		else
			document.location.href='../' + location + '/mainhome_2007.aspx?contents=' + target;
}

function ChangeStyle(style)
{
	event.srcElement.className = style;
}
	
function GetObj(objectid)
{
	var obj;
	try
	{
		obj = document.all[event.srcElement.id.split("_")[0]+"_"+objectid];		
	}
	catch(exception)
	{
		obj = null;
	}
	
	return obj;
}

function GetObjNoCtl(objectid)
{
	var obj;
	try
	{
		obj = document.all[objectid];
	}
	catch(exception)
	{
		obj = null;
	}
	return obj;
}

function ButtonClick(buttonid, isctrl) 
{
	if(event.keyCode == 13)
	{
	    try
	    {
		self.focus();
		bid = event.srcElement.id.split("_");
		//isctrl ? document.all["_"+bid[1]+"_"+buttonid].click() : document.all[buttonid].click(); 
		isctrl ? document.all[bid[0]+"_"+buttonid].click() : document.all[buttonid].click(); 
		}
		catch(e)		
		{}
		return false;
	}
}

function LoginAlert()
{
	//alert("로그인 후 해당 컨텐츠의 사용권한이 있어야지만 볼수 있습니다.");
	var ret = confirm("로그인 후 해당 컨텐츠의 사용권한이 있어야 볼수 있습니다.\r\n\r\n로그인 페이지로 이동하시겠습니까?");
	if(ret)
	{
		//LoginFocus();
		PageMove('MemberLogin','member');
	}
}

function LoginAlert2()
{
	alert("로그인후 이용하여 주시기 바랍니다.");
}

function CompanyAlert()
{
	alert("공제동의서 미제출 업체입니다. 공제동의서 제출후에 사용하여 주십시오.");
}

function FreeAlert()
{
	alert("멥버쉽 전용 공간입니다.");
}

function NoreadyAlert()
{
	alert("준비중 입니다.");
}

function NoDataAlert()
{
	alert("데이터가 없습니다.");
}

function NotApply()
{
	alert('수강신청기간이 지났습니다.');
}

function NoApply()
{
//	alert('수강신청기간이 지났습니다.');
	alert('수강신청기간이 아닙니다');
}

function NotType()
{
	alert('강좌신청형태가 수강신청이 아닙니다.');
}
function DoApply(url)
{
   if( confirm('수강신청하시겠습니까?') )
   {    
      window.location.href = url;   
   }
}

function event_popup(mypage, myname, w, h, scroll)  
{
	    var strReturn;
	    strReturn = GetCookie(myname);
	    if(strReturn == null || strReturn == '0' ) {
			NewWindow(mypage, myname, w, h, scroll);
	    }
}
function event_popup1(mypage, myname, w, h, t, l, scroll)  
{
	    var strReturn;
	    strReturn = GetCookie(myname);
	    if(strReturn == null || strReturn == '0' ) {
			NewWindow1(mypage, myname, w, h, t, l, scroll);
	    }
}
function GetCookie(sName)
{
	var aCookie = document.cookie.split("; ");
	for (var i=0; i < aCookie.length; i++)
	{
		var aCrumb = aCookie[i].split("=");
		if (sName == aCrumb[0]) 
		return unescape(aCrumb[1]);
	}
	return null;
}
function GetPosX(obj)
{
	var obj;
	var left=0;

	while(obj != null)
	{
		left = left + obj.offsetLeft;
		obj = obj.offsetParent;
	}
//				left += document.body.clientLeft;
	return left;
}

function GetPosY(obj)
{
	var obj;
	var top=0;

	while(obj != null)
	{
		top = top + obj.offsetTop;
		obj = obj.offsetParent;
	}
//				top += document.body.clientTop;
	return top;
}

function ArragePosition()
{
	var x = GetPosX(St_StartPoint);
	var y = GetPosY(St_StartPoint);
	Layer1.style.left = x + 27;
	Layer1.style.top = y;
	Layer2.style.left = x + 27;
	Layer2.style.top = y;
	Layer3.style.left = x + 27;
	Layer3.style.top = y;
	Layer4.style.left = x + 27;
	Layer4.style.top = y;
	Layer5.style.left = x + 27;
	Layer5.style.top = y;
}

function NewWindow(mypage, myname, w, h, scroll) 
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',status=no ,scrollbars='+scroll+',noresizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function NewWindow1(mypage, myname, w, h, t, l,scroll) 
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+t+',left='+l+',status=no, scrollbars='+scroll+',noresizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
function OpenNewWindow(mypage,myname)
{
  window.open(mypage,myname);
}

function GoModify()
{
	NewWindow("../Member/MemberModify.aspx", "Modify", 620, 270, 'NO');
}

function ChangeImage(newurl) {
	event.srcElement.src = newurl;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

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.0
  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 && document.getElementById) x=document.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];}
}
