
var ssa=Sys.Services.AuthenticationService;
function prepLoginForm()
{
if(ssa.get_isLoggedIn())
{
$get("LoggedInView").style.display="";
var a=new SiteService;
a.GetUserVoiceUserData($get(hidUserNameClientID).value,onGetUserVoiceUserDataSuccess,null,null)
}
else
{
!$get(txtLoginClientID)&&
alert("Login not available");
$get("AnonymousView").style.display="";
$("#forumPost").unbind("click");
$("#forumVote").unbind("click");
$("#forumView").unbind("click");
$("#forumAccept").unbind("click");
$("#forumPost").click(function()
{
AlertLink("Voor deze functie moet u ingelogd zijn","Ok")
});
$("#forumVote").click(function()
{
AlertLink("Voor deze functie moet u ingelogd zijn","Ok")
});
$("#forumView").click(function()
{
AlertLink("Voor deze functie moet u ingelogd zijn","Ok")
});
$("#forumAccept").click(function()
{
AlertLink("Voor deze functie moet u ingelogd zijn","Ok")
})
}
}
function prepContentButtons()
{
if(ssa.get_isLoggedIn())
{
var a=new SiteService;
a.GetUserVoiceUserData($get(hidUserNameClientID).value,onGetUserVoiceUserDataSuccess,null,null)
}
else
{
$("#moreNew").unbind("click");
$("#moreAccepted").unbind("click");
$("#moreNew").click(function()
{
AlertLink("Voor deze functie moet u ingelogd zijn","Ok")
});
$("#moreAccepted").click(function()
{
AlertLink("Voor deze functie moet u ingelogd zijn","Ok")
})
}
}
function navloginHandler(a,b)
{
if(a!=""&&b!="")
{
var c=false,
e=null,
d=null;
ssa.login(a,b,c,e,d,onLoginComplete,onAuthenticationServiceError,a)
}
}
function loginHandler()
{
var a=$get(txtLoginClientID).value,
b=$get(txtPasswordClientID).value;
if(a!=""&&b!="")
{
var c=false,
e=null,
d=null;
ssa.login(a,b,c,e,d,onLoginComplete,onAuthenticationServiceError,a)
}
}
function logoutHandler()
{
var b="/logout.aspx",
a=null;
ssa.logout(b,onLogoutComplete,onAuthenticationServiceError,a)
}
function onLoginComplete(c,a)
{
if(c)
{
$get("LoggedInView").style.display="";
$get("AnonymousView").style.display="none";
$get(lblLoggedinNameClientID).innerHTML=a;
var b=new SiteService;
b.GetUserVoiceUserData(a,onGetUserVoiceUserDataSuccess,null,null);
b.DeleteNavTempKey(a,onDeleteNavTempKeySuccess,null,null)
}
else
document.location="/login_failed.aspx"
}
function onGetUserVoiceUserDataSuccess(a)
{
$("#forumPost").unbind("click");
$("#forumVote").unbind("click");
$("#forumView").unbind("click");
$("#forumAccept").unbind("click");
$("#moreNew").unbind("click");
$("#moreAccepted").unbind("click");
$("#forumPost").click(function()
{
window.open("http://sde.uservoice.com/pages/16195-buildmaster-distri?sso="+a)
});
$("#forumVote").click(function()
{
window.open("http://sde.uservoice.com/pages/16195-buildmaster-distri?sso="+a)
});
$("#forumView").click(function()
{
window.open("http://sde.uservoice.com/pages/16195-buildmaster-distri?sso="+a)
});
$("#forumAccept").click(function()
{
window.open("http://sde.uservoice.com/pages/16195-buildmaster-distri/filter/accepted/?sso="+a)
});
$("#moreNew").click(function()
{
window.open("http://sde.uservoice.com/pages/16195-buildmaster-distri/filter/recent?days=14&sso="+a)
});
$("#moreAccepted").click(function()
{
window.open("http://sde.uservoice.com/pages/16195-buildmaster-distri/filter/accepted/?sso="+a)
})
}
function onDeleteNavTempKeySuccess()
{
}
function onLogoutComplete()
{
$get("LoggedInView").style.display="none";
$get("AnonymousView").style.display=""
}
function onAuthenticationServiceError()
{
}
typeof Sys!=="undefined"&&
Sys.Application.notifyScriptLoaded()
