﻿
var tt = ".searchTextBox";
//var txtLoginUsername = "";
var is_login = false;
var normalBox = 'url(../../ContentFiles/TopBar/Images/sssderaz.png)';
var hoverBox = 'url(../../ContentFiles/TopBar/Images/sssh.png)';
var onFocusWidth = '180px';
var onBlurwidth = '120px';
var easingSpeed = 500;
//--------------------
var backgroundAfterUserTextBox = 'url(../../ContentFiles/TopBar/Images/b.png)';
var backgroundBeforeUserTextBox = 'url(../../ContentFiles/TopBar/Images/b-before.png)';
var backgroundBeforePassTextBox = 'url(../../ContentFiles/TopBar/Images/b-beforeP.png)';

/// <reference path="../../../Images/TopBar/b-before.png" />

//--------------------

$(function () {


    //    if (is_login) {
    //        $(".afterUserLogin").load("afterLogin.htm");
    //    } else {
    //        $(".afterUserLogin").load("beforeLogin.htm");
    //    };




    //    $(tt).click(function () {
    //        $(tt).css('background-image', normalBox);
    //        $(tt).animate({
    //            width: onFocusWidth
    //        }, easingSpeed);

    //    });
    //    $(tt).blur(function () {
    //        $(tt).css('background-image', hoverBox);
    //        $(tt).animate({
    //            width: onBlurwidth
    //        }, easingSpeed);

    //    });
    $(tt).value = "test";

    $(tt).focus(function () {
        if (this.value == "جستجوی سریع") {
            this.value = "";
        }

        $(this).animate({
            width: "270px"
        }, 500)
    });
    $(tt).blur(function () {
        if (this.value == "") {
            this.value = "جستجوی سریع";
        }

        $(this).animate({
            width: "170px"
        }, 200)
    })





    $(".interSystem").click(function () {
        $(".allLogIn").slideDown('slow');
    });

    $(".close").click(function () {
        $(".allLogIn").slideUp('slow');
    });



    $(".userTextBox").focus(function () {
        // $(".loginFormUser").css('background-image', backgroundAfterUserTextBox);
        if (this.value == "پست الکترونیکی") {
            this.value = "";
        }
    });

    $(".userTextBox").blur(function () {
        //        if ($(".loginFormUser").val() != "") {
        //            $(".loginFormUser").css('background-image', backgroundAfterUserTextBox);

        //        } else {
        //            $(".loginFormUser").css('background-image', backgroundBeforeUserTextBox);

        //        }
        if (this.value == "") {
            this.value = "پست الکترونیکی";
        }
    });


    $(".passTextBox").focus(function () {
        //        $(".loginFormPass").css('background-image', backgroundAfterUserTextBox);

    });

    $(".passTextBox").blur(function () {

        //        if ($(".loginFormPass").val() != "") {
        //            $(".loginFormPass").css('background-image', backgroundAfterUserTextBox);

        //        } else {
        //            $(".loginFormPass").css('background-image', backgroundBeforePassTextBox);

        //        }

    });

    //    $(".regButton").click(function () {
    //        $(".regDivContainer").slideDown("slow");

    //    });

    $(".regButton").toggle(
                   function () {
                       $(".regDivContainer div").fadeTo('slow', 1);
                       $(".regDivContainer").slideDown("slow");

                   },
                   function () {

                       $(".regDivContainer").slideUp("slow");
                       $(".regDivContainer div").fadeTo('slow', 0);

                   });



    $(".closeRegArea").click(function () {
        $(".regDivContainer").slideUp("slow");

    });





});


