<!--//--><![CDATA[//><!--
		function addNewElement() {
			var imfu = document.getElementById("imagesfileupload");
			if(!imfu) return;
			var xhtml = "http://www.w3.org/1999/xhtml";
			var fu, div;
			var allFull = true;
			var i;
			var frm = document.forms["addarticolo"] || document.forms["editarticolo"];
			if(!frm) return;
			var el = frm.elements;
			for(i=1; typeof(el["images["+i+"]"])!="undefined"; i++) {
				if(el["images["+i+"]"].value == "") {
					allFull = false;
				}
			}
			var nextType = "file";
			var nextName = "images["+i+"]";
			var nextSize = el["images[1]"].size;
			var nextStyleW = el["images[1]"].style.width;
			var nextClass = el["images[1]"].className;
			var nextType_d = "text";
			var nextName_d = "description["+i+"]";
			var nextSize_d = el["description[1]"].size;
			var nextStyleW_d = el["description[1]"].style.width;

			if(!allFull) {}
			else if(document.createElementNS && (fu=document.createElementNS(xhtml,"input"))!=null
			&& fu.setAttributeNS!==undefined){
				div = document.createElementNS(xhtml,"div")
				//alert("metodo usato: createElementNS");

				//fu.setAttributeNS(xhtml,"type",nextType);
				//fu.setAttributeNS(xhtml,"class",nextClass);
				//fu.setAttributeNS(xhtml,"size",nextSize);
				//fu.setAttributeNS(xhtml,"name",nextName);
				//fu.setAttributeNS(xhtml,"onchange","addNewElement();");

				fu.type = nextType;
				fu.className = nextClass;
				fu.size = nextSize;
				fu.name = nextName;
				fu.style.width = nextStyleW;
				fu.onchange = addNewElement;

				var fu_d = document.createElementNS(xhtml,"input");
				fu_d.type = nextType_d;
				fu_d.name = nextName_d;
				fu_d.size = nextSize_d;
				fu_d.style.width = nextStyleW_d;

				el[nextName] = fu;
				el[nextName_d] = fu_d;
				div.appendChild(fu)
				div.appendChild(fu_d)
				imfu.appendChild(div);
			}
			else if(document.createElement && (fu=document.createElement("input"))!=null
			&& fu.setAttribute!==undefined){
				div = document.createElement("div")
				//alert("metodo usato: createElement");

				fu.setAttribute("type",nextType);
				fu.setAttribute("name",nextName);
				fu.setAttribute("size",nextSize);
				//fu.setAttribute("style",nextStyle);
				fu.style.width = nextStyleW;
				fu.setAttribute("className",nextClass);
				fu.setAttribute("onchange","addNewElement();");

				fu_d=document.createElement("input");
				fu_d.setAttribute("type",nextType_d);
				fu_d.setAttribute("name",nextName_d);
				fu_d.setAttribute("size",nextSize_d);
				//fu_d.setAttribute("style",nextStyle_d);
				fu_d.style.width = nextStyleW_d;

				//fu.type = nextType;
				//fu.className = nextClass;
				//fu.size = nextSize;
				//fu.name = nextName;
				//fu.onchange = addNewElement;

				el[nextName] = fu;
				el[nextName_d] = fu_d;
				div.appendChild(fu)
				div.appendChild(fu_d)
				imfu.appendChild(div);
			}
			else {
			}
		}
		function addNewElementPdf() {
			var imfu = document.getElementById("imagesfileupload");
			if(!imfu) return;
			var xhtml = "http://www.w3.org/1999/xhtml";
			var fu, div;
			var allFull = true;
			var i;
			var frm = document.forms["addarticolo"] || document.forms["editarticolo"];
			if(!frm) return;
			var el = frm.elements;
			for(i=1; typeof(el["images["+i+"]"])!="undefined"; i++) {
				if(el["images["+i+"]"].value == "") {
					allFull = false;
				}
			}
			var nextType = "file";
			var nextName = "images["+i+"]";
			var nextSize = el["images[1]"].size;
			var nextStyleW = el["images[1]"].style.width;
			var nextClass = el["images[1]"].className;
			
			var nextType_d = "text";
			var nextName_d = "description["+i+"]";
			var nextSize_d = el["description[1]"].size;
			var nextStyleW_d = el["description[1]"].style.width;
			
			var nextType_p = "checkbox";
			var nextName_p = "converti_pdf["+i+"]";
			var nextSize_p = el["converti_pdf[1]"].size;
			var nextStyleW_p = el["converti_pdf[1]"].style.width;
			var nextStyleW_pm = "0px 0px 0px 30px";
			

			if(!allFull) {}
			else if(document.createElementNS && (fu=document.createElementNS(xhtml,"input"))!=null
			&& fu.setAttributeNS!==undefined){
				div = document.createElementNS(xhtml,"div")
				//alert("metodo usato: createElementNS");

				//fu.setAttributeNS(xhtml,"type",nextType);
				//fu.setAttributeNS(xhtml,"class",nextClass);
				//fu.setAttributeNS(xhtml,"size",nextSize);
				//fu.setAttributeNS(xhtml,"name",nextName);
				//fu.setAttributeNS(xhtml,"onchange","addNewElementPdf();");

				fu.type = nextType;
				fu.className = nextClass;
				fu.size = nextSize;
				fu.name = nextName;
				fu.style.width = nextStyleW;
				fu.onchange = addNewElementPdf;

				var fu_d = document.createElementNS(xhtml,"input");
				fu_d.type = nextType_d;
				fu_d.name = nextName_d;
				fu_d.size = nextSize_d;
				fu_d.style.width = nextStyleW_d;

				var fu_p = document.createElementNS(xhtml,"input");
				fu_p.type = nextType_p;
				fu_p.name = nextName_p;
				fu_p.size = nextSize_p;
				fu_p.style.width = nextStyleW_p;
				fu_p.style.margin = nextStyleW_pm;
				
				el[nextName] = fu;
				el[nextName_d] = fu_d;
				el[nextName_p] = fu_p;
				div.appendChild(fu)
				div.appendChild(fu_d)
				div.appendChild(fu_p)
				imfu.appendChild(div);
			}
			else if(document.createElement && (fu=document.createElement("input"))!=null
			&& fu.setAttribute!==undefined){
				div = document.createElement("div")
				//alert("metodo usato: createElement");

				fu.setAttribute("type",nextType);
				fu.setAttribute("name",nextName);
				fu.setAttribute("size",nextSize);
				//fu.setAttribute("style",nextStyle);
				fu.style.width = nextStyleW;
				fu.setAttribute("className",nextClass);
				fu.setAttribute("onchange","addNewElementPdf();");

				fu_d=document.createElement("input");
				fu_d.setAttribute("type",nextType_d);
				fu_d.setAttribute("name",nextName_d);
				fu_d.setAttribute("size",nextSize_d);
				//fu_d.setAttribute("style",nextStyle_d);
				fu_d.style.width = nextStyleW_d;
				
				fu_p=document.createElement("input");
				fu_p.setAttribute("type",nextType_p);
				fu_p.setAttribute("name",nextName_p);
				fu_p.setAttribute("size",nextSize_p);
				//fu_d.setAttribute("style",nextStyle_d);
				fu_p.style.width = nextStyleW_p;
				fu_p.style.margin = nextStyleW_pm;

				//fu.type = nextType;
				//fu.className = nextClass;
				//fu.size = nextSize;
				//fu.name = nextName;
				//fu.onchange = addNewElementPdf;

				el[nextName] = fu;
				el[nextName_d] = fu_d;
				el[nextName_d] = fu_p;
				div.appendChild(fu)
				div.appendChild(fu_d)
				div.appendChild(fu_p)
				imfu.appendChild(div);
			}
			else {
			}
		}
		
		
		//window.onload = function() { if(document.forms["formhouse"]) setInterval(addNewElementPdf,1000); }
//--><!]]>
