
var imgUrl = "http://img.shinhan.com/";
var webUrl = "http://www.shinhan.com/";
//
var middlePath = "new_hpe/main2010/";
//
var middlePath = "mainxml/";
//window.onload = doInit;
function doInit(){
	//openShinhanMembers();
	//setData('banner');
	//setData('notice');
	//setData('happy');	
	//setData('service');	
}		

function openShinhanMembers(){
	// ½ÅÇÑ¸â¹ö½º ¿ÀÇÂ Å¸ÀÓ Á¶Á¤
	openLay(1);
	setInterval("closeLay(1)",10000);	
}
	function setData(file){	
		
   //var xmlPath = webUrl+file+'.xml';

		//var xmlPath = imgUrl + "new_hpe/xml/"+file+".xml";

		var xmlPath = webUrl+"mainxml/"+file+".xml";
		
   $.ajax({
      url: xmlPath,
      type: 'GET',
      dataType: 'xml',
      timeout: 10000,
      //success: xmlParser,
      success : 
      function(xml){
      	var str = setStr(xml,file);
      },
      error : function(data){
      	setError(data, file);
      }      
   });
	}

	function setStr(xml,file){
		var str = "";
		if(file == 'banner'){
			var randomStr = new Array();
			var cnt = 0;
			$(xml).find('TB_MAINMNG_RST').each(function(){
				var TYPE = $.trim($(this).find("TYPE").attr('value'));            
				var FILE_ORG_NM = $.trim($(this).find("FILE_ORG_NM").attr('value'));              
				var LINK_URL = $.trim($(this).find("LINK_URL").attr('value'));                
				var CONTENT = $.trim($(this).find("CONTENT").attr('value'));
				str +="<ul id='DropHit2' style='height:150px;'>";
				str +="<li class='ban'><a href='"+LINK_URL+"'><img src='"+imgUrl+"hpe/data/upload/comadm/gbbs/01/"+FILE_ORG_NM+"' alt='' /></a></li>";
				str +="<li class='ban'>&nbsp;</li><li class='ban'>&nbsp;</li><li class='ban'>&nbsp;</li>";
				str +="</ul>";
				randomStr[cnt] = str;
				str = "";
				cnt++;
			});	
			randomStr = randomItem(randomStr);
			for(i = 0 ; i < randomStr.length ; i++)
				str += randomStr[i];		
			
			//mainBannerList.innerHTML = str; 

		}else if(file == 'notice'){

			var tmpIdx,tmpLinkUrl, tmpContent, tmpTargetStr;
			$(xml).find('TB_MAINMNG_RST').each(function(){
         
				var IDX = $.trim($(this).find("IDX").attr('value'));
				var LINK_URL = $.trim($(this).find("LINK_URL").attr('value'));                
				var CONTENT = $.trim($(this).find("CONTENT").attr('value'));  
				var FILE_NM = $.trim($(this).find("FILE_NM").attr('value')); 
				var targetStr = "";
				if(FILE_NM == "Y") targetStr = " target='_blank' ";
				
				if(IDX == '3'){
					tmpIdx = IDX;
					tmpLinkUrl = LINK_URL;
					tmpContent = CONTENT;
					tmpTargetStr = targetStr;
				}else if(IDX != '4'){
					str +="<li><p><a href='"+LINK_URL+"' "+targetStr+">"+CONTENT+"</a></p></li>";				
				}
				if(IDX == '4' && CONTENT != ''){
					str +="<li class='new' ><p><a href='"+LINK_URL+"' "+targetStr+">"+CONTENT+"</a></p>";
					str +="<p class='btn'><a href='http://www.shinhan.com/mall/news_event/psGenr_np01.jsp?cid=B00415&mid=A00051&sid=B00415'><img src='"+imgUrl+"new_hpe/main2010/btn_more.gif' alt='more' /></a></p>";
					str+="</li>";
				}else if(IDX == '4' && CONTENT == ''){				
					str +="<li><p><a href='"+tmpLinkUrl+"' "+tmpTargetStr+">"+tmpContent+"</a></p></li>";				
				}
				
			});	
			
			mainNoticeList.innerHTML = str; 

		}else if(file == 'sgroup'){
			
			var tmpIdx,tmpLinkUrl, tmpContent, tmpTargetStr, FILE_ORG_NM_IMG;
			$(xml).find('TB_MAINMNG_RST').each(function(){
        
				var IDX = $.trim($(this).find("IDX").attr('value'));
				var FILE_ORG_NM = $.trim($(this).find("FILE_ORG_NM").attr('value'));
				var LINK_URL = $.trim($(this).find("LINK_URL").attr('value'));                
				var CONTENT = $.trim($(this).find("CONTENT").attr('value'));  
				var FILE_NM = $.trim($(this).find("FILE_NM").attr('value')); 
				var targetStr = "";
				if(FILE_NM == "Y") targetStr = " target='_blank' ";
				
				if(FILE_ORG_NM == '1') 
					FILE_ORG_NM_IMG = 'http://img.shinhan.com/new_hpe/main2010/icon_newsgroup_card.gif';
				if(FILE_ORG_NM == '2')
					FILE_ORG_NM_IMG = 'http://img.shinhan.com/new_hpe/main2010/icon_newsgroup_stock.gif';
				if(FILE_ORG_NM == '3')
					FILE_ORG_NM_IMG = 'http://img.shinhan.com/new_hpe/main2010/icon_newsgroup_life.gif';
				
				//if(IDX == '3'){
					tmpIdx = IDX;
					tmpLinkUrl = LINK_URL;
					tmpContent = CONTENT;
					tmpTargetStr = targetStr;
					str +="<li><p style='background:url("+FILE_ORG_NM_IMG+") 0 2px no-repeat;padding-left:35px;'><a href='"+LINK_URL+"' "+targetStr+">"+CONTENT+"</a></p></li>";
					
					//str +="<li><p><a href='"+LINK_URL+"' "+targetStr+">"+CONTENT+"</a></p></li>";
				//}else if(IDX != '4'){
					
				//}
				/**
				if(IDX == '4' && CONTENT != ''){
					str +="<li class='new' ><p><a href='"+LINK_URL+"' "+targetStr+">"+CONTENT+"</a></p>";
					str +="<p class='btn'><a href='http://www.shinhan.com/mall/news_event/psGenr_np01.jsp?cid=B00415&mid=A00051&sid=B00415'><img src='"+imgUrl+"new_hpe/main2010/btn_more.gif' alt='more' /></a></p>";
					str +="</li>";
				}else if(IDX == '4' && CONTENT == ''){				
					str +="<li><p><a href='"+tmpLinkUrl+"' "+tmpTargetStr+">"+tmpContent+"</a></p></li>";				
				}
				*/
				
				
			});	
			
			mainGroupNoticeList.innerHTML = str; 
			
		}else if(file == 'happy'){
			var imgStr = "";
			$(xml).find('TB_MAINMNG_RST').each(function(){
         
				var IDX = $.trim($(this).find("IDX").attr('value'));
				var FILE_ORG_NM = $.trim($(this).find("FILE_ORG_NM").attr('value')); 
				var LINK_URL = $.trim($(this).find("LINK_URL").attr('value'));                
				var CONTENT = $.trim($(this).find("CONTENT").attr('value'));  
				if(IDX == '1'){
					imgStr = "<a href='"+LINK_URL+"'><img src='"+imgUrl+"hpe/data/upload/comadm/gbbs/01/"+FILE_ORG_NM+"' alt='' /></a>";
				}				
				str +="<li onmouseover=\"imgChange('"+LINK_URL+"','"+FILE_ORG_NM+"')\"><p><a href='"+LINK_URL+"'>"+CONTENT+"</a></p></li>";
				
			});	
			
			mainHappyImg.innerHTML = imgStr;
			mainHappyList.innerHTML = str; 
		}else if(file == 'service'){
			$(xml).find('TB_MAINMNG_RST').each(function(){		
				var link1 = $.trim($(this).find("LINK1").text());
				var img1 = $.trim($(this).find("IMG1").text());
				var alt1 = $.trim($(this).find("ALT1").text());
				var link2 = $.trim($(this).find("LINK2").text());
				var img2 = $.trim($(this).find("IMG2").text());
				var alt2 = $.trim($(this).find("ALT2").text());	

				str +="<ul><li class='ban'>";
						str +="<a href='"+link1+"'><img src='"+img1+"' onmouseover='imgOver(this);' onmouseout='imgOut2(this);' alt='"+alt1+"' /></a>";
						str +="<a href='"+link2+"'><img src='"+img2+"' onmouseover='imgOver(this);' onmouseout='imgOut2(this);' alt='"+alt2+"' /></a>";
				str +="</li></ul>";

			});	



			//mainServiceList.innerHTML = str;
			jFavList.innerHTML = str;
		}
  	
	}
	function imgChange(linlUrl, imgValue){
		imgStr = "<a href='"+linlUrl+"'><img src='"+imgUrl+"hpe/data/upload/comadm/gbbs/01/"+imgValue+"' alt='' /></a>";
		mainHappyImg.innerHTML = imgStr;
	}  
	function setError(data, file){
		if(file == 'banner'){
			str +="<ul id='DropHit2' style='height:150px;'>";
				   str +="<li class='ban'><a href='#'><img src='"+imgUrl+"new_hpe/main2010/ban_prd01.jpg' alt='' /></a></li>";
				   str +="<li class='ban'>&nbsp;</li><li class='ban'>&nbsp;</li><li class='ban'>&nbsp;</li>";
			str +="</ul>";
			
			str +="<ul id='DropHit2' style='height:150px;'>";
				str +="<li class='ban'><a href='#'><img src='"+imgUrl+"new_hpe/main2010/ban_prd02.jpg' alt='' /></a></li>";
				str +="<li class='ban'>&nbsp;</li><li class='ban'>&nbsp;</li><li class='ban'>&nbsp;</li>";
			str +="</ul>";
			str +="<ul id='DropHit2' style='height:150px;'>";
				   str +="<li class='ban'><a href='#'><img src='"+imgUrl+"new_hpe/main2010/ban_prd05.jpg' alt='' /></a></li>";
				   str +="<li class='ban'>&nbsp;</li><li class='ban'>&nbsp;</li><li class='ban'>&nbsp;</li>";
			str +="</ul>";
			str +="<ul id='DropHit2' style='height:150px;'>";
				   str +="<li class='ban'><a href='#'><img src='"+imgUrl+"new_hpe/main2010/ban_prd04.jpg' alt='' /></a></li>";
				   str +="<li class='ban'>&nbsp;</li><li class='ban'>&nbsp;</li><li class='ban'>&nbsp;</li>";
			str +="</ul>";
			mainBannerList.innerHTML = str;			
		}else if(file == 'notice'){
			str +="<li><p><a href='#'>½ÅÇÑ ÀÎÅÍ³Ý¹ðÅ·Á¶È¸ ¼­ºñ½ºÁ¶È¸ »ó¼¼ ¾È³»</a></p></li>";
			str +="<li><p><a href='#'>½ÅÇÑ SÄí:ÆÝ ¼­ºñ½º ¿ÀÇÂ</a></p></li>";
			str +="<li class='new'><p><a href='#'>½ÅÇÑ ºñ°ú¼¼ ¿ù º¹¸® Á¤±â¿¹±Ý</a></p></li>";
			mainNoticeList.innerHTML = str; 
		}else if(file == 'happy'){
			str +="<li><p><a href='#'>Hello! ¸ð¹ÙÀÏ¹ðÅ· ÀÌº¥Æ®Çà»ç ¾È³»</a></p></li>";
			str +="<li><p><a href='#'>MINT·¹ÀÌµðÅ¬·´ ½ÅÇÑÈ¸¿ø¾È³»</a></p></li>";
			str +="<li><p><a href='#'>½ÅÇÑÀºÇà ±è´ë¸® ÆÐÅ°Áö ÀÌº¥Æ®</a></p></li>";
			mainHappyList.innerHTML = str; 
		}
	}
	function setServiceData(file){
   //var xmlPath = webUrl+file+'.xml';
   //
		//var xmlPath = imgUrl + "new_hpe/xml/"+file+".xml";
		
		//
		var xmlPath = webUrl+"mainxml/"+file+".xml";
		
   $.ajax({
      url: xmlPath,
      type: 'GET',
      dataType: 'xml',
      timeout: 10000,
	  async:false,
      //success: xmlParser,
      success : 
      function(xml){
      	var str = "";
				$(xml).find('TB_MAINMNG_RST').each(function(){		
					var link1 = $.trim($(this).find("LINK1").text());
					var img1 = $.trim($(this).find("IMG1").text());
					var alt1 = $.trim($(this).find("ALT1").text());
					var link2 = $.trim($(this).find("LINK2").text());
					var img2 = $.trim($(this).find("IMG2").text());
					var alt2 = $.trim($(this).find("ALT2").text());	
	
					str +="<ul><li class='ban'>";
							str +="<a href='"+link1+"'><img src='"+img1+"' onmouseover='imgOver(this);' onmouseout='imgOut2(this);' alt='"+alt1+"' /></a>";
							str +="<a href='"+link2+"'><img src='"+img2+"' onmouseover='imgOver(this);' onmouseout='imgOut2(this);' alt='"+alt2+"' /></a>";
					str +="</li></ul>";
	
				});	
				jFavList.innerHTML = str;      	
      },
      error : function(data){
      	setError(data, file);
      }      
   });
	}			
	// 
	function randomItem(ran) {
	ran.sort(randOrd);
	   return ran;
	}
	
	function randOrd(){
	return (Math.round(Math.random())-0.5);
	}

	function setBannerData(file){
   //var xmlPath = webUrl+file+'.xml';
   //
		//var xmlPath = imgUrl + "new_hpe/xml/"+file+".xml";
		//
		var xmlPath = webUrl+"mainxml/"+file+".xml";
		
   $.ajax({
      url: xmlPath,
      type: 'GET',
      dataType: 'xml',
      timeout: 10000,
      //success: xmlParser,
      success : 
      function(xml){
				var randomStr = new Array();
				var str = "";
				var cnt = 0;
				$(xml).find('TB_MAINMNG_RST').each(function(){
					var TYPE = $.trim($(this).find("TYPE").attr('value'));            
					var FILE_ORG_NM = $.trim($(this).find("FILE_ORG_NM").attr('value'));              
					var LINK_URL = $.trim($(this).find("LINK_URL").attr('value'));                
					var CONTENT = $.trim($(this).find("CONTENT").attr('value'));

					str ="<ul><li class='ban'><a href='"+LINK_URL+"'><img src='"+imgUrl+"hpe/data/upload/comadm/gbbs/01/"+FILE_ORG_NM+"' alt='' /></a></li></ul>";					

					randomStr[cnt] = str;
					str = "";
					cnt++;
				});
				
				// ÃßÃµ±ÝÀ¶»óÇ° ·£´ý ÀÖÀ»°æ¿ì
				
				var tmpArr = randomItem(randomStr);
				for(i = 0 ; i < tmpArr.length ; i++)
				str += tmpArr[i];
				
				// ÃßÃµ±ÝÀ¶»óÇ° ·£´ý ¾øÀ»°æ¿ì
				//for(i = 0 ; i < randomStr.length ; i++)
				//str += randomStr[i];
			//				
				str +=str;
				jFavList2.innerHTML = str;	
      },
      error : function(data){
      	setError(data, file);
      }      
   });
	}
			/**/
			function go_Icon(val){
				/*

				4 - http://banking.shinhan.com/gate.html?NCODE=32010
				*/
				//alert(val);
				if(val == '1') top.location.href="http://banking.shinhan.com/gate.html?/login/login_frame.jsp?&mainclick=bank_johey"; 
				else if(val == '2') top.location.href="http://banking.shinhan.com/gate.html?NCODE=42001&mainclick=bank_iche"; 
				else if(val == '3') top.location.href="http://banking.shinhan.com/gate.html?/rib/cert/O_RIBC1100.jsp?&mainclick=bank_cert";
				else if(val == '4') location.href="/pbank/bankservice/mobile/mbl_spcl.jsp?cid=C00633&mid=A00030&sid=B00175&mainclick=bank_mobile";
				else if(val == '5') location.href="http://www.shinhan.com/mall/lm/offer/simple_loan.jsp?cid=C01462&mid=A00002&sid=B00089&mainclick=bank_simpleloan"; 
				//else if(val == '5') top.location.href="http://banking.shinhan.com/gate.html?NCODE=43503&mainclick=bank_yeartax"; 
				//else if(val == '6') top.location.href="http://banking.shinhan.com/gate.html?NCODE=46050&mainclick=bank_fund";
				else if(val == '6') top.location.href="http://www.shinhan.com/mall/news_event/psGenr_news01.jsp?cid=B00416&mid=A00051&sid=B00416&pseq=3499&mainclick=bank_1004";
				else if(val == '7') top.location.href="http://banking.shinhan.com/gate.html?NCODE=32010&mainclick=bank_alljohey";
				//else if(val == '8') window.open('http://www.shinhancard.com');
				else if(val == '8') top.location.href="http://banking.shinhan.com/gate.html?/login/login_frame.jsp?sloyn=1&mainclick=bank_scard"; 
				else if(val == '9') window.open('/branch/domestic/domestic.jsp?&mainclick=bank_domestic','branch','width=980, height=700');
				else if(val == '10') top.location.href="http://banking.shinhan.com/gate.html?NCODE=61010&mainclick=bank_emjohey";
				else if(val == '11') top.location.href="http://banking.shinhan.com/gate.html?NCODE=80011&mainclick=bank_loan";	
				else if(val == '12') window.open('http://www.shinhan.com/mall/dm/rate/rate_free_pop.jsp?&mainclick=bank_rate','guide1','top=0,left=0,width=750,height=600,scrollbars=1');
				else if(val == '13') window.open('http://banking.shinhan.com/silver/index.jsp?&mainclick=bank_silver');
				else if(val == '14') location.href="http://www.shinhan.com/pbank/bankservice/ebankservice/psnl_ezplus_info.jsp?cid=C00605&mid=A00030&sid=B00174&mainclick=bank_ezplus";	
			}	
			/* layer open-close */
			function gloOver() {
				document.getElementById('gnb').style.position = 'relative';
				document.getElementById('gnb').style.zIndex = '-1';
				document.getElementById('gloNet').style.height = msg;
				document.getElementById('query').style.display = 'none';
//				document.getElementById('inType').style.display = 'none';
			}
			function gloOut() {
				document.getElementById('gnb').style.position = 'relative';
				document.getElementById('gnb').style.zIndex = '-1';
				document.getElementById('gloNet').style.height = msg;
				document.getElementById('query').style.display = 'block';
//				document.getElementById('inType').style.display = 'block';
			}
			function showGnb(n) {
				document.getElementById('depth2_'+n).style.display = 'block';
				document.getElementById('depth1_'+n).style.display = 'none';
			}
			function hideGnb(n) {
				document.getElementById('depth2_'+n).style.display = 'none';
				document.getElementById('depth1_'+n).style.display = 'block';
			}
			function openLay(n) {
				document.getElementById('lay_'+n).style.display = 'block';
			}
			function closeLay(n) {
				document.getElementById('lay_'+n).style.display = 'none';
			}
			function openFooter(n) {
				document.getElementById('lay_f'+n).style.display = 'block';
				document.getElementById('lay_fh'+n).style.display = 'none';
			}
			function closeFooter(n) {
				document.getElementById('lay_f'+n).style.display = 'none';
				document.getElementById('lay_fh'+n).style.display = 'block';
			}
			/* rollover */
			var selectedOverImg = '';
			function imgOver(param) {
				var obj;
				if (typeof param == "string" ){
					obj = document.getElementById(param);
				} else {
					obj = param;
				}
				if(obj.src.search(/\_over/gi) >= 0)selectedOverImg = obj.src;
				obj.src = obj.src.replace("_out.", "_over.");
			}
			function imgOut2(param) {
				var obj;
				if (typeof param == "string" ){
					obj = document.getElementById(param);
				} else {
					obj = param;
				}
				if(obj.src != selectedOverImg)obj.src = obj.src.replace("_over.", "_out.") 
			}
			var tb_returnURL;
			var requireReload = false;
			function openLogin(returnURL){
				tb_returnURL = returnURL;
				$.ajax({
					type: "POST",
					url: "/raemian/member?cmd=isLogin",
					data: "",
					success: function(msg){
						if(msg == 0) {
							requireReload = true;
							login();
						}
						else {
							goReturnPage();
						}
					}
					});
			}
			
			/* png images */
			function setPng24(obj) { 
			  obj.width=obj.height=1; 
			  obj.className=obj.className.replace(/\bpng24\b/i,''); 
			  obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
			  obj.src='';  
			  return ''; 
			} 

			/* all menu */
			function goAllmenu(){
				var html_dom = document.getElementsByTagName('html')[0];  
				var overflow = '';  
				 
				if(html_dom.style.overflow=='') overflow='hidden';  
				else overflow='';  
				 
				html_dom.style.overflow = overflow;  
				document.getElementById('allMenu').style.display = 'block';
			}
			function closeAllmenu() {
				var html_dom = document.getElementsByTagName('html')[0];  
				var overflow = '';  
				 
				if(html_dom.style.overflow=='') overflow='auto';  
				else overflow='';  
				 
				html_dom.style.overflow = overflow;  
				document.getElementById('allMenu').style.display = 'none';
			}

			/* non auto rolling */  
			var downLayerId;
			var dropDegree = 10; //
			var doDirect;
			var DirectTerm = 1000000; //
			var curDropIdx = 0;

					
			function DirectDown()
			{
					clearInterval(doDirect);
					clearInterval(downLayerId);
					
					for(i = curDropIdx ;i < document.all["DropHit"].length + curDropIdx;i++){
							document.all["DropHit"][i%document.all["DropHit"].length].style.posTop = document.all["DropHit"][i%document.all["DropHit"].length].style.posHeight * (-1*((i-curDropIdx)%document.all["DropHit"].length));
					}
					var temp = 'setInterval("DownLayer()",10)';
					downLayerId = eval(temp);
					direction = "down";
			}
			function DownLayer()
			{
					if(document.all["DropHit"][curDropIdx].style.posTop < document.all["DropHit"][curDropIdx].style.posHeight){
							for(j = curDropIdx ;j < document.all["DropHit"].length + curDropIdx;j++){
									document.all["DropHit"][j%document.all["DropHit"].length].style.posTop += dropDegree;
							}
					}else{
							clearInterval(downLayerId);
							for(j = curDropIdx ;j < document.all["DropHit"].length + curDropIdx;j++){
									document.all["DropHit"][j%document.all["DropHit"].length].style.posTop = document.all["DropHit"][j%document.all["DropHit"].length].style.posHeight *((-1*((j-curDropIdx)%document.all["DropHit"].length))+1);
							}
							curDropIdx = (curDropIdx + 1) ;
							curDropIdx = curDropIdx > document.all["DropHit"].length-1 ? curDropIdx%document.all["DropHit"].length:curDropIdx;
							var temp = 'setInterval("DirectDown()",DirectTerm)';
							doDirect = eval(temp);
					}
			}
			function DirectUp()
			{
					clearInterval(doDirect);
					clearInterval(downLayerId);

					var tempIdx = 0;
					for(i = 0;i<document.all["DropHit"].length;i++){
							tempIdx = (document.all["DropHit"].length + curDropIdx - i) %document.all["DropHit"].length;
							document.all["DropHit"][tempIdx].style.posTop = i*document.all["DropHit"][tempIdx].style.posHeight;
					}
					var temp = 'setInterval("UpLayer()",10)';
					downLayerId = eval(temp);
					direction = "up";
			}
			function UpLayer()
			{
					var tempIdx = 0;
					if(document.all["DropHit"][curDropIdx].style.posTop < document.all["DropHit"][curDropIdx].style.posHeight && document.all["DropHit"][curDropIdx].style.posTop > document.all["DropHit"][curDropIdx].style.posHeight * (-1)){
							for(j = 0 ;j < document.all["DropHit"].length;j++){
									tempIdx = (document.all["DropHit"].length + curDropIdx - j) %document.all["DropHit"].length;
									document.all["DropHit"][tempIdx].style.posTop -= dropDegree;
							}
					}else{
							clearInterval(downLayerId);
							for(j = 0;j<document.all["DropHit"].length;j++){
									tempIdx = (document.all["DropHit"].length + curDropIdx - j) % document.all["DropHit"].length;
									document.all["DropHit"][tempIdx].style.posTop = (j-1)*(document.all["DropHit"][tempIdx].style.posHeight);
							}
							curDropIdx = (curDropIdx - 1) ;
							curDropIdx = curDropIdx < 0 ? document.all["DropHit"].length-1:curDropIdx;
							var temp = 'setInterval("DirectUp()",DirectTerm)';
							doDirect = eval(temp);
					}
			}

			/* news layer */
			function showSvc() {
				document.getElementById('svc_show').style.display = 'none';
				document.getElementById('svc_hide').style.display = 'block';
				document.getElementById('lay_svc').style.display = 'block';
			}
			function hideSvc() {
				document.getElementById('svc_show').style.display = 'block';
				document.getElementById('svc_hide').style.display = 'none';
				document.getElementById('lay_svc').style.display = 'none';
			}
			
			function goEasyLink(idx){
    var workWin ;
    var easyUrl ;
    var features = "";
	var __easy_baseURL2 = "http://banking.shinhan.com/rib/easy_integ/easy_index.jsp?";
	switch(idx){
		case "easy_01" :	// 
					easyUrl = "/rib/easy_integ/simpleInquiryMain.jsp";
		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
					break;
		case "easy_02" :	// 
					easyUrl = "/rib/easy_integ/simpleTransferMain.jsp";
		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
					break;
		case "easy_03" :	// 
					easyUrl = "/rib/easy_integ/O_EASYRIBD5220.jsp";
		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
					break;
		case "easy_04" :	// 
					easyUrl = "/rib/easy_integ/O_EASYRIBF3730.jsp";
		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
					break;
		case "easy_05" :	// 
					easyUrl = "/rib/easy_integ/O_EASYRIBG0000.jsp";
		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
					break;
		case "easy_06" :	// 
					easyUrl = "/rib/easy_integ/O_EASYRIBG9000.jsp";
		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
					break;
//		case "easy_07" :	// 
//					easyUrl = "/rib/easy_integ/O_EASYRIBG9341.jsp";
//		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
//					break;
//		case "easy_08" :	//
//					easyUrl = "/rib/easy_integ/O_EASYRIBE3200.jsp";
//		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
//					break;
//		case "easy_09" :
//					easyUrl = "/rib/easy_integ/O_EASYRIBD3500.jsp";
//		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
//					break;
		case "easy_10" :  //
					easyUrl = "/rib/easy_integ/O_EASYRIBE3140.jsp";
		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
					break;
		case "easy_14" :	// 
					easyUrl = "/rib/easy_integ/O_EASYRIBF1130.jsp";
		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
					break;

		case "easy_15" :	// 
					easyUrl = "/rib/easy_integ/O_EASYRIBG5321.jsp";
		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
					break;
		case "easy_25" :	// 
					easyUrl = "/rib/easy_integ/O_EASYRIBG5331.jsp";
		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
					break;
		case "easy_35" :	// 
					easyUrl = "/rib/easy_integ/O_EASYRIBG5341.jsp";
		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
					break;

		case "easy_16" :	// 
					easyUrl = "/rib/easy_integ/O_EASYRIBG9520.jsp";
		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
					break;
		case "easy_26" :	// 
					easyUrl = "/rib/easy_integ/O_EASYRIBG9000.jsp";
		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
					break;
		case "easy_36" :	// 
					easyUrl = "/rib/easy_integ/O_EASYRIBG9321.jsp";
		features = "scrollbars=no,toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=no";
					break;
	
	}

		workWin = window.open(__easy_baseURL2 + easyUrl , 'pop_work', features);
    workWin.focus();				
			}


			/* auto new */
