// JavaScript Document


function sessionExpiredReLogin() {
  YAHOO.ft.sessionExpiredDlg.hide();
	window.location = "/";
}


// pass in true as the second parameter
// if you also want me to make sure they are not
// only logged in, but also still logged in as the
// account owner - use false in ALL other cases
// for example - you would use true for the createlink
// option since only account owners can do that, but
// false for metadata dlg since anyone can see that
function verifySessionOk(rsp, owneronly) {
  var retval = true;
	
	// if found text from homepage, their session expired
	// and they were redirected to the home page
	if (rsp.indexOf("Member Login") > 0) {
          YAHOO.ft.sessionExpiredDlg.cfg.setProperty("zIndex", "999");
          YAHOO.ft.sessionExpiredDlg.show();
	  return false;
	}	
	
	// if found text from ftwindowexpired.htm, their session
	// expired, and they need to be redirected to homepage 
	if (rsp.indexOf("ReturnToLogin()") > 0) {
          YAHOO.ft.sessionExpiredDlg.cfg.setProperty("zIndex", "999");
          YAHOO.ft.sessionExpiredDlg.show();
	  return false;
	}
	
	// if found text from /pictures action, then they got
	// redirected to the pictures action because they aren't 
	// an account owner anymore
  if ((owneronly) && (rsp.indexOf("pictures action") > 0)) {
	  window.location = "/ftweb/bin/ft.dll/pictures";
		return false;
	}
	
  return true;
}
