function download_action() {
	detect_platform();
	if (! (platformId.indexOf('Mac') >= 0 || platformId.indexOf('Windows XP') >= 0 || platformId.indexOf('Vista') >= 0) ) {
		 window.location = '/downloads/all.jsp';
	} else if(platformId.indexOf('Mac PPC') >= 0 ) {
		var javafxElement = document.getElementById('javafx-download');
		if(javafxElement) {
			javafxElement.style.visibility="hidden";
		}
	}
}

function download_value(chosenValue) {
        detect_platform();

		// Declare all the download urls
		var cdsDownload = new Array(3);
		for(var i=0; i<3; i++)
			cdsDownload[i] = new Array(2);
		cdsDownload[0][0] = "netbeans-6.5-javafx-1.0.1-oth-1c-JPR_English_with_Windows@CDS-CDS_Developer";
		cdsDownload[0][1] = "netbeans-6.5-javafx-1.0.1-oth-1c-JPR_English_with_Mac OS X@CDS-CDS_Developer";
		cdsDownload[1][0] = "javafx_ps-1.0.1-oth-1c-JPR_English_with_Windows@CDS-CDS_Developer";
		cdsDownload[1][1] = "javafx_ps-1.0.1-oth-1c-JPR_English_with_Mac OS X@CDS-CDS_Developer";
		cdsDownload[2][0] = "javafx_sdk-1.0.1-oth-1c-JPR_English_with_Windows@CDS-CDS_Developer";
		cdsDownload[2][1] = "javafx_sdk-1.0.1-oth-1c-JPR_English_with_Mac OS X@CDS-CDS_Developer";

		// Declare all the download names
		var downloadNames = new Array(3);
		downloadNames[0] = "NetBeans IDE 6.5 for JavaFX 1.0";
		downloadNames[1] = "JavaFX 1.0 Production Suite";
		downloadNames[2] = "JavaFX 1.0 SDK";

		// Declare all the download executable links
		var downloadLinks = new Array(3);
		for(var i=0; i<3; i++)
			downloadLinks[i] = new Array(2);
		downloadLinks[0][0] = "netbeans-6_5-javafx-windows.exe";
		downloadLinks[0][1] = "netbeans-6_5-javafx-macosx.dmg";
		downloadLinks[1][0] = "javafx_production_suite-1_0-windows-i586.exe";
		downloadLinks[1][1] = "javafx_production_suite-1_0-macosx-universal.dmg";
		downloadLinks[2][0] = "javafx_sdk-1_0-windows-i586.exe";
		downloadLinks[2][1] = "javafx_sdk-1_0-macosx-universal.dmg";

		// Declare all the Release Urls
		var releaseUrls = new Array(3);
		releaseUrls[0] = "/javafx/1/reference/releasenotes/javafx-netbeans-release-notes.html";
		releaseUrls[1] = "/javafx/1/reference/releasenotes/production-suite-release-notes.html";
		releaseUrls[2] = "/javafx/1/reference/releasenotes/javafx-sdk-release-notes.html";

		// Declare all the Installation Urls
		var installUrls = new Array(3);
		installUrls[0] = "/javafx/1/reference/javafx-netbeans-install/install-nb6.5-for-javafx.html";
		installUrls[1] = "/javafx/1/reference/releasenotes/production-suite-release-notes.html";
		installUrls[2] = "/javafx/1/reference/sdk-install/";

		var chosen = "";
		var selIndex1 = 0;
		var selIndex2 = 0;
		var radioSelected = 0;

		if(chosenValue == null || chosenValue == '') {
			var len = document.download_form.ProductRef.length;
			for (var i = 0; i <len; i++) {
				if (document.download_form.ProductRef[i].checked) {
					chosen = document.download_form.ProductRef[i].value;
					radioSelected = i;
				}
			}
		} else {
			chosen = chosenValue;
		}

		if(chosen == 'netbeans') selIndex1 = 0;
		if(chosen == 'javafx') selIndex1 = 1;
		if(chosen == 'javafx_sdk') selIndex1 = 2;
		if(platformId.indexOf('Windows') >= 0 || platformId.indexOf('Vista') >= 0) selIndex2 = 0;
		if(platformId.indexOf('Mac') >= 0 ) selIndex2 = 1;

		document.getElementById('downloadLink').href = "http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=" + cdsDownload[selIndex1][selIndex2] + "&OClick=Immediate";
		document.getElementById('downloadText').innerHTML="for downloading " + downloadNames[selIndex1];
		document.getElementById('releaseNotes').href = "http://java.sun.com" + releaseUrls[selIndex1];
		document.getElementById('installationGuide').href = "http://java.sun.com" + installUrls[selIndex1];

		if(chosenValue == null || chosenValue == '') {
			document.download_form.ProductRef[radioSelected].value = cdsDownload[selIndex1][selIndex2];
			s_linkType = 'd';
			s_linkName = downloadLinks[selIndex1][selIndex2];
			s_linkTrackVars = 'events,products,eVar3,eVar8';
			s_linkTrackEvents='event7';
			s_events='event7';
			s_products='Download Products;' + downloadNames[selIndex1];
			s_eVar3='javafx.com';
			s_eVar8=downloadLinks[selIndex1][selIndex2];
			s_lnk=s_co(this);
			s_gs(s_account);
		}

		var actionLink = "http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=";
		var inHtml = ""; 
		var bodyId = document.getElementById("homepage");
		/*
		 METHOD NOTES:
		 I changed the Markup to output just two list elements, and to inject BR tags when necessary to accomplish a two row listing.
		 
		 FROM:
		 <dd class='first'>Item</dd><dd> </dd>
		 <dd>Item 2</dd><dd> </dd>
		 
		 TO:
		 <dd class='top'>Item</dd><dd class='top'>Item 2</dd>
		 
		 
		 I had to add some padding or else the items run into eachother and its hard to read, so only one of the links now needs to add an extra space
		 
		 When they download javaFX, I add two breaks to the JavaFX SDK link.
		 
		 Output:
		 <a>JavaFX SDK<br/><br/></a>
		 
		*/
		
			
		
		// This is to show more downloads on thank you page
		if(chosen == 'netbeans') {
			inHtml = "<dd class=\"top\"><a href=\""+ actionLink + cdsDownload[1][selIndex2] + "&OClick=Immediate\">";
			inHtml = inHtml + downloadNames[1] + "<\/a><\/dd>";
			//if(bodyId) inHtml = inHtml + "<dd>&nbsp;<\/dd>";
			inHtml = inHtml + "<dd class='top'><a href=\"" + actionLink + cdsDownload[2][selIndex2] + "&OClick=Immediate\">";
			inHtml = inHtml + downloadNames[2] + "<\/a><\/dd>";
			//if(bodyId) inHtml = inHtml + "<dd>&nbsp;<\/dd>";
		}
		if(chosen == 'javafx') {
			inHtml = "<dd class='top'><a href=\""+ actionLink + cdsDownload[0][selIndex2] + "&OClick=Immediate\">";
			inHtml = inHtml + downloadNames[0] + "<\/a><\/dd>";
			//if(bodyId) inHtml = inHtml + "<dd>&nbsp;<\/dd>";
			inHtml = inHtml + "<dd class='top'><a href=\"" + actionLink + cdsDownload[2][selIndex2] + "&OClick=Immediate\">";
			inHtml = inHtml + downloadNames[2] + "<br\/><br\/><\/a><\/dd>";
			//if(bodyId) inHtml = inHtml + "<dd>&nbsp;<\/dd>";
		}
		if(chosen == 'javafx_sdk') {
			inHtml = "<dd class='top'><a href=\""+ actionLink + cdsDownload[0][selIndex2] + "&OClick=Immediate\">";
			inHtml = inHtml + downloadNames[0] + "<\/a><\/dd>";
			//if(bodyId) inHtml = inHtml + "<dd>&nbsp;<\/dd>";
			inHtml = inHtml + "<dd class='top'><a href=\"" + actionLink + cdsDownload[1][selIndex2] + "&OClick=Immediate\">";
			inHtml = inHtml + downloadNames[1] + "<\/a><\/dd>";
			//if(bodyId) inHtml = inHtml + "<dd>&nbsp;<\/dd>";
		}

		var moreElement = document.getElementById('downloadMore');
		if(moreElement) {
			var divTag = document.createElement("div");
			divTag.innerHTML = inHtml;
			moreElement.appendChild(divTag);
		}

		if(bodyId) {
			if(platformId.indexOf('Windows') >= 0 || platformId.indexOf('Vista') >= 0) {
				var jdkDownload = document.getElementById('jdk-download');
				inHtml = "<dt>Download<\/dt><dd><a href=\"http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jdk-6u11-windows-1c-JPR@CDS-CDS_Developer&OClick=Immediate\" onclick=\"s_linkType='d';s_linkName='jdk-6u11-windows-i586-p.exe';s_linkTrackVars='events,products,eVar3,eVar8';s_linkTrackEvents='event7';s_events='event7';s_products='Download Products;Java SE Development Kit 6u11';s_eVar3='javafx.com';s_eVar8='jdk-6u11-windows-i586-p.exe';s_lnk=s_co(this);s_gs(s_account);\">JDK 6u11<\/a><\/dd>";
				var divTag = document.createElement("div");
				divTag.innerHTML = inHtml;
				jdkDownload.appendChild(divTag);
			}
		}

	}


