function generate(form){
page = document.inputForm.page.value;
toolbars = document.inputForm.toolbars.checked;
scrollprops = document.inputForm.scrollit.checked;
locations = document.inputForm.locations.checked;
statusbars = document.inputForm.statusbars.checked;
menubars = document.inputForm.menubars.checked;
resizeable = document.inputForm.resizeable.checked;
width = document.inputForm.width.value;
if (!width) width = screen.width;
height = document.inputForm.height.value;
if (!height) height = screen.height;
howto = document.inputForm.howtoopen.options[document.inputForm.howtoopen.selectedIndex].value;
center = document.inputForm.center.checked;

start = "<";

if(howto == 'body') {
otherOutput = "<!-- Pegar el evento onLoad dentro del tag BODY -->\n\n<BODY onLoad=\"javascript:popUp('" + page + "')\">";
}
if(howto == 'link') {
otherOutput = "<!-- Utilice el siguiente link para abrir la nueva ventana -->\n\n<A HREF=\"javascript:popUp('" + page + "')\">Abrir Ventana Pop-Up</A>";
}
if(howto == 'button') {
otherOutput = "<!-- Utilice el siguiente botón para abrir la nueva ventana -->\n\n<form>\n<input type=button value=\"Abrir Ventana Pop-Up\" onClick=\"javascript:popUp('" + page + "')\">\n</form>";
}

scriptOutput = '<SCRIPT LANGUAGE="JavaScript">\r\n<!--\r\nfunction popUp(URL) {\nday = new Date();\nid = day.getTime();\n';

scriptOutput += "eval(\"page\" + id + \" = window.open(URL, '\" + id + \"', '" +
((toolbars) ? "toolbar=1," : "toolbar=0,") + 
((scrollprops) ? "scrollbars=1," : "scrollbars=0,") +
((locations) ? "location=1," : "location=0,") +
((statusbars) ? "statusbar=1," : "statusbar=0,") +
((menubars) ? "menubar=1," : "menubar=0,") +
((resizeable) ? "resizable=1" : "resizable=0") +
((width) ? ",width=" + width : "") +
((height) ? ",height=" + height : "") +
((center) ? ",left = " + ((screen.width - width) / 2) : "") +
((center) ? ",top = " + ((screen.height - height) / 2) : "") +
"');\");\n}\n//-->\n" + start + "/SCRIPT>\n";

document.inputForm.source.value = scriptOutput;
document.inputForm.source2.value = otherOutput;

}