﻿/**
 * @(#)cubeplayer.js  1.0  2008-08-27
 *
 * Copyright (c) 2008-2009 
 * Werner & Walter Randelshofer, Staldenmattweg 2, CH-6405 Immensee, Switzerland
 * All rights reserved.
 *
 * The copyright of this software is owned by Werner Randelshofer. 
 * You may not use, copy or modify this software, except in  
 * accordance with the license agreement you entered into with  
 * Werner Randelshofer. For details see accompanying license terms. 
 */
 
 
 
// Variables
// ---------

function insertCubePlayer(cube, script, id) {
	// Cube-specific attributes and parameters
	var cubeSpecific = {
		"rubik" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar" 
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"faceList":"5,0,1,2,3,4"
			}
		},
		
		
		// Picture Cubes: Colors & Shapes
		"dotmatrix" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/DotMatrixCubeN_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		
		"maze" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/MazeCube_512.gif",
				"twistDuration":"400",
				"displayLines":"1",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		
		// Picture Cubes: Linguistics
		"bretonfirstnames" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/BretonFirstNamesCube_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		
		// Picture Cubes: Mathematics
		"mathphysconst" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/MathPhysConstCube_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		
		// Picture Cubes: Geography
		"geocube" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"230",
				"height":"280"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/GeoCube_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"coordclockcube" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"230",
				"height":"280"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CoordClockCube_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"coordclockcube_clock" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CoordClockCube_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		
		// Picture Cubes: Astronomy
		"astro" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/AstroCube_2048.png",
				"twistDuration":"400",
				"displayLines":"1",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"starnames" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/StarNamesCube_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		
		// Picture Cubes: Cube Theory
		"orbit_solver" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"700",
				"height":"580"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/OrbitCube_2048.gif",
				"scaleFactor":"1.05",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"true",
				"showInfo":"false"
			}
		},
		
		"super_cube_solver" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"700",
				"height":"580"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/OrbitCube_2048.gif",
				"scaleFactor":"1.05",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"true",
				"showInfo":"false"
			}
		},
		
		
		// Picture Cubes: Group Theory
		"m12" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/M12Cube_2048.gif",
				"twistDuration":"400",
				"displayLines":"0",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		
		
		// Picture Cubes: Time
		"analogclock" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/AnalogClockCube_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		
		"digitalclock" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/DigitalClockCube_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"binaryclock" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/BinaryClockCube_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"clockcalendar" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/ClockCalendarCube_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_digital" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/DigitalCalendarCube_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"timezone" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/TimeZoneCube_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		
		// Calendar Cubes: 1.1 Germanic Languages
		"calendar_english" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeEn_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_american" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeUS_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_german" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeDe_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_dutch" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeNl_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_danish" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeDa_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false",
				"stickerBevel":"0.1"
			}
		},
		
		"calendar_swedish" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeSw_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false",
				"stickerBevel":"0.1"
			}
		},
		
		"calendar_norwegian" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeNo_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false",
				"stickerBevel":"0.1"
			}
		},
		
		"calendar_icelandic" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeIs_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		// Calendar Cubes: 1.2 Celtic Languages
		"calendar_irish" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeIr_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_welsh" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeWe2_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_breton" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeBr_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		// Calendar Cubes: 1.3 Italic Languages
		"calendar_spanish" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeCa_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_portuguese" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubePo_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_portuguese2" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubePo2_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_french" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeFr_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_french2" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeFr2_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_french_dual" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeFrDual_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_italian" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeIt_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_italian2" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeIt2_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_romanian" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeRo_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_romanian_dual" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeRoDual_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_latin" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeLa_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_rumantschgrischun" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeRg_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_rumantschgrischun2" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeRg2_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		// Calendar Cubes: 1.4 Greek Languages
		"calendar_greek" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeGr_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false",
				"stickerBevel":"0.1"
			}
		},
		
		// Calendar Cubes: 1.5 Slavic Languages
		"calendar_russian" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeRu_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_ukrainian" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeUk_2048.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_czech" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeCz_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		"calendar_polish" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubePl_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		// Calendar Cubes: 2.1 Old Mediterranean Languages
		"calendar_basque" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeEu_2048.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		// Calendar Cubes: 3.1 Finno-Ugric Languages
		"calendar_finnish" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeFi_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false",
				"stickerBevel":"0.1"
			}
		},
		
		"calendar_hungarian" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeHu_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		// Calendar Cubes: 4.1 Bantu Languages
		"calendar_swahili" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeSu_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		// Calendar Cubes: 5.1 Semitic Languages
		"calendar_arabic" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeAr_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		// Calendar Cubes: 6.1 Chinese Languages
		"calendar_chinese" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeCn_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false",
				"stickerBevel":"0.1"
			}
		},
		
		"calendar_chinese2" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeCn2_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false",
				"stickerBevel":"0.1"
			}
		},
		
		// Calendar Cubes: 7.1 Turkic Languages
		"calendar_turkish" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeTr_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		},
		
		// Calendar Cubes: 7.2 Japonic Languages
		"calendar_japanese" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeJp_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false",
				"stickerBevel":"0.1"
			}
		},
		
		"calendar_japanese2" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeJp2_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false",
				"stickerBevel":"0.1"
			}
		},
		
		"calendar_japaneseenglish" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeJpEn_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false",
				"stickerBevel":"0.1"
			}
		},
		
		// Calendar Cubes: 7.3 Koreanic Languages
		"calendar_korean" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeKr_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false",
				"stickerBevel":"0.1"
			}
		},
		
		"calendar_korean2" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeKr2_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false",
				"stickerBevel":"0.1"
			}
		},
		
		// Calendar Cubes: 8.1 Malayo-Polynesian Languages
		"calendar_indonesian" : {
			"attributes" : {
				"code":"RubikPlayer.class", 
				"archive":"lib/RubikPlayer.jar", 
				"width":"470",
				"height":"460"
			},
			"parameters" : {
				"resourceFile":"../notations/superset_eng_3x3.xml",
				"stickersImage":"images/CalendarCubeId_1024.gif",
				"beta":"25",
				"scaleFactor":"1.1",
				"twistDuration":"400",
				"displayLines":"3",
				"showRear":"false",
				"showInfo":"false"
			}
		}
		
		
	};


	// Applet attributes
	var appletAttributes = {
		"codebase" : "..",
		"width" : "700",
		"height" : "460"
	}
	// Set cube-specific applet attributes
	for (var key in cubeSpecific[cube]["attributes"]) {
		appletAttributes[key] = cubeSpecific[cube]["attributes"][key];
	}
	// Set id if defined
	if (id != null) {
		appletAttributes["id"] = id;
	}
	
	
	// Applet parameters
	var appletParameters = {
		"showInfo" : "true",    
		"showRear" : "true",     
		"twistDuration" : "550",     
	
		// Parameters for Sun Java Plugin:
		"codebase_lookup" : "false",   
		"classloader_cache" : "false",    
		"java_arguments" : "-Djnlp.packEnabled=true",     
		"image" : "Splash.gif",     
		"centerimage" : "true",     
		"boxborder" : "false"     
	}; 
	// Set cube-specific applet parameters
	for (var key in cubeSpecific[cube]["parameters"]) {
		appletParameters[key] = cubeSpecific[cube]["parameters"][key];
	}
	
	
	appletParameters["script"] = toSanitizedScript(script);

	// Write applet
	// ------------
	document.write("<applet ");
	for (var key in appletAttributes) {
		document.write(" "+key+"=\""+appletAttributes[key]+"\"");
	}
	document.writeln(">");
	for (var name in appletParameters) {
		document.write("  <param name=\""+name+"\" value=\"" + appletParameters[name] + "\">");
	}
	document.writeln("<p><b>To see the cube applet you have to install the <a href=\"http://java.sun.com/getjava/\" target=\"_blank\">Java Plug-in</a>!</b></p>");
	document.write("</applet>");
}

