/* ThinkQuest International 2006
	The DReaMers - DRM: Two Sides of the Story
	definition.js
	--------------------------------------------
	Copyright: You may use this script for non-commercial purposes,
	but must acknowledge the team.
	--------------------------------------------
	Last Revised: 07/05/06
*/

var defwords = new Array();
var elmnts = new Array();
var foundDefs = new Array()
var definition = "Definition not found";
var dn = new Array();

defwords[0]="connect";
defwords[1]="ajax-s";
defwords[2]="p2p";
defwords[3]="itunes";
defwords[4]="ipod";
defwords[5]="dongles";
defwords[6]="ilife";
defwords[7]="rootkit";
defwords[8]="creative common license";
defwords[9]="consumer surplus";
defwords[10]="gpl";
defwords[11]="stallman";
defwords[12]="sherman networks";
defwords[13]="copyright act";
defwords[14]="fairplay";
defwords[15]="hmv";
defwords[16]="distance education";
defwords[17]="european copyright";
defwords[18]="creative commons";
defwords[19]="sander sassen";
defwords[20]="web-sessions";
defwords[21]="electric book";
defwords[22]="css";
defwords[23]="wct";
defwords[24]="wppt";
defwords[25]="dvd-cca";
defwords[26]="region codes";
defwords[27]="hbo";
defwords[28]="pvr";
defwords[29]="fan-sub";
defwords[30]="marie curie";
defwords[31]="r&d";
defwords[32]="cartels";
defwords[33]="mobile alliance";
defwords[34]="pride and prejudice";
defwords[35]="alice in wonderland";
defwords[36]="foss";
defwords[37]="mozilla";
defwords[38]="scarcity";
defwords[39]="gnu/linux";
defwords[40]="creative archive";
defwords[41]="bbc";
defwords[42]="mit";
defwords[43]="interoperability";
defwords[44]="mark russinovinch";
defwords[45]="trojan horse";
defwords[46]="windows vista";
defwords[47]="hd";
defwords[48]="xcp";
defwords[49]="motorola";
defwords[50]="napster";
defwords[51]="rhapsody";
defwords[52]="wma drm 10";
defwords[53]="unix";
defwords[54]="gcc";
defwords[55]="emacs";
defwords[56]="copyleft";
defwords[57]="utopia";
defwords[58]="sysinternals";
defwords[59]="first4internet";
defwords[60]="freedom-to-tinker";
defwords[61]="futuremark";
defwords[62]="dpm";
defwords[63]="pio";
defwords[64]="dma";
defwords[65]="aps";
defwords[66]="eula";
defwords[67]="broadcast flag";
defwords[68]="riaa";
defwords[69]="bt";
defwords[70]="edonkey";
defwords[71]="hollywood";
defwords[72]="divx";
defwords[73]="eu copyright directive";
defwords[74]="dmca";
defwords[75]="321 studios";
defwords[76]="sunncomm mediamax";
defwords[77]="secure digital music initiative";
defwords[78]="watermarking";
defwords[79]="elcomsoft";
defwords[80]="tecmo";
defwords[81]="ninjahacker.net";
defwords[82]="tivotogo";
defwords[83]="p-code";
defwords[84]="np-hard";
defwords[85]="reverse engineer";
defwords[86]="encrypted";
defwords[87]="macrovision";
defwords[88]="algorithm";
defwords[89]="pymusique";
defwords[90]="api";
defwords[91]="ajax";
defwords[92]="dom";
defwords[93]="w3c";
defwords[94]="fcc";

