﻿function typeChange(tg)
{
	if(tg==1)	{ $get('MARiType2').style.display='none'; $get('MARiType1').style.display='block'; }
	else		{ $get('MARiType1').style.display='none'; $get('MARiType2').style.display='block'; }
}

function inputRssUrl()
{
	var vuserID = $get('MARuserID').value;
	var rssUrl = '';
	switch(GetSelectedValue($get('MARserviceName')))
	{
		case '1': rssUrl = 'http://blog.joins.com/' + vuserID + '/index.xml';	break;
		case '2': rssUrl = 'http://blog.rss.naver.com/' + vuserID + '.xml';		break;
		case '3': rssUrl = 'http://blog.empas.com/' + vuserID + '/rss.xml';		break;
		case '4': rssUrl = 'http://kr.blog.yahoo.com/' + vuserID + '/rss.xml';	break;
		case '6': rssUrl = 'http://blogrss.paran.com/RssView2.do?pmcid=' + vuserID;	break;
		case '7': rssUrl = 'http://blog.hanafos.com/getrss.asp?blogerid=' + vuserID; break;
		case '8': rssUrl = 'http://tong.nate.com/mytong/mytong.do?action=rssxml&' + 'userID=' + vuserID; break;
		case '10':rssUrl = 'http://www.mediamob.co.kr/' + vuserID + '/RSS.aspx';	break;
		case '11':rssUrl = 'http://blog.ohmynews.com/' + vuserID + '/rss/';	break;
		case '12':rssUrl = 'http://' + vuserID + '.tistory.com/rss';	break;
		/*case '13':rssUrl = 'http://blog.ohmynews.com/' + vuserID + '/rss/';	break;*/
	}
	var orssAddr = $get('MARrssAddr');
	orssAddr.value = rssUrl;
}

function pRegMetaAddr()
{
	var ouID	= $get('MARuID');
	if(IsEmpty(ouID.value)) { MARMSGShow('메일 주소 정보를 넣어 주세요.'); ouID.focus(); return false; }
	if(!CheckMail(ouID.value)) { MARMSGShow('<' + 'strong>' + ouID.value + '<' + '/strong>은 사용할 수 있는 메일 형식이 아닙니다.'); ouID.focus();return; }

	var orssAddr	= $get('MARrssAddr');
	if(IsEmpty(orssAddr.value)) { MARMSGShow('RSS 주소 정보를 넣어 주세요.'); }

	var vroleChk	= $get('MARroleChk').checked;
	if(!vroleChk)	{ MARMSGShow('약관 확인 후 확인 이용약관에 동의 하셔야 가입이 가능합니다.');return; }

	PageMethods.RegMetaAddr(ouID.value, orssAddr.value, vroleChk, OnRegMetaAddr, OnRegMetaAddrErr);
}

function OnRegMetaAddr(r)
{
	if(r.IsTrue) { WizModalClose();alert('감사합니다.\n등록이 완료 되었습니다.\n수집되기까지는 시간이 걸릴 수 있습니다.'); }	//document.location.href='RegBlogOK.aspx';
	else { MARMSGShow(r.Message); }
}

function OnRegMetaAddrErr(r) { MARMSGShow("죄송합니다. 등록 요청이 정상적으로 처리 되지 못했습니다. 다시 시도하세요."); }
function MARMSGShow(msg) { $get('MARMSGPan').innerHTML = msg; }

//case "5": rssUrl = "http://cyrss.cyworld.nate.com/" + userId + "";		break;
//case "6": rssUrl = "http://blog.paran.com/rssview.php?pmcid=" + userId;	break;
//case "9": rssUrl = "http://" + userId + ".egloos.com/index.xml";		break;	
//case "12":rssUrl = "http://joblog.scout.co.kr/" + userId + "/rss.asp";	break;
//case "13":rssUrl = "http://blog.joos.co.kr/" + userId + "/rss";			break;
//<!--option value="5">싸이월드 페이퍼</option>
//<option value="9">이글루스</option-->