function scrolling(objId,sec1,sec2,speed,height){ 
  this.objId=objId; 
  this.sec1=sec1; 
  this.sec2=sec2; 
  this.speed=speed; 
  this.height=height; 
  this.h=0; 
  this.div=document.getElementById(this.objId); 
  this.htmltxt=this.div.innerHTML; 
  this.div.innerHTML=this.htmltxt+this.htmltxt; 
  this.div.isover=false; 
  this.div.onmouseover=function(){this.isover=true;} 
  this.div.onmouseout=function(){this.isover=false;} 
  var self=this; 
  this.div.scrollTop=0; 
  window.setTimeout(function(){self.play()},this.sec1); 
} 
scrolling.prototype={ 
  play:function(){ 
    var self=this; 
    if(!this.div.isover){ 
      this.div.scrollTop+=this.speed; 
      if(this.div.scrollTop>this.div.scrollHeight/2){ 
        this.div.scrollTop=0; 
      }else{ 
        this.h+=this.speed; 
        if(this.h>=this.height){ 
          if(this.h>this.height|| this.div.scrollTop%this.height !=0){ 
            this.div.scrollTop-=this.h%this.height; 
          } 
          this.h=0; 
          window.setTimeout(function(){self.play()},this.sec1); 
          return; 
        } 
      } 
    } 
    window.setTimeout(function(){self.play()},this.sec2); 
  }, 
  prev:function(){ 
    if(this.div.scrollTop == 0) 
    this.div.scrollTop = this.div.scrollHeight/2; 
    this.div.scrollTop -= this.height; 
  }, 
  next:function(){ 
    if(this.div.scrollTop ==  this.div.scrollHeight/2) 
    this.div.scrollTop =0; 
    this.div.scrollTop += this.height; 
  } 
}; 

