// p is the popup element, id is the id of the element moused over
// since i didn't use a a library like jquery or prototype i just made
// each of the popup elements have a unique id that we can access them
// with getElementById().

// arrayDesc is an array of those elements and a description of the array
// info array
function getInfo(p, id) {
  id = id.replace('dvdid', '');
	if (typeof info[id] != 'undefined') {
		for (var i=0; i<info[id].length; i++) {
			if (obj = document.getElementById(arrayDesc[i])) {
				if (arrayDesc[i] == 'infoCover') {
					pic = new Image();
					pic.src = info[id][i];
					obj.src = info[id][i];
				}
				if (arrayDesc[i] == 'infoLength') {
					if(info[id][i].match(/^0 min/)) obj.innerHTML = 'Over 10 Hours!';
					else obj.innerHTML = info[id][i];
				}
				else
					obj.innerHTML = info[id][i];
			}
		}
		return;
	}
	clearInfo();
}

// we call this function to reset the infobox popups information. if we dont it will stick and if
// there is an error incorrect information can be displayed.
function clearInfo() {
	for (var i=0; i<arrayDesc.length; i++) {
		if (obj = document.getElementById(arrayDesc[i])) {
			var tag = 'innertHTML'
			if (obj = document.getElementById(arrayDesc[i])) {
				switch (arrayDesc[i]) {
					case 'infoCover': obj.src = 'images/popup-default-cover.jpg'; break;
					case 'infoTitle': obj.innerHTML = 'No Info'; break;
					default: obj.innerHTML = 'N/A';
				}
			}
		}
	}
}