function selectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}

var formHtml = document.createElement('form');
formHtml.setAttribute('name','zventsSearchForm');
formHtml.setAttribute('id','zventsSearchForm');
formHtml.setAttribute('method','get');
formHtml.setAttribute('action','http://events.activedayton.com/search');

var div1 = document.createElement('div');
div1.setAttribute('class','search-control');
var div2 = document.createElement('div');
div2.setAttribute('class','search-control');
var div3 = document.createElement('div');
div3.setAttribute('class','search-control');
var div4 = document.createElement('div');
div4.setAttribute('class','search-control');
var div5 = document.createElement('div');
div5.setAttribute('class','divclear');

var label1 = document.createElement('label');
label1.appendChild(document.createTextNode('what'));
var label2 = document.createElement('label');
label2.appendChild(document.createTextNode('when'));
var label3 = document.createElement('label');
label3.appendChild(document.createTextNode('where'));

var span1 = document.createElement('span');
span1.setAttribute('class','help');
span1.appendChild(document.createTextNode('(genre or category, title, theater or venue name)'));
var span2 = document.createElement('span');
span2.setAttribute('class','help');
span2.appendChild(document.createTextNode('(today, tonight, tomorrow, this weekend, Saturday, etc.)'));
var span3 = document.createElement('span');
span3.setAttribute('class','help');
span3.appendChild(document.createTextNode('(City and State, ZIP)'));
var span4 = document.createElement('span');
span4.setAttribute('class','poweredby');
span4.appendChild(document.createTextNode('powered by '));
var powerLink = document.createElement('a');
powerLink.setAttribute('href','http://events.activedayton.com');
powerLink.appendChild(document.createTextNode('ActiveDayton.com'));
span4.appendChild(powerLink);

var input1 = document.createElement('input');
input1.setAttribute('type','text');
input1.setAttribute('value','');
input1.setAttribute('name','swhat');
input1.setAttribute('id','swhat');
input1.setAttribute('onclick','selectAll(\'swhat\');');
var input2 = document.createElement('input');
input2.setAttribute('type','text');
input2.setAttribute('value','');
input2.setAttribute('name','swhen');
input2.setAttribute('id','swhen');
input2.setAttribute('onclick','selectAll(\'swhen\');');
var input3 = document.createElement('input');
input3.setAttribute('type','text');
input3.setAttribute('value','Dayton, OH');
input3.setAttribute('name','swhere');
input3.setAttribute('id','swhere');
input3.setAttribute('onclick','selectAll(\'swhere\');');
var input4 = document.createElement('input');
input4.setAttribute('type','submit');
input4.setAttribute('value','Search');
input4.setAttribute('name','commit');
input4.setAttribute('id','z_search_button');
var input5 = document.createElement('input');
input5.setAttribute('type','hidden');
input5.setAttribute('value','true');
input5.setAttribute('name','search');
var input6 = document.createElement('input');
input6.setAttribute('type','hidden');
input6.setAttribute('value','text');
input6.setAttribute('name','svt');
var input7 = document.createElement('input');
input7.setAttribute('type','hidden');
input7.setAttribute('value','');
input7.setAttribute('name','srss');

var select1 = document.createElement('select');
select1.setAttribute('name','st_select');
select1.setAttribute('id','st_select');

var option1 = document.createElement('option');
option1.setAttribute('selected','selected');
option1.setAttribute('value','any');
option1.appendChild(document.createTextNode('All Listings'));
var option2 = document.createElement('option');
option2.setAttribute('value','event');
option2.appendChild(document.createTextNode('Events'));
var option3 = document.createElement('option');
option3.setAttribute('value','movie');
option3.appendChild(document.createTextNode('Movies'));
var option4 = document.createElement('option');
option4.setAttribute('value','venue');
option4.appendChild(document.createTextNode('Venues'));
var option5 = document.createElement('option');
option5.setAttribute('value','restaurant');
option5.appendChild(document.createTextNode('Restaurants'));
var option6 = document.createElement('option');
option6.setAttribute('value','artist');
option6.appendChild(document.createTextNode('Performers'));

select1.appendChild(option1);
select1.appendChild(option2);
select1.appendChild(option3);
select1.appendChild(option4);
select1.appendChild(option5);
select1.appendChild(option6);

div1.appendChild(label1);
div1.appendChild(input1);
div1.appendChild(span1);

div2.appendChild(label2);
div2.appendChild(input2);
div2.appendChild(span2);

div3.appendChild(label3);
div3.appendChild(input3);
div3.appendChild(span3);

div4.appendChild(select1);
div4.appendChild(input4);

formHtml.appendChild(div1);
formHtml.appendChild(div2);
formHtml.appendChild(div3);
formHtml.appendChild(div4);
formHtml.appendChild(input5);
formHtml.appendChild(input6);
formHtml.appendChild(input7);
formHtml.appendChild(span4);
formHtml.appendChild(div5);

var scr = document.getElementById('ActDaySearchWidget');
scr.appendChild(formHtml);