//스터디 매니아의 정보 연계를 위함.
// idx 연결문자(,) 를 파라미터로 하여 회원 정보를 가져옴: UserIdx, UserTel, UserCell, UserEmail
var getMultiUser = function (linkStr, callBackFunc) {
  new Ajax.Request( 
		  '/AjaxCall?url_index=6', 
		  { asynchronous : false,
		  	method: 'get', 
			parameters: {'idx':linkStr},
			onSuccess: callBackFunc,     
			onFailure: function(){ alert('onFailure!'); },
			onException : function() {  alert('onException!'); }
		  }
	 ); 
};


// id 를 파라미터로 하여 1명의 정보를 가져옴: UsreID, UserIDX, UserName, UserSchoolYear
var getSingleUser = function (id, callBackFunc) {
  new Ajax.Request(
		  '/AjaxCall?url_index=5', 
		  { method: 'get', 
			parameters: {'id':id},
			onSuccess: callBackFunc,     
			onFailure: function(){ alert('onFailure!'); },
			onException : function() {  alert('onException!'); }
		  }
	 ); 
};

// 성공인경우a S|성공  , 실패인경우aF|[에러메시지]

var sendSMS = function (receiveIdx, receiveCell, receiveContent, sendDate, sendCell, callBackFunc) {
  new Ajax.Request( 
		 '/AjaxCall?url_index=7&receiveIdx='+receiveIdx+'&receiveCell='+receiveCell+'&receiveContent='+receiveContent+'&sendDate='+sendDate+'&sendCell=' + sendCell, 
		  { asynchronous : false,
		  	method: 'get', 
			parameters: {},
			onSuccess: callBackFunc,    
			onFailure: function(){ alert('Error !!') },
			onException : function() { alert('Exception!!'); }
		  }
	 ); 
};

var target_urls = [
	['/AjaxCall?url_index=0', 'omegaLogin'],				//로그인박스
	['/AjaxCall?url_index=1', 'masterdiv'], 				//좌측메뉴(추후에 상단/하단 추가)
	['/AjaxCall?url_index=2', 'omega_notice'], 		// 투데이 공지사항
	['/AjaxCall?url_index=3', 'omega_resolution'], 	// 투데이 나의각오
	['/AjaxCall?url_index=4', 'omega_resolution_friend'] 		//투데이 친구들의 각오
];
// 크로스 도메인 문제 해결된 ajax 호출
function getStudymaniaPage(target_idx, params) {
  new Ajax.Request( 
		  target_urls[target_idx][0]+params, 
		  { method: 'get', 
			parameters: {id:''},
			onSuccess: function(resultObj) {
				if ( target_idx == 4 ) {
				
					getOmegaFriendResolution(resultObj.responseText);

				} else {
					$(target_urls[target_idx][1]).update(resultObj.responseText);
				}
			},    
			onFailure: function(){  },
			onException :  function(){ }
		  }
	 ); 
};

