var projects = new Array (
  new ProjDef(0,"General expenses",'','','','','','',[''],[''],[''],0,'',''),
  new ProjDef(1,"backup.pro",'software','bash','','','0.1.19','backup.pro_0.1.19.tar.gz',['09/08','09/08','05/10','06/10'],["Onsite backup to various media (HDD,Flash,Optical,Network Shares)","Offsite backup to designated location","Various backup types (daily,incremental,full,archive,bit,mirror,etc)","Users can schedule backups (via crontab)","Pre and post script processing","Verify the contents in backups against source data","Eject media upon successful backup","Backup SMB and NFS shares","Keep track of backups via count, quota, or manually tracking","Can breakdown large backups to transfer offsite over time","Secured data transport over the internet","Custom backup commands"],['checked ','','','checked ','checked ','checked ','checked ','checked ','checked ','','','checked '],53,'na',"A data backup system designed for speed and stability by using well established binaries such as tar, rsync, wget, etc. and targets SOHO, small, and medium-sized businesses.  There are numerous features already built-in with more already planned for future releases."),
  new ProjDef(2,"delDup",'software','bash','0.1','delDup_0.1.tar.gz','','',['04/09','04/09','04/09','04/09'],["Deleted duplicate files based on MD5 hashes"],['checked '],100,'na',"This bash script parses a source directory and removes duplicate files based on MD5 hashes generated in a master list.  This script removes duplicates not based on filenames, sizes, or dates, but on uniqueness and doesn't require the use of any database aside from text files it automatically creates and deletes."),
  new ProjDef(3,"iMail",'software','Perl/html','1.0','iMail_1.0.tar.gz','','',['07/09','07/09','08/09','09/09'],["Inner website email system","No databases used"],['checked ','checked '],100,'na',"A mail system that websites can use that does not use a database but, instead, a series of directories and text files.  Little or no maintenance is required and it can be tailored to your website's appearance by adjusting the css values."),
  new ProjDef(4,"iVote",'software','PHP/HTML','2.0','iVote_2.0.tar.bz2','','',['07/09','07/09','08/09','08/09'],["Inner website voting system","No databases used","Anonymous voting"],['checked ','checked ','checked '],100,'na',"A voting system that websites can use that does not use a database but, instead, a series of directories and test files.  Little or no maintenance is required and it can be tailored to your website's appearance by adjusting the css values."),
  new ProjDef(5,"Javascript modules",'software','Javascript','1.0','javascript_1.0.tar.gz','','',['07/04','07/04','07/04','07/04'],["Provides various Javascript functions to aid in website creation"],['checked '],100,'na',"Using these modules will help reduce the amount of time it takes to provide expanded functionality with your website or HTML project.  All modules have been tested for cross platform functionality using Mozilla's Firefox and Microsoft's Internet Explorer."),
  new ProjDef(6,"OnlyProfile.org",'website','PHP/html','','','0.40','www.onlyprofile.org',['07/09','07/09','04/10','06/10'],["Maintain one profile for all your websites and applications","Access based on requests and approvals","Secured data transfers","Can be integrating into websites and applications","HTML and XML communication"],['','','','',''],90,'www.onlyprofile.org',"Save yourself time by managing only one profile and having that information syncronize with all approved websites and applications for initial account creations, as well as updates made at any time.  Click the 'Details' link above to see the website for more information."),
  new ProjDef(7,"software management",'software','bash','','','0.6','',['10/10','11/10','05/11','07/11'],["Bash script allows easy modifications and additions","Utilizes existing, well known utilities to accomplish tasks","Central respository keeps you from searching all over the internet for software","Easy package creation","Offsite downloads for software installation on computers with no internet access","Installs software and images","Crash recovery installations","Install from source code","Mac OS X compatiable (when installing from source via gcc and make)"],['','','','','','','','',''],5,'na',"This is the package management system for the XiniX GNU/Linux distribution.  This system has a wide variety of features and will attempt to become a universal installer for other packages, such as debs and rpms.  It is also important to note that this package management solution also works with Mac OS X."),
  new ProjDef(8,"Perl modules",'software','Perl','1.0','perl_1.0.tar.gz','','',['07/04','07/04','07/04','07/04'],["Provides various Javascript functions to aid in website creation"],['checked '],100,'na',"These modules work with all known GNU/Linux web servers and will help get your projects created faster by using code that has already been tested and implemented in production environments."),
  new ProjDef(9,"video script",'software','bash','0.4','video_0.4.tar.gz','','',['07/09','07/09','07/09','07/09'],["Cycle which display is active","Manually set which display is active"],['checked ','checked '],100,'na',"This bash script provides and easy frontend for xrandr tasks that allows for cycling and manually setting of the display(s) as well as identifying which ones are connected and active.  It was tested with xrandr version 1.3."),
  new ProjDef(10,"webBooks.pro",'software','Perl/html','','','0.1','',['07/10','11/10','11/10','12/10'],["Web base GUI provides speed and easy to navigate interface","No VPN's or special setup required for remote staff","Tracks various aspects of a business ranging from accounting to vehicles"],['','',''],15,'na',"This software will aim at replacing Quickbooks users with an open sourced, web based alternative that doesn't require any SQL or other database setups.  Another benefit includes no complicated remote access configurations just so outside staff can interact with the application.  Based on a modular design, this application can be completely tailored to fit your business in all aspects."),
  new ProjDef(11,"XiniX Interface",'software','bash/html','','','0.10','',['06/10','10/10','03/11','05/11'],["Web based GUI","Full functionality over OS","Remote administration of computers and equipment"],['','',''],10,'na',"This interface will be released prior to the GNU/Linux distribution being completed.  This will allow people to remotely manage their computers and equipment using a 'desktop' type interface they are familiar with using only a web browser.")
//  new ProjDef(12,"XiniX MyBook Edition",'software','Various','','','','',['09/09','09/09','09/09','12/09'],["Doesn't interfere with factory firmware","SMB and NFS file sharing","Backup your data using backup.pro"],['','',''],0,'na',"A version of XiniX GNU/Linux specifically designed for the WD MyBook World Edition that doesn't interfere with the factory firmware and can be removed with no trace of it ever being installed.  Additional modules will be released once a stable version of the OS has been completed.")
);