/* */
function scrolling2(objId,sec1,sec2,speed,height){ 
  this.objId=objId; 
  this.sec1=sec1; 
  this.sec2=sec2; 
  this.speed=speed; 
  this.height=height; 
  this.h=0; 
  this.div=document.getElementById(this.objId);   
  this.htmltxt=this.div.innerHTML; 
  this.div.innerHTML=this.htmltxt+this.htmltxt; 
  this.div.isover=false; 
  this.div.onmouseover=function(){this.isover=true;} 
  this.div.onmouseout=function(){this.isover=false;} 
  var self=this; 
  this.div.scrollTop=0;     
  window.setTimeout(function(){self.roll()},this.sec1); 
} 
scrolling2.prototype={ 
  play:function(){ 
    var self=this; 
        if(!this.div.isover){ 
      this.div.scrollTop+=this.speed; 
      if(this.div.scrollTop>this.div.scrollHeight/2){ 
        this.div.scrollTop=0; 
      }else{ 
        this.h+=this.speed; 
        if(this.h>=this.height){ 
          if(this.h>this.height|| this.div.scrollTop%this.height !=0){ 
            this.div.scrollTop-=this.h%this.height; 
          } 
          this.h=0; 
          window.setTimeout(function(){self.play()},this.sec1); 
          return; 
        } 
      } 
    } 
    window.setTimeout(function(){self.play()},this.sec2); 
  }, 
  prev:function(){   	
    if(this.div.scrollTop == 0) 
    this.div.scrollTop = this.div.scrollHeight/2;     
    this.div.scrollTop -= this.height; 
  }, 
  next:function(){   	
    if(this.div.scrollTop ==  this.div.scrollHeight/2) 
    this.div.scrollTop =0; 
    this.div.scrollTop += this.height; 
  } 
}; 



			
			/* news layer */
			function showSvc() {
				document.getElementById('svc_show').style.display = 'none';
				document.getElementById('svc_hide').style.display = 'block';
				document.getElementById('lay_svc').style.display = 'block';
			}
			function hideSvc() {
				document.getElementById('svc_show').style.display = 'block';
				document.getElementById('svc_hide').style.display = 'none';
				document.getElementById('lay_svc').style.display = 'none';
			}


			
			/* auto rolling */
			var scrollspeed = 1;		
			var s_tmp = 0, s_amount = 24;
			var startPanel=0, n_panel=0, i=0;
			var scroll_img_view_check = 0;

			function startscroll()
			{ // 
				i=0;
				for (i in scroll_content)
					n_panel++;
									
				n_panel = n_panel -1 ;
				startPanel = Math.round(Math.random()*n_panel);
				if(startPanel == 0)
				{
					i=0;
					for (i in scroll_content) 
						insert_area(total_area, total_area++); // area 
				}
				else if(startPanel == n_panel)
				{
					insert_area(startPanel, total_area);
					total_area++;
					for (i=0; i<startPanel; i++) 
					{
						insert_area(i, total_area); // area 
						total_area++;
					}
				}
				else if((startPanel > 0) || (startPanel < n_panel))
				{
					insert_area(startPanel, total_area);
					total_area++;
					for (i=startPanel+1; i<=n_panel; i++) 
					{
						insert_area(i, total_area); // area 
						total_area++;
					}
					for (i=0; i<startPanel; i++) 
					{
						insert_area(i, total_area); // area 
						total_area++;
					}
				}
				scroll_interval = setInterval("scrollingFoot()", waitingtime);
			}

			function scrollingFoot(){ // 
				if (scroll_content_act)
				{
					for (i=0;i<total_area;i++){
						tmp = document.getElementById('scroll_area'+i).style;
						tmp.top = parseInt(tmp.top)-scrollspeed;
						if (parseInt(tmp.top) <= -scrollerheight){
							tmp.top = scrollerheight*(total_area-1);
						}
					}
					if (s_tmp++ >= (s_amount - 1)){
						if (scroll_img_view_check%2 == 0){
							clearInterval(scroll_interval);
							s_tmp = 0;
							scroll_interval = setInterval("scrollingFoot()", waitingtime);
							return;
						}
					}
				}
				clearInterval(scroll_interval);
				scroll_interval = setInterval("scrollingFoot()", 1);
			}

			function scrolling_next(){ // 
				for (i=0;i<total_area;i++){
					tmp = document.getElementById('scroll_area'+i).style;
					var start = tmp.top;
					if (parseInt(tmp.top) <= 0) {
						tmp.top = scrollerheight*(total_area - 1);
					} else {
						if (parseInt(tmp.top)%scrollerheight == 0)
							tmp.top = parseInt(parseInt(tmp.top)/scrollerheight - 1)*scrollerheight;
						else
							tmp.top = parseInt(parseInt(tmp.top)/scrollerheight)*scrollerheight;
					}
				}
				clearInterval(scroll_interval);
				s_tmp = 0;
				scroll_interval = setInterval("scrollingFoot()", waitingtime);
			}

			function insert_area(idx, n){ // area 
				html='<div style="width:150px;height:24px;left: 0px; position: absolute; top: '+(scrollerheight*n)+'px" id="scroll_area'+n+'">';
				html+=scroll_content[idx]+'\n';
				html+='</div>\n';
				document.write(html);
			}

			var cur_scroll_content = 0;
			var scroll_content_act = true;

			function next_view() {
				scrolling_next();
			}
			function set_media_content() 
			{
				++cur_scroll_content;		
				if (cur_scroll_content >= scroll_content.length)
					cur_scroll_content = 0;
			}