function getElementsByClassName(oElm, strTagName, oClassNames){
    var arrElements = (strTagName == "*" && document.all)? document.all : 
    oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    var arrRegExpClassNames = new Array();
    if(typeof oClassNames == "object"){
        for(var i=0; i<oClassNames.length; i++){
            arrRegExpClassNames.push(new RegExp("(^|\\s)" + 
            oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
        }
    }
    else{
        arrRegExpClassNames.push(new RegExp("(^|\\s)" + 
        oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));
    }
    var oElement;
    var bMatchesAll;
    for(var j=0; j<arrElements.length; j++){
        oElement = arrElements[j];
        bMatchesAll = true;
        for(var k=0; k<arrRegExpClassNames.length; k++){
            if(!arrRegExpClassNames[k].test(oElement.className)){
                bMatchesAll = false;
                break;                      
            }
        }
        if(bMatchesAll){
            arrReturnElements.push(oElement);
        }
    }
    return (arrReturnElements)
}

function getDef(){
	for(c = 0; c<defwords.length; c++)
	{
		var keyword = elmnts[z].childNodes[0].nodeValue.toLowerCase();
		if(keyword == defwords[c])
		{
			//dn[z] = def[c];
			return c;
		}
	}
	//return dn[z];
}

function getDefinitions() {

	elmnts = getElementsByClassName(document, "a", "key"); 
	
	for(z=0; z<elmnts.length; z++)
	{
		definition = getDef();
		
		switch(definition)
		{
			case 0:
				elmnts[z].onmouseover = function(){overlib("Sony's music download service")};
				break;
			case 1:
				elmnts[z].onmouseover = function(){overlib("Web presentation format")};
				break;
			case 2:
				elmnts[z].onmouseover = function(){overlib("Peer to Peer sharing")};
				break;
			case 3:
				elmnts[z].onmouseover = function(){overlib("Apple's online music store")};
				break;
			case 4:
				elmnts[z].onmouseover = function(){overlib("Apple's portable music/video player")};
				break;
			case 5:
				elmnts[z].onmouseover = function(){overlib("Small hardware device connected to computer to authenticate software")};
				break;
			case 6:
				elmnts[z].onmouseover = function(){overlib("Apple's suite of programs ,includes iTunes, iMovie etc.")};
				break;
			case 7:
				elmnts[z].onmouseover = function(){overlib("Sony BMG's controversial DRM software")};
				break;
			case 8:
				elmnts[z].onmouseover = function(){overlib("License allowing free sharing of content")};
				break;
			case 9:
				elmnts[z].onmouseover = function(){overlib("Consumers' welfare")};
				break;
			case 10:
				elmnts[z].onmouseover = function(){overlib("GNU General Public License")};
				break;
			case 11:
				elmnts[z].onmouseover = function(){overlib("MIT programmer who initiated the development of Linux")};
				break;
			case 12:
				elmnts[z].onmouseover = function(){overlib("A multimedia company")};
				break;
			case 13:
				elmnts[z].onmouseover = function(){overlib("Laws regarding copyright protection")};
				break;
			case 14:
				elmnts[z].onmouseover = function(){overlib("DRM used by Apple in its products")};
				break;
			case 15:
				elmnts[z].onmouseover = function(){overlib("A music store")};
				break;
			case 16:
				elmnts[z].onmouseover = function(){overlib("Education facilitated by internet, overcoming geographical barrier")};
				break;
			case 17:
				elmnts[z].onmouseover = function(){overlib("Copyright laws adopted in Europe")};
				break;
			case 18:
				elmnts[z].onmouseover = function(){overlib("An organization dediced to promote content sharing")};
				break;
			case 19:
				elmnts[z].onmouseover = function(){overlib("A blogger")};
				break;
			case 20:
				elmnts[z].onmouseover = function(){overlib("On-line activities")};
				break;
			case 21:
				elmnts[z].onmouseover = function(){overlib("Book with digital contents")};
				break;
			case 22:
				elmnts[z].onmouseover = function(){overlib("Content-scrambling system")};
				break;
			case 23:
				elmnts[z].onmouseover = function(){overlib("WIPO Copyright Treaty")};
				break;
			case 24:
				elmnts[z].onmouseover = function(){overlib("WIPO Performances and Phonograms Treaty")};
				break;
			case 25:
				elmnts[z].onmouseover = function(){overlib("DVD Copy Control Association")};
				break;
			case 26:
				elmnts[z].onmouseover = function(){overlib("Technology that comfines the application of devices to a certain region")};
				break;
			case 27:
				elmnts[z].onmouseover = function(){overlib("Home Box Office,a cable television network")};
				break;
			case 28:
				elmnts[z].onmouseover = function(){overlib("Personal video recorder")};
				break;
			case 29:
				elmnts[z].onmouseover = function(){overlib("Unofficial addition of subtitles")};
				break;
			case 30:
				elmnts[z].onmouseover = function(){overlib("A great scientist")};
				break;
			case 31:
				elmnts[z].onmouseover = function(){overlib("Research and Development")};
				break;
			case 32:
				elmnts[z].onmouseover = function(){overlib("Business grouping in order to gain control of the market")};
				break;
			case 33:
				elmnts[z].onmouseover = function(){overlib("A body which develops standards for the mobile industry")};
				break;
			case 34:
				elmnts[z].onmouseover = function(){overlib("A classic work written Jane Austen")};
				break;
			case 35:
				elmnts[z].onmouseover = function(){overlib("A fairy tale")};
				break;
			case 36:
				elmnts[z].onmouseover = function(){overlib("Software which opens its source code and thus can be changed or improved by users")};
				break;
			case 37:
				elmnts[z].onmouseover = function(){overlib("Web browser")};
				break;
			case 38:
				elmnts[z].onmouseover = function(){overlib("Condition in which limited resources cannot satisfy unlimited human wants")};
				break;
			case 39:
				elmnts[z].onmouseover = function(){overlib("Free operation system")};
				break;
			case 40:
				elmnts[z].onmouseover = function(){overlib("Collection of past news for free access")};
				break;
			case 41:
				elmnts[z].onmouseover = function(){overlib("British Broadcasting Corporation")};
				break;
			case 42:
				elmnts[z].onmouseover = function(){overlib("Massachusetts Institute of Technology")};
				break;
			case 43:
				elmnts[z].onmouseover = function(){overlib("Ability to operate on machines developed by different companies")};
				break;
			case 44:
				elmnts[z].onmouseover = function(){overlib("A programmer who made Sony XCP defects public")};
				break;
			case 45:
				elmnts[z].onmouseover = function(){overlib("A hidden malicious program")};
				break;
			case 46:
				elmnts[z].onmouseover = function(){overlib("The latest version of Windows")};
				break;
			case 47:
				elmnts[z].onmouseover = function(){overlib("High definition")};
				break;
			case 48:
				elmnts[z].onmouseover = function(){overlib("Extended Copy Protection, the DRM used by Sony BMG")};
				break;
			case 49:
				elmnts[z].onmouseover = function(){overlib("A cell phone company")};
				break;
			case 50:
				elmnts[z].onmouseover = function(){overlib("Online music service ")};
				break;
			case 51:
				elmnts[z].onmouseover = function(){overlib("Online music service")};
				break;
			case 52:
				elmnts[z].onmouseover = function(){overlib("DRM used by Windows Media")};
				break;
			case 53:
				elmnts[z].onmouseover = function(){overlib("A computer operating system")};
				break;
			case 54:
				elmnts[z].onmouseover = function(){overlib("GNU Compiler Collection")};
				break;
			case 55:
				elmnts[z].onmouseover = function(){overlib("A class of text editors")};
				break;
			case 56:
				elmnts[z].onmouseover = function(){overlib("Opposition of Copyright")};
				break;
			case 57:
				elmnts[z].onmouseover = function(){overlib("An idealistic society")};
				break;
			case 58:
				elmnts[z].onmouseover = function(){overlib("A website operated by Winternals Software LP")};
				break;
			case 59:
				elmnts[z].onmouseover = function(){overlib("The company which developed XCP")};
				break;
			case 60:
				elmnts[z].onmouseover = function(){overlib("Weblog written by Ed Felten and J. Alex Halderman")};
				break;
			case 61:
				elmnts[z].onmouseover = function(){overlib("A software development company")};
				break;
			case 62:
				elmnts[z].onmouseover = function(){overlib("Data Protection Manager")};
				break;
			case 63:
				elmnts[z].onmouseover = function(){overlib("Programmed Input/Output")};
				break;
			case 64:
				elmnts[z].onmouseover = function(){overlib("Direct Memory Access")};
				break;
			case 65:
				elmnts[z].onmouseover = function(){overlib("Assembly Programming System")};
				break;
			case 66:
				elmnts[z].onmouseover = function(){overlib("End User License Agreement")};
				break;
			case 67:
				elmnts[z].onmouseover = function(){overlib("Tags that are attached to broadcasting signals")};
				break;
			case 68:
				elmnts[z].onmouseover = function(){overlib("Recording Industry Association of America")};
				break;
			case 69:
				elmnts[z].onmouseover = function(){overlib("Bit Torrent, a downloading tool")};
				break;
			case 70:
				elmnts[z].onmouseover = function(){overlib("A downloading tool")};
				break;
			case 71:
				elmnts[z].onmouseover = function(){overlib("A US city, famous for film making")};
				break;
			case 72:
				elmnts[z].onmouseover = function(){overlib("Video codec created by DivX, Inc")};
				break;
			case 73:
				elmnts[z].onmouseover = function(){overlib("Copyright legislation used by European Union")};
				break;
			case 74:
				elmnts[z].onmouseover = function(){overlib("Digital Millennium Copyright Act")};
				break;
			case 75:
				elmnts[z].onmouseover = function(){overlib("A music and film making company")};
				break;
			case 76:
				elmnts[z].onmouseover = function(){overlib("A form of copy protection for compact discs")};
				break;
			case 77:
				elmnts[z].onmouseover = function(){overlib("A forum that aims to develop technology specifications that protect digital music")};
				break;
			case 78:
				elmnts[z].onmouseover = function(){overlib("A technology which writes hidden massages into contents")};
				break;
			case 79:
				elmnts[z].onmouseover = function(){overlib("A Russian computer software company")};
				break;
			case 80:
				elmnts[z].onmouseover = function(){overlib("A Japanese video game corporation")};
				break;
			case 81:
				elmnts[z].onmouseover = function(){overlib("A website")};
				break;
			case 82:
				elmnts[z].onmouseover = function(){overlib("Technology that allows recordings to be made on the run")};
				break;
			case 83:
				elmnts[z].onmouseover = function(){overlib("Engine diagnostic code")};
				break;
			case 84:
				elmnts[z].onmouseover = function(){overlib("One of the computational complexity theories")};
				break;
			case 85:
				elmnts[z].onmouseover = function(){overlib("Process of discovering the technological principles of a mechanical application through backward analysis of its structure, function and operation")};
				break;
			case 86:
				elmnts[z].onmouseover = function(){overlib("Encoded")};
				break;
			case 87:
				elmnts[z].onmouseover = function(){overlib("Content and software value management company")};
				break;
			case 88:
				elmnts[z].onmouseover = function(){overlib("Description of certain processing method used by computers")};
				break;
			case 89:
				elmnts[z].onmouseover = function(){overlib("Program that enables downloading from the iTunes Music Store on Linux.")};
				break;
			case 90:
				elmnts[z].onmouseover = function(){overlib("Application programming interface")};
				break;
			case 91:
				elmnts[z].onmouseover = function(){overlib("Asynchronous JavaScript and XML")};
				break;
			case 92:
				elmnts[z].onmouseover = function(){overlib("Document Object Model")};
				break;
			case 93:
				elmnts[z].onmouseover = function(){overlib("World Wide Web Consortium")};
				break;
			case 94:
				elmnts[z].onmouseover = function(){overlib("Federal Communications Commission")};
				break;
			default:
				elmnts[z].onmouseover = function(){overlib("Definition Not Found")};
				break;
		}
		elmnts[z].onmouseout = function(){nd();};
		//definition = dn[z];
		//elements[i].setAttribute("onmouseover",function anonymous(){overlib('This is an ordinary popup.');});
		//var element = elmnts[z];
		//elmnts[z].onmouseover = function(){overlib(definition)};
		//elmnts[z].onmouseout = function(){nd();};
		//elements[i].setAttribute("onmouseout",function anonymous(){nd();});
	}
}





