// JavaScript Document

function addFormField() {
	var id = document.getElementById("id").value;
	$("#divTxt").append("<p style='margin:0px;padding:0px;width:90%;' id='row" + id + "'><label for='txt" + id + "' style='color:#2a2a2a;'>" + id + ".&nbsp;&nbsp;&nbsp;&nbsp;<input title='Type new collection data' type=text name='collection_data[]' id='txt1" + id + "' size='35'>&nbsp;&nbsp;<a href='#' onClick='removeFormField(\"#row" + id + "\"); return false;'><img alt='Remove' title='Remove' border=0 src='images/close.png'></a></label></p><br>");
	
	
	$('#row' + id).highlightFade({
		speed:1000
	});
	
	id = (id - 1) + 2;
	document.getElementById("id").value = id;
}

function removeFormField(id) {
	$(id).remove();
}

/**REFRESH SCRIPT FOR COLLECTION**/
function refreshCollection(book_id, cDel) {
	$("#contenPanCollection").load("frame-collection-loader.php?book_id="+book_id+"&cDel="+cDel+"", '', callbackCollection);
}
function callbackCollection() {
	$("#toBeHideCollection").hide();
	$("#contenPanCollection").show();
}
$(document).ready(refreshCollection(book_id, cDel));


/**REFRESH SCRIPT FOR CATEGORY**/
function refreshCategory() {
	$("#contenPanCategory").load("category-loader.php", '', callbackCategory);
}
function callbackCategory() {
	$("#toBeHideCategory").hide();
	$("#contenPanCategory").show();
}
$(document).ready(refreshCategory());