function ProjDef(p01,p02,p03,p04,p05,p06,p07,p08,p09,p10,p11,p12,p13,p14) {
// This is the object constructor function.  It defines the object prototype for the array Properties.
  this.id = p01;			// unique ID (key) for the project (used by the writeCosts function below)
  this.name = p02;			// name of the cost
  this.cat = p03;			// the category the project falls under (software or website)
  this.lang = p04;			// the language the project is written in (bash, java, html, etc)
  this.stableVer = p05;			// latest stable version number
  this.stableFile = p06;		// latest stable filename (for downloads)
  this.betaVer = p07;			// latest beta version number
  this.betaFile = p08;			// latest beta filename (for downloads)
  this.dates = p09;			// completion dates: visual design, under review, backend coding, beta testing (when completed also makes this the public release date)
  this.features = p10;			// list of features (also an array)
  this.completed = p11;			// list of 0's and 1's that represent what features (above) have been completed (also an array)
  this.status = p12;			// percentage of how far along in the development process we are (for graphing on the 'Dev Progress' screen)
  this.url = p13;			// the projects "Software page"
  this.overview = p14;			// the projects overview (for the general 'Software page')
}


function writeWriteups() {
// this writes each projects overview to the 'Projects & Software' screen.
   var i,desc='';

   desc = "<table>";
   for (i=1; i<projects.length; i++) {	// start at 1 since we don't want to include the "General expenses" as a project
	desc += "<tr><th class='thProjCol0'>";
	if (projects[i].url != 'na') { desc += "<a href='http://"+projects[i].url+"' target='new'>"; } else { desc += "<a href='#' onClick=\"alert('No page has been setup for this project yet.');\">"; }
	desc += projects[i].name+"</a></th><td class='tdProjCol1'>";
	if (projects[i].cat == "software") {
	   if (projects[i].stableFile != '') { desc += "<a href=\"downloads/"+projects[i].stableFile+"\">stable ["+projects[i].stableVer+"]</a> | "; } else { desc += "no stable | "; }
	   if (projects[i].betaFile != '') { desc += "<a href=\"downloads/"+projects[i].betaFile+"\">beta ["+projects[i].betaVer+"]</a>"; } else { desc += "no beta"; }
	} else {
	   if (projects[i].stableFile != '') { desc += "<a href=\"http://"+projects[i].stableFile+"\" target='new'>stable ["+projects[i].stableVer+"]</a> | "; } else { desc += "no stable | "; }
	   if (projects[i].betaFile != '') { desc += "<a href=\"http://"+projects[i].betaFile+"\" target='new'>beta ["+projects[i].betaVer+"]</a>"; } else { desc += "no beta"; }
	}
	desc += "</td><td class='tdProjCol2'>"+projects[i].lang+"</td></tr><tr><td class='tdProjOverview' colspan='3'>"+projects[i].overview+"</td></tr>";
   }
   document.getElementById('divProj').innerHTML = desc + "</table>";
}


