function showText(inputdata){
	window.alert(inputdata);
}

function buildPage(){
	var pagecontent = "<html><head><title>";
	pagecontent += document.pageform.pagetitle.value;
	pagecontent += "</title></head>\n"
	pagecontent += "<body bgcolor='white'>\n"
	pagecontent += document.pageform.bodytext.value;
	pagecontent += "\n</body>\n</html>";
	
	document.pageform.mycode.value=pagecontent;
}

// Form Validation Functions

function getRadioValue(formname,radioname){
    var theRadioButtons = document[formname][radioname];
    for (i=0;i<theRadioButtons.length;i++){
        if (theRadioButtons[i].checked){
            return theRadioButtons[i].value;
        }
    }
}

function showRadioValue(formname,radioname,thevalue){
    var theRadioButtons = document[formname][radioname];
    for (i=0;i<theRadioButtons.length;i++){
        var temp = theRadioButtons[i].value;
        if (temp == thevalue){
            theRadioButtons[i].checked = true;
        }
    }   
}

function getSelectValue(formname,selectname){
    var theMenu = document[formname][selectname];
    var selecteditem = theMenu.selectedIndex;
    return theMenu.options[selecteditem].value;
}

function showSelectValue(formname,selectname,thevalue){
    var theMenu = document[formname][selectname];
    for (i=0;i<theMenu.options.length;i++){
        var temp = theMenu.options[i].value;
        if (temp == thevalue){
            theMenu.selectedIndex = i;
        }
    }   
}

// End Form Validation Functions

function doDate(){
// Array of month Names
	var monthNames = new Array( "January","February","March","April","May","June","July","August","September","October","November","December");
	var now = new Date();
	document.write(monthNames[now.getMonth()] + " " + now.getDate() + ", " + now.getFullYear());
}
