        function pluckPageLoad() {
            if (PluckAuthCommon.isDefined(gEID('signinLinkDiv'))) 
                PluckAuth.ReloadAuthHeader();
            else 
                setTimeout("pluckPageLoad()", 150);
        }
        pluckPageLoad();
    
        var maxAttempts = 20;
        function afterAuthWidgetShow() {
            maxAttempts = 20;
            if ((PluckAuthCommon.isDefined(gEID("plckEmail")) && PluckAuthCommon.isDefined(gEID("signinAddLinks"))) || PluckAuthCommon.isDefined(gEID("newPasswordConfirm")) || PluckAuthCommon.isDefined(gEID("pass_email")) || PluckAuthCommon.isDefined(gEID("email")) || PluckAuthCommon.isDefined(gEID("newEmail"))) {
                //Signin
                if (PluckAuthCommon.isDefined(gEID("plckEmail")) && PluckAuthCommon.isDefined(gEID("signinAddLinks"))) {
                    if (PluckGlobal.pluckAuthStyle == 0) {
                        gEID("signinAddLinks").innerHTML = "<p><a href=\"" + PluckGlobal.forgotPass + "\">Forgotten Password?</a> | <a href=\"" + PluckGlobal.register + "\">Register</a></p>";
                    } else if (PluckGlobal.pluckAuthStyle == 1) {
                        gEID("signinAddLinks").innerHTML = "<p><a href=\"javascript:void(0);\" onclick=\"closeMessage(); PluckAuth.ShowAuthWidget('/mystyle/community/authentication/includes/authForgotPassword.html', 0, 400, 240);\">Forgotten Password?</a> | <a href=\"javascript:void(0)\" onclick=\"closeMessage(); PluckAuth.ShowAuthWidget('includes/authRegister.html', 0, 400, 420)\">Register</a></p>";
                    }
                    if(PluckAuthCommon.querySt("newuser")){
                        if(PluckAuthCommon.querySt("newuser")=="true"){
                            gEID("newUserHeader").style.display = "block";
                            gEID("standardHeader").style.display = "none";
                            PluckAuthCommon.setCookie('PlckReferringPage', PluckGlobal.profile, 1, '/', PluckGlobal.domain, false );
                        } 
                    }            
                    PluckAuth.signInSimple.checkRememberedEmail();
                }
                                
                if (PluckAuthCommon.isDefined(gEID("plckEmail"))) {
                    try {
                        if(gEID("plckEmail").value.length>0){
                            gEID("password").focus();
                        }
                        else{
                            gEID("plckEmail").focus();
                        }
                    } catch (error) {
                    }
                }
                
                //Change Password
                //if (PluckAuthCommon.isDefined(gEID("newPasswordConfirm"))) 
                //PluckAuth.changePassword.checkLogin();

                //Forgot Password
                if (PluckAuthCommon.isDefined(gEID("pass_email"))) 
                    PluckAuth.forgottenSimple.checkRememberedEmail();

                //Update Email
                if (PluckAuthCommon.isDefined(gEID("newEmail"))) 
                    PluckAuth.updateInfo.checkRememberedEmail();

				if (PluckAuthCommon.isDefined(gEID("slaSigninForm"))) {
					gEID("slaSigninForm").action = slServerURL + "/slauth/Authentication/Login.rails";
				} else if (PluckAuthCommon.isDefined(gEID("slaChangePasswordForm"))) {
					gEID("slaChangePasswordForm").action = slServerURL + "/slauth/Authentication/ChangePassword.rails";
				} else if (PluckAuthCommon.isDefined(gEID("slaUpdateSettingsForm"))) {
					gEID("slaUpdateSettingsForm").action = slServerURL + "/slauth/Authentication/Update.rails";
				} else if (PluckAuthCommon.isDefined(gEID("slaForgotPasswordForm"))) {
					gEID("slaForgotPasswordForm").action = slServerURL + "/slauth/Authentication/ResetPassword.rails";
				} else if (PluckAuthCommon.isDefined(gEID("plckRegForm"))) {
					gEID("plckRegForm").action = slServerURL + "/slauth/Authentication/Register.rails";
				}

            } else {
                maxAttempts--;
                if (maxAttempts <= 0) {
                    maxAttempts = 20;
                } else {
                    setTimeout('afterAuthWidgetShow()', 250);
                }
            }
        }

		
        messageObj = new DHTML_modalMessage();	// We only create one object of this class
        messageObj.setShadowOffset(5);	// Large shadow

        function displayMessage(url, width, height)
        {
        	
	        messageObj.setSource(url);
	        messageObj.setCssClassMessageBox(false);
	        messageObj.setSize(width,height);
	        messageObj.setShadowDivVisible(true);	// Enable shadow for these boxes
	        messageObj.display();
        }
        /*
        function displayStaticMessage(messageContent,cssClass)
        {
	        messageObj.setHtmlContent(messageContent);
	        messageObj.setSize(300,150);
	        messageObj.setCssClassMessageBox(cssClass);
	        messageObj.setSource(false);	// no html source since we want to use a static message here.
	        messageObj.setShadowDivVisible(false);	// Disable shadow for these boxes	
	        messageObj.display();
        	
        }
        */
        function closeMessage()
        {
	        messageObj.close();	
        }
