// HeadArray.java

package ed.appserver;

import ed.js.*;

public class HeadArray extends JSArray {

    public void addCSS( String css ){
        add( "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + css + "\" >" );
    }

    public void addScript( String script ){
        add( "<script src=\"" + script + "\" ></script>" );
    }

    public void addRSS( String link ){
	add("<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"" + link + "\" />" );
    }
}

@@ -94,16 +94,337 @@
 rray %7B%0A%0A
+    protected int getIndex( Object index )%7B%0A        int idx;%0A        if( index == null ) idx = size();%0A        else %7B%0A            if( ! (index instanceof Number) ) throw new JSException( %22index must be number, not %22 + index.toString() );%0A            idx = ((Number)index).intValue();%0A        %7D%0A        return idx;%0A    %7D%0A%0A
     publ
@@ -450,16 +450,31 @@
 ing css 
+, Object index 
 )%7B%0A     
@@ -480,16 +480,50 @@
     add(
+ getIndex( index ) , %0A            
  %22%3Clink 
@@ -634,31 +634,79 @@
  script 
-)%7B%0A        add(
+, Object index )%7B%0A        add( getIndex( index ) ,%0A            
  %22%3Cscrip

Allow indexes on scripts and CSS files (so you can add them at the beginning).