var thisUrl = location.href;
var referUrl = document.referrer;

//console.log("referUrl : " + referUrl);

/*
if(thisUrl.indexOf("https")>-1){
	thisUrl = thisUrl.replace("https://","http://");
	location.href = thisUrl;
}
*/

if(thisUrl.indexOf("reporter.korea.kr")>-1){
	thisUrl = "https://www.korea.kr/news/reporterList.do";;
	location.href = thisUrl;
}
	//thisUrl     = "https://www.korea.kr:7001/policy/economyView.do?newsId=148798598&aaa=11";
	var trueUrl = "";
	var param   = "";
	var pass    = false;

if(thisUrl.indexOf("economy.korea.kr") > -1) {				//economy
	trueUrl = "https://www.korea.kr"+thisUrl.substr(thisUrl.indexOf("economy.korea.kr")+16, thisUrl.length); //thisUrl.indexOf("economy.korea.kr");

	pass = true;
}
//2019.12.03 policy -> news url변경 추가
else if(thisUrl.indexOf("/policy/cardnewsView.do") > -1){
	trueUrl = thisUrl.replace("/policy/cardnewsView.do","/news/cardnewsView.do");
	pass = true;
}

/*else if(thisUrl.indexOf("policyplus/policyQuizList.do") > -1){
	if(thisUrl.indexOf("quizId") == -1){
		trueUrl = "https://www.korea.kr/policyplus/policyQuizList.do?quizId=01IjqUvCADGJ000"
		pass = true;
	}
}else if(thisUrl.indexOf("/policyplus/byulbyulList.do") > -1){
	if(thisUrl.indexOf("issue") == -1){
		trueUrl = "https://www.korea.kr/policyplus/byulbyulList.do?issue=01Ii27t0EDGJ000"
		pass = true;
	}
}*/

if(pass) {
	trueUrl = trueUrl + param;
		window.location.href = trueUrl;
}

