view script.js @ 0:7d97fa9a0423 draft

Uploaded
author davidvanzessen
date Fri, 09 May 2014 09:35:32 -0400
parents
children 778a9d130904
line wrap: on
line source

function compareAdd(id){
	var img = document.createElement('img');
	img.setAttribute('src', 'VD_' + id + '.png');
	var td = document.createElement('td');
	td.setAttribute('id', "comparison_vd_" + id);
	td.appendChild(img)
	document.getElementById('comparison_table_vd').appendChild(td);
	
	img = document.createElement('img');
	img.setAttribute('src', 'VJ_' + id + '.png');
	td = document.createElement('td');
	td.setAttribute('id', "comparison_vj_" + id);
	td.appendChild(img)
	document.getElementById('comparison_table_vj').appendChild(td);
	
	img = document.createElement('img');
	img.setAttribute('src', 'DJ_' + id + '.png');
	td = document.createElement('td');
	td.setAttribute('id', "comparison_dj_" + id);
	td.appendChild(img)
	document.getElementById('comparison_table_dj').appendChild(td);
	
	document.getElementById('compare_checkbox_' + id).setAttribute('onchange', "javascript:compareRemove('" + id + "')");
}


function compareRemove(id){
	document.getElementById("comparison_vd_" + id).remove()
	document.getElementById("comparison_vj_" + id).remove()
	document.getElementById("comparison_dj_" + id).remove()
	document.getElementById('compare_checkbox_' + id).setAttribute('onchange', "javascript:compareAdd('" + id + "')");
}