//SET VARIABLES TO DEFAULT VALUES
var iNewBE = "";
var idlOS = "";
var iSortBy = "";
var iMaxAttachment = "";
var iExit = "";
var iLoginPage = "";
var iDelayList = "";
var iOption = "";
var iLang = "";
var iXemailName = "";
var iPOP3server = "";
var iSMTPserver = "";
var iLDAPserver = "";
var iMailAttribute = "";
var iLDAPBase = "";
var iDomain = "";
var iURL = "";
var iSMTPport = "";
var iPOP3port = "";
var iLogo = "";
var iLogoWidth = "";
var iLogoHeight = "";
var iBackground = "";
var iMailBorder = "";
var iLinkName = "";
var iLinkURL = "";
var iHeaderFile = "";
var iFooterFile = "";
var iTagLineFile = "";
var iKey = "";
var i_POP3server = "";
var i_POP3port = "";
var i_SMTPserver = "";
var i_SMTPport = "";
var i_USERID = "";
var i_PASSWORD = "";
var usePOPAuth = "";
var iUseWB = "No";
var iFirstName = "First Name";
var iLastName = "Last Name";
var wbiEmail = "Email";
var iOrganization = "Organization";
var iWBHeaderFile = "NULL";
var iWBFooterFile = "NULL";
var iWBAdrHeaderFile = "NULL";
var iWBAdrFooterFile = "NULL";
var iWBNewHeaderFile = "NULL";
var iWBNewFooterFile = "NULL";


// SETS 30 DAY KEY
function setKey()
{
	iKey = "QnJvd3NlckV4cHJlc3M=";
}

// NAVIGATES TO PAGE SET IN POP UP WINDOW
function goNext(nex)
{
	openWin(nex,'wizWindow');
}

// SETS ATTRIBUTES AND OPENS POP UP WINDOW
function openWin(theURL, theName)
{
window.open(theURL, theName, "menubar=no,toolbar=no,locationbar=no,personalbar=no,scrollbars=yes,statusbar=no,width=500,height=400");
}

// WRITE THE INI FILE 
// SOME LINES ARE NOT WRITTEN IF NOT REQUIRED
function writeINI()
{
	INIFile=window.open();
	INIFile.document.writeln("<xmp>");  		//OUTPUT INSIDE OF XMP TAGS
	INIFile.document.writeln("#BrowserExpress INI File ");
	INIFile.document.writeln("#Copy and Paste this into a text editor ");
	INIFile.document.writeln("#and save the file as BrowserExpress.ini ");
	INIFile.document.writeln("#See http://www.progressivesoft.com/BE-Help/BEman.shtml");
	INIFile.document.writeln("#for more information");
	INIFile.document.writeln("SortBy = " + iSortBy);
	INIFile.document.writeln("MaxAttachment = " + iMaxAttachment);
	INIFile.document.writeln("Exit = " + iExit);

	if (iExit == "login")
	{
		INIFile.document.writeln("LoginPage = " + iLoginPage);
	}

	INIFile.document.writeln("DelayList = " + iDelayList);
	INIFile.document.writeln("Option = " + iOption);
	INIFile.document.writeln("Lang = " + iLang);
	INIFile.document.writeln(iXemailName);
	INIFile.document.writeln("URL = " + iURL);

	if (iLDAPserver != "XLDAPserver")
	{
		INIFile.document.writeln("LDAPserver = " + iLDAPserver);
		INIFile.document.writeln("MailAttribute = " + iMailAttribute);
		INIFile.document.writeln("LDAPBase = " + iLDAPBase);
	}

	if (iLDAPserver == "XLDAPserver")
	{	
		INIFile.document.writeln("XLDAPserver = ");
	}

	if (iOption == "0")
	{
		INIFile.document.writeln("POP3server = " + iPOP3server);
		INIFile.document.writeln("SMTPserver = " + iSMTPserver);
		INIFile.document.writeln("DOMAIN = " + iDomain);
		INIFile.document.writeln("SMTPport = " + iSMTPport);
		INIFile.document.writeln("POP3port = " + iPOP3port);
	}

	if (iLogo != "NULL")
	{
		INIFile.document.writeln("Logo = " + iLogo);
		INIFile.document.writeln("LogoWidth = " + iLogoWidth);
		INIFile.document.writeln("LogoHeight = " + iLogoHeight);
	}

	if (iBackground != "NULL")
	{
		INIFile.document.writeln("Background = " + iBackground);
	}

	if (iMailBorder != "NULL")
	{
		INIFile.document.writeln("MailBorder = " + iMailBorder);
	}

	INIFile.document.writeln("LinkName = " + iLinkName);
	INIFile.document.writeln("LinkURL = " + iLinkURL);

	if (iHeaderFile != "NULL")
	{
		INIFile.document.writeln("HeaderFile = " + iHeaderFile);
	}

	if (iFooterFile != "NULL")
	{
		INIFile.document.writeln("FooterFile = " + iFooterFile);
	}

	if (iTagLineFile !="NULL")
	{
		INIFile.document.writeln("TagLineFile = " + iTagLineFile);
	}

	if (iNewBE == "1")
	{
		setKey();
	}

	INIFile.document.writeln("Key = " + iKey);

	if (iUseWB == "Yes")
	{
		INIFile.document.writeln("AddressBook = YES");
		INIFile.document.writeln("AdminPath = NULL");

		if (iWBHeaderFile != "NULL")
		{
		INIFile.document.writeln("MainHeader = " + iWBHeaderFile);
		}

		if (iWBFooterFile != "NULL")
		{
			INIFile.document.writeln("MainFooter = " + iWBFooterFile);
		}

		if (iWBAdrHeaderFile != "NULL")
		{
			INIFile.document.writeln("AddressPageHeader = " + iWBAdrHeaderFile);
		}

		if (iWBAdrFooterFile != "NULL")
		{
			INIFile.document.writeln("AddressPageFooter = " + iWBAdrFooterFile);
		}

		if (iWBNewHeaderFile != "NULL")
		{
			INIFile.document.writeln("NewPageHeader = " + iWBNewHeaderFile);
		}

		if (iWBFooterFile != "NULL")
		{
			INIFile.document.writeln("NewPageFooter = " + iWBNewFooterFile);
		}	


		INIFile.document.writeln("[WebBookFields]");
		INIFile.document.writeln("FirstName = " + iFirstName);
		INIFile.document.writeln("LastName = " + iLastName);
		INIFile.document.writeln("Email = " + wbiEmail);
		INIFile.document.writeln("Org = " + iOrganization);
		INIFile.document.writeln("<EOF>");
 }

	if (usePOPAuth == "yes")
	{
		INIFile.document.writeln("_POP3server = " + i_POP3server);
		INIFile.document.writeln("_POP3port = " + i_POP3port);
		INIFile.document.writeln("_SMTPserver = " + i_SMTPserver);
		INIFile.document.writeln("_SMTPport = " + i_SMTPport);
		INIFile.document.writeln("_USERID = " + i_USERID);
		INIFile.document.writeln("_PASSWORD = " + i_PASSWORD);
	}

	INIFile.document.writeln("</xmp>");
	INIFile.document.close();
}