function writeProgess() {
// this writes all the information for each project as well as a progress graph on the 'Dev Progress' screen.
   var i,j,desc='';

   desc = "<table><tr><th id='thDevCol0' class='thDevBottom'>&nbsp;</th><th id='thDevCol1' class='thDevBottom'>~ Release</th><th id='thDevCol2' class='thDevBottom'>Name of project</th><th id='thDevCol3' class='thDevBottom'>Version</th></tr>";
   for (i=1; i<projects.length; i++) {	// start at one since we don't want to include the "General expenses" as a project
	if ((i-1)%2 == 0) { desc += "<tr class='trDevEven'>"; } else { desc += "<tr>"; }
	desc += "<td>&nbsp;</td><td>"+projects[i].dates[3]+"</td><td>";
	if (projects[i].url != 'na') { desc += "<a href='"+projects[i].url+"' target='new'>"; } else { desc += "<a href='#' onClick=\"alert('No page has been setup for this project yet.');\">"; }
	desc += projects[i].name+"</a></td><td>"+projects[i].stableVer+"</td></tr>";
	if ((i-1)%2 == 0) { desc += "<tr class='trDevEven'>"; } else { desc += "<tr>"; }
	desc += "<td><label id='lblDev"+(i-1)+"' onClick='adjDev("+(i-1)+");'>[+]</label></td><td colspan='3'>" +
		"   <div class='divDevProgress' style='width: "+(6.39*projects[i].status)+"px;'>&nbsp;</div>" +
		"   <ul class='ulDevGraph'>" +
		"	<li class='liDevDesign'>Design ["+projects[i].dates[0]+"]</li>" +
		"	<li class='liDevReview'>Review ["+projects[i].dates[1]+"]</li>" +
		"	<li class='liDevCoding'>Coding ["+projects[i].dates[2]+"]</li>" +
		"	<li class='liDevTesting'>Testing ["+projects[i].dates[3]+"]</li>" +
		"   </ul>" +
		"</td></tr>";
	if ((i-1)%2 == 0) { desc += "<tr id='trDev"+(i-1)+"' style='display: none;'><td colspan='4' class='tdDevEven'><ul class='ulTxt'>"; } else { desc += "<tr id='trDev"+(i-1)+"' style='display: none;'><td colspan='4' class='tdDevOdd'><ul class='ulTxt'>"; }
	for (j=0; j<projects[i].features.length; j++)
	   { desc += "<li><input type='checkbox' disabled "+projects[i].completed[j]+"class='checkbox' /> "+projects[i].features[j]+"</li>"; }
	desc += "</ul></td></tr><tr><td colspan='4' style='font-size: 5px;'>&nbsp;</td></tr>";
   }
   document.getElementById('divDev').innerHTML = desc + "</table>";
}


function writeDownloads() {
// this writes the submenu for the "Latest Stable" downloads
   var i,stable='',beta='';

   for (i=1; i<projects.length; i++) {	// start at two since we don't want to include the "General expenses" as a project
	if (projects[i].stableVer != '') { stable += "<li><a href=\""+projects[i].stableFile+"\">"+projects[i].name+"</a></li>"; }
	if (projects[i].betaVer != '') { beta += "<li><a href=\""+projects[i].betaFile+"\">"+projects[i].name+"</a></li>"; }
   }
   if (stable == '') { stable = "<li><a href='#'>None</a></li>"; }
   if (beta == '') { beta = "<li><a href='#'>None</a></li>"; }
   document.getElementById('ulStable').innerHTML = stable;
   document.getElementById('ulBeta').innerHTML = beta;
}




var costs = new Array (
  new CostDef(0,"Internet connection","monthly",44.95,0),
  new CostDef(0,"Hosting","monthly",10.95,0),
  new CostDef(0,"Programmer's salary","single",3000,1000)
);


function CostDef(c01,c02,c03,c04,c05) {
// This is the object constructor function.  It defines the object prototype for the array Properties.
  this.proj = c01;			// the project id that the cost is associated with
  this.name = c02;			// the name of the cost
  this.type = c03;			// single (one time) or monthly (reoccuring)
  this.cost = c04;			// the total cost for the expense
  this.paid = c05;			// the amount of funds that have been paid for this project via donations
}


function writeCosts() {
// this writes each cost associated with each project as listed in the 'costs' array.
   var i,temp1=-1,temp2=0,desc='';

   desc = "<span class='cost'>Expense</span><span class='paid'>Donations</span><br /><br /><table>";
   for (i=0; i<costs.length; i++) {
	if (temp1 != costs[i].proj) {	// if we have encountered a new project, then set the temp variable to its name
	   temp1 = costs[i].proj;
	   desc += "<tr><th colspan='3'>"+projects[costs[i].proj].name+"</th></tr>";
	   Add2List(projects[costs[i].proj].name, document.getElementById('cmbDonateApp'), costs[i].proj, 0);
	}
	temp2 = (costs[i].paid/costs[i].cost*100);		// this code writes the cost to the table
	desc += "<tr><td width='140'>"+costs[i].name+"</td><td>";
	if (costs[i].paid != 0) { desc += "<div class='paid' style='float: left; width: "+temp2+"%;'>&nbsp;</div>"; }
	desc += "<div class='cost' style='width: "+(100-temp2)+"%;'>&nbsp;</div></td>";
	desc += "<td width='140' style='text-align: right;'>"+costs[i].paid+" / "+costs[i].cost+" ["+costs[i].type+"]</td></tr>";
   }
   document.getElementById('divCosts').innerHTML = desc + "</table>";
}

