﻿$(document).ready(

            function() {

                if (getCookie("islight") == "true") {
                    $("body").css({ "background-color": "#fff" });
                    $(".homemain").css({ width: "315px" });
                    $(".listmain").css({ width: "475px" });
                    $(".resultmain").css({ width: "813px" });
                    $("#content").css({ border: "1px solid #c0c0c0" });
                    $("#menu ul").css({ width: "212px" });
                    $("#menu ul li").css({ border: "1px solid #c0c0c0" });
                }

                $("#light").click(

                    function() {
                        if (getCookie("islight") == "false" || getCookie("islight") == undefined) {
                            $("body").css({ "background-color": "#fff" });
                            $(".homemain").css({ width: "315px" });
                            $(".listmain").css({ width: "475px" });
                            $(".resultmain").css({ width: "813px" });
                            $("#content").css({ border: "1px solid #c0c0c0" });
                            $("#menu  ul").css({ width: "212px" });
                            $("#menu ul li").css({ border: "1px solid #c0c0c0" });
                            setCookie("islight", "true");

                        } else {
                            $("body").css({ "background-color": "#000" });
                            $(".homemain").css({ width: "305px" });
                            $(".listmain").css({ width: "465px" });
                            $(".resultmain").css({ width: "811px" });
                            $("#content").css({ border: "none" });
                            $("#menu  ul").css({ width: "204px" });
                            $("#menu ul li").css({ border: "none" });
                            setCookie("islight", "false");
                        }
                    }

                )







                $("#diary").hover(

                    function() {
                        $(this).attr("src", "/images/diarycolor.jpg");
                        $("#menu ul:nth-child(1) li:nth-child(8)").css({ "border-color": "#6bd729" });
                    },
                    function() {
                        $(this).attr("src", "/images/null.jpg");
                        $("#menu ul:nth-child(1) li:nth-child(8)").css({ "border-color": "#c0c0c0" });
                    }
                )

                $("#photo").hover(

                    function() {
                        $(this).attr("src", "/images/photocolor.jpg");
                        $("#menu ul:nth-child(1) li:nth-child(3)").css({ "border-color": "#00a8ff" });
                    },
                    function() {
                        $(this).attr("src", "/images/null.jpg");
                        $("#menu ul:nth-child(1) li:nth-child(3)").css({ "border-color": "#c0c0c0" });
                    }
                )

                $("#writing").hover(

                    function() {
                        $(this).attr("src", "/images/writingcolor.jpg");
                        $("#menu ul:nth-child(1) li:nth-child(6)").css({ "border-color": "#ffa800" });
                    },
                    function() {
                        $(this).attr("src", "/images/null.jpg");
                        $("#menu ul:nth-child(1) li:nth-child(6)").css({ "border-color": "#c0c0c0" });
                    }
                )

                $("#about").hover(

                    function() {
                        $(this).attr("src", "/images/aboutcolor.jpg");
                        $("#menu ul:nth-child(1) li:nth-child(1)").css({ "border-color": "#ff0000" });
                    },
                    function() {
                        $(this).attr("src", "/images/null.jpg");
                        $("#menu ul:nth-child(1) li:nth-child(1)").css({ "border-color": "#c0c0c0" });
                    }
                )

                $("#guest").hover(

                    function() {
                        $(this).attr("src", "/images/guestcolor.jpg");
                    },
                    function() {
                        $(this).attr("src", "/images/null.jpg");
                    }
                )

                $("#topic").hover(

                    function() {
                        $(this).attr("src", "/images/topiccolor.jpg");
                    },
                    function() {
                        $(this).attr("src", "/images/null.jpg");
                    }
                )


                var url = window.location.href;
                if (url.indexOf("diary") > 0) {

                    $("#diary").attr("src", "/images/diarycolor.jpg");
                    $("#diary").unbind();

                }

                if (url.indexOf("photo") > 0) {

                    $("#photo").attr("src", "/images/photocolor.jpg");
                    $("#photo").unbind();

                }

                if (url.indexOf("writing") > 0) {

                    $("#writing").attr("src", "/images/writingcolor.jpg");
                    $("#writing").unbind();

                }

                if (url.indexOf("about") > 0) {

                    $("#about").attr("src", "/images/aboutcolor.jpg");
                    $("#about").unbind();

                }

            }
        )
