Array.prototype.add=function(item){this[this.length] = item}
Array.prototype.getById = function(id){for(var i=0;i<this.length;i++)if(this[i].id == id || this[i]==id)return this[i];return null;}

var products = new Array();

function product (id, title, textcode){
	this.id = id;
  this.title = title;
  this.textcode = textcode;
}

function loadDisplay(productId){
	product = products.getById(productId);
	if (productId > 0){
		document.getElementById('display_title').style.fontSize = '24px';
		document.getElementById('display_textcode').style.fontSize = '24px';
	} else {
		document.getElementById('display_title').style.fontSize = '14px';
		document.getElementById('display_textcode').style.fontSize = '14px';
	}
	if(product){
		document.getElementById('display_title').innerHTML = product.title;
		document.getElementById('display_textcode').innerHTML = product.textcode;
	}else{
		resetDisplay()
	}	
}

function resetDisplay(){
		document.getElementById('display_title').innerHTML = "";
		document.getElementById('display_textcode').innerHTML = "";
}
