/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Bontrager Connection, LLC | http://www.willmaster.com/Licensed under: U.S. Copyright
 */

var DefaultName = "pole";
var DefaultNameIncrementNumber = 0;

function AddFormField(id,type,name,value,tag,tex) {
if(! document.getElementById && document.createElement) { return; }
var inhere = document.getElementById(id);

var formfield = document.createElement("input");
if(name.length < 1) {
   DefaultNameIncrementNumber++;
   name = String(DefaultName + DefaultNameIncrementNumber);
   }
formfield.name = name;
formfield.type = type;
formfield.value = value;

if(tag.length > 0) {
   var thetag = document.createElement(tag);
   thetag.setAttribute('id','spotrebic');

   var t=document.createTextNode(tex);

   thetag.appendChild(formfield);
   thetag.appendChild(t);
   inhere.appendChild(thetag);
   }
else { inhere.appendChild(formfield); }
} 

function AddSelectField(id,name,tag,tex) {
if(! document.getElementById && document.createElement) { return; }
var inhere = document.getElementById(id);

var formfield = document.createElement("select");
if(name.length < 1) {
   DefaultNameIncrementNumber++;
   name = String(DefaultName + DefaultNameIncrementNumber);
   }
formfield.name = name;
//formfield.type = type;
//formfield.value = value;


theOption1=document.createElement("option");
theText1=document.createTextNode("--nevybráno--");
theOption1.appendChild(theText1);
theOption1.setAttribute("value","0");

theOption2=document.createElement("option");
theText2=document.createTextNode("Dakon");
theOption2.appendChild(theText2);
theOption2.setAttribute("value","Dakon");

theOption3=document.createElement("option");
theText3=document.createTextNode("Protherm");
theOption3.appendChild(theText3);
theOption3.setAttribute("value","Protherm");

theOption4=document.createElement("option");
theText4=document.createTextNode("Viadrus");
theOption4.appendChild(theText4);
theOption4.setAttribute("value","Viadrus");

theOption5=document.createElement("option");
theText5=document.createTextNode("Buderus");
theOption5.appendChild(theText5);
theOption5.setAttribute("value","Buderus");

theOption6=document.createElement("option");
theText6=document.createTextNode("Geminox");
theOption6.appendChild(theText6);
theOption6.setAttribute("value","Geminox");

theOption7=document.createElement("option");
theText7=document.createTextNode("Karma");
theOption7.appendChild(theText7);
theOption7.setAttribute("value","Geminox");

formfield.appendChild(theOption1);
formfield.appendChild(theOption2);
formfield.appendChild(theOption3);
formfield.appendChild(theOption4);
formfield.appendChild(theOption5);
formfield.appendChild(theOption6);
formfield.appendChild(theOption7);

if(tag.length > 0) {
   var thetag = document.createElement(tag);
   thetag.setAttribute('id','spotrebic');

   var t=document.createTextNode(tex);

   thetag.appendChild(formfield);
   thetag.appendChild(t);
   inhere.appendChild(thetag);
   }
else { inhere.appendChild(formfield); }
} 

function AddFormFields() {
	var mybreak=document.createElement("br");
	var myp=document.createElement("p");
	var nadp=document.createTextNode('Spotřebič');
	myp.style.fontWeight="bold";
	inhere.appendChild(myp);
	myp.appendChild(mybreak);
	myp.appendChild(nadp);

	AddSelectField('inhere','','div',' Značka *');
	AddSelect2Field('inhere','','div',' Druh *');
	AddFormField('inhere','text','','','div',' Typ spotřebiče');
	AddFormField('inhere','text','','','div',' Rok výroby');
}

function AddSelect2Field(id,name,tag,tex) {
if(! document.getElementById && document.createElement) { return; }
var inhere = document.getElementById(id);

var formfield = document.createElement("select");
if(name.length < 1) {
   DefaultNameIncrementNumber++;
   name = String(DefaultName + DefaultNameIncrementNumber);
   }
formfield.name = name;
//formfield.type = type;
//formfield.value = value;


theOption1=document.createElement("option");
theText1=document.createTextNode("--nevybráno--");
theOption1.appendChild(theText1);
theOption1.setAttribute("value","0");

theOption2=document.createElement("option");
theText2=document.createTextNode("1.kotel na pevná paliva");
theOption2.appendChild(theText2);
theOption2.setAttribute("value","kotel na pevná paliva");

theOption3=document.createElement("option");
theText3=document.createTextNode("2.plynový kotel");
theOption3.appendChild(theText3);
theOption3.setAttribute("value","plynový kotel");

theOption4=document.createElement("option");
theText4=document.createTextNode("3.podokenní topidlo");
theOption4.appendChild(theText4);
theOption4.setAttribute("value","podokenní topidlo");

formfield.appendChild(theOption1);
formfield.appendChild(theOption2);
formfield.appendChild(theOption3);
formfield.appendChild(theOption4);

if(tag.length > 0) {
   var thetag = document.createElement(tag);
   thetag.setAttribute('id','spotrebic');

   var t=document.createTextNode(tex);

   thetag.appendChild(formfield);
   thetag.appendChild(t);
   inhere.appendChild(thetag);
   }
else { inhere.appendChild(formfield); }
} 

