

var MyTab = {
	//마이탭에서 토글 스크립트.
	toggleTab : function(){
		if($("UserPostInfoClose").style.display=='block'){
			$("UserPostInfoClose").style.display = 'none';
			$("UserPostInfo").style.display = 'block';
		}else{
			$("UserPostInfoClose").style.display = 'block';
			$("UserPostInfo").style.display = 'none';
		}
	},
	changeMyCount : function(cafeID){
		if(!cafeID || cafeID=='') return;
		
		var timeStamp = (new Date()).getTime();
		var url = CONTEXT_PATH+"/main_new/action/ajax_myRecentCount.jsp";
		var divObj = document.getElementById("myRecentCount");
		new Ajax.Request(url, {
			method: 'post',
			asynchronous: true,
			contentType: 'application/x-www-form-urlencoded',
			encoding: 'UTF-8',
			parameters: {
							'timeStamp':timeStamp,
							'sCafeId':cafeID
			},
			onSuccess: function(xmlHttp){
				divObj.innerHTML = xmlHttp.responseText;
			},
			on404: function(xmlHttp){
				alert(' Ajax Error Code 404 ');
			},
			on500: function (xmlHttp){
				alert(' Ajax Error Code 500 ');
			}
		});		
	},
	// 마이탭에서 카페 목록을 변경할 때 카페의 글목록이 변경되는 스크립트.
	changeMyCafe : function(cafeID){
		if(!cafeID || cafeID=='') return;
		
		var timeStamp = (new Date()).getTime();
		var url = CONTEXT_PATH+"/main_new/action/ajax_myCafeContents.jsp";
		var divObj = document.getElementById("myCafeContent");
		new Ajax.Request(url, {
			method: 'post',
			asynchronous: true,
			contentType: 'application/x-www-form-urlencoded',
			encoding: 'UTF-8',
			parameters: {
							'timeStamp':timeStamp,
							'sCafeId':cafeID
			},
			onSuccess: function(xmlHttp){
				divObj.innerHTML = xmlHttp.responseText;
			},
			on404: function(xmlHttp){
				alert(' Ajax Error Code 404 ');
			},
			on500: function (xmlHttp){
				alert(' Ajax Error Code 500 ');
			}
		});		
	}	
}
