﻿
$(document).ready(function(){
   var line =  $("tr#tline_next").next();
   line.find("td.line_td").css({height:"60px",background:"#FAD06A"}); 
   line.find(".line_details").hide();
   line.find(".line_pic").show();
   line.find(".line_detailsmessage").show();
   line.find(".line_name").hide();
   line.find(".line_hot").hide();
   
   $("tr.mxwl1 > td").eq(0).css("backgroundColor","#F97900");
   $("tr.mxwl2 > td").eq(0).css("backgroundColor","#F97900");
   $("table.line_simplemessage tr").slice(0,3).css("color","Red");
   $("table#nc tr a").slice(0,3).css("color","Red");
   $("table.line_simplemessage").mouseover(function(){
           var line = $(this).parents("tr");
           $("td.line_td").css({height:"auto",background:"#EBEBEB"});
           line.find(".line_details").show();
           line.find(".line_pic").hide();
           line.find(".line_detailsmessage").hide();
           line.find(".line_name").show();
           line.find(".line_hot").show();
           
           
           $("tr td.line_details",this).hide();
           $("tr td.line_pic",this).show();
           $("tr td.line_detailsmessage",this).show();
           $("tr td.line_name",this).hide();
           $("tr td.line_hot",this).hide();
           $(this).parent().css({height:"60px",background:"#FAD06A"});
        }
   );
   
   $("tr.mxwl1 > td").mouseover(function(){
        $("tr.mxwl1 > td").css("backgroundColor","");
        $(this).css("backgroundColor","#F97900");
   });
   
   $("tr.mxwl2 > td").mouseover(function(){
        $("tr.mxwl2 > td").css("backgroundColor","");
        $(this).css("backgroundColor","#F97900");
   });
   
   
   $("#VIP").mouseover(function(){
      $(this).attr("src","images/Index/caonima8.jpg");
      $("#SJYJ").attr("src","images/Index/vip_tit23.jpg");
      $("#map").attr("src","images/Index/vip_tit3.jpg");
      
      $("td#ohgod > div").hide();
      $("div#vippic").fadeIn("slow");
   });
   
//   $("#SJYJ").mouseover(function(){
//      $(this).attr("src","images/Index/vip_tit2.jpg");
//      $("#VIP").attr("src","images/Index/vip_tit1.jpg");
//      $("#map").attr("src","images/Index/vip_tit3.jpg");
//      
//   });
   
   $("#map").mouseover(function(){
      $(this).attr("src","images/Index/caonima7.jpg");
      $("#SJYJ").attr("src","images/Index/vip_tit23.jpg");
      $("#VIP").attr("src","images/Index/vip_tit1.jpg");
      
      $("td#ohgod > div").hide();
      $("div#jjditu").fadeIn("slow");
   });
   
   $("#hdyg").mouseover(function(){
       $(this).attr("src","images/Index/hd_yg.jpg");
       $("#hzxx").attr("src","images/Index/hd_hezuo.jpg");
       $("#lyzx").attr("src","images/Index/hd_lvyou.jpg");
       $("td#ahltop5 > div").hide();
       $("div#activetop5").fadeIn("slow");
   });
   
   $("#hzxx").mouseover(function(){
       $(this).attr("src","images/Index/hd_hzxx.jpg");
       $("#hdyg").attr("src","images/Index/hd_hdyg.jpg");
       $("#lyzx").attr("src","images/Index/hd_lvyou.jpg");
       $("td#ahltop5 > div").hide();
       $("div#hzxxtop5").fadeIn("slow");
   });
   
   $("#lyzx").mouseover(function(){
       $(this).attr("src","images/Index/hd_lyzx.jpg");
       $("#hdyg").attr("src","images/Index/hd_hdyg.jpg");
       $("#hzxx").attr("src","images/Index/hd_hezuo.jpg");
       $("td#ahltop5 > div").hide();
       $("div#lyzxtop5").fadeIn("slow");
   });
   
   
});

function fnGetFeatureCommandMessageForCateogry(col,iCateogry)
{

    if(col == 1){
        if(iCateogry == 1){
            $("td#fc1 > div").hide();
            $("#tsyx").show();
        }
        else if(iCateogry == 2){
            if($.trim($("#aygp").html()) == ""){
                AJAX_GETFCTABLE("operation=FeatureCommendCagegory&&category=" + iCateogry,1,"aygp");
            }
            else{
                $("td#fc1 > div").hide();
                $("#aygp").show();
            }
        }
        else if(iCateogry == 3){
            if($.trim($("#byzs").html()) == ""){
                AJAX_GETFCTABLE("operation=FeatureCommendCagegory&&category=" + iCateogry,1,"byzs");
            }
            else{
                $("td#fc1 > div").hide();
                $("#byzs").show();
            }
        }
        else{
            if($.trim($("#mspl").html()) == ""){
                AJAX_GETFCTABLE("operation=FeatureCommendCagegory&&category=" + iCateogry,1,"mspl");
            }
            else{
               $("td#fc1 > div").hide();
               $("#mspl").show();
            }
        }
   } 
   
   if(col == 2){
         if(iCateogry == 5){
            $("td#fc2 > div").hide();
            $("#qhyg").show();
        }
        else if(iCateogry == 6){
            if($.trim($("#hgky").html()) == ""){
                AJAX_GETFCTABLE("operation=FeatureCommendCagegory&&category=" + iCateogry,2,"hgky");
            }
            else{
                $("td#fc2 > div").hide();
                $("#hgky").show();
            }
        }
        else if(iCateogry == 7){
            if($.trim($("#hsly").html()) == ""){
                AJAX_GETFCTABLE("operation=FeatureCommendCagegory&&category=" + iCateogry,2,"hsly");
            }
            else{
                $("td#fc2 > div").hide();
                $("#hsly").show();
            }
        }
        else{
            if($.trim($("#qzty").html()) == ""){
                AJAX_GETFCTABLE("operation=FeatureCommendCagegory&&category=" + iCateogry,2,"qzty");
            }
            else{
                $("td#fc2 > div").hide();
                $("#qzty").show();
            }
        }
   }
}

function AJAX_GETFCTABLE(sData,sFcCol,sDisplayDivID)
{
        $.ajax({
            type:"GET",
            url:"ashx/index.ashx",
            data:sData,
            dateType:"html",
            timeout:2000,
            beforeSend: function(){
               if(sFcCol == 1){
                    $("td#fc1 > div").hide();
                    $("#fcload1").show();
               }
               else{
                    $("td#fc2 > div").hide();
                    $("#fcload2").show();
               }
            },
            complete:function(){ 
               if(sFcCol == 1){
                    $("td#fc1 > div").hide();
                    $("#" + sDisplayDivID).show();
               }
               else{
                    $("td#fc2 > div").hide();
                    $("#" + sDisplayDivID).show();
               }
            },
            success:function(responseHTML){
                $("#" + sDisplayDivID).html(responseHTML);
            }
    });
}