You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by as...@apache.org on 2014/07/06 16:34:24 UTC

svn commit: r1608207 - /openoffice/ooo-site/trunk/content/lt/download/download.js

Author: astepukonis
Date: Sun Jul  6 14:34:23 2014
New Revision: 1608207

URL: http://svn.apache.org/r1608207
Log:
CMS commit to ooo-site by astepukonis

Added:
    openoffice/ooo-site/trunk/content/lt/download/download.js   (with props)

Added: openoffice/ooo-site/trunk/content/lt/download/download.js
URL: http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/lt/download/download.js?rev=1608207&view=auto
==============================================================================
--- openoffice/ooo-site/trunk/content/lt/download/download.js (added)
+++ openoffice/ooo-site/trunk/content/lt/download/download.js Sun Jul  6 14:34:23 2014
@@ -0,0 +1,1273 @@
+/*
+ * Overview of all functions defined below
+ * ----------------------------------------------------
+ * function init			()
+ * function initVariables		()
+ * function getLanguage			()
+ * function fillOSSelection		()
+ * function fillLanguageSelection	()
+ * function fillVersionSelection	()
+ * function getOSSelection		()
+ * function getLanguageSelection	()
+ * function getVersionSelection		()
+ * function setOSSelection		()
+ * function setLanguageSelection	()
+ * function setVersionSelection		()
+ * function hideElements		()
+ * function showWindow			( target_link )
+ * function showErrorMessage		( error_text )
+ * function isLanguageSupported		()
+ * function checkForLinkExceptions	()
+ * function getLinkSelection		()
+ * function getPlatform			()
+ * function getReleaseMatrixPosition	()
+ * function getFileData			( version )
+ * function openItem			( itemid, uri )
+ * function debug			( location )
+ */
+
+/*
+ * Init function
+ * @param:  release_mode - The release mode (stable, beta, etc.) that the scriping should work with
+ * @return: None
+ */
+function init( release_mode ) {
+	// Set global variables.
+	initVariables( 1 );
+
+	// Fill the OS, language and version select boxes.
+	fillOSSelection();
+	fillLanguageSelection();
+	fillVersionSelection();
+
+	// Get the language and platform from the browser data.
+	getLanguage();
+	getPlatform();
+
+	// Set the recognized platform and language as default.
+	setOSSelection();
+	setLanguageSelection();
+	setVersionSelection();
+
+	
+	// When release mode = 2, it is a beta release. Otherwise assume "stable release" as default.
+	if( release_mode === 2 ) {
+		RELEASE_MODE = mode;
+	}
+
+	getLinkSelection();
+
+	return;
+}
+
+/*
+ * Define all global variables with default values
+ * @param:  init_all - Should all variables initialized or just a part?
+ * @return: None
+ */
+function initVariables( init_all ) {
+	// Define variables without "var" to make them globally available.
+
+	// The following are used in "download.js". and "index.html".
+
+	// All elements with ID in the sub-box.
+	element_ids_sub_box = [ "dl_rel_info", "dl_rel_notes", "dl_f_info", "dl_f_chk_keys", "space1", "dl_f_chk_asc",
+	"space2", "dl_f_chk_md5", "space3", "dl_f_chk_sha256", "dl_lp_info", "dl_lp_chk_keys", "space4", "dl_lp_chk_asc",
+	"space5", "dl_lp_chk_md5", "space6", "dl_lp_chk_sha256", "dl_hlp_img", "dl_hlp", "dl_chk_img", "dl_chk",
+	"dl_rpt_img", "dl_rpt" ];
+
+	// All elements with ID in the green and sub-box that have a link.
+	element_ids_links = [ "dl_f_link", "dl_lp_link", "dl_f_chk_keys", "dl_f_chk_asc", "dl_f_chk_md5", "dl_f_chk_sha256",
+	"dl_lp_chk_keys", "dl_lp_chk_asc", "dl_lp_chk_md5", "dl_lp_chk_sha256", "dl_hlp", "dl_chk", "dl_rpt" ];
+
+	// The following are used in "download.js" only.
+
+	// All global variables.
+	if( init_all === 1 ) {
+		RELEASE_MODE		= 1;	 // The release mode (1 = stable release (default), 2 = beta release, etc.).
+		LANG_ISO		= "";	 // The language as ISO code.
+		LANG_SEL		= "";	 // The selected language as ISO code from select box.
+		UI_PLATFORM_NO_SUP	= "";	 // The platform as readable string, if not supported.
+		PLATFORM_SEL		= "";	 // The selected platform from select box.
+		VERSION_SEL		= "";	 // The selected version from select box.
+	}
+
+	UI_PLATFORM			= "";	 // The platform as readable string.
+	PLATFORM			= "";	 // The platform in short form.
+	PLATFORM_FULL			= "";	 // The platform as part of the download URL (full install).
+	PLATFORM_LP			= "";	 // The platform as part of the download URL (langpack).
+	RELEASE_PLATFORM_POS_FULL	= -1;	 // The position of the platform in the release matrix array (full install).
+	RELEASE_PLATFORM_POS_LP		= -1;	 // The position of the platform in the release matrix array (langpack).
+	RELEASE_PLATFORM		= "";	 // The platform in the release matrix array.
+	RELEASE_LANG			= "";	 // The language specific data depending on LANG_ISO.
+	REL_TEXT			= "";	 // The release data (milestone, build ID, svn rev, release date).
+	REL_NOTES			= "";	 // The complete URL for the release notes (depends on version).
+	FILENAME_FULL			= "";	 // The complete filename of the download URL (full install).
+	FILENAME_LP			= "";	 // The complete filename of the download URL (langpack).
+	FILESIZE_FULL			= -1;	 // The filesize of the download file (full install).
+	FILESIZE_LP			= -1;	 // The filesize of the download file (langpack).
+	EXTENSION			= "";	 // The file extension of the download URL.
+	SOURCEFORGE_BASE_URL		= "";	 // The base URL for all binary files on Sourceforge.
+	SOURCEFORGE_PREV_URL		= "";	 // The base URL for all binary files (prev. version) on Sourceforge.
+	ASF_ARC_BASE_URL		= "";	 // The base URL for all checksum files on Apache Archive server.
+	ASF_ARC_PREV_URL		= "";	 // The base URL for all checksum files (prev. version) on Apache Archive server.
+	ASF_WIKI_URL			= "";	 // The base URL for all release notes on Apache Wiki.
+	LINK_FULL			= "";	 // The complete download URL (full install).
+	LINK_LP				= "";	 // The complete download URL (langpack).
+	LINK_CHK_KEYS			= "";	 // The KEYS file as download URL.
+	LINK_CHK_ASC_FULL		= "";	 // The ASC file as download URL (full install).
+	LINK_CHK_MD5_FULL		= "";	 // The MD5 file as download URL (full install).
+	LINK_CHK_SHA256_FULL		= "";	 // The SHA256 file as download URL (full install).
+	LINK_CHK_ASC_LP			= "";	 // The ASC file as download URL (langpack).
+	LINK_CHK_MD5_LP			= "";	 // The MD5 file as download URL (langpack).
+	LINK_CHK_SHA256_LP		= "";	 // The SHA256 file as download URL (langpack).
+	SHOW_SUB_BOX			= true;	 // Is the download URL OK to show the sub-box (true) or not (false)?
+	ERROR				= false; // Is the download URL in general OK (false) or not (true)?
+
+	return;
+}
+
+/*
+ * Get array and ISO code for language
+ * @param:  None
+ * @return: LANG_ISO - The language as ISO code
+ */
+function getLanguage() {
+	var language = "";
+
+	// If available, use the manual set ISO code (see "index.html") that overrides $LANG_ISO.
+	if( NL_LANG !== "" ) {
+		language = NL_LANG;
+
+	// Else if available, use the selected language from select box.
+	} else if( LANG_SEL !== "" ) {
+		language = LANG_SEL;
+
+	// Else try to recognize the language from browser data.
+	} else if( navigator.language ) {
+		language = navigator.language;
+	} else if( navigator.userLanguage ) {
+		language = navigator.userLanguage;
+	} else if( navigator.browserLanguage ) {
+		language = navigator.browserLanguage;
+	} else if( navigator.systemLanguage ) {
+		language = navigator.systemLanguage;
+	}
+
+	// Assign "en-US" as fall-back language if only "en" is set or nothing at all.
+	if( !language || language === "" || language == null || language === "en" ) {
+		language = "en-US";
+	}
+	// Assign "pt-PT" if only "pt" is set.
+	if( language === "pt" ) {
+		language = "pt-PT";
+	}
+
+	// Konqueror uses '_' where other browsers use '-'.
+	if( language.indexOf( "_" ) !== -1 ) {
+		// Change a contained '_' into a '-'.
+		language = language.split( "_" ).join( "-" );
+	}
+
+	language		= language.toLowerCase();	// Change the language into lower case.
+	var languageCode	= language.split( "-" )[ 0 ];	// Part before "-" is the language code.
+	var regionCode		= language.split( "-" )[ 1 ];	// Part behind "-" is the region code.
+	var thisLanguageSet	= languages[ languageCode ];	// Assign the complete language data of the language code.
+
+	if( thisLanguageSet == null ) {
+		// Assign "en-US" when the language code was not found inside array.
+		language	= "en-US";
+		languageCode	= "en";
+		regionCode	= "us";
+		thisLanguageSet	= languages[ languageCode ];
+	}
+
+	if( regionCode != null ) {
+		// Fix for Portuguese (European) downloads as they are named only "pt" without region code!
+		if( languageCode === "pt" && regionCode === "pt" ) {
+			language = languageCode;
+		}
+
+		// If an additional region code was found.
+		if( thisLanguageSet[ regionCode ] != null ) {
+			// Assign langCode-regionCode.
+			language     = languageCode + "-" + regionCode.toUpperCase();
+			thisLanguage = thisLanguageSet[ regionCode ];
+		} else {
+			// Choose the default languageCode.
+			var thisLanguage = thisLanguageSet[ "-" ];
+			if( languageCode === "en" ) {
+				// Special case: If language code is "en" then assign "en-US" for all "en-XX" cases.
+				language	= "en-US";
+				regionCode	= "us";
+				thisLanguageSet	= languages[ languageCode ];
+				thisLanguage	= thisLanguageSet[ regionCode ];
+			} else {
+				// Else assign the language code as language.
+				language	= languageCode;
+			}
+		}
+	} else {
+		// Choose the default for none given region code.
+		thisLanguage = thisLanguageSet[ "-" ];
+	}
+
+	LANG_ISO = language;
+	return LANG_ISO;
+}
+
+/*
+ * Set values into the <select> element for OS (select box)
+ * @param:  None
+ * @return: None
+ */
+function fillOSSelection() {
+	var selection_os = document.getElementById( "os" );
+	var option	 = "";
+
+	// Fill the <select> element until all OS's are used.
+	for( var i = 0, j = SEL_OS.length; i < j; i = i + 3 ) {
+		option       = document.createElement( "option" );
+		// Assign the platform abbreviation as index value.
+		option.value = SEL_OS[ i ];
+		// Assign the UI platform name.
+		option.text  = SEL_OS[ i + 1 ];
+		selection_os.appendChild( option );
+	}
+
+	return;
+}
+
+/*
+ * Set values into the <select> element for language (select box)
+ * @param:  None
+ * @return: None
+ */
+function fillLanguageSelection() {
+	var selection_language = document.getElementById( "language" );
+	var option	       = "";
+
+	// Fill the <select> element until all languages are used.
+	for( var i = 0, j = SEL_LANG.length; i < j; i = i + 2 ) {
+		option       = document.createElement( "option" );
+		// Assign the language ISO code as index value.
+		option.value = SEL_LANG[ i ];
+		// Assign the UI name like "English (Native) (ISO code)".
+		option.text  = SEL_LANG[ i + 1 ];
+		selection_language.appendChild( option );
+	}
+
+	return;
+}
+
+/*
+ * Set values into the <select> element for version (select box)
+ * @param:  None
+ * @return: None
+ */
+function fillVersionSelection() {
+	var selection_version = document.getElementById( "version" );
+	var option	      = "";
+
+	// Fill the <select> element until all versions are used.
+	for( var i = 0, j = SEL_VER.length; i < j; i = i + 2 ) {
+		option       = document.createElement( "option" );
+		// Assign the version as index value.
+		option.value = SEL_VER[ i ];
+		// Assign the UI version.
+		option.text  = SEL_VER[ i + 1 ];
+		selection_version.appendChild( option );
+	}
+
+	return;
+}
+
+/*
+ * Set value in the <select> element for OS (select box)
+ * @param:  None
+ * @return: PLATFORM_SEL - The platform as short code that was set as selected in the drop-down box
+ */
+function setOSSelection() {
+	// Depending on $PLATFORM assign the platform string of the release matrix.
+	var selection_os = document.getElementById( "os" );
+
+	// Set the recognized browser platform as default for the select box.
+	for( var i = 0, j = SEL_OS.length; i < j; i = i + 3 ) {
+		// If the platform was found, assign the found index to the select box.
+		if( SEL_OS[ i ] === PLATFORM ) {
+			selection_os.selectedIndex = i / 3;
+			break;
+		}
+	}
+
+	// If no selected platform for was set in the select box because it was not recognized from browser data,
+	// assign "Windows" as default.
+	if( selection_os.selectedIndex === 0 ) {
+		// Default: Assign "Windows".
+		for( var i = 0, j = SEL_OS.length; i < j; i = i + 3 ) {
+			// If the platform was found, assign the found index to the select box.
+			if( SEL_OS[ i ] === "Win_x86_install" ) {
+				selection_os.selectedIndex = i / 3;
+				break;
+			}
+		}
+	}
+
+	PLATFORM_SEL = selection_os.value;
+	return PLATFORM_SEL;
+}
+
+/*
+ * Set value in the <select> element for language (select box)
+ * @param:  None
+ * @return: LANG_SEL - The language as ISO code that was set as selected in the drop-down box
+ */
+function setLanguageSelection() {
+	// Depending on $LANG_ISO assign the language position of the release matrix.
+	var selection_language = document.getElementById( "language" );
+	var language_found     = false;
+
+	// Set the recognized browser language as default for the select box.
+	for( var i = 0, j = SEL_LANG.length; i < j; i = i + 2 ) {
+		// If the language was found, assign the found index to the select box.
+		if( SEL_LANG[ i ] === LANG_ISO ) {
+			selection_language.selectedIndex = i / 2;
+			language_found = true;
+			break;
+		}
+	}
+
+	// If no selected language was set in the select box because it was not recognized from browser data,
+	// assign "en-US" as default.
+	if( ! language_found ) {
+		// Default: Assign "en-US".
+		for( var i = 0, j = SEL_LANG.length; i < j; i = i + 2 ) {
+			// If the language was found, assign the found index to the select box.
+			if( SEL_LANG[ i ] === "en-US" ) {
+				selection_language.selectedIndex = i / 2;
+				break;
+			}
+		}
+	}
+
+	LANG_SEL = selection_language.value;
+	return LANG_SEL;
+}
+
+/*
+ * Set value in the <select> element for version (select box)
+ * @param:  None
+ * @return: VERSION_SEL - The version that was set as selected in the drop-down box
+ */
+function setVersionSelection() {
+	// Depending on $VERSION assign the version.
+	var selection_version = document.getElementById( "version" );
+
+	// Set the value of $VERSION as default for the select box.
+	for( var i = 0, j = SEL_VER.length; i < j; i = i + 2 ) {
+		// If the version was found, assign the found index to the select box.
+		if( SEL_VER[ i ] === VERSION ) {
+			selection_version.selectedIndex = i/2;
+			break;
+		}
+	}
+
+	// If no version was set as global variable,
+	// assign the most recent version as default.
+	if( selection_version.selectedIndex === 0 ) {
+		// Default: Assign "4.1.0".
+		for( var i = 0; i < SEL_VER.length; i = i + 2 ) {
+			// If the version was found, assign the found index to the select box.
+			if( SEL_VER[ i ] === "4.1.0" ) {
+				selection_version.selectedIndex = i / 2;
+				break;
+			}
+		}
+	}
+
+	VERSION_SEL = selection_version.value;
+	return VERSION_SEL;
+}
+
+/*
+ * Get values from the <select> element for OS (select box)
+ * @param:  None
+ * @return: PLATFORM_SEL - The platform as short code that was selected from the drop-down box
+ */
+function getOSSelection() {
+	var os_value = document.download.os.options[document.download.os.selectedIndex].value;
+
+	// Search through the <select> element until the chosen OS is found.
+	for( var i = 0, j = SEL_OS.length; i < j; i = i + 3 ) {
+		if( SEL_OS[ i ] === os_value ) {
+			PLATFORM_SEL	= SEL_OS[ i ];
+			UI_PLATFORM	= SEL_OS[ i + 1 ];
+			EXTENSION	= SEL_OS[ i + 2 ];
+			break;
+		}
+	}
+
+	PLATFORM = PLATFORM_SEL;
+	return PLATFORM_SEL;
+}
+
+/*
+ * Get values from the <select> element for language (select box)
+ * @param:  None
+ * @return: LANG_SEL - The language as ISO code that was selected from the drop-down box
+ */
+function getLanguageSelection() {
+	var language_value = document.download.language.options[document.download.language.selectedIndex].value;
+
+	// Search through the <select> element until the chosen language is found.
+	for( var i = 0, j = SEL_LANG.length; i < j; i = i + 2 ) {
+		if( SEL_LANG[ i ] === language_value ) {
+			LANG_SEL = language_value;
+			break;
+		}
+	}
+
+	LANG_ISO = LANG_SEL;
+	return LANG_SEL;
+}
+
+/*
+ * Get values from the <select> element for version (select box)
+ * @param:  None
+ * @return: VERSION_SEL - The version that was selected from the drop-down box
+ */
+function getVersionSelection() {
+	var version_value = document.download.version.options[document.download.version.selectedIndex].value;
+
+	// Search through the <select> element until the chosen version is found.
+	for( var i = 0, j = SEL_VER.length; i < j; i = i + 2 ) {
+		if( SEL_VER[ i ] === version_value ) {
+			VERSION_SEL = version_value;
+			break;
+		}
+	}
+
+	return VERSION_SEL;
+}
+
+/*
+ * Hide CSS style for all elements with ID to make them invisible
+ * @param:  None
+ * @return: None
+ */
+function hideElements() {
+	// Change CSS styles for all elements with ID in the green and sub-green colored boxes.
+	// Emtpy the values for all elements, make them invisible.
+	for( var i = 0, j = element_ids_sub_box.length; i < j; i++ ) {
+		document.getElementById( element_ids_sub_box[ i ] ).style.display = "none";
+	}
+
+	for( var i = 0, j = element_ids_links.length; i < j; i++ ) {
+		document.getElementById( element_ids_links[ i ] ).style.display	  = "none";
+	}
+
+	return;
+}
+
+/*
+ * Show a popup window
+ * @param:  target_link - The URL that should be opened as popup window
+ * @return: None
+ */
+function showWindow( target_link ) {
+	// Open a popup window with specific parameters to show the file from "target_link".
+ 	var popup_window = "";
+
+	popup_window = window.open( target_link, "_blank", "location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, titlebar=no, toolbar=no, left=100, top=250, width=800, height=550" );
+	window.focus();
+
+	return;
+}
+
+/*
+ * Show error message
+ * @param:  error_text - The text should should be shown as error message
+ * @return: ERROR      - Set the general error flag to "true"
+ */
+function showErrorMessage( error_text ) {
+	// The chosen items from select boxes lead to no download link, show an error message about reason and alternative.
+
+	// In general, hide the data for link, text and title of all elements.
+	hideElements();
+
+	// Now set again the values for all elements that should be shown with changed data.
+	document.getElementById( "dl_f_link"	).style.display	 = "inline";
+	document.getElementById( "dl_f_link"	).style.cursor	 = "not-allowed";
+	document.getElementById( "dl_f_link"	).href		 = "javascript:void( 0 )";
+	document.getElementById( "dl_f_link"	).innerHTML	 = l10n_download_full_link_error_text;
+	document.getElementById( "dl_f_link"	).title		 = l10n_download_full_link_error_title;
+	document.getElementById( "dl_lp_link"	).style.display	 = "inline";
+	document.getElementById( "dl_lp_link"	).style.cursor	 = "not-allowed";
+	document.getElementById( "dl_lp_link"	).href		 = "javascript:void( 0 )";
+	document.getElementById( "dl_lp_link"	).innerHTML	 = l10n_download_langpack_link_error_text;
+	document.getElementById( "dl_lp_link"	).title		 = l10n_download_langpack_link_error_title;
+
+	document.getElementById( "dl_err_img"   ).src		 = l10n_download_error_problem_img_src;
+	document.getElementById( "dl_err_img"   ).title		 = l10n_download_error_problem_img_title;
+	document.getElementById( "dl_err_img"   ).alt		 = l10n_download_error_problem_img_alt;
+	document.getElementById( "dl_err_img"	).style.display	 = "inline-block";
+	document.getElementById( "dl_err"	).innerHTML	 = "<br />" + error_text;
+	document.getElementById( "dl_err"	).style.fontSize = "1.2em";
+	document.getElementById( "dl_err"	).style.cursor	 = "default";
+	document.getElementById( "dl_err"	).style.display	 = "inline-block";
+
+	document.getElementById( "sub_box"	).className	 = "sub-green-sel_error";
+	document.getElementById( "sub_box"	).style.display	 = "block";
+
+	// Delete previously set string to get the possibility back to choose a different platform
+	// and then to assemble a new download link.
+	UI_PLATFORM_NO_SUP = "";
+	SHOW_SUB_BOX	   = true;
+	ERROR		   = true;
+	return ERROR;
+}
+
+/*
+ * Is flag set for chosen language (y/n)?
+ * @param:  None
+ * @return: ERROR - Depending on if the language is supported set the general error flag to "true" or "false"
+ */
+function isLanguageSupported() {
+	// Check the flag in "release_matrix.js", 'y' -> provide download link, 'n' -> redirect to alternative webpage.
+
+	if( VERSION_SEL === undefined || VERSION_SEL === "" ) {
+		VERSION_SEL = VERSION;
+	}
+
+	switch( VERSION_SEL ) {
+		case "4.1.0":
+			RELEASE_LANG = release_410[ LANG_ISO ][ 0 ];
+			break;
+		case "4.0.1":
+			RELEASE_LANG = release_401[ LANG_ISO ][ 0 ];
+			break;
+		case "4.0.0":
+			RELEASE_LANG = release_400[ LANG_ISO ][ 0 ];
+			break;
+		default:
+			RELEASE_LANG = "";
+			ERROR	     = true;
+	}
+
+	if( RELEASE_LANG[ 3 ] === 'y' ) {
+		ERROR = false;
+		return true;
+	} else {
+		ERROR = true;
+		return false;
+	}
+}
+
+/*
+ * Check links that should be assembled in getLinkSelection() for expections that do not lead to real download links
+ * @param:  None
+ * @return: None
+ */
+function checkForLinkExceptions() {
+	// If recognized resp. selected platform, language or version does not lead to a normal download link,
+	// show the none-availability to the user.
+
+	SHOW_SUB_BOX   = true;
+	ERROR	       = false;
+
+	// If language is not supported, show the none-availability to the user.
+	if( ! isLanguageSupported() ) {
+		// Show an error message that the chosen items do not lead to a download.
+
+		// If a customized string is not available in the "msg_prop_l10n_XX.js" file.
+		if( l10n_download_error_custom_4_text === "" ) {
+			// Show the default error text.
+			var error_text = "<b>" + l10n_download_error_problem_text + "</b>"
+					+ l10n_download_error_aoo_text + VERSION_SEL
+					+ l10n_download_error_not_available_for_text
+					+ "<b>" + RELEASE_LANG[ 1 ] + " (" + RELEASE_LANG[ 2 ] + ") (" + LANG_SEL + ")</b>."
+					+ "<br />"
+					+ "<b>" + l10n_download_error_solution_text + "</b>"
+					+ l10n_download_error_please_select_4_text;
+		} else {
+			// Show the customized error text.
+			var error_text = l10n_download_error_custom_4_text;
+		}
+
+		showErrorMessage( error_text );
+	}
+
+	// If the browser-guessed platform is not supported, show the none-availability to the user.
+	if( UI_PLATFORM_NO_SUP !== "" ) {
+		// Show an error message that the chosen items do not lead to a download.
+
+		// If a customized string is not available in the "msg_prop_l10n_XX.js" file.
+		if( l10n_download_error_custom_3_text === "" ) {
+			// Show the default error text.
+			var error_text = "<b>" + l10n_download_error_problem_text + "</b>"
+					+ l10n_download_error_aoo_text + VERSION_SEL
+					+ l10n_download_error_not_available_for_text
+					+ "<b>" + UI_PLATFORM_NO_SUP + "</b>."
+					+ "<br />"
+					+ "<b>" + l10n_download_error_solution_text + "</b>"
+					+ l10n_download_error_please_select_3_text;
+		} else {
+			// Show the customized error text.
+			var error_text = l10n_download_error_custom_3_text;
+		}
+
+		showErrorMessage( error_text );
+	}
+
+	// If version is '4.1.0' (or newer) and platform is 'Mac OS X <= 10.6', show the none-availability to the user.
+	if( VERSION_SEL === "4.1.0" && PLATFORM === "mac32" ) {
+		// Show an error message that the chosen items do not lead to a download.
+
+		// If a customized string is not available in the "msg_prop_l10n_XX.js" file.
+		if( l10n_download_error_custom_1_text === "" ) {
+			// Show the default error text.
+			var error_text = "<b>" + l10n_download_error_problem_text + "</b>"
+					+ l10n_download_error_aoo_text + VERSION_SEL
+					+ l10n_download_error_not_available_for_text
+					+ "<b>" + UI_PLATFORM + "</b>."
+					+ "<br />"
+					+ "<b>" + l10n_download_error_solution_text + "</b>"
+					+ l10n_download_error_please_select_1_text;
+		} else {
+			// Show the customized error text.
+			var error_text = l10n_download_error_custom_1_text;
+		}
+
+		showErrorMessage( error_text );
+	}
+
+	// If version is '4.0.1' (or older) and platform is 'Mac OS X >= 10.7', show the none-availability to the user.
+	if( ( VERSION_SEL === "4.0.1" || VERSION_SEL === "4.0.0" ) && PLATFORM === "mac64" ) {
+		// Show an error message that the chosen items do not lead to a download.
+
+		// If a customized string is not available in the "msg_prop_l10n_XX.js" file.
+		if( l10n_download_error_custom_2_text === "" ) {
+			// Show the default error text.
+			var error_text = "<b>" + l10n_download_error_problem_text + "</b>"
+					+ l10n_download_error_aoo_text + VERSION_SEL
+					+ l10n_download_error_not_available_for_text
+					+ "<b>" + UI_PLATFORM + "</b>."
+					+ "<br />"
+					+ "<b>" + l10n_download_error_solution_text + "</b>"
+					+ l10n_download_error_please_select_2_text;
+		} else {
+			// Show the customized error text.
+			var error_text = l10n_download_error_custom_2_text;
+		}
+
+		showErrorMessage( error_text );
+	}
+
+	// If version is '3.4.1', create a download link that leads to the "other-3.4.1.html" webpage.
+	if( VERSION_SEL === "3.4.1" ) {
+		// In general, hide the data for link, text and title of all elements.
+		hideElements();
+
+		// Set the values for the single download text button.
+		document.getElementById( "dl_f_link"	).href		= l10n_download_aoo341_link;
+		document.getElementById( "dl_f_link"	).innerHTML	= l10n_download_full_link_archive_text;
+		document.getElementById( "dl_f_link"	).title		= l10n_download_full_link_archive_title;
+		document.getElementById( "dl_f_link"	).style.cursor	= "pointer";
+		document.getElementById( "dl_f_link"	).style.display = "inline";
+		document.getElementById( "dl_lp_link"	).style.display = "none";
+		document.getElementById( "sub_box"	).style.display = "none";
+
+		SHOW_SUB_BOX = false;
+	}
+
+	// If platform is 'other', create a download link that leads to the Porting webpage.
+	if( PLATFORM_SEL === "other" ) {
+		// In general, hide the data for link, text and title of all elements.
+		hideElements();
+
+		// Set the values for the single download text button.
+		document.getElementById( "dl_f_link"	).href		= l10n_download_porting_link;
+		document.getElementById( "dl_f_link"	).innerHTML	= l10n_download_full_link_porting_text;
+		document.getElementById( "dl_f_link"	).title		= l10n_download_full_link_porting_title;
+		document.getElementById( "dl_f_link"	).style.cursor	= "pointer";
+		document.getElementById( "dl_f_link"	).style.display = "inline";
+		document.getElementById( "dl_lp_link"	).style.display = "none";
+		document.getElementById( "sub_box"	).style.display = "none";
+
+		SHOW_SUB_BOX = false;
+	}
+
+	// If version is 'older', create a download link that leads to the archive webpage.
+	if( VERSION_SEL === "older" ) {
+		// In general, hide the data for link, text and title of all elements.
+		hideElements();
+
+		// Set the values for the single download text button.
+		document.getElementById( "dl_f_link"	).href		= l10n_download_archive_link;
+		document.getElementById( "dl_f_link"	).innerHTML	= l10n_download_full_link_archive_text;
+		document.getElementById( "dl_f_link"	).title		= l10n_download_full_link_archive_title;
+		document.getElementById( "dl_f_link"	).style.cursor	= "pointer";
+		document.getElementById( "dl_f_link"	).style.display = "inline";
+		document.getElementById( "dl_lp_link"	).style.display = "none";
+		document.getElementById( "sub_box"	).style.display = "none";
+
+		SHOW_SUB_BOX = false;
+	}
+
+	return;
+}
+
+/*
+ * Get link to mirror system for download file and checksum file
+ * @param:  None
+ * @return: None
+ */
+function getLinkSelection() {
+	// Reset all variables that could have been set until now.
+	initVariables( 0 );
+
+	// Get the selected data from the select boxes.
+	getOSSelection();
+	getLanguageSelection();
+	getVersionSelection();
+
+	// First check for expections that do not lead to real download links.
+	checkForLinkExceptions();
+
+	// If the selected options lead to no download URL, should the sub-box shown anyway?
+	// Yes when SHOW_SUB_BOX = "true" and ERROR = "false".
+	if( SHOW_SUB_BOX && ! ERROR ) {
+		// Assemble the filenames and text for download and checksums.
+		getReleaseMatrixPosition();
+		getFileData( VERSION_SEL );
+
+		SOURCEFORGE_BASE_URL = SOURCEFORGE + VERSION_SEL + "/binaries/";
+		ASF_ARC_BASE_URL     = ASF_ARC     + VERSION_SEL;
+
+		// Assign the file name (column 3) from the release matrix of language and platform.
+		LINK_FULL	     = SOURCEFORGE_BASE_URL		  + LANG_SEL + "/" + FILENAME_FULL  + "/download";
+		LINK_LP		     = SOURCEFORGE_BASE_URL		  + LANG_SEL + "/" + FILENAME_LP    + "/download";
+
+		LINK_CHK_KEYS	     = "http://people.apache.org/keys/group/openoffice.asc";
+		LINK_CHK_ASC_FULL    = ASF_ARC_BASE_URL  + "/binaries/"   + LANG_SEL + "/" + FILENAME_FULL + ".asc";
+		LINK_CHK_MD5_FULL    = ASF_ARC_BASE_URL  + "/binaries/"   + LANG_SEL + "/" + FILENAME_FULL + ".md5";
+		LINK_CHK_SHA256_FULL = ASF_ARC_BASE_URL  + "/binaries/"   + LANG_SEL + "/" + FILENAME_FULL + ".sha256";
+
+		LINK_CHK_ASC_LP	     = ASF_ARC_BASE_URL  + "/binaries/"   + LANG_SEL + "/" + FILENAME_LP   + ".asc";
+		LINK_CHK_MD5_LP	     = ASF_ARC_BASE_URL  + "/binaries/"   + LANG_SEL + "/" + FILENAME_LP   + ".md5";
+		LINK_CHK_SHA256_LP   = ASF_ARC_BASE_URL  + "/binaries/"   + LANG_SEL + "/" + FILENAME_LP   + ".sha256";
+
+		SHOW_SUB_BOX	     = true;
+		ERROR		     = false;
+
+		// Set the values for both download text buttons and set the focus to the "full install".
+		document.getElementById( "dl_f_link"	    ).href	= LINK_FULL;
+		document.getElementById( "dl_f_link"	    ).innerHTML	= l10n_download_full_link_text;
+		document.getElementById( "dl_f_link"	    ).title	= l10n_download_full_link_title + FILENAME_FULL;
+		document.getElementById( "dl_f_link"	    ).focus()
+		document.getElementById( "dl_lp_link"	    ).href	= LINK_LP;
+		document.getElementById( "dl_lp_link"	    ).innerHTML	= l10n_download_langpack_link_text;
+		document.getElementById( "dl_lp_link"	    ).title	= l10n_download_langpack_link_title + FILENAME_LP;
+
+		// Set the values in the sub-box for the 3 text lines.
+		document.getElementById( "dl_rel_info"      ).innerHTML	= "<b>" + l10n_download_rel_info_headline_text
+									+ "</b> " + REL_TEXT + " | ";
+		document.getElementById( "dl_rel_notes"	    ).href	= REL_NOTES;
+		document.getElementById( "dl_rel_notes"	    ).innerHTML	= l10n_download_rel_notes_text;
+		document.getElementById( "dl_rel_notes"	    ).title	= l10n_download_rel_notes_title + VERSION_SEL;
+		document.getElementById( "dl_f_info"	    ).innerHTML = "<b>" + l10n_download_headline_full_text + "</b>"
+									+ l10n_download_filesize_text + FILESIZE_FULL
+									+ l10n_download_megabyte_text + " | "
+									+ l10n_download_checksum_headline_text;
+		document.getElementById( "dl_f_chk_keys"    ).href	= LINK_CHK_KEYS;
+		document.getElementById( "dl_f_chk_keys"    ).innerHTML	= l10n_download_checksum_keys_text;
+		document.getElementById( "dl_f_chk_keys"    ).title	= l10n_download_checksum_keys_title;
+		document.getElementById( "space1"	    ).innerHTML	= " , ";
+		document.getElementById( "dl_f_chk_asc"	    ).href	= LINK_CHK_ASC_FULL;
+		document.getElementById( "dl_f_chk_asc"	    ).innerHTML	= l10n_download_checksum_asc_text;
+		document.getElementById( "dl_f_chk_asc"	    ).title	= l10n_download_checksum_asc_title + FILENAME_FULL;
+		document.getElementById( "space2"	    ).innerHTML	= " , ";
+		document.getElementById( "dl_f_chk_md5"	    ).href	= LINK_CHK_MD5_FULL;
+		document.getElementById( "dl_f_chk_md5"	    ).innerHTML	= l10n_download_checksum_md5_text;
+		document.getElementById( "dl_f_chk_md5"	    ).title	= l10n_download_checksum_md5_title + FILENAME_FULL;
+		document.getElementById( "space3"	    ).innerHTML	= " , ";
+		document.getElementById( "dl_f_chk_sha256"  ).href	= LINK_CHK_SHA256_FULL;
+		document.getElementById( "dl_f_chk_sha256"  ).innerHTML	= l10n_download_checksum_sha256_text;
+		document.getElementById( "dl_f_chk_sha256"  ).title	= l10n_download_checksum_sha256_title + FILENAME_FULL;
+		document.getElementById( "dl_lp_info"	    ).innerHTML	= "<b>" + l10n_download_headline_langpack_text
+									+ "</b>" + l10n_download_filesize_text
+									+ FILESIZE_LP + l10n_download_megabyte_text
+									+ " | " + l10n_download_checksum_headline_text;
+		document.getElementById( "dl_lp_chk_keys"   ).href	= LINK_CHK_KEYS;
+		document.getElementById( "dl_lp_chk_keys"   ).innerHTML	= l10n_download_checksum_keys_text;
+		document.getElementById( "dl_lp_chk_keys"   ).title	= l10n_download_checksum_keys_title;
+		document.getElementById( "space4"	    ).innerHTML	= " , ";
+		document.getElementById( "dl_lp_chk_asc"    ).href	= LINK_CHK_ASC_LP;
+		document.getElementById( "dl_lp_chk_asc"    ).innerHTML	= l10n_download_checksum_asc_text;
+		document.getElementById( "dl_lp_chk_asc"    ).title	= l10n_download_checksum_asc_title + FILENAME_LP;
+		document.getElementById( "space5"	    ).innerHTML	= " , ";
+		document.getElementById( "dl_lp_chk_md5"    ).href	= LINK_CHK_MD5_LP;
+		document.getElementById( "dl_lp_chk_md5"    ).innerHTML	= l10n_download_checksum_md5_text;
+		document.getElementById( "dl_lp_chk_md5"    ).title	= l10n_download_checksum_md5_title + FILENAME_LP;
+		document.getElementById( "space6"	    ).innerHTML	= " , ";
+		document.getElementById( "dl_lp_chk_sha256" ).href	= LINK_CHK_SHA256_LP;
+		document.getElementById( "dl_lp_chk_sha256" ).innerHTML	= l10n_download_checksum_sha256_text;
+		document.getElementById( "dl_lp_chk_sha256" ).title	= l10n_download_checksum_sha256_title + FILENAME_LP;
+
+		// Set the values in the sub-box below the 3 text lines.
+		document.getElementById( "dl_hlp_img"	    ).src	= l10n_download_help_img_src;
+		document.getElementById( "dl_hlp_img"	    ).title	= l10n_download_help_img_title;
+		document.getElementById( "dl_hlp_img"	    ).alt	= l10n_download_help_img_alt;
+		document.getElementById( "dl_hlp"	    ).href	= l10n_download_help_link;
+		document.getElementById( "dl_hlp"	    ).innerHTML	= l10n_download_help_text;
+		document.getElementById( "dl_hlp"	    ).title	= l10n_download_help_title;
+		document.getElementById( "dl_chk_img"	    ).src	= l10n_download_checksum_img_src;
+		document.getElementById( "dl_chk_img"	    ).title	= l10n_download_checksum_img_title;
+		document.getElementById( "dl_chk_img"	    ).alt	= l10n_download_checksum_img_alt;
+		document.getElementById( "dl_chk"	    ).href	= l10n_download_checksum_link;
+		document.getElementById( "dl_chk"	    ).innerHTML	= l10n_download_checksum_text;
+		document.getElementById( "dl_chk"	    ).title	= l10n_download_checksum_title;
+		document.getElementById( "dl_rpt_img"	    ).src	= l10n_download_report_img_src;
+		document.getElementById( "dl_rpt_img"	    ).title	= l10n_download_report_img_title;
+		document.getElementById( "dl_rpt_img"	    ).alt	= l10n_download_report_img_alt;
+		document.getElementById( "dl_rpt"	    ).href	= l10n_download_report_link;
+		document.getElementById( "dl_rpt"	    ).innerHTML	= l10n_download_report_text;
+		document.getElementById( "dl_rpt"	    ).title	= l10n_download_report_title;
+
+		// Hide the CSS styles for the elements in the sub-green colored boxes.
+		document.getElementById( "sub_box"	    ).className	       = "sub-green-sel";
+		document.getElementById( "dl_err_img"	    ).style.display    = "none";
+		document.getElementById( "dl_err"	    ).style.display    = "none";
+
+		// Change CSS styles for all elements with ID in the green and sub-green colored boxes.
+		// Set the cursor style for elements to default and make the elements visible.
+		for( var i = 0, j = element_ids_sub_box.length; i < j; i++ ) {
+			document.getElementById( element_ids_sub_box[ i ] ).style.display = "inline";
+			document.getElementById( element_ids_sub_box[ i ] ).style.cursor  = "default";
+		}
+
+		// Set the cursor style for elements with links to pointer and make the elements visible.
+		for( var i = 0, j = element_ids_links.length; i < j; i++ ) {
+			document.getElementById( element_ids_links[ i ] ).style.display	  = "inline";
+			document.getElementById( element_ids_links[ i ] ).style.cursor	  = "pointer";
+		}
+
+		// Set the cursor style for the 3 links with icon to a help sign.
+		document.getElementById( "dl_hlp_img"	    ).style.cursor     = "help";
+		document.getElementById( "dl_hlp"	    ).style.cursor     = "help";
+		document.getElementById( "dl_chk_img"	    ).style.cursor     = "help";
+		document.getElementById( "dl_chk"	    ).style.cursor     = "help";
+		document.getElementById( "dl_rpt_img"	    ).style.cursor     = "help";
+		document.getElementById( "dl_rpt"	    ).style.cursor     = "help";
+
+		// Make the sub-box and therefore all elements visible.
+		document.getElementById( "sub_box"	    ).style.display    = "block";
+	}
+
+	return;
+}
+
+/*
+ * Get platform of browser
+ * @param:  None
+ * @return: None
+ */
+function getPlatform() {
+	// For more help or data see: "http://www.useragentstring.com".
+
+	if( navigator.appVersion ) {
+		var av	   = navigator.appVersion.toLowerCase();	// Get the application version in lower case.
+	}
+	if( navigator.platform ) {
+		var os	   = navigator.platform.toLowerCase();		// Get the platform string in lower case.
+	}
+	if( navigator.userAgent ) {
+		var ua	   = navigator.userAgent.toLowerCase();		// Get the user agent string in lower case.
+	}
+	if( navigator.vendor ) {
+		var ve	   = navigator.vendor.toLowerCase();		// Get the vendor string in lower case.
+	}
+
+	UI_PLATFORM	   = "";					// Delete previously set string.
+	UI_PLATFORM_NO_SUP = "";					// Delete previously set string.
+	PLATFORM	   = "";					// Delete previously set string.
+	EXTENSION	   = "";					// Delete previously set string.
+
+	// Add ECMA262-5 Array methods if not supported natively.
+	// To workaround that MSIE 8 and older do not support this function.
+	if( !( 'indexOf' in Array.prototype ) ) {
+		Array.prototype.indexOf= function( find, i ) {		// 'i' is an optional parameter.
+			if( i === undefined ) {
+				i = 0;
+			}
+			if( i < 0 ) {
+				i+= this.length;
+			}
+			if( i < 0 ) {
+				i = 0;
+			}
+			for( var n = this.length; i < n; i++ ) {
+				if( i in this && this[ i ] === find ) {
+					return i;
+				}
+			}
+			return -1;
+		};
+	}
+
+	// If the browser's user agent string is set with something, try to recognize its content.
+	if( ua !== "" ) {
+		// Recognized but *not supported* platforms/OS, set $UI_PLATFORM_NO_SUP to show it to the user.
+
+		// Mobile devices.
+		if( ve ) {
+		    if( ua.indexOf( "android"		) !== -1 )
+			if( ua.indexOf( "nexus"		) !== -1 &&
+			    ve.indexOf( "google"	) !== -1 )	UI_PLATFORM_NO_SUP	= "Google Nexus";
+		}
+
+		if( ua.indexOf( "android"		) !== -1 ) {
+		    if( ua.indexOf( "mobile"		) !== -1 )	UI_PLATFORM_NO_SUP	= "Mobile Devices (Android)";
+		}
+
+		if( os.indexOf( "arm"			) !== -1 )	UI_PLATFORM_NO_SUP	= "Mobile Devices (ARM processor)";
+		if( ua.indexOf( "blackberry"		) !== -1 )	UI_PLATFORM_NO_SUP	= "Blackberry Smartphones";
+		if( ua.indexOf( "brew"			) !== -1 )	UI_PLATFORM_NO_SUP	= "Smartphones (BREW)";
+		if( ua.indexOf( "ce.net"		) !== -1 )	UI_PLATFORM_NO_SUP	= "Mobile Phones (Windows CE)";
+		if( ua.indexOf( "galaxy"		) !== -1 )	UI_PLATFORM_NO_SUP	= "Samsung Galaxy";
+		if( ua.indexOf( "hiptop"		) !== -1 )	UI_PLATFORM_NO_SUP	= "Smartphones (Hiptop)";
+		if( ua.indexOf( "htc"			) !== -1 )	UI_PLATFORM_NO_SUP	= "HTC Mobile Devices";
+		if( ua.indexOf( "ipad"			) !== -1 ||
+		    ua.indexOf( "iphone"		) !== -1 ||
+		    ua.indexOf( "ipod"			) !== -1 )	UI_PLATFORM_NO_SUP	= "Apple iPhone/iPad/iPod";
+		if( ua.indexOf( "kindle"		) !== -1 )	UI_PLATFORM_NO_SUP	= "Amazon Kindle";
+		if( ua.indexOf( "lg"			) !== -1 )	UI_PLATFORM_NO_SUP	= "LG Mobile Devices";
+		if( ua.indexOf( "nokia"			) !== -1 )	UI_PLATFORM_NO_SUP	= "Mobile Phones (Nokia)";
+		if( ua.indexOf( "palm"			) !== -1 )	UI_PLATFORM_NO_SUP	= "Mobile Phones (Palm OS)";
+		if( ua.indexOf( "pike"			) !== -1 )	UI_PLATFORM_NO_SUP	= "Mobile Phones (Pike)";
+		if( ua.indexOf( "s60"	        	) !== -1 )	UI_PLATFORM_NO_SUP	= "Mobile Phones (S60)";
+		if( ua.indexOf( "sonyericsson"		) !== -1 )	UI_PLATFORM_NO_SUP	= "Sony/Ericsson Mobile Devices";
+		if( ua.indexOf( "symbian"		) !== -1 )	UI_PLATFORM_NO_SUP	= "Mobile Phones (Symbian OS)";
+		if( ua.indexOf( "symbos"		) !== -1 )	UI_PLATFORM_NO_SUP	= "Mobile Phones (Symbian OS)";
+		if( ua.indexOf( "webos"			) !== -1 )	UI_PLATFORM_NO_SUP	= "Mobile Phones (Palm webOS)";
+		if( ua.indexOf( "widerweb"		) !== -1 )	UI_PLATFORM_NO_SUP	= "Mobile Phones (WiderWeb)";
+		if( os.indexOf( "win"			) !== -1 ||
+		    os.indexOf( "windows"		) !== -1 ) {
+			if( ua.indexOf( "mobile"	) !== -1 ||
+			    ua.indexOf( "phone"		) !== -1 )	UI_PLATFORM_NO_SUP	= "Smartphones (Windows Phone)";
+		}
+
+		// Other platforms.
+		if( os.indexOf( "aix"			) !== -1 )	UI_PLATFORM_NO_SUP	= "IBM AIX";
+		if( os.indexOf( "alphaserver"		) !== -1 )	UI_PLATFORM_NO_SUP	= "AlphaServer";
+		if( os.indexOf( "amiga"			) !== -1 )	UI_PLATFORM_NO_SUP	= "AmigaOS";
+		if( os.indexOf( "darwin"		) !== -1 )	UI_PLATFORM_NO_SUP	= "Darwin";
+		if( os.indexOf( "dragonfly"		) !== -1 )	UI_PLATFORM_NO_SUP	= "DragonFly BSD";
+		if( os.indexOf( "freebsd"		) !== -1 )	UI_PLATFORM_NO_SUP	= "FreeBSD (PKG)";
+		if( os.indexOf( "irix"			) !== -1 )	UI_PLATFORM_NO_SUP	= "IRIX";
+		if( os.indexOf( "netbsd"		) !== -1 )	UI_PLATFORM_NO_SUP	= "NetBSD";
+		if( ua.indexOf( "nintendo"		) !== -1 )	UI_PLATFORM_NO_SUP	= "Nintendo Game Console";
+		if( os.indexOf( "openbsd"		) !== -1 )	UI_PLATFORM_NO_SUP	= "OpenBSD";
+		if( os.indexOf( "os/2"			) !== -1 )	UI_PLATFORM_NO_SUP	= "OS/2";
+		if( os.indexOf( "pcbsd"			) !== -1 )	UI_PLATFORM_NO_SUP	= "PC-BSD";
+		if( ua.indexOf( "playstation"		) !== -1 )	UI_PLATFORM_NO_SUP	= "Sony Playstation";
+		if( ua.indexOf( "psp"			) !== -1 )	UI_PLATFORM_NO_SUP	= "Sony Playstation Portable";
+		if( os.indexOf( "qnx"			) !== -1 )	UI_PLATFORM_NO_SUP	= "QNX";
+		if( os.indexOf( "vms"			) !== -1 )	UI_PLATFORM_NO_SUP	= "OpenVMS";
+		if( ua.indexOf( "wii"			) !== -1 )	UI_PLATFORM_NO_SUP	= "Nintendo Wii Game Console";
+		if( os.indexOf( "x11"			) !== -1 )	UI_PLATFORM_NO_SUP	= "unknown OS (X11 support)";
+
+		// Legacy, no longer supported platforms.
+		if( ua.indexOf( "power_pc"		) !== -1 ||
+		    ua.indexOf( "ppc"			) !== -1 )	UI_PLATFORM_NO_SUP	= "Mac OS PPC (DMG)";
+		if( ua.indexOf( "sun4u"			) !== -1 )	UI_PLATFORM_NO_SUP	= "Solaris SPARC (PKG)";
+		if( os.indexOf( "sunos"			) !== -1 )	UI_PLATFORM_NO_SUP	= "Solaris x86 (PKG)";
+
+		// If $UI_PLATFORM_NO_SUP is already filled, something was recognized and no more work is needed.
+		if( UI_PLATFORM_NO_SUP !== "" ) {
+			ERROR = true;
+			return UI_PLATFORM_NO_SUP;
+		}
+
+		// Recognized and *supported* platforms/OS, set $UI_PLATFORM to show it to the user.
+
+		// Windows?
+		if( os.indexOf( "win"			) !== -1 ||
+		    os.indexOf( "windows"		) !== -1 ) {	UI_PLATFORM	= "Windows (EXE)";
+									PLATFORM	= "win32";
+									EXTENSION	= ".exe";
+		}
+
+		// Linux: x86 or x86-64, DEB or RPM?
+		if( os.indexOf( "linux"			) !== -1 ) {
+			// 32-bit: DEB or RPM?
+			if( os.indexOf( "x86"		) !== -1 ||
+			    os.indexOf( "i686"		) !== -1 ||
+			    os.indexOf( "i586"		) !== -1 ||
+			    os.indexOf( "i486"		) !== -1 ||
+			    os.indexOf( "i386"		) !== -1 ||
+			    av.indexOf( "x86"		) !== -1 ||
+			    av.indexOf( "i686"		) !== -1 ||
+			    av.indexOf( "i586"		) !== -1 ||
+			    av.indexOf( "i486"		) !== -1 ||
+			    av.indexOf( "i386"		) !== -1 ) {	UI_PLATFORM	= "Linux 32-bit (x86) (RPM)";
+									PLATFORM	= "lnx32r";
+									EXTENSION	= ".tar.gz";
+			     if( ua.indexOf( "debian"	 ) !== -1 ||
+				 ua.indexOf( "iceweasel" ) !== -1 ||
+				 ua.indexOf( "ubuntu"	 ) !== -1 ) {	UI_PLATFORM	= "Linux Debian 32-bit (x86) (DEB)";
+									PLATFORM	= "lnx32d";
+									EXTENSION	= ".tar.gz";
+			     }
+			}
+
+			// 64-bit: DEB or RPM?
+			if( os.indexOf( "_64"		) !== -1 ||
+			    os.indexOf( "-64"		) !== -1 ||
+			    os.indexOf( "x64"		) !== -1 ||
+			    os.indexOf( "amd64"		) !== -1 ||
+			    av.indexOf( "_64"		) !== -1 ||
+			    av.indexOf( "-64"		) !== -1 ||
+			    av.indexOf( "x64"		) !== -1 ||
+			    av.indexOf( "amd64"		) !== -1 ) {	UI_PLATFORM	= "Linux 64-bit (x86-64) (RPM)";
+									PLATFORM	= "lnx64r";
+									EXTENSION	= ".tar.gz";
+			     if( ua.indexOf( "debian"	 ) !== -1 ||
+				 ua.indexOf( "iceweasel" ) !== -1 ||
+				 ua.indexOf( "ubuntu"	 ) !== -1 ) {	UI_PLATFORM	= "Linux Debian 64-bit (x86-64) (DEB)";
+									PLATFORM	= "lnx64d";
+									EXTENSION	= ".tar.gz";
+			     }
+			}
+		}
+
+		// Mac OS X?
+		if( os.indexOf( "mac"			) !== -1 ) {	UI_PLATFORM	= "OS X 64-bit (x86-64) (DMG)";
+									PLATFORM	= "mac64";
+									EXTENSION	= ".dmg";
+			// OS X: 10.6 or older?
+			if( ua.indexOf( "10.6"		) !== -1 ||
+			    ua.indexOf( "10_6"		) !== -1 ||
+			    ua.indexOf( "10.5"		) !== -1 ||
+			    ua.indexOf( "10_5"		) !== -1 ||
+			    ua.indexOf( "10.4"		) !== -1 ||
+			    ua.indexOf( "10_4"		) !== -1 ||
+			    ua.indexOf( "10.3"		) !== -1 ||
+			    ua.indexOf( "10_3"		) !== -1 ) {	UI_PLATFORM	= "Mac OS X (Version <= 10.6)";
+									PLATFORM	= "mac32";
+			}
+		} 
+	} 
+
+	// If nothing was recognized until now, set $UI_PLATFORM_NO_SUP to show it to the user.
+	if( UI_PLATFORM === "" ) {
+		UI_PLATFORM_NO_SUP = l10n_download_unknown_platform_text;
+		ERROR		   = true;
+	}
+
+	return;
+}
+
+/*
+ * Get positions of platform in release matrix
+ * @param:  None
+ * @return: None
+ */
+function getReleaseMatrixPosition() {
+	// Depending on $PLATFORM, assign the platform position from the release matrix.
+	switch( PLATFORM ) {
+		case "lnx64d":
+			RELEASE_PLATFORM_POS_FULL = 1;
+			RELEASE_PLATFORM_POS_LP	  = 2;
+			PLATFORM_FULL		  = "Linux_x86-64_install-deb";
+			PLATFORM_LP		  = "Linux_x86-64_langpack-deb";
+			break;
+		case "lnx64r":
+			RELEASE_PLATFORM_POS_FULL = 3;
+			RELEASE_PLATFORM_POS_LP	  = 4;
+			PLATFORM_FULL		  = "Linux_x86-64_install-rpm";
+			PLATFORM_LP		  = "Linux_x86-64_langpack-rpm";
+			break;
+		case "lnx32d":
+			RELEASE_PLATFORM_POS_FULL = 5;
+			RELEASE_PLATFORM_POS_LP	  = 6;
+			PLATFORM_FULL		  = "Linux_x86_install-deb";
+			PLATFORM_LP		  = "Linux_x86_langpack-deb";
+			break;
+		case "lnx32r":
+			RELEASE_PLATFORM_POS_FULL = 7;
+			RELEASE_PLATFORM_POS_LP	  = 8;
+			PLATFORM_FULL		  = "Linux_x86_install-rpm";
+			PLATFORM_LP		  = "Linux_x86_langpack-rpm";
+			break;
+		case "mac64":
+			RELEASE_PLATFORM_POS_FULL = 9;
+			RELEASE_PLATFORM_POS_LP	  = 10;
+			PLATFORM_FULL		  = "MacOS_x86-64_install";
+			PLATFORM_LP		  = "MacOS_x86-64_langpack";
+			break;
+		case "mac32":
+			RELEASE_PLATFORM_POS_FULL = 9;
+			RELEASE_PLATFORM_POS_LP	  = 10;
+			PLATFORM_FULL		  = "MacOS_x86_install";
+			PLATFORM_LP		  = "MacOS_x86_langpack";
+			break;
+		case "win32":
+			RELEASE_PLATFORM_POS_FULL = 11;
+			RELEASE_PLATFORM_POS_LP	  = 12;
+			PLATFORM_FULL		  = "Win_x86_install";
+			PLATFORM_LP		  = "Win_x86_langpack";
+			break;
+		default:
+			RELEASE_PLATFORM_POS_FULL = -1;
+			RELEASE_PLATFORM_POS_LP	  = -1;
+			ERROR			  = true;
+	}
+
+	return;
+}
+
+/*
+ * Get file name for download file
+ * @param:  version - The version to use to get the file data
+ * @return: None
+ */
+function getFileData( version ) {
+	// Depending on $ver, a different release matrix has to be used to assemble the download filenames.
+	switch( version ) {
+		case "4.1.0":
+			// Assign all values from the release matrix of language and platform.
+			RELEASE_PLATFORM = release_410[ LANG_ISO ][ RELEASE_PLATFORM_POS_FULL ];
+
+			// Assemble filename: Product name + version + platform as URL part + language ISO + file extension.
+			FILENAME_FULL	 = "Apache_OpenOffice_" + version + "_" + PLATFORM_FULL + "_" + LANG_ISO + EXTENSION;
+			FILENAME_LP	 = "Apache_OpenOffice_" + version + "_" + PLATFORM_LP   + "_" + LANG_ISO + EXTENSION;
+
+			// Assign the file size (column 2) from the release matrix of language and platform.
+			FILESIZE_FULL	 = release_410[ LANG_ISO ][ RELEASE_PLATFORM_POS_FULL ][ 1 ];
+			FILESIZE_LP	 = release_410[ LANG_ISO ][ RELEASE_PLATFORM_POS_LP   ][ 1 ];
+
+			// Assign all values from the release data.
+			REL_TEXT	 = 	   l10n_download_rel_info_milestone_text + release_410[ "src" ][ 1 ][ 0 ]
+					 + " | " + l10n_download_rel_info_buildid_text   + release_410[ "src" ][ 1 ][ 1 ]
+					 + " | " + l10n_download_rel_info_svn_text       + release_410[ "src" ][ 1 ][ 2 ]
+					 + " | " + l10n_download_rel_info_rel_date_text  + release_410[ "src" ][ 1 ][ 3 ];
+
+			// Assign the link for release notes, depending on the version.
+			REL_NOTES	 = l10n_download_rel_notes_aoo410_link;
+			break;
+		case "4.0.1":
+			// Assign all values from the release matrix of language and platform.
+			RELEASE_PLATFORM = release_401[ LANG_ISO ][ RELEASE_PLATFORM_POS_FULL ];
+
+			// Assemble filename: Product name + version + platform as URL part + language ISO + file extension.
+			FILENAME_FULL	 = "Apache_OpenOffice_" + version + "_" + PLATFORM_FULL + "_" + LANG_ISO + EXTENSION;
+			FILENAME_LP	 = "Apache_OpenOffice_" + version + "_" + PLATFORM_LP   + "_" + LANG_ISO + EXTENSION;
+
+			// Assign the file size (column 2) from the release matrix of language and platform.
+			FILESIZE_FULL	 = release_401[ LANG_ISO ][ RELEASE_PLATFORM_POS_FULL ][ 1 ];
+			FILESIZE_LP	 = release_401[ LANG_ISO ][ RELEASE_PLATFORM_POS_LP   ][ 1 ];
+
+			// Assign all values from the release data.
+			REL_TEXT	 = 	   l10n_download_rel_info_milestone_text + release_401[ "src" ][ 1 ][ 0 ]
+					 + " | " + l10n_download_rel_info_buildid_text   + release_401[ "src" ][ 1 ][ 1 ]
+					 + " | " + l10n_download_rel_info_svn_text       + release_401[ "src" ][ 1 ][ 2 ]
+					 + " | " + l10n_download_rel_info_rel_date_text  + release_401[ "src" ][ 1 ][ 3 ];
+
+			// Assign the link for release notes, depending on the version.
+			REL_NOTES	 = l10n_download_rel_notes_aoo401_link;
+			break;
+		case "4.0.0":
+			// Assign all values from the release matrix of language and platform.
+			RELEASE_PLATFORM = release_400[ LANG_ISO ][ RELEASE_PLATFORM_POS_FULL ];
+
+			// Assemble filename: Product name + version + platform as URL part + language ISO + file extension.
+			FILENAME_FULL	 = "Apache_OpenOffice_" + version + "_" + PLATFORM_FULL + "_" + LANG_ISO + EXTENSION;
+			FILENAME_LP	 = "Apache_OpenOffice_" + version + "_" + PLATFORM_LP   + "_" + LANG_ISO + EXTENSION;
+
+			// Assign the file size (column 2) from the release matrix of language and platform.
+			FILESIZE_FULL	 = release_400[ LANG_ISO ][ RELEASE_PLATFORM_POS_FULL ][ 1 ];
+			FILESIZE_LP	 = release_400[ LANG_ISO ][ RELEASE_PLATFORM_POS_LP   ][ 1 ];
+
+			// Assign all values from the release data.
+			REL_TEXT	 = 	   l10n_download_rel_info_milestone_text + release_400[ "src" ][ 1 ][ 0 ]
+					 + " | " + l10n_download_rel_info_buildid_text   + release_400[ "src" ][ 1 ][ 1 ]
+					 + " | " + l10n_download_rel_info_svn_text       + release_400[ "src" ][ 1 ][ 2 ]
+					 + " | " + l10n_download_rel_info_rel_date_text  + release_400[ "src" ][ 1 ][ 3 ];
+
+			// Assign the link for release notes, depending on the version.
+			REL_NOTES	 = l10n_download_rel_notes_aoo400_link;
+			break;
+		default:
+			FILENAME_FULL	 = "";
+			FILENAME_LP	 = "";
+			FILESIZE_FULL	 = -1;
+			FILESIZE_LP	 = -1;
+			REL_TEXT	 = l10n_download_rel_info_milestone_text + "? | "
+					 + l10n_download_rel_info_buildid_text   + "? | "
+					 + l10n_download_rel_info_svn_text       + "? | "
+					 + l10n_download_rel_info_rel_date_text  + "?";
+			REL_NOTES	 = "";
+			ERROR		 = true;
+	}
+
+	return;
+}
+
+/*
+ * Set document.location to start the download
+ * @param:  itemid, uri - The ID of the colored box and the URI that should be opened
+ * @return: None
+ */
+function openItem( itemid, uri ) {
+//	var thisDocument  = document.getElementById( "downloadextendedtext" );
+//	var thisDocument  = document.getElementById( itemid );
+	document.location = uri;
+}
+
+/*
+ * Output values of variables for debugging
+ * @param:  location - The location where the debug utput should take place
+ * @return: None
+ */
+function debug( location ) {
+	if( location === "" ) {
+		location = "No location named!";
+	}
+
+	alert( location												+ "\n"
+	+ "NL_LANG: "				+ "\t\t\t\t\t\t\t"	+ NL_LANG				+ "\n"
+	+ "LANG_ISO: "				+ "\t\t\t\t\t\t"	+ LANG_ISO				+ "\n"
+	+ "LANG_SEL: "				+ "\t\t\t\t\t\t"	+ LANG_SEL				+ "\n"
+	+ "UI_PLATFORM: "			+ "\t\t\t\t\t\t"	+ UI_PLATFORM				+ "\n"
+	+ "UI_PLATFORM_NO_SUP: "		+ "\t\t\t\t"		+ UI_PLATFORM_NO_SUP			+ "\n"
+	+ "PLATFORM: "				+ "\t\t\t\t\t\t"	+ PLATFORM				+ "\n"
+	+ "PLATFORM_FULL: "			+ "\t\t\t\t\t"		+ PLATFORM_FULL				+ "\n"
+	+ "PLATFORM_LP: "			+ "\t\t\t\t\t\t"	+ PLATFORM_LP				+ "\n"
+	+ "PLATFORM_SEL: "			+ "\t\t\t\t\t\t"	+ PLATFORM_SEL				+ "\n"
+	+ "RELEASE_PLATFORM_POS_FULL: "		+ "\t\t\t"		+ RELEASE_PLATFORM_POS_FULL		+ "\n"
+	+ "RELEASE_PLATFORM_POS_LP: "		+ "\t\t\t"		+ RELEASE_PLATFORM_POS_LP		+ "\n"
+	+ "RELEASE_PLATFORM: "			+ "\t\t\t\t\t"		+ RELEASE_PLATFORM			+ "\n"
+	+ "RELEASE_LANG: "			+ "\t\t\t\t\t\t"	+ RELEASE_LANG				+ "\n"
+	+ "REL_TEXT: "				+ "\t\t\t\t\t\t\t"	+ REL_TEXT				+ "\n"
+	+ "REL_NOTES: "				+ "\t\t\t\t\t\t"	+ REL_NOTES				+ "\n"
+	+ "VERSION_SEL: "			+ "\t\t\t\t\t\t"	+ VERSION_SEL				+ "\n"
+	+ "FILENAME_FULL: "			+ "\t\t\t\t\t"		+ FILENAME_FULL				+ "\n"
+	+ "FILENAME_LP: "			+ "\t\t\t\t\t\t"	+ FILENAME_LP				+ "\n"
+	+ "FILESIZE_FULL: "			+ "\t\t\t\t\t\t"	+ FILESIZE_FULL				+ "\n"
+	+ "FILESIZE_LP: "			+ "\t\t\t\t\t\t"	+ FILESIZE_LP				+ "\n"
+	+ "EXTENSION: "				+ "\t\t\t\t\t\t"	+ EXTENSION				+ "\n"
+	+ "LINK_FULL: "				+ "\t\t\t\t\t\t"	+ LINK_FULL				+ "\n"
+	+ "LINK_LP: "				+ "\t\t\t\t\t\t\t"	+ LINK_LP				+ "\n"
+	+ "LINK_CHK_ASC_FULL: "			+ "\t\t\t\t\t"		+ LINK_CHK_ASC_FULL			+ "\n"
+	+ "LINK_CHK_MD5_FULL: "			+ "\t\t\t\t\t"		+ LINK_CHK_MD5_FULL			+ "\n"
+	+ "LINK_CHK_SHA256_FULL: "		+ "\t\t\t\t"		+ LINK_CHK_SHA256_FULL			+ "\n"
+	+ "LINK_CHK_ASC_LP: "			+ "\t\t\t\t\t"		+ LINK_CHK_ASC_LP			+ "\n"
+	+ "LINK_CHK_MD5_LP: "			+ "\t\t\t\t\t"		+ LINK_CHK_MD5_LP			+ "\n"
+	+ "LINK_CHK_SHA256_LP: "		+ "\t\t\t\t"		+ LINK_CHK_SHA256_LP			+ "\n"
+	+ "SHOW_SUB_BOX: "			+ "\t\t\t\t\t"		+ SHOW_SUB_BOX				+ "\n"
+	+ "ERROR: "				+ "\t\t\t\t\t\t\t"	+ ERROR					+ "\n" );
+
+	return;
+}
+

Propchange: openoffice/ooo-site/trunk/content/lt/download/download.js
------------------------------------------------------------------------------
    svn:eol-style = native