	var baseurl = ""

	<!-- ALL VARIABLES -->
	var mscDownloads = new Array()
	var mscDLinks = new Array()
	var mscPaths = new Array()
	var mscSoftwareData = new Array()
	
	mscDownloads[0] = "!#MegaScore Free"
	mscDownloads[1] = "x@MegaScore Free for Windows"
	
	mscDLinks[0] = "MSCfeatures.html"
	mscDLinks[1] = "MSCfeatures.html"
	
	mscPaths[0] = "software/Megascore-MAC.zip"
	mscPaths[1] = "software/Megascore-WIN.zip"
	
	mscSoftwareData[0] = "4.9 MB Zip (Oct. 27, 2009)"
	mscSoftwareData[1] = "2.2 MB Zip (Oct. 27, 2009)"
	
	var xenDownloads = new Array()
	var xenDLinks = new Array()
	var xenPaths = new Array()
	var xenSoftwareData = new Array()
	
	xenDownloads[0] = "!#XENTONE 1.0.3"
	xenDownloads[1] = "x@XENTONE 1.0.3 for Windows"
	
	xenDLinks[0] = "XENTsoftware.html"
	xenDLinks[1] = "XENTsoftware.html"
	
	xenPaths[0] = "software/XENTONE-MAC.zip"
	xenPaths[1] = "software/XENTONE-WIN.zip"
	
	xenSoftwareData[0] = "7.6 MB Zip (Jan. 8, 2010)"
	xenSoftwareData[1] = "4.1 MB Zip (Jan. 8, 2010)"
	
	var scrdDownloads = new Array()
	var scrdDLinks = new Array()
	var scrdPaths = new Array()
	var scrdSoftwareData = new Array()
	
	scrdDownloads[0] = "!#SCORDATURA 1.0.7"
	
	scrdDLinks[0] = "SCRDsoftware.html"
	
	scrdPaths[0] = "software/SCORDATURA-MAC.zip"
	
	scrdSoftwareData[0] = "9.4 MB Zip (Feb. 13, 2010)"
	
	var tbxDownloads = new Array()
	var tbxDLinks = new Array()
	var tbxPaths = new Array()
	var tbxSoftwareData = new Array()

	tbxDownloads[0] = "User Manual (pdf)"
	tbxDownloads[1] = "Factory .cse Tuning Files List (pdf)"
	tbxDownloads[2] = "Factory .scl Scala Files List (pdf)"
	tbxDownloads[3] = "!#CSE 2.4.1 - Custom Scale Editor"
	tbxDownloads[4] = "x@CSE 2.4.0 - Custom Scale Editor for Windows"
	tbxDownloads[5] = "Factory .cse and .scl Files"
	tbxDownloads[6] = "Turkish / Arabic Maqam .cse and .scl Files"
	
	tbxDLinks[3] = "CSEsoftware.html"
	tbxDLinks[4] = "CSEsoftware.html"
	
	tbxPaths[0] = "manuals/TBX1UserManual.pdf"
	tbxPaths[1] = "additionals/TBX1FactoryPresets.pdf"
	tbxPaths[2] = "additionals/TBX1FactoryScalaFiles.pdf"
	tbxPaths[3] = "software/CSE-MAC.zip"
	tbxPaths[4] = "software/CSE-WIN.zip"
	tbxPaths[5] = "software/TBX1Files.zip"
	tbxPaths[6] = "software/Maqamat-OzanYarman.zip"
	
	tbxSoftwareData[0] = "9.9 MB Zip (Dec. 9, 2009)"
	tbxSoftwareData[1] = "5.2 MB Zip (Feb. 23, 2010) <font color='#cc3300'>*</font>"
	
	var tpx28Downloads = new Array()
	var tpxDLinks = new Array()
	var tpx28Paths = new Array()
	var tpx28SoftwareData = new Array()
	
	tpx28Downloads[0] = "TPX2s/4s/6 User Manual (pdf)"
	tpx28Downloads[1] = "TPX6s/8s User Manual (pdf)"
	tpx28Downloads[2] = "TPX Developer Guidelines (pdf)"
	tpx28Downloads[3] = "TPX Factory Preset Tuning Files"
	tpx28Downloads[4] = "!#TPXE 1.4.1 - Tonal Plexus Editor"
	tpx28Downloads[5] = "x@TPXE 1.4.0 - Tonal Plexus Editor for Windows"
	
	tpxDLinks[4] = "TPXEsoftware.html"
	tpxDLinks[5] = "TPXEsoftware.html"
	
	tpx28Paths[0] = "manuals/TPX2s4s6UserManual.pdf"
	tpx28Paths[1] = "manuals/TPX6s8sUserManual.pdf"
	tpx28Paths[2] = "additionals/TPXSoftInstGuide.pdf"
	tpx28Paths[3] = "software/TPXfiles.zip"
	tpx28Paths[4] = "software/TPXE-MAC.zip"
	tpx28Paths[5] = "software/TPXE-WIN.zip"
	
	tpx28SoftwareData[0] = "12.9 MB Zip (Dec. 9, 2009)"
	tpx28SoftwareData[1] = "5.7 MB Zip (Feb. 23, 2010) <font color='#cc3300'>*</font>"
	
	var pscDownloads = new Array()
	var pscDLinks = new Array()
	var pscPaths = new Array()
	var pscSoftwareData = new Array()
	
	pscDownloads[0] = "!#PXSC 0.1.0 - Plexus Synth Control"
	pscDownloads[1] = "x@PXSC 0.1.0 - Plexus Synth Control for Windows"
	
	pscDLinks[0] = "PXSCsoftware.html"
	pscDLinks[1] = "PXSCsoftware.html"
	
	pscPaths[0] = "software/PXSC-MAC.zip"
	pscPaths[1] = "software/PXSC-WIN.zip"
	
	pscSoftwareData[0] = "3.6 MB Zip (Sept. 20, 2008)"
	pscSoftwareData[1] = "1.4 MB Zip (Sept. 20, 2008)"
	
	var hplfDownloads = new Array()
	var hplfDLinks = new Array()
	var hplfPaths = new Array()
	var hplfSoftwareData = new Array()
	
	hplfDownloads[0] = "!#HPLF 1.0.5 - Lo-Fi Microsynth"
	
	hplfDLinks[0] = "HPLFsoftware.html"
	
	hplfPaths[0] = "software/HPLF-MAC.zip"
	
	hplfSoftwareData[0] = "11.1 MB Zip (Feb. 14, 2010)"
	
	var svDownloads = new Array()
	var svDLinks = new Array()
	var svPaths = new Array()
	var svSoftwareData = new Array()
	
	svDownloads[0] = "!#ScalaVista 1.0.2 - Scale Browser"
	svDownloads[1] = "x@ScalaVista 1.0.2 - Scale Browser for Windows"
	
	svDLinks[0] = "ScalaVistasoftware.html"
	svDLinks[1] = "ScalaVistasoftware.html"
	
	svPaths[0] = "software/ScalaVista-MAC.zip"
	svPaths[1] = "software/ScalaVista-WIN.zip"
	
	svSoftwareData[0] = "5.0 MB Zip (Dec. 17, 2009)"
	svSoftwareData[1] = "3.2 MB Zip (Dec. 17, 2009)"
	
	var theDownloads = new Array()
	var thePaths = new Array()
	var theDLinks = new Array()
	var theSoftwareData = new Array()

