function HtmlPreview(f1,f2)
{
	
	if(f1.length == '')
	{
		alert('Empty Document !!!');
	}
	else if(!f2.checked)
	{
		alert('Only for HTML !!!');	
	}
	else
	{		
		
		var model = /graphic\//g;
		var text = f1.replace(model, "\.\.\/graphic\/");											
						
    var prevWnd=window.open("", "prvw", "left=50,top=50,width=700,height=500,scrollbars=yes,resizable=yes,status=0");
    prevWnd.document.open();
    prevWnd.document.writeln('<html>');
    prevWnd.document.writeln('<head>');
    prevWnd.document.writeln('<title>Preview HTML</title>');
    prevWnd.document.writeln('<meta http-equiv="content-type" content="text/html; charset=Big5">');
    prevWnd.document.writeln('</head>');
    prevWnd.document.writeln('<body topmargin=0 leftmargin=0 bgcolor="#ffffff">');
    prevWnd.document.writeln('<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td align=center bgcolor=#7770c2><br><h2><font color=white>HTML Preview</font></h2></td></tr></table>');
    prevWnd.document.writeln('<center>');
    prevWnd.document.writeln('</center>');
    prevWnd.document.writeln('<br>' + text + '<br><br>');
    prevWnd.document.writeln('<center><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=2 bgcolor=silver></td></tr></table><br><input type=button value="   Close   " onclick="javascript:window.close()" style="font-size: 9px;"></center>');
    prevWnd.document.writeln('</body></html>');
    prevWnd.document.close();							
  }
								
} // end of function