var cookie = document.cookie;
var ckCnt = cookie.indexOf("selectedMedia=PC");
if(ckCnt == -1){
	
	if( navigator.userAgent.match(/Android/i)
	    || navigator.userAgent.match(/webOS/i)
	    || navigator.userAgent.match(/iPhone/i)
	    || navigator.userAgent.match(/iPad/i)
	    || navigator.userAgent.match(/iPod/i)
	    || navigator.userAgent.match(/BlackBerry/i)
	    || navigator.userAgent.match(/Windows Phone/i) ){
		
		
		 if(thisUrl.indexOf("guide/privacy.do") > -1) {						//개인??보 처리방침
			trueUrl = "https://m.korea.kr/etc/privacy.do";
			pass = true;
		} else if(thisUrl.indexOf("etc/privacy.do") > -1) {						//개인정보 처리방침
			trueUrl = "https://m.korea.kr/etc/privacy.do";
			pass = true;
		} else if(thisUrl.indexOf("guide/copyRight.do") > -1) {						//????권??책
			trueUrl = "https://m.korea.kr/etc/copyRight.do";
			pass = true;
		} else if(thisUrl.indexOf("etc/copyRight.do") > -1) {						//저작권정책
			trueUrl = "https://m.korea.kr/etc/copyRight.do";
			pass = true;
		} else if(thisUrl.indexOf("guide/emailReject.do") > -1) {					//??메????집거??
			trueUrl = "https://m.korea.kr/etc/emailReject.do";
			pass = true;
		} else if(thisUrl.indexOf("etc/emailReject.do") > -1) {					//이메일수집거부
			trueUrl = "https://m.korea.kr/etc/emailReject.do";
			pass = true;
		} else if(thisUrl.indexOf("guide/toMaster.do") > -1) {					//운영자에게
			trueUrl = "https://m.korea.kr/etc/toMaster.do";
			pass = true;
		} else if(thisUrl.indexOf("cultureWriterView.do") > -1){
			trueUrl = "https://m.korea.kr/news/cultureColumnView.do";
				param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
				pass = true;
		} else if(thisUrl.indexOf("briefing/stateCouncilList.do") > -1) {			//??????의 브리??
			trueUrl = "https://m.korea.kr/briefing/briefingHomeList.do?gubun=stateCouncil";
			pass = true;
		} else if(thisUrl.indexOf("briefing/policyBriefingList.do") > -1) {			//???? 브리??
			trueUrl = "https://m.korea.kr/briefing/briefingHomeList.do?gubun=policyBriefing";
			pass = true;
		} else if(thisUrl.indexOf("briefing/presidentList.do") > -1) {
			trueUrl = "https://m.korea.kr/briefing/briefingHomeList.do?gubun=president";
			pass = true;
		} else if(thisUrl.indexOf("archive/ebookWeeklyList.do") > -1) {
			trueUrl = "https://m.korea.kr/archive/ebookMainList.do";
			pass = true;
		} else if(thisUrl.indexOf("archive/ebookDeptList.do") > -1) {
			trueUrl = "https://m.korea.kr/archive/ebookMainList.do?metaId=dept_ebook";
			pass = true;
		}  else if(thisUrl.indexOf("archive/ebookCartoonList.do") > -1) {
			trueUrl = "https://m.korea.kr/archive/ebookMainList.do?metaId=yaho_korea2";
			pass = true;
		} else if(thisUrl.indexOf("archive/expDocMainList.do") > -1 || thisUrl.indexOf("archive/expDocList.do") > -1) {				//??문??료 리스??
			trueUrl = "https://m.korea.kr/archive/expDocMainList.do";
			pass = true;
		} else if(thisUrl.indexOf("etc/byulbyulList.do") > -1) {				//SNS이벤트
			
			trueUrl = "https://m.korea.kr/etc/byulbyulView.do"+location.href.substr(location.href.indexOf('?'));
			pass = true;
		} else if(thisUrl.indexOf("etc/byulBeforeList.do") > -1 && thisUrl.indexOf("period=ended") < 0 ) {				//SNS이벤트
			trueUrl = "https://m.korea.kr/etc/policyQuizList.do?pageSe=byulbyul&eventIng=ING";
			pass = true;
		} else if(thisUrl.indexOf("etc/byulBeforeList.do") > -1 && thisUrl.indexOf("period=ended") > -1 ) {				//SNS이벤트
			trueUrl = "https://m.korea.kr/etc/policyQuizList.do?pageSe=byulbyul&eventIng=END";
			pass = true;
		} else if(thisUrl.indexOf("etc/policyQuizList.do") > -1 ) {				//정책퀴즈
			trueUrl = "https://m.korea.kr/etc/policyQuizView.do";
			pass = true;
		} else if(thisUrl.indexOf("news/policyFocusHome.do") > -1 ) {			//정책포커스
			trueUrl = "https://m.korea.kr/news/policyFocusList.do";
			pass = true;
		} else if(thisUrl.indexOf("/main.do") > -1) {				//SNS이벤트
			trueUrl = "https://m.korea.kr";
			pass = true;
		}else if(thisUrl.indexOf("/etc/newsNotifySetting.do") > -1) {				//SNS이벤트
			trueUrl = "https://m.korea.kr/etc/newsNotifyGuide.do?pageSe=setting";
			pass = true;
		} else{
			//thisUrl = thisUrl.replace("https://www.korea.kr", "http://m.korea.kr");
			//thisUrl = thisUrl.replace("http://korea.kr", "http://m.korea.kr");
			thisUrl = thisUrl.replace("https://korea.kr", "https://m.korea.kr");
			thisUrl = thisUrl.replace("https://www.korea.kr", "https://m.korea.kr");
			console.log("trueUrl=="+thisUrl);
			trueUrl = thisUrl;
			pass = true;				
		}



		if(pass) {
			trueUrl = trueUrl + param;
				window.location.href = trueUrl;
				console.log(trueUrl);
		}
		
		/*
		if(thisUrl.indexOf("deptIntroduceView.do") > -1) {
			url = thisUrl.substring(thisUrl.indexOf("url=")+4, thisUrl.indexOf("url=")+11);
			trueUrl = "https://www.gov.kr/portal/orgInfo/"+url;
			pass = true;
		}else if(thisUrl.indexOf("policyNewsView.do") > -1) {
			trueUrl = "https://m.korea.kr/news/policyNewsView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		
		} else if(thisUrl.indexOf("cultureView.do") > -1) {	
			trueUrl = "https://m.korea.kr/news/policyNewsView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		
		} else if(thisUrl.indexOf("societyView.do") > -1) {	
			trueUrl = "https://m.korea.kr/news/policyNewsView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		
		} else if(thisUrl.indexOf("diplomacyView.do") > -1) {	
			trueUrl = "https://m.korea.kr/news/policyNewsView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		
		} else if(thisUrl.indexOf("/policy/mainView.do") > -1) {	
			trueUrl = "https://m.korea.kr/news/policyNewsView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		
		} else if(thisUrl.indexOf("summitDiplomacyList.do") > -1) {
			trueUrl = "https://m.korea.kr/special/summitDiplomacyList.do";
			pass = true;
		
		} else if(thisUrl.indexOf("summitDiplomacyView.do") > -1){
			trueUrl = "https://m.korea.kr/special/summitDiplomacyView.do";
			param   = "?pkgId=" + thisUrl.substring(thisUrl.indexOf("pkgId=")+6, thisUrl.indexOf("pkgId=")+15);	
			param   += "newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
			pass = true;
			
		} else if(thisUrl.indexOf("cardnewsView.do") > -1) {
	
			trueUrl = "https://m.korea.kr/news/cardnewsView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);		
			pass = true;
		} else if(thisUrl.indexOf("pressReleaseView.do") > -1) {
			trueUrl = "https://m.korea.kr/news/pressReleaseView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		
		} else if(thisUrl.indexOf("actuallyView.do") > -1) {
			//trueUrl = "https://m.korea.kr/newsWeb/m/factView.do";
			trueUrl = "https://m.korea.kr/news/actuallyView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		
		} else if(thisUrl.indexOf("graphicsView.do") > -1) {
			trueUrl = "https://m.korea.kr/news/graphicsView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
	
		} else if(thisUrl.indexOf("cartoonView.do") > -1) {
			trueUrl = "https://m.korea.kr/news/cartoonView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
			
		} else if(thisUrl.indexOf("weekendView.do") > -1) {
			//trueUrl = "https://m.korea.kr/newsWeb/m/factView.do";
			trueUrl = "https://m.korea.kr/news/weekendView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
			
		} else if(thisUrl.indexOf("healthView.do") > -1) {
			trueUrl = "https://m.korea.kr/news/healthView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
			
		} else if(thisUrl.indexOf("policyQuizList.do") > -1) {
			if(thisUrl.indexOf("quizId") > -1){
				trueUrl = "https://m.korea.kr/etc/policyQuizView.do";
				param   = "?quizId=" + thisUrl.substring(thisUrl.indexOf("quizId=")+7, thisUrl.indexOf("quizId=")+22);
				pass = true;
			}else{
				trueUrl = "https://m.korea.kr/etc/policyQuizList.do";
				pass = true;
			}
			
			
		} else if(thisUrl.indexOf("policyQuizView.do") > -1) {
			trueUrl = "https://m.korea.kr/etc/policyQuizView.do";
			pass = true;
			if(thisUrl.indexOf("quizId") > -1){
				param   = "?quizId=" + thisUrl.substring(thisUrl.indexOf("quizId=")+7, thisUrl.indexOf("quizId=")+22);
			}
		} else if(thisUrl.indexOf("reporterView.do") > -1) {
			
			trueUrl = "https://m.korea.kr/news/reporterView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		} else if(thisUrl.indexOf("reporterList.do") > -1) {
			
			trueUrl = "https://m.korea.kr/news/reporterList.do";
			pass = true;
		} else if(thisUrl.indexOf("economyList.do") > -1 || thisUrl.indexOf("cultureList.do") > -1|| thisUrl.indexOf("societyList.do") > -1
				|| thisUrl.indexOf("diplomacyList.do") > -1){
			trueUrl = "https://m.korea.kr/news/policyNewsList.do";
			pass = true;
			
		} else if(thisUrl.indexOf("cardnewsList.do") > -1 || thisUrl.indexOf("cardnewsMainList.do") > -1) {
			trueUrl = "https://m.korea.kr/news/policyNewsList.do";
			pass = true;
			
		} else if(thisUrl.indexOf("policy/mainList.do") > -1) {
			trueUrl = "https://m.korea.kr/news/policyNewsList.do";
			pass = true;
			
		} else if(thisUrl.indexOf("pressReleaseList.do") > -1) {
			trueUrl = "https://m.korea.kr/news/briefingHomeList.do?gubun=pressRelease";
			pass = true;
		
		//} else if(thisUrl.indexOf("policyplus/mainList.do") > -1 || thisUrl.indexOf("news/policyNewsList.do") > -1) {
		} else if(thisUrl.indexOf("policyplus/mainList.do") > -1) {	
			trueUrl = "https://m.korea.kr/news/policyNewsList.do";
			pass = true;	
		
		} else if(thisUrl.indexOf("actuallyList.do") > -1) {
			trueUrl = "https://m.korea.kr/news/actuallyList.do";
			pass = true;	
		
		} else if(thisUrl.indexOf("graphicsMainList.do") > -1) {
			trueUrl = "https://m.korea.kr/news/policyNewsList.do";
			pass = true;
	
		} else if(thisUrl.indexOf("cartoonMainList.do") > -1 || thisUrl.indexOf("cartoonList.do") > -1) {
			trueUrl = "https://m.korea.kr/news/policyNewsList.do";
			pass = true;
			
		} else if(thisUrl.indexOf("weekendList.do") > -1) {
			//trueUrl = "https://m.korea.kr/newsWeb/m/factView.do";
			trueUrl = "https://m.korea.kr/news/policyNewsList.do";
			pass = true;
			
		} else if(thisUrl.indexOf("healthList.do") > -1) {
			trueUrl = "https://m.korea.kr/news/policyNewsList.do";
			pass = true;
			
		} else if(thisUrl.indexOf("/policyplus/mediaMainList.do") > -1) {
			trueUrl = "https://m.korea.kr/news/policyNewsList.do";
			pass = true;
	
		} else if(thisUrl.indexOf("jobinfoMainList.do") > -1) {
			trueUrl = "https://m.korea.kr/jobinfo/recruitInfoList.do";
			pass = true;
			
		} else if(thisUrl.indexOf("recruitInfoList.do") > -1) {
			trueUrl = "https://m.korea.kr/jobinfo/recruitInfoList.do";
			pass = true;
			
		} else if(thisUrl.indexOf("examInfoList.do") > -1) {
			trueUrl = "https://m.korea.kr/jobinfo/examInfoList.do";
			pass = true;
			
		} else if(thisUrl.indexOf("examPassList.do") > -1) {
			trueUrl = "https://m.korea.kr/jobinfo/examPassList.do";
			pass = true;
			
		} else if(thisUrl.indexOf("workPlaceList.do") > -1) {
			trueUrl = "https://m.korea.kr/jobinfo/workPlaceList.do";
			pass = true;
			
		} else if(thisUrl.indexOf("photoQuizList.do") > -1) {
			trueUrl = "https://m.korea.kr/policyplus/photoQuizList.do";
			pass = true;
		
		} else if(thisUrl.indexOf("special/mainList.do") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500649";
			pass = true;
		
		} else if(thisUrl.indexOf("recruitInfoView.do") > -1) {
			trueUrl = "https://m.korea.kr/jobinfo/recruitInfoView.do";
			param   = "?dataId=" + thisUrl.substring(thisUrl.indexOf("dataId=")+7, thisUrl.indexOf("dataId=")+22);
			pass = true;
			
		} else if(thisUrl.indexOf("examInfoView.do") > -1) {
			trueUrl = "https://m.korea.kr/jobinfo/examInfoView.do";
			param   = "?dataId=" + thisUrl.substring(thisUrl.indexOf("dataId=")+7, thisUrl.indexOf("dataId=")+22);
			pass = true;
			
		} else if(thisUrl.indexOf("examPassView.do") > -1) {
			trueUrl = "https://m.korea.kr/jobinfo/examPassView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
			
		} else if(thisUrl.indexOf("workPlaceView.do") > -1) {
			trueUrl = "https://m.korea.kr/jobinfo/workPlaceView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
			
		}  else if(thisUrl.indexOf("policyFocusList.do") > -1) {
			thisUrl = thisUrl.replace("https://www.korea.kr", "http://m.korea.kr");
			thisUrl = thisUrl.replace("http://korea.kr", "http://m.korea.kr");
			console.log("trueUrl=="+thisUrl);
			trueUrl = thisUrl;
			pass = true;
				
		} else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500649") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500649";
			pass = true;
			
		}	else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500647") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500647";
			pass = true;
			
		} else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500640") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500640";
			pass = true;
			
		} else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500627") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500627";
			pass = true;
			
		} else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500636") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500636";
			pass = true;
			
		} else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500633") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500633";
			pass = true;
			
		} else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500632") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500632";
			pass = true;
			
		} else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500568") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500568";
			pass = true;
			
		} else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500628") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500628";
			pass = true;
			
		} else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500625") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500625";
			pass = true;
			
		} else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500565") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500565";
			pass = true;
			
		} else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500617") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500617";
			pass = true;
			
		} else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500595") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500595";
			pass = true;
			
		} else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500594") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500594";
			pass = true;
			
		}else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500574") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500574";
			pass = true;
			
		} else if(thisUrl.indexOf("policyFocusList.do?pkgId=49500667") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do?pkgId=49500667";
			pass = true;

		} else if(thisUrl.indexOf("policyFocusList.do") > -1) {
			trueUrl = "https://m.korea.kr/special/policyFocusList.do";
			pass = true;
			
		} else if(thisUrl.indexOf("policyFocusView.do") > -1){
			trueUrl = "https://m.korea.kr/special/policyFocusView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
			param   += "&pkgId=" + thisUrl.substring(thisUrl.indexOf("pkgId=")+6, thisUrl.indexOf("pkgId=")+15);	
			pass = true;
			
		} else if(thisUrl.indexOf("mediaSympathyView.do") > -1 || thisUrl.indexOf("mediaWideBlueHouseStoryView.do") > -1 || thisUrl.indexOf("mediaPolicyAdView.do") > -1 ) {
			trueUrl = "https://m.korea.kr/policyplus/mediaSympathyView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
			
		} else if(thisUrl.indexOf("celebrityList.do") > -1 || thisUrl.indexOf("celebrity/mainList.do") > -1 || thisUrl.indexOf("celebrity/contributePolicyList.do") > -1) {			//칼럼&??플 ?? ??책기고 리스??
			trueUrl = "https://m.korea.kr/celebrity/contributePolicyList.do";
			pass = true;
		
		} else if(thisUrl.indexOf("news/contributePolicyView.do") > -1) {			//??책기고 ??세보기
			trueUrl = "https://m.korea.kr/news/contributePolicyView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		
		} else if(thisUrl.indexOf("news/contributePolicyView.do") > -1) {			//??책기고 ??세보기
			trueUrl = "https://m.korea.kr/news/contributePolicyView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		
		} else if(thisUrl.indexOf("news/cultureColumnList.do") > -1) {		//문화칼럼
			trueUrl = "https://m.korea.kr/news/celebrityList.do";
			pass = true;
		
		} else if(thisUrl.indexOf("news/cultureWriterList.do") > -1) {		//문화칼럼
			trueUrl = "https://m.korea.kr/news/celebrityList.do";
			pass = true;
		
		} else if(thisUrl.indexOf("news/cultureColumnView.do") > -1) {		//문화칼럼 ??세보기
			trueUrl = "https://m.korea.kr/news/cultureColumnView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		
		} else if(thisUrl.indexOf("celebrity/interviewList.do") > -1) {			//??터??
			trueUrl = "https://m.korea.kr/news/policyNewsList.do";
			pass = true;
		
		}  else if(thisUrl.indexOf("news/interviewView.do") > -1) {		//??터????세보기
			trueUrl = "https://m.korea.kr/news/interviewView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		} else if(thisUrl.indexOf("news/briefingHomeList.do") > -1 || thisUrl.indexOf("news/blueHouseList.do") > -1) {			//브리??룸, ?????브리??
			trueUrl = "https://m.korea.kr/news/briefingHomeList.do";
			pass = true;
		} else if(thisUrl.indexOf("news/blueHouseView.do") > -1) {				//?????브리????세보기
			trueUrl = "https://m.korea.kr/news/blueHouseView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		} else if(thisUrl.indexOf("news/stateCouncilList.do") > -1) {			//??????의 브리??
			trueUrl = "https://m.korea.kr/news/briefingHomeList.do?gubun=stateCouncil";
			pass = true;
		} else if(thisUrl.indexOf("news/stateCouncilView.do") > -1) {			//??????의 브리????세보기
			trueUrl = "https://m.korea.kr/news/stateCouncilView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		} else if(thisUrl.indexOf("news/policyBriefingList.do") > -1) {			//???? 브리??
			trueUrl = "https://m.korea.kr/news/briefingHomeList.do?gubun=policyBriefing";
			pass = true;
		} else if(thisUrl.indexOf("news/policyBriefingView.do") > -1) {			//???? 브리????세보기
			trueUrl = "https://m.korea.kr/news/policyBriefingView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		} else if(thisUrl.indexOf("archive/speechList.do") > -1) {					//??설??
			trueUrl = "https://m.korea.kr/archive/speechList.do";
			pass = true;
		} else if(thisUrl.indexOf("archive/speechView.do") > -1) {					//??설????세보기
			trueUrl = "https://m.korea.kr/archive/speechView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		} else if(thisUrl.indexOf("policy/majorbannerList.do") > -1) {				//??이??이??
			trueUrl = "https://m.korea.kr/policy/majorbannerList.do";
			pass = true;
		} else if(thisUrl.indexOf("special/govGongmoList.do") > -1) {				//공모??업??리??
			pass = true;
		} else if(thisUrl.indexOf("news/civilList.do") > -1) {					//공무??뉴??
			trueUrl = "https://m.korea.kr/news/civilList.do";
			pass = true;
		} else if(thisUrl.indexOf("news/civilView.do") > -1) {					//공무??뉴????세보기
			trueUrl = "https://m.korea.kr/news/civilView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		} else if(thisUrl.indexOf("guide/privacy.do") > -1) {						//개인??보 처리방침
			trueUrl = "https://m.korea.kr/etc/privacy.do";
			pass = true;
		} else if(thisUrl.indexOf("etc/privacy.do") > -1) {						//개인정보 처리방침
			trueUrl = "https://m.korea.kr/etc/privacy.do";
			pass = true;
		} else if(thisUrl.indexOf("guide/copyRight.do") > -1) {						//????권??책
			trueUrl = "https://m.korea.kr/etc/copyRight.do";
			pass = true;
		} else if(thisUrl.indexOf("etc/copyRight.do") > -1) {						//저작권정책
			trueUrl = "https://m.korea.kr/etc/copyRight.do";
			pass = true;
		} else if(thisUrl.indexOf("guide/emailReject.do") > -1) {					//??메????집거??
			trueUrl = "https://m.korea.kr/etc/emailReject.do";
			pass = true;
		} else if(thisUrl.indexOf("etc/emailReject.do") > -1) {					//이메일수집거부
			trueUrl = "https://m.korea.kr/etc/emailReject.do";
			pass = true;
		} else if(thisUrl.indexOf("guide/toMaster.do") > -1) {					//운영자에게
			trueUrl = "https://m.korea.kr/etc/toMaster.do";
			pass = true;
		} else if(thisUrl.indexOf("archive/simpleSearch.do") > -1|| thisUrl.indexOf("archive/mainList.do") > -1) {					//??책??보 ??카??브
			trueUrl = "https://m.korea.kr/archive/simpleSearch.do";
			pass = true;
		} else if(thisUrl.indexOf("archive/expDocMainList.do") > -1 || thisUrl.indexOf("archive/expDocList.do") > -1) {				//??문??료 리스??
			trueUrl = "https://m.korea.kr/archive/expDocMainList.do";
			pass = true;
		} else if(thisUrl.indexOf("archive/expDocView.do") > -1) {					//??문??료 ??
			trueUrl = "https://m.korea.kr/archive/expDocView.do";
			param   = "?docId=" + thisUrl.substring(thisUrl.indexOf("docId=")+6, thisUrl.indexOf("docId=")+11);
			param   += "&group=" + thisUrl.substring(thisUrl.indexOf("group=")+6, thisUrl.indexOf("group=")+7);
			pass = true;
		} else if(thisUrl.indexOf("policyplus/byulbyulList.do?issue=") > -1) {				//SNS이벤트
			//trueUrl = "https://m.korea.kr/etc/byulbyulView.do?issue="+thisUrl.substring(thisUrl.indexOf("issue=")+6, thisUrl.indexOf("issue=")+19);
			trueUrl = thisUrl.replace("//www.korea.kr","//m.korea.kr");
			trueUrl = trueUrl.replace("//korea.kr","//m.korea.kr");
			trueUrl = trueUrl.replace("/policyplus/byulbyulList.do","/etc/byulbyulView.do");
			pass = true;
		} else if(thisUrl.indexOf("policyplus/byulbyulList.do") > -1) {				//SNS이벤트
			trueUrl = "https://m.korea.kr/etc/policyQuizList.do?pageSe=byulbyul&eventIng=ING";
			pass = true;
		} else if(thisUrl.indexOf("policyplus/byulBeforeList.do") > -1 && thisUrl.indexOf("period=ended") < 0 ) {				//SNS이벤트
			trueUrl = "https://m.korea.kr/etc/policyQuizList.do?pageSe=byulbyul&eventIng=ING";
			pass = true;
		} else if(thisUrl.indexOf("policyplus/byulBeforeList.do") > -1 && thisUrl.indexOf("period=ended") > -1 ) {				//SNS이벤트
			trueUrl = "https://m.korea.kr/etc/policyQuizList.do?pageSe=byulbyul&eventIng=END";
			pass = true;
		}else if(thisUrl.indexOf("jobinfo/uniqueJobList.do?cateId=unique_future") > -1) {				//이색직업
			trueUrl = "https://m.korea.kr/jobinfo/uniqueJobList.do?cateId=unique_future";
			pass = true;
		} else if(thisUrl.indexOf("jobinfo/uniqueJobList.do?cateId=unique_baby") > -1) {				//이색직업
			trueUrl = "https://m.korea.kr/jobinfo/uniqueJobList.do?cateId=unique_baby";
			pass = true;
		} else if(thisUrl.indexOf("jobinfo/uniqueJobList.do?cateId=unique_job") > -1) {					//이색직업
			trueUrl = "https://m.korea.kr/jobinfo/uniqueJobList.do?cateId=unique_job";
			pass = true;
		} else if(thisUrl.indexOf("jobinfo/uniqueJobList.do") > -1) {									//이색직업
			trueUrl = "https://m.korea.kr/jobinfo/uniqueJobList.do";
			pass = true;
		} else if(thisUrl.indexOf("uniqueJobView.do?cateId=unique_future") > -1){					//이색직업 상세
			trueUrl = "https://m.korea.kr/jobinfo/uniqueJobView.do?cateId=unique_future";
			param   += "&newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
			pass = true;
		} else if(thisUrl.indexOf("uniqueJobView.do?cateId=unique_baby") > -1){						//이색직업 상세
			trueUrl = "https://m.korea.kr/jobinfo/uniqueJobView.do?cateId=unique_baby";
			param   += "&newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
			pass = true;
		} else if(thisUrl.indexOf("uniqueJobView.do?cateId=unique_job") > -1){						//이색직업 상세
			trueUrl = "https://m.korea.kr/jobinfo/uniqueJobView.do?cateId=unique_job";
			param   += "&newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
			pass = true;
		} else if(thisUrl.indexOf("uniqueJobView.do") > -1){										//이색직업 상세
			trueUrl = "https://m.korea.kr/jobinfo/uniqueJobView.do";
			param   += "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
			pass = true;
		} else if(thisUrl.indexOf("etc/deptSns.do") > -1){												//소셜네트워크
			trueUrl = "https://m.korea.kr/etc/deptSns.do";
			pass = true;
		} else if(thisUrl.indexOf("deptSns.do") > -1){												//소셜네트워크
			//trueUrl = "https://m.korea.kr/social/socialNetwork.do";
			trueUrl = "https://m.korea.kr/etc/deptSns.do";
			pass = true;
		} else if(thisUrl.indexOf("recommendBookList.do") > -1){									//사서추천도서
			trueUrl = "https://m.korea.kr/policyplus/recommendBookList.do";
			pass = true;
		} else if(thisUrl.indexOf("recommendBookView.do") > -1){									//사서추천도서 상세
			trueUrl = "https://m.korea.kr/policyplus/recommendBookView.do";
			param   += "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+10);	
			pass = true;
		} else if(thisUrl.indexOf("urimalList.do") > -1){											//쉼표, 마침표
			trueUrl = "https://m.korea.kr/policyplus/urimalList.do";
			pass = true;
		} else if(thisUrl.indexOf("urimalView.do") > -1){											//쉼표, 마침표 상세
			trueUrl = "https://m.korea.kr/policyplus/urimalView.do";
			param   += "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
			pass = true;
		} else if(thisUrl.indexOf("https://www.korea.kr/news/policyPhotoList.do") > -1 || thisUrl.indexOf("https://www.korea.kr/news/policyPhotoView.do") > -1){
			trueUrl = thisUrl.replace("www.korea.kr","m.korea.kr");
			pass = true;
		} else if(thisUrl.indexOf("https://korea.kr/news/policyPhotoList.do") > -1 || thisUrl.indexOf("https://korea.kr/news/policyPhotoView.do") > -1){
			console.log("thisUrl111"+trueUrl);
			trueUrl = thisUrl.replace("https://korea.kr","http://m.korea.kr");
			console.log("thisUrl222"+trueUrl);
			pass = true;
		} else if(thisUrl.indexOf("https://www.korea.kr/news/top50View.do") > -1 || thisUrl.indexOf("https://korea.kr/news/top50View.do") > -1){
			trueUrl = "https://m.korea.kr/news/top50View.do";
			param   += "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+30);	
			pass = true;
		} else if(thisUrl.indexOf("https://www.korea.kr/news/top50List.do") > -1 || thisUrl.indexOf("http://news.kr/policy/top50List.do") > -1){
			if(thisUrl.indexOf("newest=Y") > -1){
				trueUrl = "https://m.korea.kr/news/top50List.do?newest=Y";
			}else{
				trueUrl = "https://m.korea.kr/news/top50List.do";
			}
			pass = true;
		} else if(thisUrl.indexOf("issueQAView.do") > -1){									//사서추천도서 상세
			trueUrl = "https://m.korea.kr/special/policyFocusView.do";
			param   += "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
			pass = true;
		} else if(thisUrl.indexOf("mediaOnePointView.do") > -1){									//원포인트생활상식 상세
			trueUrl = "https://m.korea.kr/policyplus/mediaOnePointView.do";
			param   += "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
			pass = true;
		} else if(thisUrl.indexOf("mediaNewsView.do") > -1){									//11시50분입니다 상세
			trueUrl = "https://m.korea.kr/news/mediaNewsView.do";
			param   += "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
			pass = true;
		} else if(thisUrl.indexOf("mediaNewsList.do") > -1){									//11시50분입니다 상세
			trueUrl = "https://m.korea.kr/news/mediaNewsList.do";			
			pass = true;
		} else if (thisUrl.indexOf("policyAgendaList.do") > -1){         // 정책아젠다 목록
			trueUrl = "https://m.korea.kr/special/policyAgendaList.do";
			pass = true;
		} else if (thisUrl.indexOf("policyAgendaView.do") > -1){ // 정책아젠다 상세
			trueUrl = "https://m.korea.kr/special/policyAgendaView.do";
			param   = "?pkgId=" + thisUrl.substring(thisUrl.indexOf("pkgId=")+6, thisUrl.indexOf("pkgId=")+15);	
			param   += "newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
			pass = true;
		}else if (thisUrl.indexOf("totalSearch.do") > -1){ // 통합검색
			trueUrl = "https://m.korea.kr/totalSearch.do";
			param   = thisUrl.substring(thisUrl.indexOf("korea.kr")+8, thisUrl.length).replace('topSearchKeyword', 'keyword');	
			pass = true;
		}else if (thisUrl.indexOf("policyCurationList.do") > -1){ // 큐레이션
			trueUrl = "https://m.korea.kr/special/policyCurationList.do";
			pass = true;
		} else if(thisUrl.indexOf("news/policyBriefingView.do") > -1) {					//이브리핑
			trueUrl = "https://m.korea.kr/news/policyBriefingView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		} else if(thisUrl.indexOf("special/policyCurationView.do") > -1) {			//정책위키
			trueUrl = "https://m.korea.kr/special/policyCurationView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		} else if(thisUrl.indexOf("/introduce/deptIntroduce.do") > -1) {					//
			trueUrl = "https://m.korea.kr/introduce/deptIntroduce.do";
			pass = true;
		} else if(thisUrl.indexOf("/introduce/govVisionList.do") > -1) {					//
			trueUrl = "https://m.korea.kr/introduce/govVisionList.do";
			pass = true;
		}  else if(thisUrl.indexOf("/introduce/koreaIntroduce.do") > -1) {					//
			trueUrl = "https://m.korea.kr/introduce/koreaIntroduce.do";
			pass = true;
		} else if(thisUrl.indexOf("/news/policyNewsList.do") > -1) {					//정책뉴스
			console.log("thisUrl="+thisUrl);
			if(thisUrl.indexOf("subject") > -1){
				trueUrl = "https://m.korea.kr/news/policyNewsList.do?cateId=policyNews";
			}else if(thisUrl.indexOf("issue_q") > -1){
				trueUrl = "https://m.korea.kr/news/policyNewsList.do?cateId=issue_q";
			}else if(thisUrl.indexOf("column_n_interview") > -1){
				trueUrl = "https://m.korea.kr/news/policyNewsList.do?cateId=column_n_interview";
			}else if(thisUrl.indexOf("graphic_news") > -1){
				trueUrl = "https://m.korea.kr/news/policyNewsList.do?cateId=graphic_news";
			}else if(thisUrl.indexOf("info_pds3") > -1){
				trueUrl = "https://m.korea.kr/news/policyNewsList.do?cateId=info_pds3";
			}else if(thisUrl.indexOf("health_common") > -1){
				trueUrl = "https://m.korea.kr/news/policyNewsList.do?cateId=health_common";
			}else if(thisUrl.indexOf("leisure") > -1){
				trueUrl = "https://m.korea.kr/news/policyNewsList.do?cateId=leisure";
			}else if(thisUrl.indexOf("cardnews") > -1){
				trueUrl = "https://m.korea.kr/news/policyNewsList.do?cateId=cardnews";
			}else if(thisUrl.indexOf("exam_pass") > -1){
				trueUrl = "https://m.korea.kr/news/policyNewsList.do?cateId=exam_pass";
			}else{
				trueUrl = "https://m.korea.kr/news/policyNewsList.do";
			}
			pass = true;
		} else if(thisUrl.indexOf("truthView.do") > -1) {
			trueUrl = "https://m.korea.kr/news/truthView.do";
			param   += "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
			pass = true;
			
		} else if(thisUrl.indexOf("visualNewsList.do") > -1) {
			if(thisUrl.indexOf("graphic_news") > -1){
				trueUrl = "https://m.korea.kr/news/visualNewsList.do?cateId=graphic_news";
			}else if(thisUrl.indexOf("cardnews") > -1){
				trueUrl = "https://m.korea.kr/news/visualNewsList.do?cateId=cardnews";
			}else{
				trueUrl = "https://m.korea.kr/news/visualNewsList.do";
			}
			pass = true;
			
		} else if(thisUrl.indexOf("visualNewsView.do") > -1) {
			trueUrl = "https://m.korea.kr/news/visualNewsView.do";
			param   += "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
			pass = true;
			
		} else if(thisUrl.indexOf("truthList.do") > -1) {
			trueUrl = "https://m.korea.kr/news/truthList.do";
			pass = true;
		
		} else if(thisUrl.indexOf("/special/bhFocusList.do") > -1) {
			trueUrl = "https://www.korea.kr/bhfocus";
			pass = true;
			//alert(trueUrl);

		}else if(thisUrl.indexOf("/special/eLibraryList.do") > -1) {
			trueUrl = "https://m.korea.kr/special/eLibraryList.do";
			pass = true;
			//alert(trueUrl);

		} else if(thisUrl.indexOf("/special/bhFocusView.do") > -1) {
			trueUrl = "https://www.korea.kr/blueHouse/specialView.do";
			param   += "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
			param   += "&pkgId=" + thisUrl.substring(thisUrl.indexOf("pkgId=")+6, thisUrl.indexOf("pkgId=")+15);	
			pass = true;
		} else if(thisUrl.indexOf("/etc/newsLetterMain.do") > -1){
			if(thisUrl.indexOf("tabGubun=cancle") > -1){
				trueUrl = "https://m.korea.kr/etc/newsLetterMain.do?pageSe=cancel";
			}else{
				trueUrl = "https://m.korea.kr/etc/newsLetterMain.do";
			}
			pass = true;
		}else if(thisUrl.indexOf("/etc/newsLetterList.do") > -1){
			trueUrl = "https://m.korea.kr/etc/newsLetterMain.do?pageSe=list";
			pass = true;
		}else if(thisUrl.indexOf("/etc/newsLetterView.do") > -1){
			if(thisUrl.indexOf("newsId") > -1){
				trueUrl = "https://m.korea.kr/etc/newsLetterView.do";
				param   = "?pageSe=view&newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+18);	
				pass = true;
			}else{
				trueUrl = "https://m.korea.kr/etc/newsLetterView.do?pageSe=view";
				pass = true;
			}
		}else if(thisUrl.indexOf("ebookMainList.do") > -1){
			trueUrl = "https://m.korea.kr/archive/ebookMainList.do";
			pass = true;
		}else if(thisUrl.indexOf("mediaNewsHomeList.do") > -1){
			trueUrl = "https://m.korea.kr/news/policyPhotoList.do";
			pass = true;
		}else if(thisUrl.indexOf("banner.do") > -1){
			trueUrl = "https://m.korea.kr/etc/banner.do";
			pass = true;
		}else if(thisUrl.indexOf("rss.do") > -1){
			trueUrl = "https://m.korea.kr/etc/rss.do";
			pass = true;
		}else if(thisUrl.indexOf("noticeList.do") > -1){
			trueUrl = "https://m.korea.kr/guide/noticeList.do";
			pass = true;
		}else if(thisUrl.indexOf("noticeView.do") > -1){
			trueUrl = "https://m.korea.kr/guide/noticeView.do";
				param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
				pass = true;
		}else if(thisUrl.indexOf("cultureWriterList.do") > -1){
			trueUrl = "https://m.korea.kr/news/celebrityList.do";
			pass = true;
		}else if(thisUrl.indexOf("cultureWriterView.do") > -1){
			trueUrl = "https://m.korea.kr/news/cultureColumnView.do";
				param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);	
				pass = true;
		}else if(thisUrl.indexOf("estNewsView.do") > -1){
			thisUrl = thisUrl.replace("https://www.korea.kr/news/estNewsView.do", "https://m.korea.kr/news/top50View.do");
			thisUrl = thisUrl.replace("https://korea.kr/news/estNewsView.do", "https://m.korea.kr/news/top50View.do");
			param = "&newest=Y";
			trueUrl = thisUrl;
			pass = true;
		}else if(thisUrl.indexOf("presidentView.do") > -1) {
			
			trueUrl = "https://m.korea.kr/news/presidentView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		}else if(thisUrl.indexOf("governmentView.do") > -1) {
			
			trueUrl = "https://m.korea.kr/archive/governmentView.do";
			param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
			pass = true;
		}else if(thisUrl.indexOf("news/president.do") > -1) {
			trueUrl = "https://m.korea.kr/news/briefingHomeList.do?gubun=president";
			pass = true;
		}else if(thisUrl.indexOf("archive/ebookWeeklyList.do") > -1) {
			trueUrl = "https://m.korea.kr/archive/ebookWeeklyList.do";
			pass = true;
		}else {
			trueUrl = "https://m.korea.kr/";
			pass = true;		
		}
		
		
		
		if(pass) {
			trueUrl = trueUrl + param;
				window.location.href = trueUrl;
		}
	*/	
		
		 /*else if(thisUrl.indexOf("/archive/media") > -1) {
		trueUrl = "http://m.korea.kr/policyplus/mediaView.do";
		param   = "?newsId=" + thisUrl.substring(thisUrl.indexOf("newsId=")+7, thisUrl.indexOf("newsId=")+16);
		pass = true;
		
	} */
	
	
	}
}

