jQuery.noConflict();var popupStatus=0;var currErrorCode=0;var registerRedirectUrL=jQuery("#registerRedirectUrL").val();var fgtPwdUrl=jQuery("#forgotPwdUrl").val();var loginEmailAddKey=jQuery("#loginEmailAddKey").val();var loginRememberMeKey=jQuery("#loginRememberMeKey").val();var loginPasswordKey=jQuery("#loginPasswordKey").val();var loginButtonTextKey=jQuery("#loginButtonTextKey").val();var loginForgotPwdKey=jQuery("#loginForgotPwdKey").val();var loginPopupHeaderKey=jQuery("#SLpopupHeaderKey").val();var loginSpclCharErrKey=jQuery("#SLspclCharErrKey").val();var loginInvalidCredErrKey=jQuery("#SLinvalidCredentialErrKey").val();var loginSuccessMsgKey=jQuery("#SLsuccessMsgKey").val();var loginInstrMsgKey=jQuery("#SLinstrMsgKey").val();var loginEmailIdKey=jQuery("#SLloginIdKey").val();var loginJoinNowMsgKey=jQuery("#SLjoinNowMsgKey").val();var loginEmptyFieldErrorMsgKey=jQuery("#SLemptyFieldErrKey").val();var ldapErrorKey="LDAP service error occurred. Please try to log-in again";var loginFormURL=jQuery("#loginFormURL").val();var preLoginBoxHtml='<a id="SLPopupClosePreLogin" class = "SLPopupClose"></a><span class ="SLBoldText">'+loginPopupHeaderKey+"</span>"+'&nbsp;&nbsp;<span class="SLJoinNow">'+'<A HREF="'+registerRedirectUrL+'">'+loginJoinNowMsgKey+"</A></span>"+'<div id = "SLMessage" class = "SLNormalText" >'+loginInstrMsgKey+"</div>"+'<table  id="SLTableView" cellpadding="2" >'+'<tr> <td  class="SLLabel"  valign="top">'+loginEmailIdKey+"</td>"+'<td><input type="text" size="40" maxlength="50" class="SLInputBox" name="loginID" id="loginID"/><br>'+"</td></tr>"+'<tr><td class="SLLabel" style="text-align:right;" valign="top"> '+loginPasswordKey+" </td>"+'<td><input type ="password" size="35" maxlength="20" class="SLInputBox" name="myAccountPwd" id="myAccountPwd"/> <br />'+"</td></tr>"+'<tr><td colspan = "2"><span id ="SLErrorMessage">'+loginInvalidCredErrKey+"</span></td> </tr>"+"<tr><td>&nbsp;</td>"+'<td><span class="SLInputBoxRemember">'+'<input type="checkbox"	name= "remeberMe" value="true" id="remeberMe" />'+'<span class="SLRememberMeLabel">'+loginRememberMeKey+"</span></span>"+"</td></tr>"+"<tr> <td>&nbsp;</td>"+"<td>"+"<!-- Start Table to hold login button and Forgot password link --> "+"<table> <tbody><tr><td>"+"<table>"+'<tr class="buttonbackground">  <td class="registrationArrow">'+'<img src="/images/btn-shop-arrow.gif"> </td>'+'<td class="registerbuttonformat">'+'<div> <input  type="submit" id= " loginButton" class ="registrationButton" name="'+loginButtonTextKey+'" '+'value="'+loginButtonTextKey+'" title="'+loginButtonTextKey+'"  style = "cursor: pointer;"/>'+'<div><img src="/staticimages/spacer.gif" width="1" height="16"></div>'+"</div> </td> </tr> </table>"+"</td><td>"+'<span class="forgotPasswordChat">'+'<a href="'+fgtPwdUrl+'" class="linksNoSize">'+loginForgotPwdKey+"</a>"+"</span>"+"</td></tr>	"+"</tbody></table>"+"<!-- End  Table to hold login button and Forgot password link   -->"+"</td></tr></table>";var postLoginSuccessHtml='<a id="SLPopupClosePostLogin" class = "SLPopupClose"></a>'+'<div id = "successMessage" class = "SLNormalText" >'+loginSuccessMsgKey+"</div>";jQuery(document).ready(function(){onLoadSmartLoginScript();});function onLoadSmartLoginScript(){var e=jQuery("#loginFormURL").val();jQuery("#SLForm").attr("action",e);var b=document.location.href;if(b.indexOf("&invLogin=1")>0){currErrorCode=1;var d=readCookie("postLoginAction");var a=e.replace("&invLogin=1","");jQuery("#SLForm").attr("action",a);loginInitiateLink(d);}else{if(b.indexOf("&invLogin=2")>0){currErrorCode=2;var d=readCookie("postLoginAction");var a=e.replace("&invLogin=2","");jQuery("#SLForm").attr("action",a);loginInitiateLink(d);}else{if(b.indexOf("&invLogin=3")>0){currErrorCode=3;var d=readCookie("postLoginAction");var a=e.replace("&invLogin=3","");jQuery("#SLForm").attr("action",a);loginInitiateLink(d);}else{if(b.indexOf("&invLogin=4")>0){currErrorCode=4;var d=readCookie("postLoginAction");var a=e.replace("&invLogin=4","");jQuery("#SLForm").attr("action",a);loginInitiateLink(d);}else{if(b.indexOf("&invLogin=5")>0){currErrorCode=5;var d=readCookie("postLoginAction");var a=e.replace("&invLogin=5","");jQuery("#SLForm").attr("action",a);loginInitiateLink(d);}else{if(b.indexOf("&invLogin")==-1){var c=readCookie("postLoginAction");if(c){eraseCookie("postLoginAction");}}else{if(b.indexOf("&invLogin=0")>0){jQuery("#SLPopup").html(postLoginSuccessHtml);}}}}}}}}function getHTTPObject(){var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5)
try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
    try {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
    xmlhttp = false;
}
}
@else
    xmlhttp = false;
