
function GUIBasic()
{ 
	this.createA = function(href, target, text)
				   {
						var a = document.createElement("a");
							a.setAttribute("href",href);
							a.setAttribute("target",target);
							a.appendChild(document.createTextNode(text));
						return a;
						}
	this.createBold = function(text)
					   {
							var b = document.createElement('b');
							    b.appendChild(document.createTextNode(text));
						    return b;
							}
	this.createButton = function(name,value,onclick)
						{
							var td = this.createColumn("center", "","","");
							var b = this.createInput("button",name,value);
								b.onclick = onclick;
								b.className = "inputgr";
								td.appendChild(b);
							return td;
							}
	this.createColumn = function(align,valign,className,width)
						{
							var td = document.createElement('td');
								td.setAttribute("align",align);
								td.className = className;
							if (valign.length>0) td.setAttribute("valign",valign);
							if (width.length>0) td.setAttribute("width",width);
                            return td;
							}
	this.createInput = function(type, name, value)
					   {
							var input = document.createElement('input');
						        input.setAttribute("type",type);
		                        input.setAttribute("name",name);
		                        input.setAttribute("value",value);
							return input;
							}
	this.createTextField = function(name, className, maxlength, width)
					   {
							var input = this.createInput('input',name,"");
						        input.className = className;
							if (maxlength.length>0)	input.setAttribute("maxlength" , maxlength);
							if (width.length>0)	input.style.width = width;
							return input;
							}
	this.createRow = function()
						{
							var tr = document.createElement('tr');
							return tr;
							}
	this.createSelect = function(name, className, values, text, label)
						{
							var select = document.createElement('select');
							    select.className = className;
								select.setAttribute("name" , name);
								option = document.createElement('option');
								option.value = 0;
								option.text = "- "+label+" -";
								select.options.add(option);
									
								for(i=0;i<values.length;i++)
							    {
									option = document.createElement('option');
								    option.value = values[i];
									option.text = text[i];
									select.options.add(option);
									}
							return select;
							}
	this.createTable = function(border, width, sborder)
					   {
							var table = document.createElement('table');
								table.setAttribute("border",border);
								table.setAttribute("width",width);
								table.style.border = sborder;
							return table;
							}
	this.createTableBody = function()
						   {
								var tbody = document.createElement('tbody');
								return tbody;
								}
	this.createTdHeader = function(names)
						  {
								var tr = this.createRow();
								for(i=0;i<names.length;i++)
							    {
									var td = this.createColumn("center", "top", "comm_t", "");
    									td.style.borderBottom = "1px dotted CCCCCC";
	                                    td.appendChild(document.createTextNode(names[i]));
										tr.appendChild(td);
									}
                                var td = this.createColumn("center", "", "comm_t", "");
								    tr.appendChild(td);
								return tr;
								}
	this.createTdTextField = function(name)
							 {
									var td = this.createColumn("center","top","comm_t","");
									    td.appendChild(this.createTextField(name,"comm_t","6","40px"));
                                    return td;
									}
	this.createTdTextFieldDate = function(name)
								 {
									var td1 = this.createColumn("center","top","comm_t","");
									    td1.appendChild(this.createTextFieldDate(name));
                                    var img = document.createElement("img");
									    img.setAttribute("src","images/calendar.gif");
										img.setAttribute("id",name+"_b");
//										img.onclick = function(){displayCalendar(name,'dd/mm/yyyy',this);};
  img.onmouseover = function(){Calendar.setup({inputField : name+"_t",ifFormat : '%d/%m/%Y',button : name+"_b",align : 'T1',singleClick : true}); };
                                    var td2 = this.createColumn("center","top","comm_t","");
									    td2.appendChild(img);
//										td2.appendChild(text);
                                    var t = document.createElement("table");
									var tbody = document.createElement("tbody");
									var tr = document.createElement("tr");
									    tr.appendChild(td1);
									    tr.appendChild(td2);
										tbody.appendChild(tr);
										t.appendChild(tbody);
									var td = this.createColumn("center","top","comm_t","");
									    td.appendChild(t);
                                    return td;
									}
	this.createTextFieldDate = function(name)
							   {
									var te = this.createInput("text",name,"");
										te.className = "comm_t";
									//	te.setAttribute("maxlength" , "10");
										te.setAttribute("readonly" , "1");
										te.readOnly = "1";
//										te.setAttribute("disabled","disabled");
										te.setAttribute("id" , name+"_t");
										te.style.width = "80px";
										return te;
									}
	}

