StartupTokens();

function StartupTokens(){
    CL("Starting tokens")

    cl("TOKEN:" + gSavedToken);
    if (!gSavedToken){
        //we should attemopt to get a guest token and then save it
        GetGuestToken();
    } else {
        //we have a saved token so lets try to validate it
        //ValidateToken(gSavedToken);
        CartGet();
    }
    setLoginStatus(GetLSValue("Auth"));
}

function add2Cart(QTY, PID){
    CartAdd(QTY, PID);
}
//function add2Cart(QTY,productID){
//    tURL = 'ajax/ajax.php?p=add&pid=' + productID + '&qty=' + QTY + '&cartid=' + gCartID;
//    if (productID && QTY){
//        $('.cart').addClass('active');
//        $('.cart').css('right','0px');
//        jResult = $.getJSON( tURL, function( data ) {
////            cl("data:" + data[0])
//            if (!jErrorCheck(data)){
//                loadCart();
//                $("#cartAdded-modal").show();
//            }
//         }).done(function(){
////            $('.site-header__cart-btn').click();
////			loadCart();
//          });;
//    } else {
//        alert("Please make a selection first");
//    }
//}

$('.bootToggle').on("click",function(){
	if (this.id=="pairofboots"){
		$("#bootSingles").attr("class","hide");
		$("#bootPairs").attr("class","show");
	} else {
		$("#bootPairs").attr("class","hide");
		$("#bootSingles").attr("class","show");
	}

})

function CartAdd(tQTY, tProductID){
    if (tQTY && tProductID){
        tURL = gAjaxURL + 'p=CartAdd&ProductID=' + tProductID + '&QTY=' + tQTY + '&Token=' + gSavedToken
        cl('CART ADD: ' + tURL)
        jResult = $.getJSON( tURL, function( data ) {
            console.log(data.Error);
            //if (data.Error==0){
            if (!ErrorChk(data.Error, data.Message)){
                $("#cartAdded-modal").show();
                CartGet();
            } 
        });
        cl("Refreshing cart after product add")
    } else {
        alert("Please make a selection first");
    }
}

function CartUpdate(tQTY, tRowID){
    $("#cartTarget").html('');
    tURL = gAjaxURL + 'p=CartUpdate&RowID=' + tRowID + '&QTY=' + tQTY + '&Token=' + gSavedToken
    cl('CART UPDATE: ' + tURL)
    jResult = $.getJSON( tURL, function( data ) {
        console.log(data.Error);
        //if (data.Error==0){
        if (!ErrorChk(data.Error, data.Message)){
            CartGet();
        } 
    });
    
}

function CartRemove(tRowID){
    $("#cartTarget").html('');
    tURL = gAjaxURL + 'p=CartDelete&RowID=' + tRowID + '&Token=' + gSavedToken
    cl('CART DEL: ' + tURL)
    jResult = $.getJSON( tURL, function( data ) {
        console.log(data.Error);
        if (!ErrorChk(data.Error, data.Message)){
        //if (data.Error==0){
            CartGet();
        }
    });
}

function CartGet(){
    gCartItems = 0
    tURL = gAjaxURL + 'p=CartGet&Token=' + gSavedToken
    jResult = $.getJSON( tURL, function( data ) {
        console.log(data.Error);
        if (!ErrorChk(data.Error, data.Message)){
            CartBuildHTML(data['Data']);
        }
    }); 
}