@end @*/
if(!xmlhttp&&typeof XMLHttpRequest!="undefined"){try{xmlhttp=new XMLHttpRequest();}catch(e){xmlhttp=false;}}return xmlhttp;}var receiveReqSLogin;var currentPageUrl=document.location.href;function loginInitiateLink(c){var b=jQuery("#cartSmartId").val();if((c==null)&&b=="SmartLoginCart"){c=102;}createCookie("postLoginAction",c,1);var h=jQuery("#loginFormURL").val();if(currentPageUrl.indexOf(".sec",0)==-1){var f=currentPageUrl;if(currentPageUrl.indexOf("&invLogin",0)>-1){var g=currentPageUrl.indexOf("&invLogin",0);currentPageUrl=currentPageUrl.substring(0,g);}jQuery("input[name=requestUrl]").val(currentPageUrl);receiveReqSLogin=getHTTPObject();var e="true";var d=getRandomNumber();url="/SmartLoginGetSession.ajx"+"?smartLoginGetSessionId=true";url=url+"&randomNumber="+d+"&requestUrl="+f;receiveReqSLogin.open("POST",url,true);receiveReqSLogin.onreadystatechange=replaceServerUrlNonSecure;receiveReqSLogin.send(null);}else{if(currentPageUrl.indexOf("|requestUrl=",0)>-1){var a=currentPageUrl.indexOf("|requestUrl=",0);f=currentPageUrl.substring(a+12,currentPageUrl.length);jQuery("input[name=requestUrl]").val(f);}else{jQuery("input[name=requestUrl]").val(currentPageUrl);}jQuery("input[name=SLtoken]").val(c);jQuery("#SLForm").attr("action",h);jQuery("#SLPopup").html(preLoginBoxHtml);jQuery("#SLErrorMessage").css("display","none");jQuery("#SLPopupClosePreLogin").click(function(){closePopup();});centerPopup();loadPopup();}}function getRandomNumber(){return Math.random();}function replaceServerUrlNonSecure(){if(receiveReqSLogin.readyState==4){var b=receiveReqSLogin.responseText;var c=jQuery("#loginFormURL").val();var a=readCookie("postLoginAction");if(a==null){a=100;}jQuery("input[name=SLtoken]").val(a);jQuery("#SLForm").attr("action",b);jQuery("#SLPopup").html(preLoginBoxHtml);jQuery("#SLErrorMessage").css("display","none");jQuery("#SLPopupClosePreLogin").click(function(){closePopup();});centerPopup();loadPopup();}}function centerPopup(){var a=document.documentElement.clientWidth;var d=document.documentElement.clientHeight;var c=jQuery("#SLPopup").height();var b=jQuery("#SLPopup").width();jQuery("#SLPopup").css({"position":"absolute","top":d/2-c/2,"left":a/2-b/2});jQuery("#SLPopupBG").css({"height":d});}function loadPopup(){if(popupStatus==0){jQuery("#SLPopupBG").css({"opacity":"0.5"});jQuery("#SLPopupBG").fadeIn("slow");jQuery("#SLPopup").fadeIn("slow");jQuery("#loginID").val("");jQuery("#loginID").focus();jQuery("#myAccountPwd").val("");if(currErrorCode==1){jQuery("#SLErrorMessage").css("display","block");jQuery("#SLErrorMessage").html(loginInvalidCredErrKey);}else{if(currErrorCode==2){jQuery("#SLErrorMessage").css("display","block");jQuery("#SLErrorMessage").html(loginEmptyFieldErrorMsgKey);}else{if(currErrorCode==3){jQuery("#SLErrorMessage").css("display","block");jQuery("#SLErrorMessage").html(loginInvalidCredErrKey);}else{if(currErrorCode==4){jQuery("#SLErrorMessage").css("display","block");jQuery("#SLErrorMessage").html(loginSpclCharErrKey);}else{if(currErrorCode==5){jQuery("#SLErrorMessage").css("display","block");jQuery("#SLErrorMessage").html(ldapErrorKey);}}}}}currErrorCode=0;popupStatus=1;}}function closePopup(){if(popupStatus==1){jQuery("#SLPopupBG").fadeOut("slow");jQuery("#SLPopup").fadeOut("slow");popupStatus=0;}}function createCookie(c,d,e){if(e){var b=new Date();b.setTime(b.getTime()+(e*24*60*60*1000));var a="; expires="+b.toGMTString();}else{var a="";}document.cookie=c+"="+d+a+"; path=/";}function readCookie(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length);}if(f.indexOf(e)==0){return f.substring(e.length,f.length);}}return null;}function eraseCookie(a){createCookie(a,"",-1);}
