<!--// Begin
// Nicola Zordan: 20 November 2003

// Assume Cookies.js has been loaded
var LoggedInCookieName='LoggedIn';
var LoggedIn=GetCookie(LoggedInCookieName);
//alert('L LoggedIn=['+LoggedIn+']'+'\nname=['+LoggedInCookieName+']');
var RedirectLocation='/';
 //RedirectLocation='index.htm';
 RedirectLocation='index.asp';
var LoggedInApplication=''; // 'Qwik-Order';
//var expDays = 30;
var expDays = 1;
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function IsLoggedIn() {
  return (!(LoggedIn==null));
};

function OpenIfLoggedIn(url) {
  if (LoggedIn==null) {
    alert('You must Login for this feature');
   } else {
    window.open(url);
  };
};

function DoIfLoggedIn(js) {
  if (LoggedIn==null) {
    alert('You must Login for this feature');
   } else {
    eval(js);
  };
};

function urlRedIfNotLoggedIn(url, text) {
  var html=''
  html+='<a href="'+url+'" ';
  if (LoggedIn==null) html+=' style="color:red" ';
  html+='>';
  html+=text;
  html+='</a>';
  return html
};

function VerifyLoggedIn () {
  if (LoggedIn==null) {
    // Return to Home page
    //alert ('You have Signed-Out, please Sign-in');
    //alert ('Qwik-Order:'+'\n'+'You are not currently Signed-in'+'\n'+'Please Sign-in');
    alert (LoggedInApplication+'\n'+'You are not currently Loggedin'+'\n'+'Please Login');
    window.location=RedirectLocation;
  };
};

function LoggedInOK (user) {
//  SetCookie(LoggedInCookieName,''+(new Date()));
  //SetCookie(LoggedInCookieName,''+(new Date()), exp);
  if (user==null) user=new Date();
  SetCookie(LoggedInCookieName,''+(user), exp);
  LoggedIn=GetCookie(LoggedInCookieName);
};

function LoggedOutOK () {
  DeleteCookie(LoggedInCookieName)
  LoggedIn=null;
};

//alert('LogInLogOut.js loaded');

// End -->

