// JavaScript Document
function divPage(currPage,currOffset,option){
	
	var mid = $('#memberId').val();
	var word = $("#txtMainSearch").val();
    var options;
    
	switch(option){
		/**
		* case blog
		*/
		case 'getBlogTitle':
			$.ajax({
				url:'modules/blog/listblog.php', 
				cache: true, 
				data:{'reqType':'ajax','mid':mid,'currPage':currPage,'currOffset':currOffset,'option':option,'orderBy':$('#listBlogOrder').val()},
				type:'POST',
				success:function(data){
					$('#listblog').empty().append(data);	
				}
			});
		break;
		
		/**
		* case bookmark
		*/
		case 'getBookmarkMid':
			$.ajax({
				url:'modules/bookmark/showAll.php', 
				cache: true, 
				data:{'reqType':'ajax','mid':mid,'currPage':currPage,'currOffset':currOffset,'option':option,'case':'mid'}, 
				type:'POST', 
				success:function(data){
					$('#bookmarkMid').empty().append(data);	
				}
			});
		break;
		
		/**
		* case comment
		*/
		case 'getComment':
			var refId = $('#RefID').val();
			options = $('#CmmOption').val();
			$.ajax({
				url:'modules/comment/comment.php', 
				cache: true, 
				data:{'reqTypeCmt':'ajax','refId':refId,'currPage':currPage,'currOffset':currOffset,'option':options},
				type:'POST', 
				success:function(data){
					$('#showComment').empty().append(data);	
				}
			});
		break;
		case 'getCommentMember':
			$.ajax({
				url:'modules/comment/commentProfile.php',
				cache: true,
				data:{'reqType':'ajax','mid':mid,'currPage':currPage,'currOffset':currOffset},
				type:'POST',
				success:function(data){
					$('#showCommentProfile').empty().append(data);
				}
			});
		break;
		case 'getCommentJeedNews':
			var refId = $('#RefID').val();
			options = $('#CmmOption').val();
			var divide = $('#divNews').val();
			var status = $('#memState').val();
			$.ajax({
				url:'modules/comment/formJeedNewsComment.php',
				cache: true,
				data:{'reqTypeCmt':'ajax','mid':mid,'currPage':currPage,'currOffset':currOffset,'divide':divide,'status':status,'refId':refId,'option':options},
				type:'POST',
				success:function(data){
					$('#showComment'+refId+divide).empty().append(data);
				}
			});
		break;
        case 'getCommentHistory':
            var mid = $('#memberID').val();
            var refId = $('#historyRefId').val();
			$.ajax({
				url:'modules/comment/commentHistory.php',
				cache: true,
				data:{'reqType':'ajax','mid':mid, 'refId':refId,'currPage':currPage,'currOffset':currOffset, 'flag':'1'},
				type:'POST',
				success:function(data){
					$('#showHistory').empty().append(data);
				}
			});
		break;
        case 'getCommentJeedGame':
			var refId = $('#RefID').val();
			options = $('#CmmOption').val();
			var divide = $('#divNews').val();
			var status = $('#memState').val();
            
			$.ajax({
				url:'modules/comment/formJeedGameComment.php',
				cache: true,
				data:{'reqTypeCmt':'ajax','mid':mid,'currPage':currPage,'currOffset':currOffset,'divide':divide,'status':status,'refId':refId,'option':options},
				type:'POST',
				success:function(data){
					$('#showComment'+refId+divide).empty().append(data);
				}
			});
		break;		
		
		/**
		* case video
		*/		
		
		case 'getVideoTags':
			var vid = $('#videoId').val();
			$('#vdoTags').hide();
			$('#vdoTagsloading').show();
			$.ajax({
				url:'modules/video/videoTag.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset,'mid':mid,'vid':vid},
				type:'POST',
				success:function(data){
					$('#vdoTagsloading').hide();
					$('#vdoTags').empty().append(data).show();	
				}
			});
		break;
        

	  case 'getAllSMS':
          var mid = $('#mid').val();
		  var sortDate = $("#optDate_New").val(); 
          $.ajax({
				url:'modules/report/report_new.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset, 'mid':mid, 'sortDate':sortDate},
				type:'POST',
				success:function(data){
      
                       $('#JeedReport_New').empty().append(data);
					   window.scrollTo(0,0);
                   
				}
			});
      break;
	  /************************************************************************************************************************************/
	  case 'getListNew':
					  $.ajax({
							url:'modules/report/showAll.php',
							cache: true,
							data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset,'option':'getListNew','case':'newList'},
							type:'POST',
							success:function(data){
								   $('#newsNew').empty().append(data);
								   window.scrollTo(0,0);
							}
						});
      break;
	  
	  case 'getListHot':
          $.ajax({
				url:'modules/report/showAll.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset,'option':'getListHot','case':'hot'},
				type:'POST',
				success:function(data){
                       $('#newsHot').empty().append(data);
					   window.scrollTo(0,0);
				}
			});
      break;
	  
	  case 'getListSuggest':
          $.ajax({
				url:'modules/report/showAll.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset, 'option':'getListSuggest','case':'suggestList'},
				type:'POST',
				success:function(data){
                       $('#newsSuggest').empty().append(data);
					   window.scrollTo(0,0);
				}
			});
      break;
	 
	 /************************************************************************************************************************************/
	 
	  case 'getVoteSMS':
          //var mid = $('#mid').val();
		  var sortDate = $("#optDate_hit").val(); 
          $.ajax({
				url:'modules/report/report.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset, 'sortDate':sortDate},
				type:'POST',
				success:function(data){
                  
                       $('#showJeedReport').empty().append(data);
					   window.scrollTo(0,0);
                  
				}
			});
      break;
	  
	  case 'getAllSuggest':
          //var mid = $('#mid').val();
		  var sortDate = $("#optDate_suggest").val(); 
          $.ajax({
				url:'modules/report/report_suggestion.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset,'sortDate':sortDate},
				type:'POST',
				success:function(data){
                 
                       $('#JeedSuggest').empty().append(data);
					   window.scrollTo(0,0);
                   
				}
			});
      break;

	  case 'byDay':
          var option = $('#optReport').val();
		  var mid = $('#mid').val();
          $.ajax({
				url:'modules/report/showSearch.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset,'option':option, 'mid':mid},
				type:'POST',
				success:function(data){
                    if(data==-50){
                       sessionTimeout();
                    }else{
                       $('#showJeedReport').empty().append(data);
					   window.scrollTo(0,0);
                    }
				}
			});
      break;
	  
	   case 'byWeek':
          var option = $('#optReport').val();
		  var mid = $('#mid').val();
          $.ajax({
				url:'modules/report/showSearch.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset,'option':option, 'mid':mid},
				type:'POST',
				success:function(data){
                    if(data==-50){
                       sessionTimeout();
                    }else{
                       $('#showJeedReport').empty().append(data);
					   window.scrollTo(0,0);
                    }
				}
			});
      break;
	  
	   case 'byMonth':
          var option = $('#optReport').val();
		  var mid = $('#mid').val();
          $.ajax({
				url:'modules/report/showSearch.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset,'option':option, 'mid':mid},
				type:'POST',
				success:function(data){
                    if(data==-50){
                       sessionTimeout();
                    }else{
                       $('#showJeedReport').empty().append(data);
					   window.scrollTo(0,0);
                    }
				}
			});
      break;
	  
	  case 'getSMS_Member':
          var name = $("#name").val();
		  var mid = $("#mid").val();
		  var sortDate = $("#optDate_OldNews").val();
		  var source = $("#source").val();
          $.ajax({
				url:'modules/report/showOldSMS.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset, 'memid':mid, 'nickname':name, 'sortDate':sortDate},
				type:'POST',
				success:function(data){
                  
						$('#showNews').empty().append(data);
						window.scrollTo(0,0);
                    
				}
			});
      break;
	  
	   case 'getAllSMS_notMember':
          //var mid = $('#mid').val();
		  var sortDate = $("#optDate_notMember").val(); 
          $.ajax({
				url:'modules/report/report_new_notMem.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset, 'sortDate':sortDate},
				type:'POST',
				success:function(data){
                    if(data==-50){
                       sessionTimeout();
                    }else{
                       $('#JeedReport_New').empty().append(data);
                    }
				}
			});
      break;
	  
	  case 'getSMS_Member_notMember':
          var name = $('#name').val();
		  var mid = $('#mid').val();
		  var sortDate = $("#optDate_notMember").val(); 
          $.ajax({
				url:'modules/report/showOldSMS_notMem.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset, 'mid':mid, 'name':name, 'sortDate':sortDate},
				type:'POST',
				success:function(data){
                    if(data==-50){
                       sessionTimeout();
                    }else{
                       $('#showJeedReport').empty().append(data);
                    }
				}
			});
      break;
	  
	  case 'byDay_notMember':
          var option = $('#optReport').val();
		  //var mid = $('#mid').val();
          $.ajax({
				url:'modules/report/showSearch_notMem.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset,'option':option},
				type:'POST',
				success:function(data){
                    if(data==-50){
                       sessionTimeout();
                    }else{
                       $('#showJeedReport').empty().append(data);
                    }
				}
			});
      break;
	  
	   case 'byWeek_notMember':
          var option = $('#optReport').val();
		  //var mid = $('#mid').val();
          $.ajax({
				url:'modules/report/showSearch_notMem.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset,'option':option},
				type:'POST',
				success:function(data){
                    if(data==-50){
                       sessionTimeout();
                    }else{
                       $('#showJeedReport').empty().append(data);
                    }
				}
			});
      break;
	  
	  case 'byMonth_notMember':
          var option = $('#optReport').val();
		 // var mid = $('#mid').val();
          $.ajax({
				url:'modules/report/showSearch_notMem.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset,'option':option},
				type:'POST',
				success:function(data){
                    if(data==-50){
                       sessionTimeout();
                    }else{
                       $('#showJeedReport').empty().append(data);
                    }
				}
			});
      break;
	  
	  case 'getNewsMid':
          $.ajax({
				url:'modules/report/showAll.php',
				cache: true,
				data:{'reqType':'ajax','mid':mid,'currPage':currPage,'currOffset':currOffset,'option':option,'case':'mid'},
				type:'POST',
				success:function(data){
                 
                       $('#newsMid').empty().append(data);
                   	   window.scrollTo(0,0);
				}
			});
      break;
	  
	   case 'getSearchSMS':
          $.ajax({
				url:'modules/report/showAll.php',
				cache: true,
				data:{'reqType':'ajax','currPage':currPage,'currOffset':currOffset,'option':'getSearchSMS','case':'search','word':word},
				type:'POST',
				success:function(data){
                  
                       $('#searchWord').empty().append(data);
                       window.scrollTo(0,0);
				}
			});
      break;
	}
}