﻿/*$(document).ready(function(){
    $("#loginLink").toggle(function(){
      $("#login").slideDown("slow");
    }, function(){
      $("#login").slideUp("slow");
    });

    
})
*/
function LoginToggle()
{
    $("#login").slideToggle("slow");
}

var isOpen = false;
function SearchToggle()
{
    if (isOpen)
    {
        $("#searchToggle").addClass("white");
        $("#searchToggle").html("חיפוש מתקדם +");
        $("#headerSearch").slideUp("slow");
        isOpen = false;
    }
    else
    {
        $("#searchToggle").removeClass("white");
        $("#searchToggle").html("חיפוש מתקדם -&nbsp;");
        $("#headerSearch").slideDown("slow");
        isOpen = true;
    }
}

// Setting the default texts to the text boxes
function GotFocus(sender, defaultText)
{
    if (sender.value == defaultText)
    {
        sender.value = "";
    }
}

function LostFocus(sender, defaultText)
{
    if (sender.value.length == 0)
    {
        // Setting back the defautl text
        sender.value = defaultText;
    }
}

function luanchpopupforgotpassword(name, height, width, clientId)
    {
        //alert(clientId);
        var str = "height=" + height + ",innerHeight=" + height;
        str += ",width=" + width + ",innerWidth=" + width;
        if (window.screen)
        {
            var ah = screen.availHeight - 200;
            var aw = screen.availWidth - 200;
        
            var xc = (aw - width) / 2;
            var yc = (ah - height) / 2;
        
            str += ",left=" + xc + ",screenX=" + xc;
            str += ",top=" + yc + ",screenY=" + yc;
        }
            return window.open("ForgotPassword.aspx?Mail=" + document.getElementById(clientId).value, name, str);
    }
    
function luanchpopupsendfriends(SendFriends, height, width, name, sale, productId)
    {
        //alert(sale);
        var str = "height=" + height + ",innerHeight=" + height;
        str += ",width=" + width + ",innerWidth=" + width;
        if (window.screen)
        {
            var ah = screen.availHeight - 200;
            var aw = screen.availWidth - 200;
        
            var xc = (aw - width) / 2;
            var yc = (ah - height) / 2;
        
            str += ",left=" + xc + ",screenX=" + xc;
            str += ",top=" + yc + ",screenY=" + yc;
        }
            return window.open("SendFriends.aspx?Name=" + name + "&Sale=" + sale + "&ProductId=" + productId, SendFriends, str);
    }
    
function BannerClick(BannerId, UserId, SessionId)
    {
        $.post("../Handlers/BannerClickHandler.ashx",
            {
                BannerId : BannerId,
                UserId : UserId,
                SessionId : SessionId
            });
    }
    
function QuestionMarkOver(sender)
{
    $('#'+sender).next().stop().css('opacity',1).fadeIn('normal');
}

function QuestionMarkOut(sender)
{
    $(sender).next().fadeOut('normal');
}