var totalWidth=720;
var newLine;
var netMenuName;
var spaceString;
var spaceNum;
var subAdress;
var preText;
var preTextIndex;
delay=new Array();
hdng=new Array();
menuLength=new Array();
menuItems=new Array();
menuRepeat=new Array();
menuHeight=new Array();
subMenuItems=new Array();
subMenuHeight=new Array();
subLinks=new Array();
endLinks=new Array();
firstIndex=new Array();
secondIndex=new Array();

webPage=document.URL;
preTextIndex=webPage.search('demoweb');
preTextIndex=preTextIndex+8;
preText=webPage.substring(0,preTextIndex);

if(isID==1){
	newLine='\n';
}	else{
	newLine='<br>';
};

/*Begin definition of menu headings*/
hdng[1]='ABC\'s of'+newLine+'motion';
hdng[2]='causes of'+newLine+'motion';
hdng[3]='E&M/'+newLine+'relativity';
hdng[4]='waves &'+newLine+'light\\sound';
hdng[5]='heat &'+newLine+'matter';
hdng[6]='mathematical'+newLine+'physics';
hdng[7]='applications';
hdng[8]='tables &'+newLine+'reference';
/*End definition of menu headings*/


/*Calculate the number of headings*/
var hdngLength=hdng.length;

for(i=0;i<hdngLength;i=i+1){
	menuItems[i]=new Array();
	subMenuItems[i]=new Array();
	subMenuHeight[i]=new Array();
	subLinks[i]=new Array();
	endLinks[i]=new Array();
	menuRepeat[i]=0;
	check[i]=0;
};

/*Begin definition of first menu items*/
menuItems[1][1]='neat stuff';
menuItems[1][2]='speed';
menuItems[1][3]='velocity';
menuItems[1][4]='acceleration';
/*End definition of first menu items*/

/*Begin definition of second menu items*/
menuItems[2][1]='mass';
menuItems[2][2]='forces';
menuItems[2][3]='oscillators';
menuItems[2][4]='energy';
/*End definition of second menu items*/

/*Begin definition of third menu items*/
menuItems[3][1]='electrostatics';
menuItems[3][2]='magnetostatics';
menuItems[3][3]='circuits';
menuItems[3][4]='time dependent';
menuItems[3][5]='radiation';
menuItems[3][6]='relativity';
/*End definition of third menu items*/

/*Begin definition of fourth menu items*/
menuItems[4][1]='general';
menuItems[4][2]='optics';
menuItems[4][3]='radiation';
menuItems[4][4]='acoustics';
/*End definition of fourth menu items*/

/*Begin definition of fifth menu items*/
menuItems[5][1]='matter';
menuItems[5][2]='thermodynamics';
/*End definition of fifth menu items*/

/*Begin definition of sixth menu items*/
menuItems[6][1]='vectors';
menuItems[6][2]='fourier';
/*End definition of sixth menu items*/

/*Begin definition of the seventh menu items*/
menuItems[7][1]='Earth Science';
menuItems[7][2]='Astonomy';

/*Begin definition of eighth menu items*/
menuItems[8][1]='tables';
menuItems[8][2]='links';
/*End definition of eighth menu items*/

for(i=1;i<hdngLength;i=i+1){
	menuLength[i]=menuItems[i].length;
	firstIndex[i]=menuLength[i];
	if(menuLength[i]>1){
		for(k=1;k<menuLength[i];k=k+1){
			subMenuItems[i][k]=new Array();
			subLinks[i][k]=new Array();
			endLinks[i][k]=new Array();
		};
	};
};

/*Begin second submenu of the first menu*/
subMenuItems[1][1][1]='test your reaction time';
subLinks[1][1][1]='ntnujava/Reaction/ereaction_time.htm';
subMenuItems[1][1][2]='when two cannons are fired at one another';
subLinks[1][1][2]='ntnujava/projectile/ecannons.htm';
/*End second submenu of the first menu*/

/*Begin second submenu of the first menu*/
subMenuItems[1][2][1]='table';
subLinks[1][2][1]='newtables/speed_scales.htm';
subMenuItems[1][2][2]='race cars traveling at '+newLine+'a constant speed';
subLinks[1][2][2]='newkin/html/speed_racing_cars.htm';
subMenuItems[1][2][3]='speed selector';
subLinks[1][2][3]='newkin/html/speed_discriminator.htm';
/*End second submenu of the first menu*/

/*Begin third submenu of the first menu*/
subMenuItems[1][3][1]='ship traveling in a current';
subLinks[1][3][1]='newkin/html/position_velocity_ship.htm';
/*End third submenu of the first menu*/

/*Begin fourth submenu of the first menu*/
subMenuItems[1][4][1]='race cars experiencing '+newLine+'constant acceleration';
subLinks[1][4][1]='newkin/html/acceleration_racing_cars.htm';
subMenuItems[1][4][2]='Derby Physics';
subLinks[1][4][2]='newkin/html/downhill_racing.htm';
/*End fourth submenu of the first menu*/

/*Begin first submenu of the second menu*/
subMenuItems[2][1][1]='table';
subLinks[2][1][1]='newtables/mass_scales.htm';
/*End first submenu of the second menu*/

