function viewit()
{

var cool= window.open('','win1','width=550,height=400,scrollbars=yes,resizable=yes');
var toreplace=/</g;
cool.document.open();

cool.document.write("<FONT FACE='Arial' SIZE='-1'>");
cool.document.write("<H3>Formatting:</H3>");
cool.document.write("You will want your lines of script to look this way. It is recommended that you only use line breaks ");
cool.document.write("where they are shown here, and that you don't add line breaks beyond what is shown here.");

 if (document.forms[0].elements[0])
 {
   cool.document.write("<H3>Head Section Code:</H3>");
   var text1=document.forms[0].elements[0].value;
   var newtext1=text1.replace(toreplace,"&lt;");
   cool.document.write("<PRE>"+newtext1+"</PRE>");

 } 

 if (document.forms[1].elements[0])
 {
   cool.document.write("<H3>Body Section Code:</H3>");
   var text2=document.forms[1].elements[0].value;
   var newtext2=text2.replace(toreplace,"&lt;");
   cool.document.write("<PRE>"+newtext2+"</PRE>");
 } 

cool.document.write("</FONT>");

// add close button for viewers
cool.document.writeln("<P><FORM>");
cool.document.writeln("<INPUT TYPE='button' value='Close Window' onClick='window.close();'>");
cool.document.write("</FORM>");
cool.document.close();

}

