function validate_form ( )
{
    valid = true;

    if ( document.newHourForm.description.value == "" ){
    	//document.write('hallo');
        alert ( "Du lyt skrive inn eit «namn» på timen" );
        valid = false;
        document.newHourForm.description.focus();
    }

    return valid;
}

var i = 2;

function addTextInput(){
 	var tr = document.createElement("tr");
 	var td1 = document.createElement("td");
 	var td2 = document.createElement("td");
 	var td3 = document.createElement("td");
 	var td4 = document.createElement("td");
 	var input1 = document.createElement("input");
 	var input2 = document.createElement("input");
 	var input3 = document.createElement("input");
 	var name = "objects_name_"+i;
 	var description = "objects_description_"+i;
 	var number = "objects_number_"+i;

 	var objectName = document.newObjectForm.objects_name_1.value;
 	var objectDescription = document.newObjectForm.objects_description_1.value;
 	
 	input1.setAttribute("type", "text");
 	input1.setAttribute("name", name);
 	input1.setAttribute("value", objectName);
 	
 	input2.setAttribute("type","text");
 	input2.setAttribute("name", number);
 	input2.setAttribute("value", i);
 	input2.setAttribute("size", "8");
 	
 	input3.setAttribute("type","text");
 	input3.setAttribute("name", description);
 	input3.setAttribute("value", objectDescription);
 	
 	td1.setAttribute("class","inputtext");
 	td2.setAttribute("class","inputtext");
 	td3.setAttribute("class","inputfield_small"); 	
 	td4.setAttribute("class","inputtext"); 	

	td2.appendChild(input1);
 	td3.appendChild(input2); 	
 	td4.appendChild(input3); 	

 	tr.appendChild(td1);
 	tr.appendChild(td3);
 	tr.appendChild(td2);
 	tr.appendChild(td4);
 	
 	document.getElementById("newObjects").appendChild(tr);
	document.getElementById('total_objects').value = i;
 	
 	i++;
}

function disable(selected){
	if(selected == true){
		document.getElementById("object_groups_table").setAttribute("style","display: block;");
	}else{
		document.getElementById("object_groups_table").setAttribute("style","display: none;");
	}
	
	
	
	//input.setAttribute("disable","disable");
	
}

/*function addTextInput(){
 	var d = document.createElement("div");
 	var file = document.createElement("input");
 	file.setAttribute("type", "file");
 	file.setAttribute("name", "filer[]");
 	d.appendChild(file);
 	document.getElementById("moreUploads").appendChild(d);
 	upload_number++;
}*/