$(function() {
    $("#h_button2").css("height", "20");
    $("#h_button1").css("height", "22");
    $("#result").html('میزبانی وب web hosting <br /> شرکت ارتباطات شبکه دی با 10 سال سابقه از نخستین شرکت های ارائه دهنده میزبانی وب در کشور می باشد که در ایران از سال 2000 میلادی با نام <a href="http://iranhosting.com" style="color:#036889">ایران هاستینگ</a> خدمات خود را در این زمینه آغاز نمود و در سال 1382 پس از ظهور شرکت های جدید و وب سایت های مختلف با نام مشابه تصمیم به تغییر نام به ارتباطات شبکه دی و ثبت علامت تجاری شبکه دی را نمود در تمام این سالها هدف ما ارائه بهترین سرویس های ممکن به مشترکین بوده است و در حال حاضر با همکاری گروه شرکت های دی تلکام و به لطف خدا با بهترین امکانات سخت افزاری و نرم افزاری ایده آل ترین برای شما فراهم آورده ایم.');
    $("#button1").click(function() {
        $("#h_button1").css("height", "22");
        $("#h_button2").css("height", "20");
        $("#h_button3").css("height", "20");
        $("#result").html('میزبانی وب web hosting <br /> شرکت ارتباطات شبکه دی با 10 سال سابقه از نخستین شرکت های ارائه دهنده میزبانی وب در کشور می باشد که در ایران از سال 2000 میلادی با نام <a href="http://iranhosting.com" style="color:#036889">ایران هاستینگ</a> خدمات خود را در این زمینه آغاز نمود و در سال 1382 پس از ظهور شرکت های جدید و وب سایت های مختلف با نام مشابه تصمیم به تغییر نام به ارتباطات شبکه دی و ثبت علامت تجاری شبکه دی را نمود در تمام این سالها هدف ما ارائه بهترین سرویس های ممکن به مشترکین بوده است و در حال حاضر با همکاری گروه شرکت های دی تلکام و به لطف خدا با بهترین امکانات سخت افزاری و نرم افزاری ایده آل ترین برای شما فراهم آورده ایم.');
        $("#zir_button1").css("border-top-color", "#DBDBDB");
        $("#zir_button2").css("border-top-color", "#666666");
        $("#zir_button3").css("border-top-color", "#666666");
    });
    $("#button2").click(function() {
        $("#h_button2").css("height", "22");
        $("#h_button1").css("height", "20");
        $("#h_button3").css("height", "20");
        $("#result").html('دامنه کلمه ای است که به عنوان ترجمه Domain در فارسی رایج شده و در لغت به معنی قلمرو می باشد و در اینترنت به نام اختصاصی هر وب سایت گفته میشود که حد اقل دو بخش دارد بخش اول که قبل از نقطه می آید به انتخاب ثبت کننده و برای ثبت دامنه ای که  قبلا ثبت نشده باشد انتخاب می شود <a href="http://day.ir/help/faq.aspx" style="color:#036889" target="_blank">ادامه</a>');
        
        $("#zir_button2").css("border-top-color", "#DBDBDB");
        $("#zir_button1").css("border-top-color", "#666666");
        $("#zir_button3").css("border-top-color", "#666666");
    });
    $("#button3").click(function() {
        $("#h_button3").css("height", "22");
        $("#h_button1").css("height", "20");
        $("#h_button2").css("height", "20");
        $("#result").html('سرویس های جدید ایمیل شبکه دی با کاملترین امکانات ممکن به شما امکان استفاده از سرویس ایمیل تجاری و یا شخصی با امنیت و کیفیت با لا را میدهد محل سرویس دهنده ها در کشور ایران و یا کانادا به انتخاب شما می باشد برای اطلاع از جزئیات بیشتر به بخش <a href="http://day.ir/EmailServices.aspx" style="color:#036889">تعرفه سرویس های ایمیل</a> مراجعه نمایید');

        $("#zir_button3").css("border-top-color", "#DBDBDB");
        $("#zir_button1").css("border-top-color", "#666666");
        $("#zir_button2").css("border-top-color", "#666666");
    });




    $("#close_offer1").click(function() {
        $('#Offer_Buy').hide();
    });
    $("#close_offer2").click(function() {
        $('#Offer_Buy1').hide();
    });
    $("#close_offer3").click(function() {
        $('#Offer_Buy2').hide();
    });
    $("#close_offer4").click(function() {
        $('#Offer_Buy3').hide();
    });
    $("#close_offer5").click(function() {
        $('#Offer_Buy4').hide();
    });
    $("#close_offer6").click(function() {
        $('#Offer_Buy5').hide();
    });
    $("#close_offer7").click(function() {
        $('#Offer_Buy6').hide();
    });
    $("#close_offer8").click(function() {
        $('#Offer_Buy7').hide();
    });
    $("#close_offer9").click(function() {
        $('#Offer_Buy8').hide();
    });
    $('#check1').click(function() {//اولین بار است از سرویس هاستینگ استفاده می کنم
        if ($('#check1').attr('checked') == true) {
            // if checkbox is checked code execute
            $('#check2').attr('disabled', true);
            $('#check3').attr('disabled', true);
            $('#check4').attr('disabled', true);
            $('#check5').attr('disabled', true);
            $('#check6').attr('disabled', true);
            $('#check7').attr('disabled', true);
            $('#check8').attr('disabled', true);
            $('#check9').attr('disabled', true);
            $('#check10').attr('disabled', true);
            //$('#myResult').text("کاربر گرامی شما باید از سرویس های استارتر شبکه دی استفاده نمایید")
        } else {
            $('#check2').attr('disabled', false);
            $('#check3').attr('disabled', false);
            $('#check4').attr('disabled', false);
            $('#check5').attr('disabled', false);
            $('#check6').attr('disabled', false);
            $('#check7').attr('disabled', false);
            $('#check8').attr('disabled', false);
            $('#check9').attr('disabled', false);
            $('#check10').attr('disabled', false);
            //$('#myResult').text("");
            $('#Offer_Buy').hide();

        }
    }); //اولین بار است از سرویس هاستینگ استفاده می کنم


    $('#check2').click(function() {//طراح وب سایت هستم
        if ($('#check2').attr('checked') == true) {
            // if checkbox is checked code execute
            $('#check1').attr('disabled', true);
            $('#check3').attr('disabled', true);
            $('#check4').attr('disabled', true);
            $('#check5').attr('disabled', true);
            $('#check6').attr('disabled', true);
            $('#check7').attr('disabled', true);
            $('#check8').attr('disabled', true);
            $('#check9').attr('disabled', true);
            $('#check10').attr('disabled', true);
            //$('#myResult').text("کاربر گرامی شما باید از سرویس های استارتر 2 به بالاب شبکه دی استفاده نمایید")
        } else {
            $('#check1').attr('disabled', false);
            $('#check3').attr('disabled', false);
            $('#check4').attr('disabled', false);
            $('#check5').attr('disabled', false);
            $('#check6').attr('disabled', false);
            $('#check7').attr('disabled', false);
            $('#check8').attr('disabled', false);
            $('#check9').attr('disabled', false);
            $('#check10').attr('disabled', false);
            $('#Offer_Buy1').hide();
        }
    }); //طراح وب سایت هستم


    $('#check3').click(function() {//برنامه نویسی تحت وب هستم و طراح وب
        if ($('#check3').attr('checked') == true) {
            // if checkbox is checked code execute
            $('#check1').attr('disabled', true);
            $('#check2').attr('disabled', true);
            $('#check4').attr('disabled', false);
            $('#check5').attr('disabled', false);
            $('#check6').attr('disabled', true);
            $('#check7').attr('disabled', true);
            $('#check8').attr('disabled', true);
            $('#check9').attr('disabled', true);
            $('#check10').attr('disabled', true);
            $('#ProgramLan').slideDown();

            $('#check4').click(function() {
                if ($('#check4').attr('checked') == true) {
                    $('#check5').attr('disabled', true);
                    $('#check4').attr('disabled', false);
                    // $('#myResult').text("کاربر گرامی شما باید از هاست لینوکس استفاده کنید");
                } else {
                    $('#check4').attr('disabled', false);
                    $('#check5').attr('disabled', false);
                    //$('#myResult').text("");
                    $('#Offer_Buy2').hide();
                }
            });

            $('#check5').click(function() {
                if ($('#check5').attr('checked') == true) {
                    $('#check4').attr('disabled', true);
                    $('#check5').attr('disabled', false);
                    // $('#myResult').text("کاربر گرامی شما باید از هاست ویندوز استفاده کنید");
                } else {
                    $('#check5').attr('disabled', false);
                    $('#check4').attr('disabled', false);
                    //$('#myResult').text("");
                    $('#Offer_Buy3').hide();
                }
            });

            //
        } else {
            $('#check1').attr('disabled', false);
            $('#check2').attr('disabled', false);
            $('#check4').attr('disabled', false);
            $('#check5').attr('disabled', false);
            $('#check6').attr('disabled', false);
            $('#check7').attr('disabled', false);
            $('#check8').attr('disabled', false);
            $('#check9').attr('disabled', false);
            $('#check10').attr('disabled', false);
            $('#ProgramLan').slideUp();
            //$('#myResult').text("");
        }
    }); //برنامه نویسی تحت وب هستم و طراح وب


    $('#check6').click(function() {//می خواهم وب سایت شخصی داشته باشم
        if ($('#check6').attr('checked') == true) {
            // if checkbox is checked code execute
            $('#check1').attr('disabled', true);
            $('#check3').attr('disabled', true);
            $('#check4').attr('disabled', true);
            $('#check5').attr('disabled', true);
            $('#check2').attr('disabled', true);
            $('#check7').attr('disabled', true);
            $('#check8').attr('disabled', true);
            $('#check9').attr('disabled', true);
            $('#check10').attr('disabled', true);
            //$('#myResult').text("کاربر گرامی شما باید از سرویس های استارتر به بالاب شبکه دی استفاده نمایید")
        } else {
            $('#check1').attr('disabled', false);
            $('#check3').attr('disabled', false);
            $('#check4').attr('disabled', false);
            $('#check5').attr('disabled', false);
            $('#check2').attr('disabled', false);
            $('#check7').attr('disabled', false);
            $('#check8').attr('disabled', false);
            $('#check9').attr('disabled', false);
            $('#check10').attr('disabled', false);
            //$('#myResult').text("");
            $('#Offer_Buy4').hide();
        }
    }); //می خواهم وب سایت شخصی داشته باشم


    $('#check7').click(function() {//خواستار ترافیک بالا هستم
        if ($('#check7').attr('checked') == true) {
            // if checkbox is checked code execute
            $('#check1').attr('disabled', true);
            $('#check3').attr('disabled', true);
            $('#check4').attr('disabled', true);
            $('#check5').attr('disabled', true);
            $('#check6').attr('disabled', true);
            $('#check2').attr('disabled', true);
            $('#check8').attr('disabled', true);
            $('#check9').attr('disabled', true);
            $('#check10').attr('disabled', true);
            //$('#myResult').text("کاربر گرامی شما باید از سرویس های بیزینس 2 به بالاب شبکه دی استفاده نمایید")
        } else {
            $('#check1').attr('disabled', false);
            $('#check3').attr('disabled', false);
            $('#check4').attr('disabled', false);
            $('#check5').attr('disabled', false);
            $('#check6').attr('disabled', false);
            $('#check2').attr('disabled', false);
            $('#check8').attr('disabled', false);
            $('#check9').attr('disabled', false);
            $('#check10').attr('disabled', false);
            //$('#myResult').text("");
            $('#Offer_Buy5').hide();
        }
    }); //خواستار ترافیک بالا هستم



    $('#check8').click(function() {//می خواهم از سرویس ایمیل استفاده کنم
        if ($('#check8').attr('checked') == true) {
            // if checkbox is checked code execute
            $('#check1').attr('disabled', true);
            $('#check3').attr('disabled', true);
            $('#check4').attr('disabled', true);
            $('#check5').attr('disabled', true);
            $('#check6').attr('disabled', true);
            $('#check7').attr('disabled', true);
            $('#check2').attr('disabled', true);
            $('#check9').attr('disabled', true);
            $('#check10').attr('disabled', true);
            //$('#myResult').text("کاربر گرامی شما باید از سرویس های استارتر  شبکه دی استفاده نمایید")
        } else {
            $('#check1').attr('disabled', false);
            $('#check3').attr('disabled', false);
            $('#check4').attr('disabled', false);
            $('#check5').attr('disabled', false);
            $('#check6').attr('disabled', false);
            $('#check7').attr('disabled', false);
            $('#check2').attr('disabled', false);
            $('#check9').attr('disabled', false);
            $('#check10').attr('disabled', false);
            // $('#myResult').text("");
            $('#Offer_Buy6').hide();
        }
    }); //می خواهم از سرویس ایمیل استفاده کنم

    $('#check9').click(function() {//می خواهم کار تبلیغاتی کنم
        if ($('#check9').attr('checked') == true) {
            // if checkbox is checked code execute
            $('#check1').attr('disabled', true);
            $('#check3').attr('disabled', true);
            $('#check4').attr('disabled', true);
            $('#check5').attr('disabled', true);
            $('#check6').attr('disabled', true);
            $('#check7').attr('disabled', true);
            $('#check8').attr('disabled', true);
            $('#check2').attr('disabled', true);
            $('#check10').attr('disabled', true);
            //$('#myResult').text("کاربر گرامی شما باید از میل سرور اختصاصی  شبکه دی استفاده نمایید")
        } else {
            $('#check1').attr('disabled', false);
            $('#check3').attr('disabled', false);
            $('#check4').attr('disabled', false);
            $('#check5').attr('disabled', false);
            $('#check6').attr('disabled', false);
            $('#check7').attr('disabled', false);
            $('#check8').attr('disabled', false);
            $('#check2').attr('disabled', false);
            $('#check10').attr('disabled', false);
            //$('#myResult').text("");
            $('#Offer_Buy7').hide();
        }
    }); //می خواهم کار تبلیغاتی کنم


    $('#check10').click(function() {//سرویس مورد نیاز برای سازمانها و ارگانها
        if ($('#check10').attr('checked') == true) {
            // if checkbox is checked code execute
            $('#check1').attr('disabled', true);
            $('#check3').attr('disabled', true);
            $('#check4').attr('disabled', true);
            $('#check5').attr('disabled', true);
            $('#check6').attr('disabled', true);
            $('#check7').attr('disabled', true);
            $('#check8').attr('disabled', true);
            $('#check9').attr('disabled', true);
            $('#check2').attr('disabled', true);
            // $('#myResult').text("کاربر گرامی شما باید از پکیج های سرور اختصاصی و یا سیستم پی به بالا  شبکه دی استفاده نمایید")
        } else {
            $('#check1').attr('disabled', false);
            $('#check3').attr('disabled', false);
            $('#check4').attr('disabled', false);
            $('#check5').attr('disabled', false);
            $('#check6').attr('disabled', false);
            $('#check7').attr('disabled', false);
            $('#check8').attr('disabled', false);
            $('#check9').attr('disabled', false);
            $('#check2').attr('disabled', false);
            //$('#myResult').text("");
            $('#Offer_Buy8').hide();
        }
    }); //سرویس مورد نیاز برای سازمانها و ارگانها



    /*$("#whois").animate({opacity: 0.9});
    $("#ir").animate({opacity: 0.9});
    $("#Subsupport").animate({opacity: 0.9});
    $("#contact").animate({opacity: 0.9});
    $("#service").animate({opacity: 0.9});*/

    $("#Subsupport").animate({ opacity: 0.9 });
    $("#Subservice").animate({ opacity: 0.9 });
    $("#Subir").animate({ opacity: 0.9 });
    var _width = document.body.parentNode.clientWidth + "px";
    var _height = document.body.parentNode.clientHeight + "px";
    $("#tdheight").css("height", _height);
    var _clientW = parseInt(_width) - 800;
    _submenu1 = parseInt(_clientW / 2 + 644) + "px";
    _submenu2 = parseInt(_clientW / 2 + 324) + "px";
    _submenu3 = parseInt(_clientW / 2 + 165) + "px";
    $("#Subsupport").css("left", _submenu1);
    $("#Subservice").css("left", _submenu2);
    $("#Subir").css("left", _submenu3);

    $(window).resize(function() {
        var _width = document.body.parentNode.clientWidth + "px";
        var _height = document.body.parentNode.clientHeight + "px";
        $("#tdheight").css("height", _height);
        var _clientW = parseInt(_width) - 800;
        _submenu1 = parseInt(_clientW / 2 + 644) + "px";
        _submenu2 = parseInt(_clientW / 2 + 324) + "px";
        _submenu3 = parseInt(_clientW / 2 + 165) + "px";
        $("#Subsupport").css("left", _submenu1);
        $("#Subservice").css("left", _submenu2);
        $("#Subir").css("left", _submenu3);
    });


    $("#support").hover(function() {
        $("#Subsupport").slideDown("normal");
        $("#Subservice").slideUp("normal");
        $("#Subir").slideUp("normal");

    });
    $("#service").hover(function() {
        $("#Subservice").slideDown("normal");
        $("#Subsupport").slideUp("normal");
        $("#Subir").slideUp("normal");

    });
    $("#ir").hover(function() {
        $("#Subir").slideDown("normal");
        $("#Subservice").slideUp("normal");
        $("#Subsupport").slideUp("normal");

    });

    $("#body").click(function() {
        $("#Subservice").slideUp("normal");
        $("#Subsupport").slideUp("normal");
        $("#Subir").slideUp("normal");
    });

    $("#check1").click(function() {
        if ($('#check1').attr('checked') == true) {
            var _width = document.body.parentNode.clientWidth + "px";
            var _height = document.body.parentNode.clientHeight + "px";
            //alert(_width + ":" + _height);
            //item//
            item_width = $("#Offer_Buy").css("width");
            item_height = $("#Offer_Buy").css("height");
            Half_item_width = parseInt(item_width) / 2;
            Half_item_height = parseInt(item_height) / 2;
            //item//

            Half_width = parseInt(_width) / 2 - parseInt(Half_item_width);
            Half_height = parseInt(_height) / 2 - parseInt(Half_item_height);
            $("#Offer_Buy").css("left", Half_width);
            $("#Offer_Buy").css("top", Half_height);

            $("#Offer_Buy").slideDown("slow");
        }

    });



    $("#check2").click(function() {
        if ($('#check2').attr('checked') == true) {
            var _width = document.body.parentNode.clientWidth + "px";
            var _height = document.body.parentNode.clientHeight + "px";
            //alert(_width + ":" + _height);
            //item//
            item_width = $("#Offer_Buy1").css("width");
            item_height = $("#Offer_Buy1").css("height");
            Half_item_width = parseInt(item_width) / 2;
            Half_item_height = parseInt(item_height) / 2;
            //item//

            Half_width = parseInt(_width) / 2 - parseInt(Half_item_width);
            Half_height = parseInt(_height) / 2 - parseInt(Half_item_height);
            $("#Offer_Buy1").css("left", Half_width);
            $("#Offer_Buy1").css("top", Half_height);

            $("#Offer_Buy1").slideDown("slow");
        }
    });


    $("#check4").click(function() {
        if ($('#check4').attr('checked') == true) {
            var _width = document.body.parentNode.clientWidth + "px";
            var _height = document.body.parentNode.clientHeight + "px";
            //alert(_width + ":" + _height);
            //item//
            item_width = $("#Offer_Buy2").css("width");
            item_height = $("#Offer_Buy2").css("height");
            Half_item_width = parseInt(item_width) / 2;
            Half_item_height = parseInt(item_height) / 2;
            //item//

            Half_width = parseInt(_width) / 2 - parseInt(Half_item_width);
            Half_height = parseInt(_height) / 2 - parseInt(Half_item_height);
            $("#Offer_Buy2").css("left", Half_width);
            $("#Offer_Buy2").css("top", Half_height);

            $("#Offer_Buy2").slideDown("slow");
        }
    });
    $("#check5").click(function() {
        if ($('#check5').attr('checked') == true) {
            var _width = document.body.parentNode.clientWidth + "px";
            var _height = document.body.parentNode.clientHeight + "px";
            //alert(_width + ":" + _height);
            //item//
            item_width = $("#Offer_Buy3").css("width");
            item_height = $("#Offer_Buy3").css("height");
            Half_item_width = parseInt(item_width) / 2;
            Half_item_height = parseInt(item_height) / 2;
            //item//

            Half_width = parseInt(_width) / 2 - parseInt(Half_item_width);
            Half_height = parseInt(_height) / 2 - parseInt(Half_item_height);
            $("#Offer_Buy3").css("left", Half_width);
            $("#Offer_Buy3").css("top", Half_height);

            $("#Offer_Buy3").slideDown("slow");
        }
    });


    $("#check6").click(function() {
        if ($('#check6').attr('checked') == true) {
            var _width = document.body.parentNode.clientWidth + "px";
            var _height = document.body.parentNode.clientHeight + "px";
            //alert(_width + ":" + _height);
            //item//
            item_width = $("#Offer_Buy4").css("width");
            item_height = $("#Offer_Buy4").css("height");
            Half_item_width = parseInt(item_width) / 2;
            Half_item_height = parseInt(item_height) / 2;
            //item//

            Half_width = parseInt(_width) / 2 - parseInt(Half_item_width);
            Half_height = parseInt(_height) / 2 - parseInt(Half_item_height);
            $("#Offer_Buy4").css("left", Half_width);
            $("#Offer_Buy4").css("top", Half_height);

            $("#Offer_Buy4").slideDown("slow");
        }
    });


    $("#check7").click(function() {
        if ($('#check7').attr('checked') == true) {
            var _width = document.body.parentNode.clientWidth + "px";
            var _height = document.body.parentNode.clientHeight + "px";
            //alert(_width + ":" + _height);
            //item//
            item_width = $("#Offer_Buy5").css("width");
            item_height = $("#Offer_Buy5").css("height");
            Half_item_width = parseInt(item_width) / 2;
            Half_item_height = parseInt(item_height) / 2;
            //item//

            Half_width = parseInt(_width) / 2 - parseInt(Half_item_width);
            Half_height = parseInt(_height) / 2 - parseInt(Half_item_height);
            $("#Offer_Buy5").css("left", Half_width);
            $("#Offer_Buy5").css("top", Half_height);

            $("#Offer_Buy5").slideDown("slow");
        }
    });

    $("#check8").click(function() {
        if ($('#check8').attr('checked') == true) {
            var _width = document.body.parentNode.clientWidth + "px";
            var _height = document.body.parentNode.clientHeight + "px";
            //alert(_width + ":" + _height);
            //item//
            item_width = $("#Offer_Buy6").css("width");
            item_height = $("#Offer_Buy6").css("height");
            Half_item_width = parseInt(item_width) / 2;
            Half_item_height = parseInt(item_height) / 2;
            //item//

            Half_width = parseInt(_width) / 2 - parseInt(Half_item_width);
            Half_height = parseInt(_height) / 2 - parseInt(Half_item_height);
            $("#Offer_Buy6").css("left", Half_width);
            $("#Offer_Buy6").css("top", Half_height);

            $("#Offer_Buy6").slideDown("slow");
        }
    });

    $("#check9").click(function() {
        if ($('#check9').attr('checked') == true) {
            var _width = document.body.parentNode.clientWidth + "px";
            var _height = document.body.parentNode.clientHeight + "px";
            //alert(_width + ":" + _height);
            //item//
            item_width = $("#Offer_Buy7").css("width");
            item_height = $("#Offer_Buy7").css("height");
            Half_item_width = parseInt(item_width) / 2;
            Half_item_height = parseInt(item_height) / 2;
            //item//

            Half_width = parseInt(_width) / 2 - parseInt(Half_item_width);
            Half_height = parseInt(_height) / 2 - parseInt(Half_item_height);
            $("#Offer_Buy7").css("left", Half_width);
            $("#Offer_Buy7").css("top", Half_height);

            $("#Offer_Buy7").slideDown("slow");
        }
    });

    $("#check10").click(function() {
        if ($('#check10').attr('checked') == true) {
            var _width = document.body.parentNode.clientWidth + "px";
            var _height = document.body.parentNode.clientHeight + "px";
            //alert(_width + ":" + _height);
            //item//
            item_width = $("#Offer_Buy8").css("width");
            item_height = $("#Offer_Buy8").css("height");
            Half_item_width = parseInt(item_width) / 2;
            Half_item_height = parseInt(item_height) / 2;
            //item//

            Half_width = parseInt(_width) / 2 - parseInt(Half_item_width);
            Half_height = parseInt(_height) / 2 - parseInt(Half_item_height);
            $("#Offer_Buy8").css("left", Half_width);
            $("#Offer_Buy8").css("top", Half_height);

            $("#Offer_Buy8").slideDown("slow");
        }
    });


});