function toSanitizedScript(script) {
	// Sanitize the script parameter.
	sanitizedScript = "";
	if(script != null) { sanitizedScript = script; }
	
	sanitizedScript = sanitizedScript.replace(/\"/g,"\\\"");  // replaces " with \"
	sanitizedScript = sanitizedScript.replace(/\./g," ·");  // replaces . with a blank followed by ·
	sanitizedScript = sanitizedScript.replace(/([RUFLDB]2?|\))-/g,"$1\'");    // replaces - with ' if it appears after RUFLDB a 2 or )
	sanitizedScript = sanitizedScript.replace(/(([CNMSTVW][1-9]*(-[1-9]+)?)?[RUFLDB]'?)/g," $1");     // inserts a blank before a statement. 
	// A statement optionally starts with one of the letters CMNSTVW, optionally followed by the number 1, 
	// and always contains one of the letters RUFLDB, and optionally finishes with an apostrophe
	sanitizedScript = sanitizedScript.replace(/(?:(\(|<))/g," $1");     // inserts a whitespace before an opening brackets: ( <
	sanitizedScript = sanitizedScript.replace(/(?:(\(|<) )/g,"$1");     // removes whitespace after opening brackets: ( <
	sanitizedScript = sanitizedScript.replace(/(?:(>) )/g,"$1");     // removes whitespace after closing bracket: >
	sanitizedScript = sanitizedScript.replace(/  /g," ");     // removes duplicate whitespaces
	sanitizedScript = sanitizedScript.replace(/^ +/g,"");     // removes leading whitespace
	return sanitizedScript;
}