function getDownloadData(theProduct) {
	if (theProduct != "") {
		if (theProduct == "MSC") {
			theDownloads = mscDownloads
			theDLinks = mscDLinks
			thePaths = mscPaths
			theSoftwareData = mscSoftwareData
		}
		if (theProduct == "XENT") {
			theDownloads = xenDownloads
			theDLinks = xenDLinks
			thePaths = xenPaths
			theSoftwareData = xenSoftwareData
		}
		if (theProduct == "SCRD") {
			theDownloads = scrdDownloads
			theDLinks = scrdDLinks
			thePaths = scrdPaths
			theSoftwareData = scrdSoftwareData
		}
		if (theProduct == "TBX1") {
			theDownloads = tbxDownloads
			theDLinks = tbxDLinks
			thePaths = tbxPaths
			theSoftwareData = tbxSoftwareData
		}
		if (theProduct == "TPX28") {
			theDownloads = tpx28Downloads
			theDLinks = tpxDLinks
			thePaths = tpx28Paths
			theSoftwareData = tpx28SoftwareData
		}
		if (theProduct == "PXSC") {
			theDownloads = pscDownloads
			theDLinks = pscDLinks
			thePaths = pscPaths
			theSoftwareData = pscSoftwareData
		}
		if (theProduct == "HPLF") {
			theDownloads = hplfDownloads
			theDLinks = hplfDLinks
			thePaths = hplfPaths
			theSoftwareData = hplfSoftwareData
		}
		if (theProduct == "ScalaVista") {
			theDownloads = svDownloads
			theDLinks = svDLinks
			thePaths = svPaths
			theSoftwareData = svSoftwareData
		}
	}
}

function DownloadList(theProduct) {
	getDownloadData(theProduct)
	for (j = 0; j < theDownloads.length; j++) {
		if (theDownloads[j].charAt(1) == "#") {
			DownloadSoftwareList(theProduct, j)
		}
		else { 
			if (theDownloads[j].charAt(0) != "x") {
				<!-- document.write("<a href='"+baseurl+thePaths[j]+"'>"+theDownloads[j]+"</a><br>") -->
				document.write("<a href='"+baseurl+"downloads.html'>"+theDownloads[j]+"</a><br>")
			}
		}
	}
}