function CartBuildHTML(tData){
    cl(tData)
    tCount = 0;
    tCartWeight = 0;
    tSubTotal = 0;
    tCartSubTotal = 0;
    tCartItemsCount = 0;
    rFooter='';
    btnLog = '';
    rData="";
    $("#cartTarget").html('');
    if (typeof(tData)==='undefined'){
        isDisabledCheckout = "disable cta-gray"
        //$(".cart-")  ??? no clue why this is hereS
        tCartItemsCount = 0;
        tSubTotal = 0.00;
        rData += '<li class="cart-product">';
        rData += '    <ul class="cart-product-specs">';
        rData += '        <li class="clr-blue">Your Cart Is Empty</li>';
        rData += '    </ul><span class="itemSubTotal hide">0</span>';
        rData += '</li>';
    } else {
        rData='';
        $.each( tData, function( key, val ) { 
            cl("In Cart HTML loop")
            cl(val)
        
            isDisabledCheckout = ""

            tID             =  val.ID;
            tProductPartID  =  val.ProductPartID;
            tUnitPrice      =  val.UnitPrice;
            tImgPath        =  getProductImage(tProductPartID);
            tProductTitle   =  val.ProductTitle;
            if (tProductPartID != 'SHIP' || tProductPartID != 'NOTE' || tProductPartID != 'TAX'){

                tCount          += 1;

                tQTY            = val.QTY
                tSubTotal       = (parseInt(tQTY) * parseFloat(tUnitPrice).toFixed(2));
                tCartSubTotal   += tSubTotal;
                tCartItemsCount += parseInt(tQTY);
                tCartWeight		+= parseInt(val.UnitWeight * tQTY);
                //cl(tCartWeight)

                //rData  = '';
                rData += '<li class="cart-product">';
                //rData += '    <div class="cart-product-delete remove" rid="' + tID + '">Remove</div>';
                rData += '    <figure>';
                rData += '     <img src="'+ tImgPath + '" style="background: #FFF">';
                rData += '    </figure>';
                rData += '    <ul class="cart-product-specs">';
                rData += '        <li class="clr-blue">' + tProductTitle+ '</li>';
                rData += '        <li>';
                rData += '            <span class="title">QTY:</span>';
                rData += '            <label><input  class="cartQTY" type="number" name="quantity' + tCount + '" maxlength="3" min="0" step="1" value="' + tQTY + '" id="qty' + tCount +'"></label>';
                rData += '            <div class="update" qid="qty' + tCount + '" rid="' + tID + '">Update</div><div class=" remove" rid="' + tID + '">Remove</div>';
                rData += '        </li>';
                rData += '        <li>';
                rData += '            <span class="title">Price:</span><span class=".itemSubTotal">$' + parseFloat(tUnitPrice).toFixed(2) + "</span>";
                rData += '        </li>';
                rData += '        <li><span class="title clr-blue">Subtotal:</span>';
                rData += '           <span class="clr-blue itemSubTotal">$' + parseFloat(tSubTotal).toFixed(2) + '</span>';
                rData += '        </li>'
                rData += '    </ul>';
                rData += '</li>';
            } 
        });
    }
cl(rData)    
    rFooter += '<footer><h3><span>Total:</span><span class="cart-total"> $' + parseFloat(tCartSubTotal).toFixed(2) + '</span></h3></footer>'
    rFooter += '<div class="cart-top"><p class="cta cta-gray" id="cartAccount"><a href="#" class="modal-trigger" data-modal-id="modal-quote" id="btnQuote">Shipping Quote</a></p><p class="cta cart-chkout"><a href="checkout.php" class="' +isDisabledCheckout +'">Secure Checkout</a></p></div>'
    $("#cartTarget").html('<ul class="cart-listing">' + rData + '</ul>' + rFooter);
    $("#btnQuote").on("click", function(){
        $("#quoteContent").load('/ajax/ajax.php?p=quote');
        $("#quote-modal").css("display","block");
    })
    if (tCartItemsCount!==0){
        cl("--Cart not empty")
        $(".itemTotal").text(tCartItemsCount);
        $(".nav-cart em").addClass("update");
    } else {
        cl('--Cart Empty')
        $(".itemTotal").text();
        $(".nav-cart em").removeClass("update");
    }
    cl('Cart Weight: ' + tCartWeight)
    //setLoginStatus(tIsCustomer)
    $('div.update').on("click", function(){
        what = $(this).attr('qid')
        CartUpdate($('#' + what).val(),  $(this).attr('rid'));
    })

    $('div.remove').on("click", function(){
        CartRemove($(this).attr('rid'))
    })
    buildGTagCart(tData)
}

function buildGTagCart(tData){
    tCartItems=[];
    tCartSubTotal=0;
    $.each( tData, function( key, val ) {
        tProductTitle   =  val.ProductTitle;
        tProductPartID  =  val.ProductPartID;
        tUnitPrice      =  val.UnitPrice;
        tQTY            =  val.QTY;
        tSubTotal       = (parseInt(tQTY) * parseFloat(tUnitPrice).toFixed(2));
        tCartSubTotal   += tSubTotal;
        tCartRow = {
          item_id: tProductPartID,
          item_name: tProductTitle,
          price: tUnitPrice,
          quantity: tQTY
        }
        tCartItems.push(tCartRow)
    })
    console.log(tCartItems)
    tCartSubTotal = parseFloat(tCartSubTotal).toFixed(2)
    gtag("event", "view_cart", {
        currency: "USD",
        value: tCartSubTotal,
        items: tCartItems
    });
}