/*Begin second submenu of the second menu*/
subMenuItems[2][2][1]='forces exerted on bridges';
subLinks[2][2][1]='newdyn/html/static_forces_bridge.htm';
subMenuItems[2][2][2]='inclined plane';
subLinks[2][2][2]='ntnujava/forceDiagram/e_inclined_plane.htm';
subMenuItems[2][2][3]='buoyant forces';
subLinks[2][2][3]='ntnujava/buoyant/ebuoyant_forces.htm';
/*End second submenu of the second menu*/

/*Begin third submenu of the second menu*/
subMenuItems[2][3][1]='pendulums';
subLinks[2][3][1]='ntnujava/Pendulum/esimple_pendulums.htm';
subMenuItems[2][3][2]='undamped springs';
subLinks[2][3][2]='newdyn/html/basic_spring.htm';
subMenuItems[2][3][3]='damped springs';
subLinks[2][3][3]='newdyn/html/damped_spring.htm';
subMenuItems[2][3][4]='genral springs';
subLinks[2][3][4]='ntnujava/springWave/esprings_one.htm';
subMenuItems[2][3][5]='more on springs';
subLinks[2][3][5]='ntnujava/springForce/esprings_two.htm';
subMenuItems[2][3][6]='driving forces and resonance';
subLinks[2][3][6]='newdyn/html/resonance.htm';
/*End third submenu of the second menu*/

/*Begin fourth submenu of the second menu*/
subMenuItems[2][4][1]='table';
subLinks[2][4][1]='newtables/energy_scales.htm';
subMenuItems[2][4][2]='racing balls';
subLinks[2][4][2]='ntnujava/racingBall/eball_race.htm';
/*End fourth submenu of the second menu*/

/*Begin first submenu of the third menu*/
subMenuItems[3][1][1]='field and potential produced '+newLine+'by point charges';
subLinks[3][1][1]='physlets/1.1/e_electric_field.htm';
/*End first submenu of the third menu*/

/*Begin second submenu of the third menu*/
subMenuItems[3][2][1]='field produced by constant '+newLine+'currents with in coils and '+newLine+'straight wires';
subLinks[3][2][1]='physlets/1.1/ewires.htm';
subMenuItems[3][2][2]='magnetic mass spectrometer';
subLinks[3][2][2]='EandM/html/magneticMass.htm';
/*End second submenu of the third menu*/

/*Begin third submenu of the third menu*/
subMenuItems[3][3][1]='RC circuits';
subLinks[3][3][1]='ntnujava/rc/erc_circuits.htm';
subMenuItems[3][3][2]='RLC circuits: DC power source';
subLinks[3][3][2]='ntnujava/electronics/erlc_circuits_dc.htm';
subMenuItems[3][3][3]='RLC circuits: AC power source';
subLinks[3][3][3]='ntnujava/rlc/erlc_circuits_ac.htm';
/*Begin third submenu of the third menu*/

/*Begin fourth submenu of the third menu*/
subMenuItems[3][4][1]='Faraday\'s Law';
subLinks[3][4][1]='physlets/efaraday.htm';
/*End fourth submenu of the third menu*/

/*Begin fifth submenu of the third menu*/
subMenuItems[3][5][1]='synchrotron radiation';
subLinks[3][5][1]='physlets/esynch.htm';
subMenuItems[3][5][2]='black body radiation';
subLinks[3][5][2]='physlets/eblackbody.htm';
subMenuItems[3][5][3]='electromagnetic spectrum table';
subLinks[3][5][3]='newtables/electromagnetic_spectrum_w3c.htm';
/*End fifth submenu of the third menu*/

/*Begin sixth submenu of the third menu*/
subMenuItems[3][6][1]='clocks and the postulates of special relativity';
subLinks[3][6][1]='ntnujava/relativity/epostulates_clocks.htm';
/*End sixth submenu of the third menu*/

/*Begin first submenu of the fourth menu*/
subMenuItems[4][1][1]='inteference of waves';
subLinks[4][1][1]='physlets/einterference.htm';
subMenuItems[4][1][2]='superposition of waves';
subLinks[4][1][2]='ntnujava/waveSuperposition/esuperposition.htm';
subMenuItems[4][1][3]='transverse and longitudinal waves';
subLinks[4][1][3]='ntnujava/waveType/etypes.htm';
subMenuItems[4][1][4]='doppler shift'
subLinks[4][1][4]='physlets/edoppler_shift.htm';
/*End first submenu of the fourth menu*/

/*Begin second submenu of the fourth menu*/
subMenuItems[4][2][1]='reflection and refraction';
subLinks[4][2][1]='ntnujava/propagation/ereflection_and_refraction.htm';
subMenuItems[4][2][2]='physics of rainbows';
subLinks[4][2][2]='ntnujava/Rainbow/erainbow.htm';
subMenuItems[4][2][3]='lenses and mirrors';
subLinks[4][2][3]='physlets/1.1/elenses_and_mirrors.htm';
subMenuItems[4][2][4]='Fermats principle';
subLinks[4][2][4]='ntnujava/Fermat/efermat.htm';
subMenuItems[4][2][5]='double slit experiment';
subLinks[4][2][5]='ntnujava/doubleSlit/edouble_slit_experiment.htm';
subMenuItems[4][2][6]='How fish see the world above '+newLine+'the surface of the water';
subLinks[4][2][6]='ntnujava/fishEye/efish.htm';
/*End second submenu of the fourth menu*/