function DownloadBar(theProduct) {
	getDownloadData(theProduct)
	for (j = 0; j < theDownloads.length; j++) {
		if (theDownloads[j].charAt(1) == "#") {
			DownloadTable(theProduct)
		}
		else { 
			if (theDownloads[j].charAt(0) != "x") {
				<!-- document.write("<a href='"+baseurl+thePaths[j]+"'>"+theDownloads[j]+"</a><br>") -->
				document.write("<a href='"+baseurl+"downloads.html'>"+theDownloads[j]+"</a><br>")
			}
		}
	}
}

function verifyDownload() {
	if (document.HUMAN.HOPE.value == "music") {
		return true
	} 
	else {
		alert("You must type the correct word into the entry field above the download table in order to download the files.")
		return false
	}
}

function DownloadTable(theProduct, withHeader, withFooter) {
	getDownloadData(theProduct)
	for (k = 0; k < theDownloads.length; k++) {
		if (theDownloads[k].charAt(0) == "!") {
			theDownloads[k] = theDownloads[k].split("#")[1]		
			if (withHeader == true) {
				document.write("<p><table class='download' width=100% border=1 cellpadding=4 cellspacing=0><tr>")
				document.write("<th class='downloads'>Application</th><th bgcolor='#ffffff'>")
				document.write("<img border=0 vspace=6 hspace=30 valign='middle' src='images/MacOSX_Universal_50px.gif'>(10.4+/G4/Intel)</th><th bgcolor='#ffffff'>")
				document.write("<img border=0 vspace=7 hspace=20 valign='middle' src='images/windows_logo.jpg'>(XP/Vista/7)</th></tr>")
			}
			
			document.write("<tr><th bgcolor='#ffffff'><a class='plain' href='"+theDLinks[k]+"'>"+theDownloads[k]+"</a></th><th bgcolor='#ffffff'>")
			
			document.write("<FORM NAME='DOWNLOAD' METHOD='POST' ACTION='/cgi-bin/formmail.pl' onSubmit='return verifyDownload()'>")
			document.write("<INPUT TYPE='hidden' NAME='recipient' VALUE='contact@h-pi.com'>")
			document.write("<INPUT TYPE='hidden' NAME='subject' VALUE='"+theDownloads[k]+"-MAC Download'>")
			document.write("<INPUT TYPE='hidden' NAME='redirect' VALUE='http://h-pi.com/"+thePaths[k]+"'>")
			document.write("<INPUT TYPE='hidden' NAME='App' VALUE='"+theDownloads[k]+" - MAC'>")
			document.write("<INPUT TYPE='SUBMIT' VALUE='Download'> "+theSoftwareData[0]+"</FORM></th><th bgcolor='#ffffff'>")
			
			if ( theSoftwareData[1] != undefined ) {
				document.write("<FORM NAME='DOWNLOAD' METHOD='POST' ACTION='/cgi-bin/formmail.pl' onSubmit='return verifyDownload()'>")
				document.write("<INPUT TYPE='hidden' NAME='recipient' VALUE='contact@h-pi.com'>")
				document.write("<INPUT TYPE='hidden' NAME='subject' VALUE='"+theDownloads[k]+"-WIN Download'>")
				document.write("<INPUT TYPE='hidden' NAME='redirect' VALUE='http://h-pi.com/"+thePaths[k+1]+"'>")
				document.write("<INPUT TYPE='hidden' NAME='App' VALUE='"+theDownloads[k]+" - WIN'>")
				document.write("<INPUT TYPE='SUBMIT' VALUE='Download'> "+theSoftwareData[1]+"</FORM>")
			}
			else {
				document.write("&mdash;")
			}
			document.write("</th></tr>")
			if (withFooter == true) {
				document.write("<tr><th bgcolor='#ffffff' colspan='2'>The Windows versions are reported to")
				document.write(" work on Linux Ubuntu using <a target='parent' href='http://www.winehq.org/site/download'>WineHQ</a>.</th>")
				document.write("<th bgcolor='#ffffff'><img border=0 vspace=6 hspace=3 valign='middle' src='images/linux_logo.gif'> + ")
				document.write("<img border=0 vspace=6 hspace=3 valign='middle' src='images/winehq_logo.gif'> (Ubuntu/WineHQ)</th>")
				document.write("</tr></table></p>")
			}
		}
	}
}

function DownloadSoftwareList(theProduct, m) {
	<!-- document.write("<a href='"+baseurl+thePaths[m]+"'>"+theDownloads[m].split("#")[1]+" for Mac</a><br>") -->
	<!-- document.write("<a href='"+baseurl+thePaths[m+1]+"'>"+theDownloads[m+1].split("@")[1]+"</a><br>") -->
	document.write("<a href='"+baseurl+"downloads.html'>"+theDownloads[m].split("#")[1]+" for Mac</a><br>")
	document.write("<a href='"+baseurl+"downloads.html'>"+theDownloads[m+1].split("@")[1]+"</a><br>")
}