function CustomerLogin(){
    $('#LoginError').html('');
    tLoginEmail= $('#loginUserName').val()
    tLoginPassword = $('#loginPassword').val()
    $("#cartTarget").html('');
    tURL = gAjaxURL + 'p=Login&Email=' + tLoginEmail + '&Password=' + tLoginPassword + '&Token=' + gSavedToken;
    cl('Login: ' + tURL)
    jResult = $.getJSON( tURL, function( data ) {
        console.log(data.Error);
        //if (data.Error==0){
        if (!ErrorChk(data.Error, data.Message)){
            tSavedToken = data['Data']['Token']
            if (tSavedToken){
                SetLSValue("Token",tSavedToken)
                SetLSValue("Auth",'1')
                gSavedToken = GetLSValue("Token")
                $('#login-modal').hide();
                setLoginStatus(GetLSValue("Auth"));
                CartGet();
            }
        } else {
            $('#LoginError').html(data.Message);
            SetLSValue("Auth",'0')
            SetLSValue("Token","")
        }
    });
}

function CustomerLogout(){
    gSavedToken="";
//    SetLSValue("Auth",'0')
//    SetLSValue("Token",gSavedToken)
    ClearLS();
    cl('Logout Successful');
    $('#login-modal').hide();
    $('#logout-modal').hide();
    setLoginStatus(0);
    GetGuestToken();
}


//Listeners
$(".cartBtn").on("click",function(){
	pQty 	 = $("#" + $(this).attr("productQty")).val();
	pID	     = $("#" + $(this).attr("productID")).val();
	if (pID == ''){
		alert('Please select a size first')
	}else {
		if (pQty > 0){
//			console.log(pID)
			CartAdd(pQty,pID);
		} else {
			alert ("Please select a QTY first.");
		}		
	}
	return false;
});

$(".cartBtnMulti").on("click",function(){
	pQtyObj  = $(this).attr('productQty');
	pQty 	 = $("#" + pQtyObj).val();
	if (pQty > 0){
		pID	     = $("#" + $(this).attr('productID')).val();
		CartAdd(pQty,pID);
	} else {
		alert ("Please select a QTY first.");
	}
	return false;
})

$('#btnKeepShopping').on("click",function(){
    $('#cartAdded-modal').hide();

});

$('#btnCancelLogout').on("click",function(){
    $('#login-modal').hide();
    $('#account-modal').hide();
    $('#logout-modal').hide();
});

$('#btnConfirmLogout').on("click",function(){
    CustomerLogout();
    window.location.reload();
});

$('body').on("click", '.btnLogout', function(){
    $('#login-modal').hide();
    $('#logout-modal').show();
});


$('body').on("click",".btnLogin", function(){
    $('#login-modal').show();
    $("#pwdStep2").hide();
    $("#pwdStep1").show();
    CustomerLogin();
})

$('body').on("click",".login-modal-link", function(){
    $('.modal__section--login').removeClass('modal__section--hide');
    $('.modal__section--login').addClass('modal__section--show');
    $('.modal__section--pwRecovery').removeClass('modal__section--show');
    $('.modal__section--pwRecovery').addClass('modal__section--hide');;
 
   $("#pwdStep2").hide();
   $("#pwdStep1").show();
   $('#login-modal').show();
})

$('body').on("click", '.btnAccount', function(){
    window.location.href='/account.php';
});

$("#pwRecovery").on("click", function(){
    $('#login-modal').show();
    $("#pwdStep1").show();
    $('.modal__section--login').removeClass('modal__section--show');
    $('.modal__section--login').addClass('modal__section--hide');
    $('.modal__section--pwRecovery').addClass('modal__section--show');;
    
//    r.classList.remove("modal__section--show"),
//    a.classList.add("modal__section--show")
     //modal__section--show
}); 

//$(".btnRecoverPassword").on("click",function(){
//	RecoverPassword();
//})

$("#btnRecoverPassword").on("click", function(){
	email = $("#Email2Recover").val();
	$("#pwdStep1").hide();
    $('#bRecoveryEmail').html(email)
	$("#pwdStep2").show();
	if (email){
	   tURL = 'ajax/ajax.php?p=recover&email='+email;
		cl(tURL);
		jResult = $.getJSON( tURL, function(data) {
			
	   });
		
	}
})
///end listeners ///





