<?xml version="1.0" encoding="UTF-8" ?>
<%@page import="kr.co.hsnc.common.util.ValueObject"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="kr.co.udapsoft.common.menu.PotalMenuManager"%>
<%@ page import="kr.co.hsnc.common.config.WAFConfig;" %>
<jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
<%
	ctx.init(request, response);
	String strTitle = WAFConfig.get("waf.ServerType");
	ValueObject params = ctx.getParams();
	ValueObject user = ctx.getUser();
	user.set("USE_SYSTEM", "10");
	ctx.setUser(user);

	PotalMenuManager menuManager = new PotalMenuManager(request);
	String USE_SYSTEM = menuManager.getUseSystem();	
	
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<!-- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -->
		<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
		<link rel="stylesheet" type="text/css" href="/css/supplier/main.css" />
		<link rel="stylesheet" type="text/css" href="/css/supplier/common.css" />
		
		
		<!-- WAF JQuery 제공 스크립트 참조 -->
		<script language="javascript" src="/js/jquery/jquery-1.11.0.js"></script>
		
		<title>SGC이앤씨 협력업체포탈 시스템</title>
		
		
		<script language="javascript">
			//modular UI 관련 모든 초기화 로직 실행 함수
			function _modularViewInit() {
				Modular.view.Form.display();
				try {
					eval("_onReady();");
				} catch (e) {}//ignored
			}
			
			jQuery(document).ready(function () {
			    
			    
			    //정보수정
			    /*
			    jQuery("#myInfoChange").click(function(){
			        jQuery("#form1").attr("action", "/portal/own/MyInfo.screen");
			        jQuery("#form1").attr("target", "_self");
			        jQuery("#form1").attr("method", "post");
					
			        jQuery("#form1").submit();
			    });
			    */
			    
			    
				//메인 메뉴 관련 css 조작
				jQuery('.menuItem').mouseover(function() {
				    var src = jQuery(this).find(':first-child').find(':first-child').attr("src").match(/[^\.]+/) + "_on.gif";
				    jQuery(this).find(':first-child').find(':first-child').attr('src', src);
				});
				jQuery('.menuItem').mouseout(function() {
				    var src = jQuery(this).find(':first-child').find(':first-child').attr("src").replace('_on', '');
				    jQuery(this).find(':first-child').find(':first-child').attr('src', src);
				});
				jQuery("ul.main-menu li ul li:last-child").addClass("last-child");
				
				//modular UI 관련 모든 초기화 로직을 실행함.
				//_modularViewInit();
			});
			
			function goMenu(url, pgmGrName, pgmName) {
				if( url.substring(0, 1) != "#" ) {
					document.getElementById("menu_linker").href = url;
					
					if(document.createEvent){
						var click_ev = document.createEvent("MouseEvents");
						click_ev.initEvent("click", true , true );
						document.getElementById("menu_linker").dispatchEvent(click_ev);
					}else if(document.createEventObject){
						var click_ev = document.createEventObject();
						click_ev.button = 1;
						document.getElementById("menu_linker").fireEvent('onclick',click_ev);
					}
				}
			}
			function autoResize(){
				var bodyFrame = document.getElementById("bodyFrame");
				
				 var iframeHeight= document.body.scrollHeight - 109;   
				
				bodyFrame.height = iframeHeight + "px";
				
			}
			function helpLink(){
				/*	도메인변경에 따른 원격주소 변경 2020.11.23
				var url="http://as82.kr/etecenc/";
				*/
				var url="https://988.co.kr/sgcenc/";				
		  		
		  		window.open(url, "_blank");
			}
		</script>
	</head>
	<BODY onresize="autoResize()">
	<form name="form1" id="form1" method="post" action="" >
		<input type="hidden" name="user_id" id="user_id" value="<%=user.get("user_id") %>" />
		<input type="hidden" name="corp_id" id="corp_id" value="<%=user.get("corp_id") %>" />
	</form>

	
	<a id='menu_linker' target='bodyFrame' href='' style="display:none" onclick="document.bodyFrame.location.href=this.href; return false;"></a>
	
	<div style="position:absolute;top:3px;right:20px;z-index:100;">
	   <table border="0" cellpadding="0" cellspacing="0">
	    <tr>
	     <td><a href="/mainPortal.screen"><img src="/img/buyer/main/icon_home.png" /></a></td>
	     <td>&nbsp;</td>
	     <td><b><%=user.get("corp_kor") %></b>님 로그인중입니다.&nbsp;</td>
	     <% if(user.get("job_div").equals("P")){%>
	     <td><div id="job_div" onclick="helpLink()" style="cursor:pointer">[구매]</div></td>
	     <%}else if(user.get("job_div").equals("O")){ %>
	     <td><div id="job_div" onclick="helpLink()" style="cursor:pointer">[외주]</div></td>
	     <%}else{%>
	     <td></td>
	     <%} %>
	     <td><img src="/img/buyer/main/icon_bar.gif" /></td>
	     <td><img src="/img/supplier/menu/btn_info_add.gif" alt="edit"  id="myInfoChange" onclick="goMenu('/portal/own/MyInfo.screen?p_user_id=<%=user.get("user_id")%>', '', '정보수정');" style="cursor:pointer;" /></td>
	     <td>&nbsp;</td>
	     <td><img src="/img/supplier/menu/btn_logout.gif" alt="logout"  onclick="self.location='/sign_potal_off.screen';" style="cursor:pointer;" /></td>
	    </tr>
	    </table>  
	</div>
	
		<div id="main_wrap">
		<table width="100%" height="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td valign="top"  height="103">
			<div id="header" >
				<div id="supplier-main-menu">
					<ul class="main-menu">
						<li class="logo">
							<a href="/mainPortal.screen"><img src="/img/supplier/portal_logo.png" /></a>
						</li>
						<!-- Menu -->
						<%
							if( menuManager.getSystemSize() > 0 ) { 
								for( int i = 0 ; i < menuManager.getSystemSize() ; i++ ) {
									for( int j = 0 ; j < menuManager.getMenuGroupSize() ; j++ ) {
										ValueObject menuGroupValue = menuManager.getMenuGroupValue(j);
						%>
						<li class="menuItem">
							<div><img src="<%= menuGroupValue.get("OFF_IMAGE_PATH") %>" alt="<%= menuGroupValue.get("PGM_GR_NAME")%>" /></div>
							<ul>
							<%
								int subRowSetSize = menuManager.getSubMenuRowSetSize(j);
								for( int k = 0 ; k < subRowSetSize ; k++ ) {
									ValueObject subMenuRow = menuManager.getSubMenuRowValue(j, k);
							%>
								<li onclick="javascript:goMenu('<%= subMenuRow.get("SCREEN_NAME") %>', '<%= params.get("PGM_GR_NAME") %>', '<%= subMenuRow.get("PGM_NAME") %>');"><%= subMenuRow.get("PGM_NAME") %></li>
							<%
								}
							%>
							</ul>
						</li>
						<%
									}
								}
							}
						%>
					</ul>
				</div>
			</div>
				</td>
			</tr>
			<tr>
				<td valign="top" align="center">   
					<iframe name="bodyFrame" id="bodyFrame" src="/supplier/notice.screen" tabIndex="-1" 
					marginwidth="0" 
					marginheight="0" 
					scrolling="auto"
					frameBorder="0" style="margin:0px;" width="100%" height="100%" onload="autoResize(this)"></iframe>
				</td>
			</tr>
			
		</table>
		</div>
	
	</body>
</html>