

//***** get mouse x,y on screen & window *****
var moLocH, moLocV;
var smoLocH, smoLocV;
window.document.onmousemove = attachImage;
function attachImage(){
	moLocH = event.x; //mouse x on screen
	moLocV = event.y; //mouse y on screen
	smoLocH = window.event.screenX; //mouse x on window
	smoLocV = window.event.screenY; //mouse y on window
}

//***** check os & browser *****
var mac = navigator.userAgent.indexOf('Mac')!=-1 ? 'mac' : 0;
var win = navigator.userAgent.indexOf('Win')!=-1 ? 'win' : 0;
var os  = (mac || win);
var ie  = document.all ? 'ie' : 0;
var nn  = document.layers ? 'nn' : 0;
var bw  = (ie || nn);

//***** open subwindow function *****
function openWin(index){
  //generate variables
	var term = 'term' + index;
	term = eval(term);
	var exp = 'exp' + index;
	exp = eval(exp);

  //open subwindow in the center of parent window
	var winWidth, winHeight;
	var winX, winY;
	var lebA, lebB;
	if (document.all){ //IE
		if(navigator.appVersion.indexOf("Mac") != -1){ //Mac
			if(navigator.userAgent.indexOf("M") != -1){ //IE
				winWidth  = document.body.clientWidth;
				winHeight = document.body.clientHeight;
				if ((winHeight-220)/2 > moLocV) {
					lebA = (winHeight-220)/2 - moLocV;
					lebB = smoLocV + lebA;
				}else if ((winHeight-220)/2 < moLocV) {
					lebA = moLocV - (winHeight-220)/2;
					lebB = smoLocV - lebA;
				}
				if ((winWidth-360)/2 > moLocH) {
					lebC = (winWidth-360)/2 - moLocH;
					lebD = smoLocH + lebC;
				}else if ((winWidth-360)/2 < moLocH) {
					lebC = moLocH - (winWidth-360)/2;
					lebD = smoLocH - lebC;
				}
				var subwin = window.open('','newwin1','scrollbars=1,width=360,height=220');
				subwin.moveTo(lebD,lebB-45);
				subwin.focus();
			}
		} else { //win IE
			winWidth  = document.body.clientWidth;
			winHeight = document.body.clientHeight;
			winX = window.screenLeft;
			winY = window.screenTop;
			var subwin = window.open('','newwin1','scrollbars=1,width=360,height=220');
			subwin.moveTo(winX+(winWidth-360)/2,winY+(winHeight-220)/2);
			subwin.focus();
		}
	} else { //NN or other browser
		winWidth  = window.outerWidth;
		winHeight = window.outerHeight;
		winX = window.screenX;
		winY = window.screenY;
		var subwin = window.open('','newwin1','scrollbars=1,width=360,height=220');
		subwin.moveTo(winX+(winWidth-360)/2,winY+(winHeight-220)/2);
		subwin.focus();
	}

  //output subWindow's HTML
	subwin.document.write('<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
	subwin.document.write('<TITLE>Technical Terms</TITLE>');
	subwin.document.write('<BODY bgcolor="#FFFFFF" text="#333333" onLoad="window.focus();">');
	subwin.document.write('<TABLE border="0" width="100%" height="100%" cellspacing="0" cellpadding="2"><TR><TD valign="top">');
	subwin.document.write('<SPAN style="font-family:Verdana,Arial,Helvetica,sans-serif; color:#99CC66;');
	if(os=='win' && bw=='nn') subwin.document.write('font-size:21px;"><B>'); //win nn
	else subwin.document.write('font-size:16px;"><B>'); //other
	subwin.document.write(term);
	subwin.document.write('</B></SPAN><BR>');
	subwin.document.write('<IMG src="subwin_line.gif" width="268" height="7"><BR>');
	subwin.document.write('<SPAN style="font-family:Verdana,Arial,Helvetica,sans-serif; color:#333333;');
	if(os=='win' && bw=='nn') subwin.document.write('font-size:14px;">'); //win nn
	else  subwin.document.write('font-size:10px;">'); //other
	subwin.document.write(exp);
	subwin.document.write('</SPAN></TD></TR>');
	subwin.document.write('<TR><TD valign="bottom"><IMG src="subwin_line.gif" width="268" height="7"><BR>');
	subwin.document.write('<A href="#" onClick="window.close();return false"><IMG src="btn_close_win.gif" border="0" alt="CLOSE WINDOW"></A></TD></TR></TABLE>');
	subwin.document.write('</BODY></HTML>');
	subwin.document.close();
}

//***** substitute data for variables *****
//--- No. ---
var term0 = '1-bit coding technology';
var exp0  = 'Digital coding technology that uses only one bit (0 or 1) instead of multiple bits for each quantised sample. Compared to multi-bit coding technology, this coding technology records a higher density of information, which results in a more accurate and faithful reproduction.';

//--- A ---
var term1 = 'A/D converter';
var exp1  = 'An electronic component or circuit that converts analogue signals to digital signals.';

var term2 = 'Analogue signal';
var exp2  = 'Any data that varies continuously. For audio, it refers to uncoded electrical representations of air vibration.';

//--- B ---
var term3 = 'Bit';
var exp3  = 'Abbreviation for binary digit. In multi-bit coding, the number of bits shows how precisely each quantised sample represents the original analogue signal. Digital signals are generated based on a binary notation system (0 or 1), while the number of bits represents the total number of steps that can be selected. In the case of 16-bit CDs, one sampled unit has 65,536 possible values (2<IMAGE src="sup16.gif" align="absolute" alt="16">). The number of bits basically determines dynamic range (volume difference between the loudest and most quiet recordable sounds), with each bit representing a dynamic range of 6dB. Therefore 16-bit CDs have a dynamic range of 96dB (16 times 6). An orchestra in a concert hall produces a dynamic range of approximately 100dB.';

var term4 = 'Bit stream';
var exp4  = 'Sequence of digital signals. In computer terms it refers to continuous digital signals of any kind, while in audio terms it mainly refers to a sequence of digital signals which contain only sound information. The term "bit stream" is usually not applied to multi-bit signals, as either they contain information other than sound or the order of data is changed for error correction.';

//--- D ---
var term5 = 'D/A converter';
var exp5  = 'An electronic component or circuit that converts digital signals to analogue signals.';

var term6 = 'Decimation';
var exp6  = 'Dropping of information during the digital recording process.';

var term7 = '<IMG src=\"ds_green.gif\" width=25 height=14 align=absmiddle>(Delta-Sigma) modulation';
var exp7  = 'One of the coding systems in 1-bit digital conversion. Analogue signals are converted into digital signals in a process that records the fluctuations of sound information. Analogue sound information is modulated onto high frequency digital signals. Digital signals are generated while maintaining the characteristics of the original analogue waveform.';

var term8 = 'Digital signal';
var exp8  = 'Any data that is expressed in binary form. For audio it is the signal into which intermittently sampled analogue sound information is encoded.';

var term9 = 'Distortion';
var exp9  = 'Deviation from the original sound signal. For example, when sound signals are recorded on a cassette tape above its input capacity, the reproduced sound becomes distorted because the original signal was not properly recorded.';

var term10 = 'DSD';
var exp10  = 'Abbreviation for Direct Stream Digital, otherwise known as the bit stream (1-bit) recording technology. Bit stream is actually used in the multi-bit recording process of CDs, but due to technological limitations inherent to CDs, is subject to deterioration during the decimation process from 1-bit to multi-bit. By using SACD as a recording medium, DSD transmits a pure bit stream from the input stage to the output from the player, ensuring that the purity of the sound signal is kept.';

var term11 = 'DVD-Audio';
var exp11  = 'A next-generation digital audio medium that uses the large capacity of DVD (Digital Versatile Disc) for high-quality sound. DVD is expected not only to supplant LD, but also to become the core of next-generation recording media. DVD-Audio employs a multi-bit digital technology. Depending on users\' requirements for sound quality and recording time, various sampling frequencies and quantisation bits are available (up to 192kHz and 24 bits, respectively). Greater interactivity with PCs and multi-track recording are expected to follow.';

var term12 = 'Dynamic range ';
var exp12  = 'The difference in volume between the quietest point and the loudest that a sound system can record and reproduce. Measured in decibels (dB).';

//--- F ---
var term13 = 'Frequency';
var exp13  = 'The number of air vibrations per second. Shows how high a sound pitch is (higher-pitched sound is a result of a greater frequency of air vibrations). The term can also refer to the tuning frequency of electric waves or the sampling frequency of digital audio signals.';

//--- H ---
var term14 = 'Hz';
var exp14  = 'Hertz. A unit of measurement which represents the number of cycles per second with respect to the rate of sampling or vibration. Also refers to pitch, as sound comprises air vibrations and is determined by the rate of vibration. 1kHz stands for 1,000 vibrations per second, 1MHz for 1,000,000. ';

//--- I ---
var term15 = 'Impedance';
var exp15  = 'The resistance to the flow of an electric current in a circuit, measured in ohms. Most speakers have a normal impedance of between 4 and 8 ohms.';

//--- L ---
var term16 = 'Low-pass filter'
var exp16  = 'A filter that allows sounds up to specified frequencies to pass through, while cutting off higher frequency sounds. Low-pass filters are employed in digital audio systems to cut off quantisation noise in the higher frequency range.'

//--- N ---
var term17 = 'Negative feedback'
var exp17  = 'The process of comparing a fraction of an amplifier\'s output signal to its input signal at the input stage, and correcting the difference. This feedback reduces sound distortion caused in the amplification process.'

var term18 = 'Noise'
var exp18  = 'Sound from external sources which adversely affects fidelity. Noise can come from the power supply, hum, interactions between internal electrical components, or from other sources.'

var term19 = 'Noise shaping'
var exp19  = 'The process in which the frequency range of quantised noise is shifted by negative feedback. Quantisation noise shifted above the audible range is cut off by a low-pass filter.'

//--- O ---
var term20 = 'Oversampling'
var exp20  = 'The technology of processing digital signals during the D/A conversion at a higher frequency rate than was applied during the sampling (recording) process. Sampling noise is shifted to the upper frequency range.'

//--- P ---
var term21 = 'Phase'
var exp21  = 'Time-varying quantity in one cycle of vibration or wave motion. When two sound waves are synchronised, i.e. in phase, they reinforce each other. When two sound waves are out of phase, they cancel each other and the result is a weak signal, or no signal at all if they are 180 degrees out of phase.'

var term22 = 'PCM'
var exp22  = 'Abbreviation for Pulse Code Modulation, the process by which analogue information is converted into multi-bit digital signals.'

//--- Q ---
var term23 = 'Quantisation noise'
var exp23  = 'Noise caused by the difference between analogue and digital signals during the sampling process. Quantisation noise is shifted to the upper frequency range by oversampling and is then removed by a low-pass filter to ensure a wide dynamic range in the audible band.'

//--- S ---
var term24 = 'SACD'
var exp24  = 'Abbreviation for Super Audio Compact Disc, a next-generation CD which reproduces sound superior to that from conventional CDs. Signals are recorded in 1-bit digital form.'

var term25 = 'Sampling frequency'
var exp25  = 'The number of digital samples made per second. The sampling frequency shows how frequently analogue sound waves are sampled along the time axis. Frequency response basically depends on sampling rate; higher rates can record a greater frequency of vibrations (higher-pitched sound). The sampling frequency for CDs is 44.1kHz  (44,100 times per second) per channel.'

var term26 = 'Shannon theorem'
var exp26  = 'A theorem on digital technology which holds that in order to obtain a faithful reproduction of an original sound, the sampling frequency must be at least twice as high as the highest frequency of the original sound.'

var term27 = 'S/N ratio'
var exp27  = 'A ratio of signal (S) to noise (N) measured in decibels (dB). A higher ratio is indicative of better sound quality.'