//var jResult = "";
//tCartWeight = 0;
//tmp = getCart();
//

//
//function CustomerLogout(){
////    setCookie('CartID','');
////    setCookie('Authenticated','0');
////    cl('Logout Successful');
//}
//
//function CustomerLogin(){
////added 8.23.23
//    tUserName = $("#loginUserName").val();
//    tPassword = $("#loginPassword").val();
//    if (tUserName && tPassword){
//        tURL = 'ajax/ajax2.php?p=Login&Email=' + tUserName + '&Password=' + tPassword + '&GuestToken=' + gGuestToken;
//        jResult = $.getJSON( tURL, function( data ) {
//            console.log(data.Error);
//            if (data.Error!==1){
//                tCartID = data.UserKey;
//                tURL2 = 'ajax/ajax.php?p=swap&cartid=' + gCartID + '&newcartid=' + tCartID;
//                jResult2 = $.getJSON( tURL2, function( data2 ) {
//                    console.log(data2.Error);
//                    if (!data2.Error==1){
//                        setCookie('CartID',tCartID);
//                        setCookie('Authenticated','1');
//						setLoginStatus(1);
//                        loc = location.href
//                        if (loc.includes('ResetPassword.php')){
//                            location.href='/';
//                        }else{
//                          location.reload();  
//                        }
//                    } 
//                });
//            } else {
//                $('#LoginError').html(data.ErrorDescription);
//                setCookie('Authenticated','0');
//            }
//         });
//    } else {
//        alert("Please make a selection first");
//    }
//}

//function setLoginStatus(tStatus){
//	cl("Setting login status:" + tStatus)
//	if (tStatus==0){
//		cartAccountLog = 'login-modal'
//		cartAccountHtml = "Sign In"
//		cartAccountLink = "#"
//		mClass = "login-modal-link modal-trigger"
//		dClass = "login-modal-link modal-trigger site-header__icon-btn"
//	} else{
//		cartAccountLog = 'logout-modal' 
//		cartAccountHtml = "Sign Out"
//		cartAccountLink = "#"
//		mClass = "logout-modal-link modal-trigger btnLogout"
//		dClass = "logout-modal-link modal-trigger btnLogout site-header__icon-btn"
//	}
//	
////	$(".AccountBtn A").attr("data-modal-id",cartAccountLog)
////	$(".AccountBtn A").html(cartAccountHtml)
////	$(".AccountBtn A").attr('href', cartAccountLink)
//		
//	$("#desktopAccountBtn").attr("data-modal-id",cartAccountLog)
//	//$("#desktopAccountBtn").html(cartAccountHtml)
//	$("#desktopAccountBtn").attr("title",cartAccountHtml);
//	$("#desktopAccountBtn").attr('href', cartAccountLink)
//	$("#desktopAccountBtn").attr('class', dClass)
//
//	$("#mobileAccountBtn").attr("data-modal-id",cartAccountLog)
//	$("#mobileAccountBtn").html(cartAccountHtml)
//    $("#mobileAccountBtn").attr("title",cartAccountHtml);
//    $("#mobileAccountBtn").attr('href', cartAccountLink)
//	$("#mobileAccountBtn").attr('class', mClass)
//
//	$('.btnLogout').on("click",function(){
//		//CustomerLogout();
//		//window.location.reload();
//		$('#login-modal').hide();
//		$('#logout-modal').show();
//	});
//	$(".btnLogin").on("click",function(){
//       $("#pwdStep2").hide();
//	   $("#pwdStep1").show();
//		CustomerLogin();
//	})
//}
//    $('#btnKeepShopping').on("click",function(){
//		$('#cartAdded-modal').hide();
//		
//	});
//	$('#btnCancelLogout').on("click",function(){
//		$('#login-modal').hide();
//		$('#logout-modal').hide();
//	});
//	$('#btnConfirmLogout').on("click",function(){
//		CustomerLogout();
//		window.location.reload();
//	});

