/*
 * Created on 09-Oct-2006
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package uk.ac.roe.wfau;

/**
 * @author mar
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class HTMLSnippets {
    public static String DOCTYPE=     "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?> \n\n" +
    "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \n" +
    "          \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> \n\n" +
    "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\"> \n" ;
    static String BODYSTART="<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" vlink=\"#000080\" alink=\"#FF0000\" ";
    static String BODYEND="";
    static String HEADSTART="<head>\n" +
    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n<title>";
    static String TITLEEND="</title>\n";
    static String HEADEND="</head>\n\n";
    public String getStartPageWithTitle(String title) {
        return getStartPageWithTitleAndBody(title,"","","");
    }
    
    
    public static String getStartPageWithTitleAndBody (String title, String bodyBit,String cssURL, String jsURL){
        if (cssURL != null && !cssURL.equals("")){
            cssURL="\n<link rel=\"stylesheet\" type=\"text/css\" \n" + 
            "href=\"" +
            cssURL + "\" /> \n";
        }
        if (jsURL != null && !jsURL.equals("")){
            jsURL="\n<script type=\"text/javascript\" src=\"" + jsURL + "\">\n</script>\n";
        }
        return DOCTYPE+HEADSTART+title+TITLEEND+cssURL+jsURL+HEADEND+BODYSTART+bodyBit+" > \n";
    }

}