var rolling = function(this_s,pos_flag){if(this_s.nodeType==1){this.this_s = this_s;}else{this.this_s = document.getElementById(this_s);};this.is_rolling = false;this.direction = 1;this.children =	null;this.move_gap = 1;this.time_dealy = 100;this.time_dealy_pause = 1000;this.time_timer=null;this.time_timer_pause=null;this.mouseover=false;this.init(pos_flag==null?'relative':'absolute');this.set_direction(this.direction);};
rolling.prototype.init = function(pos_flag){this.this_s.style.position=pos_flag;this.this_s.style.overflow='hidden';var children = this.this_s.childNodes;for(var i=(children.length-1);0<=i;i--){if(children[i].nodeType==1){children[i].style.position='relative';}else{this.this_s.removeChild(children[i]);}};var this_s=this;this.this_s.onmouseover=function(){this_s.mouseover=true;if(!this_s.time_timer_pause){this_s.pause();}};this.this_s.onmouseout=function(){this_s.mouseover=false;if(!this_s.time_timer_pause){this_s.resume();}};}
rolling.prototype.set_direction = function(direction){this.direction=direction;if(this.direction==2 ||this.direction==4){this.this_s.style.whiteSpace='nowrap';}else{this.this_s.style.whiteSpace='normal';};var children = this.this_s.childNodes;for(var i=(children.length-1);0<=i;i--){if(this.direction==1){children[i].style.display='block';}else if(this.direction==2){children[i].style.textlign='right';children[i].style.display='inline';}else if(this.direction==3){children[i].style.display='block';}else if(this.direction==4){children[i].style.display='inline';}}this.init_element_children();};
rolling.prototype.init_element_children = function(){var children = this.this_s.childNodes;this.children = children;for(var i=(children.length-1);0<=i;i--){if(this.direction==1){children[i].style.top='0px';}else if(this.direction==2){children[i].style.left='-'+this.this_s.firstChild.offsetWidth+'px';}else if(this.direction==3){children[i].style.top='-'+this.this_s.firstChild.offsetHeight+'px';}else if(this.direction==4){children[i].style.left='0px';}}};
rolling.prototype.act_move_up = function(){for(var i = 0,m=this.children.length;i<m;i++){var child = this.children[i];child.style.top=(parseInt(child.style.top)-this.move_gap)+'px';}if((this.children[0].offsetHeight+parseInt(this.children[0].style.top))<=0){this.this_s.appendChild(this.children[0]);this.init_element_children();this.pause_act();}};
rolling.prototype.move_up = function(){if(this.direction!=1&&this.direction!=3){return false;}this.this_s.appendChild(this.children[0]);this.init_element_children();this.pause_act();};
rolling.prototype.act_move_down = function(){for(var i = 0,m=this.children.length;i<m;i++){var child = this.children[i];child.style.top=(parseInt(child.style.top)+this.move_gap)+'px';}if(parseInt(this.children[0].style.top)>=0){this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);this.init_element_children();this.pause_act();}};
rolling.prototype.move_down = function(){if(this.direction!=1&&this.direction!=3){return false;}this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);this.init_element_children();this.pause_act();};
rolling.prototype.act_move_left = function(){for(var i = 0,m=this.children.length;i<m;i++){var child = this.children[i];child.style.left=(parseInt(child.style.left)-this.move_gap)+'px';};if((this.children[0].offsetWidth+parseInt(this.children[0].style.left))<=0){this.this_s.appendChild(this.this_s.firstChild);this.init_element_children();this.pause_act();}};
rolling.prototype.move_left = function(){if(this.direction!=2&&this.direction!=4){return false;}this.this_s.appendChild(this.this_s.firstChild);this.init_element_children();this.pause_act();};
rolling.prototype.act_move_right = function(){for(var i = 0,m=this.children.length;i<m;i++){var child = this.children[i];child.style.left=(parseInt(child.style.left)+this.move_gap)+'px';};if(parseInt(this.this_s.lastChild.style.left)>=0){this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);this.init_element_children();this.pause_act();}};
rolling.prototype.move_right = function(){if(this.direction!=2&&this.direction!=4){return false;}this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);this.init_element_children();this.pause_act();};
rolling.prototype.start = function(){var this_s = this;this.stop();this.is_rolling = true;var act = function(){if(this_s.is_rolling){if(this_s.direction==1){this_s.act_move_up();}else if(this_s.direction==2){this_s.act_move_right();}else if(this_s.direction==3){this_s.act_move_down();}else if(this_s.direction==4){this_s.act_move_left();}}};this.time_timer = setInterval(act,this.time_dealy);};
rolling.prototype.pause_act = function(){if(this.time_dealy_pause){var this_s = this;var act = function(){this_s.resume();this_s.time_timer_pause=null;};if(this.time_timer_pause){clearTimeout(this.time_timer_pause);};this.time_timer_pause = setTimeout(act,this.time_dealy_pause);this.pause();}};
rolling.prototype.pause = function(){this.is_rolling = false;};
rolling.prototype.resume = function(){if(!this.mouseover){this.is_rolling = true;}};
rolling.prototype.stop = function(){this.is_rolling = false;if(!this.time_timer){clearInterval(this.time_timer);}this.time_timer = null;};			