//function isAuth(){
//    tIsAuth = document.cookie.replace(/(?:(?:^|.*;\s*)Authenticated\s*\=\s*([^;]*).*$)|^.*$/, "$1");
////    cl('tISAuth: ' + tIsAuth)
//    if (tIsAuth==1){
//        return true
//    } else {
//        setCookie('Authenticated','0')
//        return false
//    }
//}
//
//function getCart(){
//    cl("getting cart...")
//    gCartID = document.cookie.replace(/(?:(?:^|.*;\s*)CartID\s*\=\s*([^;]*).*$)|^.*$/, "$1");
//    tIsAuth = document.cookie.replace(/(?:(?:^|.*;\s*)Authenticated\s*\=\s*([^;]*).*$)|^.*$/, "$1");
//    if (!gCartID){
//        gCartID = uuid();
//        setCookie('CartID',gCartID)
//        setCookie('Authenticated','0')
//    } else {
////        cl('Found CartID: ' + gCartID)
////        cl('Authenticated? ' + tIsAuth)
//    }
//    return gCartID; 
//}
//
//function setCookie(tCookie, gCartID){
//    document.cookie = tCookie + "=" + gCartID + "; expires=Fri, 31 Dec 9999 23:59:59 GMT";
//}
//
//function delCookie(tCookie) {
//    document.cookie = tCookie + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
//};
//
//function add2Cart(QTY,productID){
//    tURL = 'ajax/ajax.php?p=add&pid=' + productID + '&qty=' + QTY + '&cartid=' + gCartID;
//    if (productID && QTY){
//        $('.cart').addClass('active');
//        $('.cart').css('right','0px');
//        jResult = $.getJSON( tURL, function( data ) {
////            cl("data:" + data[0])
//            if (!jErrorCheck(data)){
//                loadCart();
//                $("#cartAdded-modal").show();
//            }
//         }).done(function(){
////            $('.site-header__cart-btn').click();
////			loadCart();
//          });;
//    } else {
//        alert("Please make a selection first");
//    }
//}
//
////$('.btnLogout').on("click",function(){
////		//CustomerLogout();
////		//window.location.reload();
////		$('#login-modal').hide();
////		$('#logout-modal').show();
////	});
////	$(".btnLogin").on("click",function(){
////		CustomerLogin();
////	})
//
//
//function remove(rid){
//    tURL = 'ajax/ajax.php?p=del&rid=' + rid + '&cartid=' + gCartID;
//    jResult = $.getJSON( tURL, function( data ) {
//        loadCart();
//   });
//}
//
//function update(rid,oQTY){
//	if (rid){
//		qty = $("#" + oQTY).val();
//		tURL = 'ajax/ajax.php?p=qty&rid=' + rid + '&qty=' + qty + '&cartid=' + gCartID
//		jResult = $.getJSON( tURL, function(data) {
//			loadCart();
//	   });
//		
//	}
//}
//
//
//
//function loadCart(){
////	cl("loading cart...")
//    $("#cartTarget").html('');
//    var rData = "";
//    tURL = 'ajax/ajax.php?p=list&cartid=' + gCartID;
//    tCount = 0;
//	tCartWeight = 0;
//    tSubTotal = 0;
//    tCartSubTotal = 0;
//    tCartItemsCount = 0;
//    rFooter='';
//    btnLog = '';
//    jResult= $.getJSON( tURL, function( data ) {
//        if (!jErrorCheck(data)){
//            $.each( data, function( key, val ) {                
//                tIsCustomer = val[0].IsCustomer;
////                cl("Val.isCustomer:"+val[0].IsCustomer)
////                cl("btnLog:"+btnLog)
////                cl("Val.id:"+val[0].ID)
//                if (typeof val[0].ID == 'undefined' ){
//                    isDisabledCheckout = "disable cta-gray"
////                    cl('No items in cart');
//                    $(".cart-")
//                    tCartItemsCount = 0;
//                    tSubTotal = 0.00;
//                    rData += '<li class="cart-product">';
//                    rData += '    <ul class="cart-product-specs">';
//                    rData += '        <li class="clr-blue">Your Cart Is Empty</li>';
//                    rData += '    </ul>';
//                    rData += '</li>';
//                   // rFooter += '<footer><h3><span>Total:</span><span class="cart-total"> $0.00</span></h3></footer>'
//                } else {
//                    isDisabledCheckout = ""
//
//                    tID             =  val[0].ID;
//                    tProductPartID  =  val[0].ProductPartID;
//                    tUnitPrice      =  val[0].UnitPrice;
//                    tImgPath        =  getProductImage(tProductPartID);
//                    tProductTitle   =  val[0].ProductTitle;
//                    if (tProductPartID != 'SHIP' || tProductPartID != 'NOTE' || tProductPartID != 'TAX'){
//
//                        tCount          += 1;
//
//                        tQTY            = val[0].QTY
//                        tSubTotal       = (parseInt(tQTY) * parseFloat(tUnitPrice).toFixed(2));
//                        tCartSubTotal   += tSubTotal;
//                        tCartItemsCount += parseInt(tQTY);
//						tCartWeight		+= parseInt(val[0].UnitWeight * tQTY);
//						cl(tCartWeight)
//
//                        //rData  = '';
//                        rData += '<li class="cart-product">';
//                        //rData += '    <div class="cart-product-delete remove" rid="' + tID + '">Remove</div>';
//                        rData += '    <figure>';
//                        rData += '     <img src="'+ tImgPath + '" style="background: #FFF">';
//                        rData += '    </figure>';
//                        rData += '    <ul class="cart-product-specs">';
//                        rData += '        <li class="clr-blue">' + tProductTitle+ '</li>';
//                        rData += '        <li>';
//                        rData += '            <span class="title">Quantity:</span>';
//                        rData += '            <label><input type="number" name="quantity' + tCount + '" maxlength="3" min="0" step="1" value="' + tQTY + '" id="qty' + tCount +'"></label>';
//                        rData += '            <div class="update" qid="qty' + tCount + '" rid="' + tID + '">Update</div><div class=" remove" qid="qty' + tCount + '" rid="' + tID + '">Remove</div>';
//                        rData += '        </li>';
//                        rData += '        <li>';
//                        rData += '            <span class="title">Price:</span> $' + parseFloat(tUnitPrice).toFixed(2) + '';
//                        rData += '        </li>';
//                        rData += '        <li><span class="title clr-blue">Subtotal:</span>';
//                        rData += '           <span class="clr-blue itemSubTotal">$' + parseFloat(tSubTotal).toFixed(2) + '</span>';
//                        rData += '        </li>'
//                        rData += '    </ul>';
//                        rData += '</li>';
//                    } 
//
//                }
//               
//            });
//            rFooter += '<footer><h3><span>Total:</span><span class="cart-total"> $' + parseFloat(tCartSubTotal).toFixed(2) + '</span></h3></footer>'
//            rFooter += '<div class="cart-top"><p class="cta cta-gray" id="cartAccount"><a href="#" class="modal-trigger" data-modal-id="modal-quote" id="btnQuote">Shipping Quote</a></p><p class="cta cart-chkout"><a href="checkout.php" class="' +isDisabledCheckout +'">Secure Checkout</a></p></div>'
////            cl(rData + rFooter)
//            $("#cartTarget").html('<ul class="cart-listing">' + rData + '</ul>' + rFooter);
//			$("#btnQuote").on("click", function(){
//					$("#quoteContent").load('/ajax/ajax.php?p=quote');
//					$("#quote-modal").css("display","block");
//			})
//            if (tCartItemsCount!==0){
//                $(".itemTotal").text(tCartItemsCount);
//                $(".nav-cart em").addClass("update");
//            } else {
//                $(".itemTotal").text("");
//                $(".nav-cart em").removeClass("update");
//            }
//			cl('Cart Weight: ' + tCartWeight)
//			setLoginStatus(tIsCustomer)
//        }
//        $('.update').click(function() {
//            qtyid = $(this).attr("qid");
//            rowid = $(this).attr("rid");
//            update(rowid,qtyid);
//        });
//
//        $('.remove').click(function() {
//            rowid = $(this).attr("rid")
//            remove(rowid)
//        });
//
//     });
//}
//
//

//
//function setCount(cnt){
//	document.getElementById('cnt1').innerText=cnt
//	document.getElementById('cnt2').innerText=cnt
//}
//   
//$(".btnLRecoverPassword").on("click",function(){
//	RecoverPassword();
//})
//
//
//
//
//
//$("#btnRecoverPassword").on("click", function(){
//	email = $("#Email2Recover").val();
//	$("#pwdStep1").hide();
//    $('#bRecoveryEmail').html(email)
//	$("#pwdStep2").show();
//	if (email){
//	tURL = 'ajax/ajax.php?p=recover&email='+email;
//		cl(tURL);
//		jResult = $.getJSON( tURL, function(data) {
//			
//	   });
//		
//	}
//})



 


