document.write("<link rel='shortcut icon' href='/Content/logo/whmh.ico' />");
previousColor = "#8ac0e2";

$(function () {
    $("input[type='text']").bind(
   "focus", function () {
       previousColor = $(this).css("border-color");
       $(this).css("border-color", "#4a9cd6");
   })
    $("input[type='text']").bind(
   "blur", function () {
       $(this).css("border-color", previousColor);
   })
    $("input[type='password']").bind(
   "focus", function () {
       previousColor = $(this).css("border-color");
       $(this).css("border-color", "#4a9cd6");
   })
    $("input[type='password']").bind(
   "blur", function () {
       $(this).css("border-color", previousColor);
   })

    $(".headerList a").bind(
   "mouseover", function () {
       $(this).css('text-decoration', 'none')
       $(this).css('color', '#4a9cd6').parents('li').css('background', 'url(/FrontPage/WeiHai/image/headerBanner.jpg) no-repeat center bottom');

   }
  )
    $(".headerList a").bind(
   "mouseout", function () {
       $(this).css('color', '#777777').parents('li').css('background', 'none');
   }
  )




    $(".header_notice a").bind(
   "mouseover", function () {
       $(this).css('color', '#646665')

   }
  )

    $(".header_notice a").bind(
   "mouseout", function () {
       $(this).css('color', '#114683')
   }
  )



    $(".towerInfo_right li a").hover(
    function () {
        $(this).css("color", "#4a9cd6").css("text-decoration", "underline");
    },
  function () {
      $(this).css("color", "#565656").css("text-decoration", "none");
  }

  )

    $(".quickGuidance span a").hover(
    function () {
        $(this).css("color", "#4a9cd6").css("text-decoration", "underline");
    },
  function () {
      $(this).css("color", "#565656").css("text-decoration", "none");
  }

  )


    $(".flightsMed").bind(
     "click", function () {
         window.location.href = "fligtsMed/Airbus300.html";
     })

    $(".account input").bind(
     "focus", function () {
         $(this).css("border", "solid 1px #fac366");

     })

    $(".account input").bind(
     "blur", function () {
         $(this).css("border", "solid 1px #4a9cd6");

     })

    $(".pass input").bind(
     "focus", function () {
         $(this).css("border", "solid 1px #fac366");

     })

    $(".pass input").bind(
     "blur", function () {
         $(this).css("border", "solid 1px #4a9cd6");

     })


    $(".airCompanyIntro a").bind(
    "mouseover", function () {
        $(this).css("color", "#4a9cd6").css("text-decoration", "underline");
    })


    $(".airCompanyIntro a").bind(
    "mouseout", function () {
        $(this).css("color", "#555").css("text-decoration", "none");
    })



    $("#tab1").bind(
    "click", function () {
        var backFlag = $(this).attr("src");
        if (backFlag == "/FrontPage/WeiHai/image/cc1b.jpg") {
            return false;
        }
        else {
            $(this).attr("src", "/FrontPage/WeiHai/image/cc1b.jpg");
            $("#tab2").attr("src", "/FrontPage/WeiHai/image/cc1b2.jpg");
            $("#tab2").css("margin-left", "0px");
            $(".mainWrap").css("display", "block");
            $(".mainWrapInternational").css("display", "none");


        }
    })

    $("#tab2").bind(
    "click", function () {
        var backgroundFlag = $(this).attr("src");
        if (backgroundFlag == "/FrontPage/WeiHai/image/cc1b2.jpg") {
            $(this).attr("src", "/FrontPage/WeiHai/image/cc2.jpg");
            $("#tab1").attr("src", "/FrontPage/WeiHai/image/cc1.jpg");
            $(this).css("margin-left", "-2px");
            $(".mainWrap").css("display", "none");
            $(".mainWrapInternational").css("display", "block");

        }
    })




    $("#adjust1").bind(
   "click", function () {
       var backgroundFlag = $(this).attr("src");
       if (backgroundFlag == "/FrontPage/WeiHai/image/bb1.jpg") {
           return false;
       }
       else {
           $(this).attr("src", "/FrontPage/WeiHai/image/bb1.jpg");
           $("#adjust2").attr("src", "/FrontPage/WeiHai/image/bb2.jpg");
           $(this).css("margin-left", "0px");
           $("#adjust2").css("margin-left", "25px");
           $(".mainWrap").css("display", "block");
           $(".mainWrapInternational").css("display", "none");

       }
   })


    $("#adjust2").bind(
   "click", function () {
       var backgroundFlag = $(this).attr("src");
       if (backgroundFlag == "/FrontPage/WeiHai/image/bb2.jpg") {

           $(this).attr("src", "/FrontPage/WeiHai/image/bb2b.jpg");
           $("#adjust1").attr("src", "/FrontPage/WeiHai/image/bb1b.jpg");
           $("#adjust1").css("margin-left", "19px");
           $(this).css("margin-left", "23px");
           $(".mainWrap").css("display", "none");
           $(".mainWrapInternational").css("display", "block");

       }
       else {


           return false;
           $(this).attr("src", "/FrontPage/WeiHai/image/bb2.jpg");

       }
   })






    function cutExtra() {
        var username = $(".userSuccess").text();
        var usernameShowing1 = username.substring(0, 10);
        var usernameShowing2 = "..";
        var usernameShowing = usernameShowing1 + usernameShowing2;
        if (username.length > 10) {
            $(".userSuccess").text(usernameShowing);
        }
    }
    cutExtra();
    //如果用户名过长只显示前10个字符



    $(".underline").hover(
           function () {
               $(this).css("color", "#4a9cd6");
           }, function () {
               $(this).css("color", "#555");
           }
  )


 var wrapLink = $("<a href='#' class='wrapLink'></a>");
 $(".wrapDetail2").wrap(wrapLink);
 $(".wrap:last").css("border-bottom", "1px solid #e3e3e3");






})