if(thisUrl.indexOf("/policy/actuallyList.do") > -1){
	window.location.href = "/news/actuallyList.do";
}

//모바일이동 스크립트 추가 2017.03.24
$(document).ready(function(){	
	if( navigator.userAgent.match(/Android/i)
	    || navigator.userAgent.match(/webOS/i)
	    || navigator.userAgent.match(/iPhone/i)
	    || navigator.userAgent.match(/iPad/i)
	    || navigator.userAgent.match(/iPod/i)
	    || navigator.userAgent.match(/BlackBerry/i)
	    || navigator.userAgent.match(/Windows Phone/i) ){

		thisUrl = thisUrl.replace('https://www.korea.kr', 'https://m.korea.kr');
		thisUrl = thisUrl.replace('https://korea.kr', 'https://m.korea.kr');
		thisUrl = thisUrl.replace('https://m.korea.kr/main.do', 'https://m.korea.kr/index.jsp');
		//$('#mobileweb_link a').attr('href', thisUrl);
		var mobile = '<div class="mobileweb_link on" id="mobileweb_link"><a href="javascript:void(0);">';
		//mobile += '<img src="/images/common/ico_md_prev.png" alt="모바일 화면으로 이동" />모바일 화면으로 이동</a></div>';
		mobile += '<span>모바일 화면으로 이동</span></a></div>';
		$('body').append(mobile);
		
		$('#mobileweb_link').click(function (){
			$.cookie('selectedMedia', null, {expires : -1, path : '/'});
			window.location.href = thisUrl;
		});
		
		$(window).resize(function() {	
			$('.mobileweb_link').css({'width':$(document).outerWidth()+'px'});
		}).trigger('resize');		
	};
});

