	var nFloor = "";	
	
	function removeField(nField){

		nField.parentNode.parentNode.removeChild(nField.parentNode);
	}

	function insertField(){

		var newFieldContainer = document.createElement('div');
		newFieldContainer.setAttribute("class", "naramky");
		var newFieldLabel = document.createElement('label');
		newFieldLabel.innerHTML = "Náramků Kusů :&nbsp;&nbsp;&nbsp;"; 		
		var newFieldLabel2 = document.createElement('label');
		newFieldLabel2.innerHTML = "&nbsp;&nbsp;Barva :&nbsp;&nbsp;&nbsp;"; 		

		var newField = document.createElement("input");
		newField.type = "text";
		newField.name = "kusov[]";
		newField.size = "5";
		newFieldContainer.appendChild(newFieldLabel);
		newFieldLabel.appendChild(newField);
		document.forms[0].insertBefore(newFieldContainer,nFloor);

		var myselect = document.createElement("select");
		myselect.name = "farba[]";
		newFieldContainer.appendChild(newFieldLabel2);
		newFieldLabel2.appendChild(myselect);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T001 Bílá");
		theOption.setAttribute("value","T001 Bílá");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T002 Černá");
		theOption.setAttribute("value","T002 Černá");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T003 Červená");
		theOption.setAttribute("value","T003 Červená");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T004 Zelená");
		theOption.setAttribute("value","T004 Zelená");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T005 Modrá");
		theOption.setAttribute("value","T005 Modrá");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T006 Žlutá");
		theOption.setAttribute("value","T006 Žlutá");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T007 Oranžová");
		theOption.setAttribute("value","T007 Oranžová");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T008 Fialová");
		theOption.setAttribute("value","T008 Fialová");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T009 Levandulová");
		theOption.setAttribute("value","T009 Levandulová");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T010 Růžová");
		theOption.setAttribute("value","T010 Růžová");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T011 Šedá");
		theOption.setAttribute("value","T011 Šedá");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T012 Neon Oranžová");
		theOption.setAttribute("value","T012 Neon Oranžová");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T013 Neon Růžová");
		theOption.setAttribute("value","T013 Neon Růžová");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T014 Neon Limetkově zelená");
		theOption.setAttribute("value","T014 Neon Limetkově zelená");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T015 Neon žlutá");
		theOption.setAttribute("value","T015 Neon žlutá");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T016 Neon Sunfire");
		theOption.setAttribute("value","T016 Neon Sunfire");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T017 Neon modrá");
		theOption.setAttribute("value","T017 Neon modrá");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T018 Bledě modrá");
		theOption.setAttribute("value","T018 Bledě modrá");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T019 Aqua");
		theOption.setAttribute("value","T019 Aqua");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T020 Stříbrná");
		theOption.setAttribute("value","T020 Stříbrná");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

        	var theOption=document.createElement("option");
	        var theText=document.createTextNode("T021 Zlatá");
		theOption.setAttribute("value","T021 Zlatá");
		myselect.appendChild(theOption);
	        theOption.appendChild(theText);

		var deleteBtn = document.createElement('input');
		deleteBtn.type = "button";
		deleteBtn.value = "Odstránit";
		deleteBtn.style.marginLeft = "5px";
		deleteBtn.onclick = function(){removeField(this)};
		newFieldContainer.appendChild(deleteBtn);

	}


	function init(){

		var insertBtn = document.getElementById('newFieldBtn')
		insertBtn.onclick = function()
			{
			 insertField();
			}
		nFloor = insertBtn;		
	}

	navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false);	
