function addGiftCard(parentElem,childElem,totalElem) {
	
	var _currTotal = parseInt(document.getElementById(totalElem).value);
	var _newTotal = parseInt(_currTotal) + 1;
	
	var _newElem = document.createElement("li");
	
	var _innerHtml = '<div class="width-one-quarter acenter"><br />Gift Card #' + _newTotal + '</div><div class="width-one-quarter"><label for="gcQty_' + _newTotal + '" class="block">Quantity:</label><input type="text" class="go-shortest" name="gcQty_' + _newTotal + '" id="gcQty_' + _newTotal + '" onblur="updateTotal();"></div><div class="width-one-quarter"><label for="gcAmt_' + _newTotal + '" class="block">Amount per Gift Card:</label><span style="font-size:16px; font-weight:bold;">$ </span><input type="text" class="go-shortest" name="gcAmt_' + _newTotal + '" id="gcAmt_' + _newTotal + '" value="0.00" onblur="updateTotal();"><a href="javascript:fnRemoveGiftCard(\''+ parentElem +'\',\''+childElem+'\',\''+totalElem+'\','+ _newTotal +')"><img src="/images/remove-ico.gif" border="0"></a></div><div class="width-one-quarter"><br><span style="font-size:16px; font-weight:bold;">$ <span id="gcTotal_' + _newTotal + '">0.00</span></span></div>';
	
	_newElem.setAttribute('id',childElem + _newTotal);
	_newElem.innerHTML = _innerHtml;
	
	var _parent = document.getElementById(parentElem);
	
	_parent.appendChild(_newElem);
	
	document.getElementById(totalElem).value = _newTotal;
}

function fnRemoveGiftCard(parentElem,childElem,totalElem,itemNo) {
	var _currTotal = parseInt(document.getElementById(totalElem).value);	
	var _newTotal = parseInt(_currTotal) - 1;
	
	for(var i=itemNo;i<_currTotal;i++) {
		var plusone = parseInt(i) + 1;
		document.getElementById("gcQty_"+i).value = document.getElementById("gcQty_"+plusone).value;
		document.getElementById("gcAmt_"+i).value = document.getElementById("gcAmt_"+plusone).value;
	}
	
	removelist = childElem + _currTotal;
	var removeelement = document.getElementById(removelist);
	document.getElementById(parentElem).removeChild(removeelement);
	document.getElementById(totalElem).value = _newTotal;
	
	updateTotal();	
}

