asked on
<script>
function doLogin() {
ColdFusion.Window.create('loginwindow','Login','login.cfm',{center:true,modal:true,height:180,width:300,resizeable:false});
Coldfusion.Window.alignTo('parentDiv',0,0);
}
function handleResponse(s) {
if(s == "good") {
//first hide the window
ColdFusion.Window.hide('loginwindow');
//rewrite out login
var loginspan = document.getElementById('loginstatus');
var newcontent = "<a href='index.cfm?logout=1'>Logout</a>";
var myaccountspan = document.getElementById('my_account');
var myaccountnewcontent = '<div class="gallery">Welecome<cfif isDefined('session.auth.email')><cfoutput>, #session.auth.email#</cfoutput>.</cfif> You can visit your Account Page to update your information, manage your Favorites, and much more.</div>';
loginspan.innerHTML = newcontent;
myaccountspan.innerHTML = myaccountnewcontent;
} else {
alert('There was a problem with your login. Please try again.');
}
}
function handleLogin() {
ColdFusion.Ajax.submitForm('loginform','processlogin.cfm',handleResponse);
}
</script>