function addFormField() {
	var id = document.getElementById("id").value;

	if (id <= 30) {
	$("#divTxt").append("<p id='row" + id + "'><label for='txt" + id + "'>Imagem " + id + "&nbsp;&nbsp;<input type='file' size='20' name='images[]' id='txt" + id + "'>&nbsp;&nbsp;&nbsp<a href='#' onClick='removeFormField(\"#row" + id + "\"); return false;'>Remove</a><!--br>Comentário da Imagem " + id + "<br><textarea cols='45' rows='5' name='coment[]' id='coment_" + id + "' >Digite um comentário para esta imagem.</textarea--></label></p>");

	$('#row' + id).highlightFade({
		speed:1000
	});
  }

	id = (id - 1) + 2;
	document.getElementById("id").value = id; 
	tinyMCE.init({
		// General options
    	language : "pt",
		mode : "textareas",
		theme : "advanced",
		plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

		// Theme options
		theme_advanced_buttons1:"code,bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,cleanup,link,unlink,image,media,table,bullist,numlist",

		// Theme options
		theme_advanced_buttons2 : "formatselect,fontselect,fontsizeselect,forecolor,backcolor,fullscreen",
		theme_advanced_buttons3 : "",
		theme_advanced_buttons4 : "",


		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		// Example content CSS (should be your site CSS)
	 content_css : "css/content.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",
    file_browser_callback : "tinyBrowser",
		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
}

function removeFormField(id) {
	$(id).remove();
}
var ieBlink = (document.all)?true:false;
function doBlink(){
	if(ieBlink){
		obj = document.getElementsByTagName('BLINK');
		for(i=0;i<obj.length;i++){
			tag=obj[i];
			tag.style.visibility=(tag.style.visibility=='hidden')?'visible':'hidden';
		}
	}
}

function selectThis(src) {
     document.selection.clear;
     txt = eval(src +".innerText");
     theObj = document.all(txt);
     txtRange = document.body.createTextRange();
     txtRange.moveToElementText(eval(src));
     txtRange.select();
     txtRange.execCommand("Copy");
}