/*Begin third submenu of the fourth menu*/
subMenuItems[4][3][1]='synchrotron radiation';
subLinks[4][3][1]='physlets/esynch.htm';
subMenuItems[4][3][2]='black body radiation';
subLinks[4][3][2]='physlets/eblackbody.htm';
subMenuItems[4][3][3]='electromagnetic spectrum table';
subLinks[4][3][3]='newtables/electromagnetic_spectrum_w3c.htm';
/*End third submenu of the fourth menu*/

/*Begin fourth submenu of the fourth menu*/
subMenuItems[4][4][1]='organ pipes';
subLinks[4][4][1]='physlets/eorgan_pipe.htm';
subMenuItems[4][4][2]='fourier synthesis';
subLinks[4][4][2]='ntnujava/sound/efourier_synthesis.htm';
/*End fourth submenu of the fourth menu*/

/*Begin first submenu of the fifth menu*/
subMenuItems[5][1][1]='a molecular explanation of pressure';
subLinks[5][1][1]='ntnujava/idealGas/emolecular_pressure.htm';
subMenuItems[5][1][2]='brownian motion';
subLinks[5][1][2]='ntnujava/gas2D/ebrownian_motion.htm';
subMenuItems[5][1][3]='magnetic mass spectrometer';
subLinks[5][1][3]='EandM/html/magneticMass.htm';
subMenuItems[5][1][4]='nuclear decay';
subLinks[5][1][4]='modernPhysics/html/nuclear_isotopes.htm';
/*End first submenu of the fifth menu*/

/*Begin second submenu of the fifth menu*/
subMenuItems[5][2][1]='carnot cycle';
subLinks[5][2][1]='ntnujava/carnot/ecarnot_cycle.htm';
/*End second submenu of the fifth menu*/

/*Begin first submenu of sixth menu*/
subMenuItems[6][1][1]='vector addition';
subLinks[6][1][1]='ntnujava/vector/evector_addition.htm';
subMenuItems[6][1][2]='application: ship navigation';
subLinks[6][1][2]='newkin/html/position_velocity_ship.htm';
/*End first submenu of sixth menu*/

/*Begin second submenu of the sixth menu*/
subMenuItems[6][2][1]='fourier synthesis';
subLinks[6][2][1]='ntnujava/sound/efourier_synthesis.htm';
/*End second submenu of the sixth menu*/

/*Begin first submenu of seventh menu*/
subMenuItems[7][1][1]='tides and orbital motion';
subLinks[7][1][1]='shockwavedi/tides.htm';
/*End first submenu of seventh menu*/

/*Begin second submenu of seventh menu*/
subMenuItems[7][2][1]='cratering';
subLinks[7][2][1]='shockwavedi/cratering.htm';
subMenuItems[7][2][2]='radiation and reflected spectra';
subLinks[7][2][2]='shockwavedi/spectra.htm';
subMenuItems[7][2][3]='build a planet';
subLinks[7][2][3]='shockwavedi/buildAplanet.htm';
subMenuItems[7][2][4]='orbital motion';
subLinks[7][2][4]='shockwavedi/orbital.htm';
subMenuItems[7][2][5]='atmospheres';
subLinks[7][2][5]='shockwavedi/atmospheres.htm';
/*End second submenu of seventh menu*/

/*Begin first submenu of the eighth menu*/
subMenuItems[8][1][1]='electromagnetic spectrum';
subLinks[8][1][1]='newtables/electromagnetic_spectrum_w3c.htm';
subMenuItems[8][1][2]='energy';
subLinks[8][1][2]='newtables/energy_scales.htm';
subMenuItems[8][1][3]='length';
subLinks[8][1][3]='newtables/length_scales.htm';
subMenuItems[8][1][4]='mass';
subLinks[8][1][4]='newtables/mass_scales.htm';
subMenuItems[8][1][5]='speed';
subLinks[8][1][5]='newtables/speed_scales.htm';
subMenuItems[8][1][6]='time';
subLinks[8][1][6]='newtables/time_scales.htm';
/*End first submenu of the eighth menu*/

/*Begin second submenu of the eighth menu*/
subMenuItems[8][2][1]='ePhysics home';
subLinks[8][2][1]='ephysics.htm';
subMenuItems[8][2][2]='links';
subLinks[8][2][2]='misc/links.htm';
/*End second submenu of the eighth menu*/

for(i=1;i<hdngLength;i=i+1){
	for(k=1;k<subLinks[i].length;k=k+1){
		for(m=1;m<subLinks[i][k].length;m=m+1){
			whereTo=preText+subLinks[i][k][m];
			subLinks[i][k][m]=whereTo;
		};
	};
};
