/*DRGGNMail Login JScript Plug-in
Copyright DRGGN.

LOGIN VARIABLES */
var wcURL = 'http:\/\/millercabman.com:3000/DRGGNMail.dll?View=Main';// URL to your WorldClient application
var WCDate = .5;// Number of days until expiry
var WCpath;// Setting the path limits the directories that the cookie will be accessible to
var WCdomain = '.millercabman.com';// The domain to which this cookie belongs, i.e. '.DRGGN.com'
var WCsecure;// Set to 'true'  to require a secure connection
//	WORLDCLIENT LOGIN CSS ATTRIBUTES
var WCtableWidth = '15px';
var WCFont = 'Ariel';
var WCborder = '1px inset';
var WCBannerColor = '#67895d';
var WCBannerTextColor = 'black';

function WCLogin(formObj){if(formObj.setCookie.checked){WCsetCookie('myWCUserName',formObj.User.value);WCsetCookie('myWCPassword',formObj.Password.value);}if(formObj.goToMailbox.checked){formObj.submit();}else{document.location.href=document.location.href;}}
function WCgetCookie(str){var WCCookie = document.cookie.split("; ");for (var i=0; i < WCCookie.length; i++){var wcCookie = WCCookie[i].split("=");if (str == wcCookie[0]){return (wcCookie[1]);}}return null;}
function WCsetCookie(strKey, strVal){var WCexpiry = new Date();WCexpiry.setTime(WCexpiry.getTime()+(60*1000*60*24*WCDate));document.cookie=strKey+"="+strVal +";expires="+WCexpiry.toGMTString()+((WCpath)?";path="+WCpath:"")+((WCdomain)?";domain="+WCdomain:"")+((WCsecure)?";secure":"");}
function WCRmCookie(){WCsetCookie('myWCUserName','');WCsetCookie('myWCPassword','');document.location.href=document.location.href;}
var WCUser = WCgetCookie("myWCUserName");var WCPass = WCgetCookie("myWCPassword");

var WCoutput = '<form name="wcJSInclude" id="wcJSInclude" action="' + wcURL + '" method="POST"><table border="0" cellpadding="0" cellspacing="0" style="border:'+WCborder+';width:'+WCtableWidth+';font-family:'+WCFont+'"><tr>'+
	'<table cellpadding="2" cellspacing="0" style="border:'+WCborder+';width:'+WCtableWidth+';font-family:'+WCFont+'"><tr>' +
	'<td align="center" style="border-bottom:'+WCborder+';background-color:'+WCBannerColor+';color:'+WCBannerTextColor+';font-weight:bold;font-family:'+WCFont+';">Check the Mail</td></tr>';
if(WCUser==null && WCPass==null){WCoutput += '<tr><td style="font-family:'+WCFont+';">Name: <input type="text" name="User"></td></tr><tr><td style="font-family:'+WCFont+';">Password: <input type="Password" name="Password"></td></tr><tr>' +
	'<td style="font-family:'+WCFont+';"><input type="hidden" name="setCookie"></td></tr><tr><td style="font-family:'+WCFont+';"><input type="checkbox" name="goToMailbox" onclick="WCLogin(this.form)">Mailbox</td></tr><tr>' +
	'<td align="center"><input type="hidden" value="Log In" onclick="WCLogin(this.form)"></td></tr></table></form>';
}else{WCoutput += '<tr><td><a href="javascript:WCLogin(document.forms[\'wcJSInclude\'])" style="font-family:'+WCFont+';">Go To Mailbox</a></td></tr><tr>' +
	'<td><a href="javascript:WCRmCookie()" style="font-family:'+WCFont+';">Forget Me</a></td></tr></table><input type="HIDDEN" name="User" value="' + WCUser + '"><input type="HIDDEN" name="Password" value="' + WCPass + '"><input type="CHECKBOX" name="setCookie" style="display:none;" checked><input type="CHECKBOX" name="goToMailbox" style="display:none;" checked></form>';}
document.write(WCoutput);

