Index: .hgignore
===================================================================
--- .hgignore	(revision 77)
+++ .hgignore	(revision 0)
@@ -8,13 +8,2 @@
 syntax: regexp
 ^\.project$
-syntax: regexp
-^\.shell_history$
-syntax: regexp
-^src/main/webapp/WEB-INF/consumerkeys\.property$
-
-syntax: regexp
-^src/main/webapp/WEB-INF/serverconfig\.property$
-syntax: regexp
-^src/main/webapp/WEB-INF/classes$
-syntax: regexp
-^src/main/webapp/neo4j-annotation-db$
Index: ICENSE.txt
===================================================================
--- LICENSE.txt	(revision 71)
+++ 	(revision )
@@ -1,166 +1,0 @@
-		   GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
-  This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
-  0. Additional Definitions. 
-
-  As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
-  "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
-  An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
-  A "Combined Work" is a work produced by combining or linking an
-Application with the Library.  The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
-  The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
-  The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
-  1. Exception to Section 3 of the GNU GPL.
-
-  You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
-  2. Conveying Modified Versions.
-
-  If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
-   a) under this License, provided that you make a good faith effort to
-   ensure that, in the event an Application does not supply the
-   function or data, the facility still operates, and performs
-   whatever part of its purpose remains meaningful, or
-
-   b) under the GNU GPL, with none of the additional permissions of
-   this License applicable to that copy.
-
-  3. Object Code Incorporating Material from Library Header Files.
-
-  The object code form of an Application may incorporate material from
-a header file that is part of the Library.  You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
-   a) Give prominent notice with each copy of the object code that the
-   Library is used in it and that the Library and its use are
-   covered by this License.
-
-   b) Accompany the object code with a copy of the GNU GPL and this license
-   document.
-
-  4. Combined Works.
-
-  You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
-   a) Give prominent notice with each copy of the Combined Work that
-   the Library is used in it and that the Library and its use are
-   covered by this License.
-
-   b) Accompany the Combined Work with a copy of the GNU GPL and this license
-   document.
-
-   c) For a Combined Work that displays copyright notices during
-   execution, include the copyright notice for the Library among
-   these notices, as well as a reference directing the user to the
-   copies of the GNU GPL and this license document.
-
-   d) Do one of the following:
-
-       0) Convey the Minimal Corresponding Source under the terms of this
-       License, and the Corresponding Application Code in a form
-       suitable for, and under terms that permit, the user to
-       recombine or relink the Application with a modified version of
-       the Linked Version to produce a modified Combined Work, in the
-       manner specified by section 6 of the GNU GPL for conveying
-       Corresponding Source.
-
-       1) Use a suitable shared library mechanism for linking with the
-       Library.  A suitable mechanism is one that (a) uses at run time
-       a copy of the Library already present on the user's computer
-       system, and (b) will operate properly with a modified version
-       of the Library that is interface-compatible with the Linked
-       Version. 
-
-   e) Provide Installation Information, but only if you would otherwise
-   be required to provide such information under section 6 of the
-   GNU GPL, and only to the extent that such information is
-   necessary to install and execute a modified version of the
-   Combined Work produced by recombining or relinking the
-   Application with a modified version of the Linked Version. (If
-   you use option 4d0, the Installation Information must accompany
-   the Minimal Corresponding Source and Corresponding Application
-   Code. If you use option 4d1, you must provide the Installation
-   Information in the manner specified by section 6 of the GNU GPL
-   for conveying Corresponding Source.)
-
-  5. Combined Libraries.
-
-  You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
-   a) Accompany the combined library with a copy of the same work based
-   on the Library, uncombined with any other library facilities,
-   conveyed under the terms of this License.
-
-   b) Give prominent notice with the combined library that part of it
-   is a work based on the Library, and explaining where to find the
-   accompanying uncombined form of the same work.
-
-  6. Revised Versions of the GNU Lesser General Public License.
-
-  The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
-  Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
-  If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
-
Index: pom.xml
===================================================================
--- pom.xml	(revision 90)
+++ pom.xml	(revision 0)
@@ -1,131 +1,42 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>de.mpiwg.itgroup.annotations</groupId>
-  <artifactId>AnnotationManagerN4J</artifactId>
-  <version>0.5-SNAPSHOT</version>
-  <properties>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <neo4j-version>2.1.6</neo4j-version>
-    <!-- <restlet-version>2.2.3</restlet-version> -->
-    <restlet-version>2.3.1</restlet-version>
-  </properties>
-  <repositories>
-    <repository>
-      <id>neo4j-release-repository</id>
-      <name>Neo4j Maven 2 release repository</name>
-      <url>http://m2.neo4j.org/releases</url>
-      <releases>
-        <enabled>true</enabled>
-      </releases>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
-    <repository>
-      <id>maven-restlet</id>
-      <name>Public online Restlet repository</name>
-      <url>http://maven.restlet.org</url>
-    </repository>
-  </repositories>
-  <dependencies>
-    <dependency>
-      <groupId>org.neo4j</groupId>
-      <artifactId>neo4j</artifactId>
-      <version>${neo4j-version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.neo4j.app</groupId>
-      <artifactId>neo4j-server</artifactId>
-      <version>${neo4j-version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.neo4j.app</groupId>
-      <artifactId>neo4j-server</artifactId>
-      <classifier>static-web</classifier>
-      <version>${neo4j-version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.restlet.jee</groupId>
-      <artifactId>org.restlet</artifactId>
-      <version>${restlet-version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.restlet.jee</groupId>
-      <artifactId>org.restlet.ext.servlet</artifactId>
-      <version>${restlet-version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.restlet.jee</groupId>
-      <artifactId>org.restlet.ext.json</artifactId>
-      <version>${restlet-version}</version>
-    </dependency>
-    <dependency>
-      <groupId>com.googlecode.jsontoken</groupId>
-      <artifactId>jsontoken</artifactId>
-      <version>1.1</version>
-      <exclusions>
-        <exclusion>
-          <artifactId>servlet-api</artifactId>
-          <groupId>javax.servlet</groupId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-      <version>1.2.14</version>
-    </dependency>
-    <dependency>
-      <groupId>commons-codec</groupId>
-      <artifactId>commons-codec</artifactId>
-      <version>1.4</version>
-    </dependency>
-    <dependency>
-      <groupId>org.restlet.jee</groupId>
-      <artifactId>org.restlet.lib.org.json</artifactId>
-      <version>2.0</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <finalName>AnnotationManager</finalName>
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-compiler-plugin</artifactId>
-          <configuration>
-            <source>1.7</source>
-            <target>1.7</target>
-          </configuration>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-    <plugins>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>license-maven-plugin</artifactId>
-        <version>1.4</version>
-        <configuration>
-          <!-- <verbose>false</verbose> -->
-          <licenseName>lgpl_v3</licenseName>
-          <roots>
-            <root>src/main/java</root>
-          </roots>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  <packaging>war</packaging>
-  <name>AnnotationManager</name>
-  <organization>
-    <name>IT-Group, MPIWG Berlin</name>
-    <url>http://itgroup.mpiwg-berlin.mpg.de</url>
-  </organization>
-  <scm>
-    <connection>scm:hg:https://it-dev.mpiwg-berlin.mpg.de/hg/AnnotationManagerN4J</connection>
-    <url>https://it-dev.mpiwg-berlin.mpg.de/hg/AnnotationManagerN4J</url>
-    <developerConnection>scm:hg:https://it-dev.mpiwg-berlin.mpg.de/hg/AnnotationManagerN4J</developerConnection>
-  </scm>
-  <inceptionYear>2012</inceptionYear>
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>de.mpiwg.itgroup.annotations</groupId>
+	<artifactId>AnnotationManagerN4J</artifactId>
+	<version>0.0.1-SNAPSHOT</version>
+	<properties>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		<neo4j-version>1.7.1</neo4j-version>
+	</properties>
+	<repositories>
+		<repository>
+			<id>neo4j-release-repository</id>
+			<name>Neo4j Maven 2 release repository</name>
+			<url>http://m2.neo4j.org/releases</url>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+			<snapshots>
+				<enabled>false</enabled>
+			</snapshots>
+		</repository>
+	</repositories>
+	<dependencies>
+		<dependency>
+			<groupId>org.neo4j</groupId>
+			<artifactId>neo4j</artifactId>
+			<version>${neo4j-version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.neo4j.app</groupId>
+			<artifactId>neo4j-server</artifactId>
+			<version>${neo4j-version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.neo4j.app</groupId>
+			<artifactId>neo4j-server</artifactId>
+			<classifier>static-web</classifier>
+			<version>${neo4j-version}</version>
+		</dependency>
+	</dependencies>
 </project>
Index: rc/main/java/de/mpiwg/itgroup/annotations/Actor.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/Actor.java	(revision 103)
+++ 	(revision )
@@ -1,176 +1,0 @@
-/**
- * 
- */
-package de.mpiwg.itgroup.annotations;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-import de.mpiwg.itgroup.annotations.restlet.BaseRestlet;
-
-/**
- * @author casties
- * 
- */
-public abstract class Actor {
-
-    public String uri;
-    public String name;
-    public String id;
-
-    /**
-     * @return if this Actor is a Group
-     */
-    public abstract boolean isGroup();
-
-    /**
-     * Returns if this Actor is equivalent to Person person. If this is
-     * a Group returns true when the Person is in the Group.
-     * 
-     * @param person
-     * @param store AnnotationStore to check group membership
-     * @return
-     */
-    public boolean isEquivalentWith(Person person, AnnotationStore store) {
-        if (person == null) return false;
-        if (person.equals(this)) return true;
-        if (person.getIdString().equalsIgnoreCase(this.getIdString())) return true;
-        if (isGroup() && store != null) {
-            // check if person in group
-            if (person.groups != null) {
-                // check person's groups
-                if (person.groups.contains(this.id)) {
-                    return true;
-                }
-            }
-            // check in store
-            return store.isPersonInGroup(person, (Group) this);            
-        }
-        return false;
-    }
-
-    /**
-     * @return the uri
-     */
-    public String getUri() {
-        return uri;
-    }
-
-    /**
-     * Returns the uri (uses id if empty).
-     * 
-     * @return the uri
-     */
-    public String getUriString() {
-        if (uri == null) {
-            return getUriFromId(id, isGroup());
-        }
-        return uri;
-    }
-
-    /**
-     * @param uri
-     *            the uri to set
-     */
-    public void setUri(String uri) {
-        this.uri = uri;
-    }
-
-    /**
-     * @return the name
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * @param name
-     *            the name to set
-     */
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    /**
-     * @return the id
-     */
-    public String getId() {
-        return id;
-    }
-
-    /**
-     * Returns id as a String starting with "group:" for groups.
-     * 
-     * @return
-     */
-    public abstract String getIdString();
-
-    /**
-     * @param id
-     *            the id to set
-     */
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    /**
-     * Returns a short id from an uri.
-     * 
-     * @param uri
-     * @return
-     */
-    public static String getIdFromUri(String uri, boolean isGroup) {
-        String id = null;
-        String prefix = BaseRestlet.PERSONS_URI_PREFIX;
-        if (isGroup) {
-            prefix = BaseRestlet.GROUPS_URI_PREFIX;
-        }
-        if (uri != null && uri.startsWith(prefix)) {
-            id = uri.replace(prefix, "");
-        }
-        if (id == null && uri != null) {
-        	// accept uri without prefix
-        	id = uri;
-        }
-        return id;
-    }
-
-    /**
-     * Returns an uri from a short id.
-     * 
-     * @param id
-     * @return
-     */
-    public static String getUriFromId(String id, boolean isGroup) {
-        String uri = null;
-        String prefix = BaseRestlet.PERSONS_URI_PREFIX;
-        if (isGroup) {
-            prefix = BaseRestlet.GROUPS_URI_PREFIX;
-        }
-        if (id != null && !id.startsWith("http://")) {
-            uri = prefix + id;
-        }
-        return uri;
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/Annotation.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/Annotation.java	(revision 105)
+++ 	(revision )
@@ -1,477 +1,0 @@
-/**
- * 
- */
-package de.mpiwg.itgroup.annotations;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.io.UnsupportedEncodingException;
-import java.util.Set;
-
-import org.apache.commons.codec.binary.Base64;
-
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-
-/**
- * @author casties
- *
- */
-public class Annotation {
-    /**
-     * The URI of this annotation.
-     */
-    protected String uri;
-
-    /**
-     * The annotation (body) text.
-     */
-    protected String bodyText;
-
-    /**
-     * The URI of the annotation text
-     */
-    protected String bodyUri;
-    
-    /**
-     * The annotation target.
-     */
-    protected Target target;
-    
-    /**
-     * The fragment part of the annotation target.
-     */
-    protected String targetFragment;
-    
-    /**
-     * The types of annotation target fragments.
-     *
-     */
-    public static enum FragmentTypes {
-        XPOINTER, AREA, WKT
-    };
-    
-    /**
-     * The type of the annotation target fragment.
-     */
-    protected FragmentTypes fragmentType;
-    
-    /**
-     * The selected text of the annotation target.
-     */
-    protected String quote;
-    
-    /**
-     * The Resource that is annotated e.g. a book. 
-     * The target is part of this resource e.g. a page of a book.
-     */
-    protected Resource resource;
-    
-    /**
-     * The creator of this annotation.
-     */
-    protected Actor creator;
-    
-    /**
-     * The creation date of this annotation.
-     */
-    protected String created;
-
-    /**
-     * The last update date of this annotation.
-     */
-    protected String updated;
-
-    /**
-     * The user or group that has admin permissions.
-     * null means any user.
-     */
-    protected Actor adminPermission;
-    
-    /**
-     * The user or group that has delete permissions.
-     * null means any user.
-     */
-    protected Actor deletePermission;
-    
-    /**
-     * The user or group that has update permissions.
-     * null means any user.
-     */
-    protected Actor updatePermission;
-    
-    /**
-     * The user or group that has read permissions.
-     * null means any user.
-     */
-    protected Actor readPermission;
-       
-    /**
-     * List of tags on this Annotation.
-     */
-    protected Set<String> tags;
-    
-    /**
-     * Enum of actions (for permissions).
-     */
-    public static enum Action {
-    	read, update, create, delete, admin
-    }
-    
-    /**
-     * Returns if the requested action is allowed for the given user on this annotation.
-     * 
-     * @param action
-     * @param user
-     * @param store AnnotationStore to check group membership
-     * @return
-     */
-    public boolean isActionAllowed(Action action, Person user, AnnotationStore store) {
-        if (action == Action.read) {
-            Actor reader = getReadPermission();
-            if (reader == null) {
-                // if not specified then everybody is allowed
-                return true;
-            } else {
-                return reader.isEquivalentWith(user, store);
-            }
-        } else if (action == Action.update) {
-            // require at least an authenticated user
-            if (user == null) return false;
-            Actor updater = getUpdatePermission();
-            if (updater == null) {
-                // if not specified then everybody is allowed
-                return true;
-            } else {
-                return updater.isEquivalentWith(user, store);
-            }
-        } else if (action == Action.delete) {
-            // require at least an authenticated user
-            if (user == null) return false;
-            Actor deleter = getDeletePermission();
-            if (deleter == null) {
-                // if not specified then only creator is allowed
-                deleter = creator;
-            }
-            return deleter.isEquivalentWith(user, store);
-        } else if (action == Action.admin) {
-            // require at least an authenticated user
-            if (user == null) return false;
-            Actor admin = getAdminPermission();
-            if (admin == null) {
-                // if not specified then only creator is allowed
-                admin = creator;
-            }
-            return admin.isEquivalentWith(user, store);
-        }
-        return false;
-    }
-    
-    /**
-     * @return the uri
-     */
-    public String getUri() {
-        return uri;
-    }
-
-    /**
-     * @param uri the uri to set
-     */
-    public void setUri(String uri) {
-        this.uri = uri;
-    }
-
-    /**
-     * Returns an URL-compatible id.
-     * Currently the uri as base64 encoded string.
-     * @return
-     */
-    public String getUrlId() {
-        if (uri == null) return null;
-        try {
-            return Base64.encodeBase64URLSafeString(uri.getBytes("UTF-8"));
-        } catch (UnsupportedEncodingException e) {
-            return null;
-        }
-    }
-
-    public static String decodeId(String id) {
-        if (id == null) return null;
-        try {
-            return new String(Base64.decodeBase64(id), "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            return null;
-        }
-    }
-
-    /**
-     * @return the bodyText
-     */
-    public String getBodyText() {
-        return bodyText;
-    }
-
-    /**
-     * @param bodyText the bodyText to set
-     */
-    public void setBodyText(String bodyText) {
-        this.bodyText = bodyText;
-    }
-
-    /**
-     * @return the bodyUri
-     */
-    public String getBodyUri() {
-        return bodyUri;
-    }
-
-    /**
-     * @param bodyUri the bodyUri to set
-     */
-    public void setBodyUri(String bodyUri) {
-        this.bodyUri = bodyUri;
-    }
-
-    /**
-     * @return the target
-     */
-    public Target getTarget() {
-        return target;
-    }
-
-    /**
-     * @param target the target to set
-     */
-    public void setTarget(Target target) {
-        this.target = target;
-    }
-
-    /**
-     * @return the targetBaseUri
-     */
-    public String getTargetBaseUri() {
-        if (target == null) return null;
-        return target.getUri();
-    }
-
-    /**
-     * @return the targetFragment
-     */
-    public String getTargetFragment() {
-        return targetFragment;
-    }
-
-    /**
-     * @param targetFragment the targetFragment to set
-     */
-    public void setTargetFragment(String targetFragment) {
-        this.targetFragment = targetFragment;
-    }
-
-    /**
-     * @return the targetType
-     */
-    public FragmentTypes getFragmentType() {
-        return fragmentType;
-    }
-
-    /**
-     * @param fragmentType the fragmentType to set
-     */
-    public void setFragmentType(FragmentTypes fragmentType) {
-        this.fragmentType = fragmentType;
-    }
-
-    /**
-     * @return the quote
-     */
-    public String getQuote() {
-        return quote;
-    }
-
-    /**
-     * @param quote the quote to set
-     */
-    public void setQuote(String quote) {
-        this.quote = quote;
-    }
-
-    /**
-     * @return the resource
-     */
-    public Resource getResource() {
-        return resource;
-    }
-
-    /**
-     * @param resource the resource to set
-     */
-    public void setResource(Resource resource) {
-        this.resource = resource;
-    }
-
-    /**
-     * @return the resourceUri
-     */
-    public String getResourceUri() {
-        if (resource == null) return null;
-        return resource.getUri();
-    }
-
-    /**
-     * @return the creator
-     */
-    public Actor getCreator() {
-        return creator;
-    }
-
-    /**
-     * @param creator the creator to set
-     */
-    public void setCreator(Actor creator) {
-        this.creator = creator;
-    }
-
-    /**
-     * @return the creatorUri
-     */
-    public String getCreatorUri() {
-        if (creator != null) {
-            return creator.getUri();
-        }
-        return null;
-    }
-
-    /**
-     * @return the creatorName
-     */
-    public String getCreatorName() {
-        if (creator != null) {
-            return creator.getName();
-        }
-        return null;
-    }
-
-    /**
-     * @return the created
-     */
-    public String getCreated() {
-        return created;
-    }
-
-    /**
-     * @param created the created to set
-     */
-    public void setCreated(String created) {
-        this.created = created;
-    }
-
-    public String getUpdated() {
-		return updated;
-	}
-
-	public void setUpdated(String updated) {
-		this.updated = updated;
-	}
-
-	/**
-     * @return the adminPermission
-     */
-    public Actor getAdminPermission() {
-        if (adminPermission != null) {
-            return adminPermission;
-        } else {
-            // if not specified then only creator is allowed
-            return this.creator;
-        }
-    }
-
-    /**
-     * @param adminPermission the adminPermission to set
-     */
-    public void setAdminPermission(Actor adminPermission) {
-        this.adminPermission = adminPermission;
-    }
-
-    /**
-     * @return the deletePermission
-     */
-    public Actor getDeletePermission() {
-        if (deletePermission != null) {
-            return deletePermission;
-        } else {
-            // if not specified then only creator is allowed
-            return this.creator;
-        }
-    }
-
-    /**
-     * @param deletePermission the deletePermission to set
-     */
-    public void setDeletePermission(Actor deletePermission) {
-        this.deletePermission = deletePermission;
-    }
-
-    /**
-     * @return the updatePermission
-     */
-    public Actor getUpdatePermission() {
-        return updatePermission;
-    }
-
-    /**
-     * @param updatePermission the updatePermission to set
-     */
-    public void setUpdatePermission(Actor updatePermission) {
-        this.updatePermission = updatePermission;
-    }
-
-    /**
-     * @return the readPermission
-     */
-    public Actor getReadPermission() {
-        return readPermission;
-    }
-
-    /**
-     * @param readPermission the readPermission to set
-     */
-    public void setReadPermission(Actor readPermission) {
-        this.readPermission = readPermission;
-    }
-
-    /**
-     * @return the tags
-     */
-    public Set<String> getTags() {
-        return tags;
-    }
-
-    /**
-     * @param tags the tags to set
-     */
-    public void setTags(Set<String> tags) {
-        this.tags = tags;
-    }
-    
-    
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/Group.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/Group.java	(revision 70)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/**
- * 
- */
-package de.mpiwg.itgroup.annotations;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-/**
- * @author casties
- *
- */
-public class Group extends Actor {
-
-    public Group(String id) {
-        super();
-        this.id = id;
-    }
-
-    public Group(String uri, String name) {
-        super();
-        this.uri = uri;
-        this.name = name;
-    }
-
-    public Group(String id, String uri, String name) {
-        super();
-        this.id = id;
-        this.uri = uri;
-        this.name = name;
-    }
-
-
-    @Override
-    public boolean isGroup() {
-        return true;
-    }
-
-    public String getIdString() {
-        if (id == null) {
-            id = getIdFromUri(uri, true);
-        }
-        return "group:" + id;
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/NS.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/NS.java	(revision 70)
+++ 	(revision )
@@ -1,34 +1,0 @@
-package de.mpiwg.itgroup.annotations;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-public class NS {
-    public static final String OAC_NS = "http://www.openannotation.org/ns/";
-    public static final String CNT_NS = "http://www.w3.org/2011/content#";
-    public static final String DCTERMS_NS = "http://www.purl.org/dc/terms/";
-    public static final String RDF_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
-    public static final String MPIWG_ANNOT_NS = "http://ontologies.mpiwg-berlin.mpg.de/annotations/";
-    public static final String MPIWG_ANNOT_URL = "http://entities.mpiwg-berlin.mpg.de/annotations/";
-    public static final String MPIWG_ANNOT_CTX = "file:///annotations2";    
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/Person.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/Person.java	(revision 103)
+++ 	(revision )
@@ -1,116 +1,0 @@
-package de.mpiwg.itgroup.annotations;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.util.Set;
-
-import de.mpiwg.itgroup.annotations.restlet.BaseRestlet;
-
-/**
- * @author casties
- *
- */
-public class Person extends Actor {
-
-    public Set<String> groups;
-    
-    public Person() {
-    }
-
-    public Person(String id) {
-        super();
-        this.id = id;
-    }
-
-    public Person(String uri, String name) {
-        super();
-        this.uri = uri;
-        this.name = name;
-    }
-
-    public Person(String id, String uri, String name) {
-        super();
-        this.id = id;
-        this.uri = uri;
-        this.name = name;
-    }
-
-    @Override
-    public boolean isGroup() {
-        return false;
-    }
-
-    public String getIdString() {
-        if (id == null) {
-            id = getIdFromUri(uri, false);
-        }
-        return id;
-    }
-
-    /**
-     * Returns a Person with this id or null.
-     * 
-     * @param id
-     * @return
-     */
-    public static Person createPersonWithId(String id) {
-        if (id != null) {
-            return new Person(id);
-        }
-        return null;
-    }
-
-    /**
-     * Sets the name from the id using getFullNameForId of the Application.
-     *  
-     * @param application
-     * @return
-     */
-    public String updateName(BaseRestlet application) {
-        if (id != null) {
-            name = application.getFullNameForId(id);
-        }
-        return name;
-    }
-    
-    /**
-     * Returns the anonymous Person.
-     * 
-     * @return
-     */
-    public static Person getAnonymous() {
-        return new Person("anonymous", null, "Anonymous");
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#toString()
-     */
-    @Override
-    public String toString() {
-        String s = "PERSON["+id+"]";
-        if (name != null) {
-            s += ": "+name;
-        }
-        return s;
-    }
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/Resource.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/Resource.java	(revision 70)
+++ 	(revision )
@@ -1,41 +1,0 @@
-/**
- * 
- */
-package de.mpiwg.itgroup.annotations;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-/**
- * @author casties
- *
- */
-public class Resource extends Uri {
-
-    /**
-     * @param uri
-     */
-    public Resource(String uri) {
-        super(uri);
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/Tag.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/Tag.java	(revision 70)
+++ 	(revision )
@@ -1,68 +1,0 @@
-package de.mpiwg.itgroup.annotations;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import de.mpiwg.itgroup.annotations.restlet.BaseRestlet;
-
-/**
- * @author dwinter
- *
- */
-public class Tag {
-
-	    public String uri;
-	    public String name;
-	    public String id;
-	    
-	    
-		public Tag(String id, String uri, String name) {
-			this.uri=uri;
-			this.id=id;
-			this.name=name;
-		}
-		public String getUri() {
-			if (uri==null){
-				return BaseRestlet.TAGS_URI_PREFIX+getId(); // erzeuge uri aus if falls keine ID
-			}
-			return uri;
-		}
-		public void setUri(String uri) {
-			this.uri = uri;
-		}
-		public String getName() {
-			return name;
-		}
-		public void setName(String name) {
-			this.name = name;
-		}
-		public String getId() {
-			if (id==null){
-				return getName(); //take name if id not defined
-			}
-			return id;
-		}
-		public void setId(String id) {
-			this.id = id;
-		}
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/Target.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/Target.java	(revision 70)
+++ 	(revision )
@@ -1,41 +1,0 @@
-/**
- * 
- */
-package de.mpiwg.itgroup.annotations;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-/**
- * @author casties
- *
- */
-public class Target extends Uri {
-
-    /**
-     * @param uri
-     */
-    public Target(String uri) {
-        super(uri);
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/Uri.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/Uri.java	(revision 70)
+++ 	(revision )
@@ -1,44 +1,0 @@
-package de.mpiwg.itgroup.annotations;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-/**
- * @author casties
- * 
- */
-public class Uri {
-
-    public String uri;
-
-    public Uri(String uri) {
-        this.uri = uri;
-    }
-
-    public String getUri() {
-        return uri;
-    }
-
-    public void setUri(String uri) {
-        this.uri = uri;
-    }
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java	(revision 101)
+++ 	(revision )
@@ -1,1222 +1,0 @@
-/**
- * 
- */
-package de.mpiwg.itgroup.annotations.neo4j;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- * Author: Robert Casties (casties@mpiwg-berlin.mpg.de)
- */
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.logging.Logger;
-
-import org.neo4j.graphdb.Direction;
-import org.neo4j.graphdb.GraphDatabaseService;
-import org.neo4j.graphdb.Node;
-import org.neo4j.graphdb.Relationship;
-import org.neo4j.graphdb.RelationshipType;
-import org.neo4j.graphdb.Transaction;
-import org.neo4j.graphdb.index.Index;
-import org.neo4j.graphdb.index.IndexHits;
-
-import de.mpiwg.itgroup.annotations.Actor;
-import de.mpiwg.itgroup.annotations.Annotation;
-import de.mpiwg.itgroup.annotations.Annotation.FragmentTypes;
-import de.mpiwg.itgroup.annotations.Group;
-import de.mpiwg.itgroup.annotations.Person;
-import de.mpiwg.itgroup.annotations.Resource;
-import de.mpiwg.itgroup.annotations.Tag;
-import de.mpiwg.itgroup.annotations.Target;
-import de.mpiwg.itgroup.annotations.Uri;
-
-/**
- * Neo4J based Annotation store.
- * 
- * @author casties
- * 
- */
-public class AnnotationStore {
-
-    protected static Logger logger = Logger.getLogger(AnnotationStore.class.getCanonicalName());
-
-    protected GraphDatabaseService graphDb;
-
-    public static enum NodeTypes {
-        ANNOTATION, PERSON, TARGET, GROUP, TAG, RESOURCE
-    }
-
-    // types of nodes that should not be automatically deleted.
-    public Set<String> permanentNodeTypes = new HashSet<String>(Arrays.asList("PERSON", "GROUP", "TAG"));
-
-    protected List<Index<Node>> nodeIndexes;
-
-    public static enum RelationTypes implements RelationshipType {
-        ANNOTATES, CREATED, PERMITS_ADMIN, PERMITS_DELETE, PERMITS_UPDATE, PERMITS_READ, MEMBER_OF, HAS_TAG, PART_OF
-    }
-
-    public static String ANNOTATION_URI_PREFIX = "";
-
-    public AnnotationStore(GraphDatabaseService graphDb) {
-        super();
-        this.graphDb = graphDb;
-        nodeIndexes = new ArrayList<Index<Node>>(5);
-        // List.set(enum.ordinal(), val) seems not to work.
-        try (Transaction tx = graphDb.beginTx()) {
-            nodeIndexes.add(NodeTypes.ANNOTATION.ordinal(), graphDb.index().forNodes("annotations"));
-            nodeIndexes.add(NodeTypes.PERSON.ordinal(), graphDb.index().forNodes("persons"));
-            nodeIndexes.add(NodeTypes.TARGET.ordinal(), graphDb.index().forNodes("targets"));
-            nodeIndexes.add(NodeTypes.GROUP.ordinal(), graphDb.index().forNodes("groups"));
-            nodeIndexes.add(NodeTypes.TAG.ordinal(), graphDb.index().forNodes("tags"));
-            nodeIndexes.add(NodeTypes.RESOURCE.ordinal(), graphDb.index().forNodes("resources"));
-            tx.success();
-        }
-    }
-
-    protected Index<Node> getNodeIndex(NodeTypes type) {
-        return nodeIndexes.get(type.ordinal());
-    }
-
-    /**
-     * @param userUri
-     * @return
-     */
-    public Node getPersonNodeByUri(String userUri) {
-        return getNodeFromIndex("uri", userUri, NodeTypes.PERSON);
-    }
-
-    /**
-     * @param tagUri
-     * @return
-     */
-    public Node getTagNodeByUri(String tagUri) {
-        return getNodeFromIndex("uri", tagUri, NodeTypes.TAG);
-    }
-
-    /**
-     * @param resourceUri
-     * @return
-     */
-    public Node getResourceNodeByUri(String resourceUri) {
-        return getNodeFromIndex("uri", resourceUri, NodeTypes.RESOURCE);
-    }
-
-    /**
-     * @param targetUri
-     * @return
-     */
-    public Node getTargetNodeByUri(String targetUri) {
-        return getNodeFromIndex("uri", targetUri, NodeTypes.RESOURCE);
-    }
-
-    /**
-     * Returns the Node with the given key and value. Key has to be indexed.
-     * 
-     * @param key
-     * @param value
-     * @param type
-     * @return
-     */
-    public Node getNodeFromIndex(String key, String value, NodeTypes type) {
-        if (key == null || value == null)
-            return null;
-        Node node = null;
-        try (Transaction tx = graphDb.beginTx()) {
-            node = getNodeIndex(type).get(key, value).getSingle();
-            tx.success();
-        }
-        return node;
-    }
-
-    /**
-     * Returns list of Actors of given type (Group or Person). Key has to be
-     * indexed.
-     * 
-     * @param key
-     * @param query
-     * @param type
-     * @return
-     */
-    @SuppressWarnings("unchecked")
-    protected <T extends Actor> List<T> getActors(String key, String query, NodeTypes type) {
-        ArrayList<T> actors = new ArrayList<T>();
-        Index<Node> idx = getNodeIndex(type);
-        if (key == null) {
-            key = "uri";
-            query = "*";
-        }
-        try (Transaction tx = graphDb.beginTx()) {
-            IndexHits<Node> actorNodes = idx.query(key, query);
-            for (Node actorNode : actorNodes) {
-                Actor actor = createActorFromNode(actorNode);
-                actors.add((T) actor);
-            }
-            tx.success();            
-        }
-        return actors;
-    }
-
-    /**
-     * Returns list of groups. Key has to be indexed.
-     * 
-     * @param key
-     * @param query
-     * @return
-     */
-    public List<Group> getGroups(String key, String query) {
-        List<Group> groups = getActors(key, query, NodeTypes.GROUP);
-        return groups;
-    }
-
-    /**
-     * Returns list of Persons. Key has to be indexed.
-     * 
-     * @param key
-     * @param query
-     * @return
-     */
-    public List<Person> getPersons(String key, String query) {
-        List<Person> persons = getActors(key, query, NodeTypes.PERSON);
-        return persons;
-    }
-
-    /**
-     * Returns list of uri-like objects of given type (Target or Resource). Key
-     * has to be indexed.
-     * 
-     * @param key
-     * @param query
-     * @param type
-     * @return
-     */
-    @SuppressWarnings("unchecked")
-    protected <T extends Uri> List<T> getUris(String key, String query, NodeTypes type) {
-        ArrayList<T> uris = new ArrayList<T>();
-        Index<Node> idx = getNodeIndex(type);
-        if (key == null) {
-            key = "uri";
-            query = "*";
-        }
-        try (Transaction tx = graphDb.beginTx()) {
-            IndexHits<Node> actorNodes = idx.query(key, query);
-            for (Node actorNode : actorNodes) {
-                Uri uri = createUriFromNode(actorNode);
-                uris.add((T) uri);
-            }
-            tx.success();
-        }
-        return uris;
-    }
-
-    /**
-     * Returns list of Targets. Key has to be indexed.
-     * 
-     * @param key
-     * @param query
-     * @return
-     */
-    public List<Target> getTargets(String key, String query) {
-        List<Target> targets = getUris(key, query, NodeTypes.TARGET);
-        return targets;
-    }
-
-    /**
-     * Returns list of Resources. Key has to be indexed.
-     * 
-     * @param key
-     * @param query
-     * @return
-     */
-    public List<Resource> getResources(String key, String query) {
-        List<Resource> targets = getUris(key, query, NodeTypes.RESOURCE);
-        return targets;
-    }
-
-    /**
-     * Returns the total number of Annotations.
-     * 
-     * @return number of annotations
-     */
-    public int getAnnotationCount() {
-        int num = -1;
-        Index<Node> idx = getNodeIndex(NodeTypes.ANNOTATION);
-        try (Transaction tx = graphDb.beginTx()) {
-            IndexHits<Node> annotNodes = idx.query("id", "*");
-            num = annotNodes.size();
-            tx.success();
-        }
-        return num;
-    }
-    
-    /**
-     * Returns List of Annotations. Key has to be indexed.
-     * 
-     * @param key
-     * @param query
-     * @param limit 
-     * @param offset 
-     * @return
-     */
-    public List<Annotation> getAnnotations(String key, String query, int limit, int offset) {
-        long ts = System.currentTimeMillis();
-        ArrayList<Annotation> annotations = new ArrayList<Annotation>();
-        Index<Node> idx = getNodeIndex(NodeTypes.ANNOTATION);
-        if (key == null) {
-            key = "id";
-            query = "*";
-        }
-        try (Transaction tx = graphDb.beginTx()) {
-            IndexHits<Node> annotNodes = idx.query(key, query);
-            int cnt = 0;
-            int max = offset + limit;
-            for (Node annotNode : annotNodes) {
-                cnt += 1;
-                if (cnt < offset) continue;
-                Annotation annotation = createAnnotationFromNode(annotNode);
-                annotations.add(annotation);
-                if (limit > 0 && cnt >= max) {
-                    annotNodes.close();
-                    break;
-                }
-            }
-            tx.success();
-        }
-        logger.finer("got "+annotations.size()+" annotations in "+(System.currentTimeMillis()-ts)+"ms");
-        return annotations;
-    }
-
-    /**
-     * Returns List of Tags. Key has to be indexed.
-     * 
-     * @param key
-     * @param query
-     * @return
-     */
-    public List<Tag> getTags(String key, String query) {
-        ArrayList<Tag> tags = new ArrayList<Tag>();
-        Index<Node> idx = getNodeIndex(NodeTypes.TAG);
-        if (key == null) {
-            key = "uri";
-            query = "*";
-        }
-        try (Transaction tx = graphDb.beginTx()) {
-            IndexHits<Node> groupNodes = idx.query(key, query);
-            for (Node groupNode : groupNodes) {
-                Tag tag = createTagFromNode(groupNode);
-                tags.add(tag);
-            }
-            tx.success();
-        }
-        return tags;
-    }
-
-    /**
-     * Returns List of Groups the person is member of.
-     * 
-     * @param person
-     * @return
-     */
-    public List<Group> getGroupsForPersonNode(Node person) {
-        ArrayList<Group> groups = new ArrayList<Group>();
-        try (Transaction tx = graphDb.beginTx()) {
-        	Iterable<Relationship> rels = person.getRelationships(RelationTypes.MEMBER_OF);
-        	for (Relationship rel : rels) {
-        		Node groupNode = rel.getEndNode();
-        		Actor group = createActorFromNode(groupNode);
-        		// make sure we're getting a group
-        		if (!(group instanceof Group)) {
-        			logger.severe("target of MEMBER_OF is not GROUP! rel=" + rel);
-        			continue;
-        		}
-        		groups.add((Group) group);
-        	}
-        	tx.success();
-        }
-        return groups;
-    }
-
-    /**
-     * Returns if person with uri is in Group group.
-     * 
-     * @param person
-     * @param group
-     * @return
-     */
-    public boolean isPersonInGroup(Person person, Group group) {
-        Node pn = getPersonNodeByUri(person.getUriString());
-        if (pn == null)
-            return false;
-        // optimized version of getGroupsForPersonNode
-        try (Transaction tx = graphDb.beginTx()) {
-            Iterable<Relationship> rels = pn.getRelationships(RelationTypes.MEMBER_OF);
-            for (Relationship rel : rels) {
-                Node gn = rel.getEndNode();
-                if (gn.getProperty("uri", "").equals(group.getUriString()) 
-                        || gn.getProperty("id", "").equals(group.getId())) {
-                    tx.success();
-                    return true;
-                }
-            }
-            tx.success();
-        }
-        return false;
-    }
-
-    /**
-     * Returns the members of the group.
-     * 
-     * @param group
-     * @return
-     */
-    public List<Person> getMembersOfGroup(Group group) {
-        ArrayList<Person> members = new ArrayList<Person>();
-        Node gn = getActorNode(group);
-        try (Transaction tx = graphDb.beginTx()) {
-        	Iterable<Relationship> rels = gn.getRelationships(RelationTypes.MEMBER_OF);
-        	for (Relationship rel : rels) {
-        		Node memberNode = rel.getStartNode();
-        		Actor member = createActorFromNode(memberNode);
-        		// make sure we're getting a group
-        		if (!(member instanceof Person)) {
-        			logger.severe("source of MEMBER_OF is not PERSON! rel=" + rel);
-        			continue;
-        		}
-        		members.add((Person) member);
-        	}
-        	tx.success();
-        }
-        return members;
-    }
-
-    /**
-     * Add Person newMember to Group group.
-     * 
-     * @param group
-     * @param member
-     */
-    public Person addGroupMember(Group group, Person member) {
-        Node gn = getActorNode(group);
-        Node pn = getActorNode(member);
-        Person addedMember = null;
-        if (gn != null && pn != null) {
-            getOrCreateRelation(pn, RelationTypes.MEMBER_OF, gn);
-            addedMember = member;
-        }
-        return addedMember;
-    }
-
-    /**
-     * Delete Person oldMember from Group group.
-     * 
-     * @param group
-     * @param member
-     */
-    public void deleteGroupMember(Group group, Person member) {
-        Node gn = getActorNode(group);
-        Node pn = getActorNode(member);
-        try (Transaction tx = graphDb.beginTx()) {
-        	Iterable<Relationship> rels = gn.getRelationships(RelationTypes.MEMBER_OF);
-        	for (Relationship rel : rels) {
-        		Node mn = rel.getStartNode();
-        		if (mn.equals(pn)) {
-                    rel.delete();
-                }
-                // there should be only one
-                break;
-            }
-            tx.success();
-        }
-    }
-
-    /**
-     * Returns the stored Actor matching the given one.
-     * 
-     * @param actor
-     * @return
-     */
-    public Actor getActor(Actor actor) {
-        Node actorNode = getActorNode(actor);
-        Actor storedActor = createActorFromNode(actorNode);
-        return storedActor;
-    }
-
-    /**
-     * Stores an Actor (Person or Group). Creates a new actor Node or update an
-     * existing one.
-     * 
-     * @param actor
-     * @return
-     */
-    public Actor storeActor(Actor actor) {
-        Node actorNode = getOrCreateActorNode(actor);
-        try (Transaction tx = graphDb.beginTx()) {
-            // id
-            String id = actor.getId();
-            if (id != null) {
-                actorNode.setProperty("id", id);
-            }
-            // name
-            String name = actor.getName();
-            if (name != null) {
-                actorNode.setProperty("name", name);
-            }
-            // uri
-            String uri = actor.getUri();
-            if (uri != null) {
-                actorNode.setProperty("uri", uri);
-            }
-            tx.success();
-        }
-        Actor storedActor = createActorFromNode(actorNode);
-        return storedActor;
-    }
-
-    /**
-     * Deletes the given Actor.
-     * 
-     * @param actor
-     */
-    public void deleteActor(Actor actor) {
-        String uri = actor.getUriString();
-        Index<Node> idx;
-        if (actor.isGroup()) {
-            idx = getNodeIndex(NodeTypes.GROUP);
-        } else {
-            idx = getNodeIndex(NodeTypes.PERSON);
-        }
-        try (Transaction tx = graphDb.beginTx()) {
-        	Node actorNode = idx.get("uri", uri).getSingle();
-        	if (actorNode != null) {
-        		// delete relations
-            	for (Relationship rel : actorNode.getRelationships()) {
-            		rel.delete();
-            	}
-            	if (!actorNode.hasRelationship()) {
-                    // this shouldn't happen
-                    deleteNode(actorNode);
-                } else {
-                    logger.severe("deleteActor: unable to delete: Node still has relations.");
-                }
-            }
-            tx.success();
-        }
-    }
-
-    /**
-     * Returns the Annotation with the given id.
-     * 
-     * @param id
-     * @return
-     */
-    public Annotation getAnnotationById(String id) {
-        Annotation annot = null;
-        try (Transaction tx = graphDb.beginTx()) {
-            Node annotNode = getNodeIndex(NodeTypes.ANNOTATION).get("id", id).getSingle();
-            annot = createAnnotationFromNode(annotNode);
-            tx.success();
-        }
-        return annot;
-    }
-
-    /**
-     * Returns an Annotation object from an annotation-Node.
-     * 
-     * @param annotNode
-     * @return
-     */
-    public Annotation createAnnotationFromNode(Node annotNode) {
-        Annotation annot = new Annotation();
-        try (Transaction tx = graphDb.beginTx()) {
-            annot.setUri((String) annotNode.getProperty("id", null));
-            annot.setBodyText((String) annotNode.getProperty("bodyText", null));
-            annot.setBodyUri((String) annotNode.getProperty("bodyUri", null));
-            annot.setQuote((String) annotNode.getProperty("quote", null));
-            /*
-             * get annotation target and resource from relation
-             */
-            for (Relationship rel : annotNode.getRelationships(RelationTypes.ANNOTATES)) {
-                Node target = rel.getEndNode();
-                String type = (String) target.getProperty("TYPE");
-                if (type.equals("TARGET")) {
-                    annot.setTarget(new Target((String) target.getProperty("uri", null)));
-                } else if (type.equals("RESOURCE")) {
-                    annot.setResource(new Resource((String) target.getProperty("uri", null)));
-                }
-            }
-            if (annot.getTarget() == null) {
-                logger.warning("annotation " + annotNode + " has no target node!");
-            }
-            // get fragment from attribute
-            annot.setTargetFragment((String) annotNode.getProperty("targetFragment", null));
-            String ft = (String) annotNode.getProperty("fragmentType", null);
-            if (ft != null) {
-                annot.setFragmentType(FragmentTypes.valueOf(ft));
-            }
-            /*
-             * get creator from relation
-             */
-            Relationship creatorRel = getRelation(annotNode, RelationTypes.CREATED, null);
-            if (creatorRel != null) {
-                Node creatorNode = creatorRel.getStartNode();
-                Actor creator = createActorFromNode(creatorNode);
-                annot.setCreator(creator);
-            } else {
-                logger.warning("annotation " + annotNode + " has no creator node!");
-            }
-            /*
-             * get creation and update date
-             */
-            annot.setCreated((String) annotNode.getProperty("created", null));
-            annot.setUpdated((String) annotNode.getProperty("updated", null));
-            /*
-             * get permissions
-             */
-            Relationship adminRel = getRelation(annotNode, RelationTypes.PERMITS_ADMIN, null);
-            if (adminRel != null) {
-                Node adminNode = adminRel.getEndNode();
-                Actor admin = createActorFromNode(adminNode);
-                annot.setAdminPermission(admin);
-            }
-            Relationship deleteRel = getRelation(annotNode, RelationTypes.PERMITS_DELETE, null);
-            if (deleteRel != null) {
-                Node deleteNode = deleteRel.getEndNode();
-                Actor delete = createActorFromNode(deleteNode);
-                annot.setDeletePermission(delete);
-            }
-            Relationship updateRel = getRelation(annotNode, RelationTypes.PERMITS_UPDATE, null);
-            if (updateRel != null) {
-                Node updateNode = updateRel.getEndNode();
-                Actor update = createActorFromNode(updateNode);
-                annot.setUpdatePermission(update);
-            }
-            Relationship readRel = getRelation(annotNode, RelationTypes.PERMITS_READ, null);
-            if (readRel != null) {
-                Node readNode = readRel.getEndNode();
-                Actor read = createActorFromNode(readNode);
-                annot.setReadPermission(read);
-            }
-            /*
-             * get tags
-             */
-            Set<String> tags = new HashSet<String>();
-            for (Relationship rel : annotNode.getRelationships(RelationTypes.HAS_TAG)) {
-                String tag = (String) rel.getEndNode().getProperty("name", null);
-                if (tag != null) {
-                    tags.add(tag);
-                }
-            }
-            annot.setTags(tags);
-
-            tx.success();
-        }
-        return annot;
-    }
-
-    /**
-     * Returns an Actor object from a node.
-     * 
-     * @param actorNode
-     * @return
-     */
-    protected Actor createActorFromNode(Node actorNode) {
-        if (actorNode == null)
-            return null;
-        try (Transaction tx = graphDb.beginTx()) {
-            String id = (String) actorNode.getProperty("id", null);
-            String uri = (String) actorNode.getProperty("uri", null);
-            String name = (String) actorNode.getProperty("name", null);
-            String type = (String) actorNode.getProperty("TYPE", null);
-            tx.success();
-            if (type != null && type.equals("PERSON")) {
-                return new Person(id, uri, name);
-            } else if (type != null && type.equals("GROUP")) {
-                return new Group(id, uri, name);
-            }
-        }
-        return null;
-    }
-
-    public Tag createTagFromNode(Node tagNode) {
-        if (tagNode == null)
-            return null;
-        String id;
-        String uri;
-        String name;
-        try (Transaction tx = graphDb.beginTx()) {
-            name = (String) tagNode.getProperty("name", null);
-            uri = (String) tagNode.getProperty("uri", null);
-            id = (String) tagNode.getProperty("id", null);
-            tx.success();
-        }
-        return new Tag(id, uri, name);
-
-    }
-
-    /**
-     * @param resourceNode
-     * @return
-     */
-    public Resource createResourceFromNode(Node resourceNode) {
-        return (Resource) createUriFromNode(resourceNode);
-    }
-
-    /**
-     * @param targetNode
-     * @return
-     */
-    public Target createTargetFromNode(Node targetNode) {
-        return (Target) createUriFromNode(targetNode);
-    }
-
-    protected Uri createUriFromNode(Node uriNode) {
-        if (uriNode == null)
-            return null;
-        try (Transaction tx = graphDb.beginTx()) {
-            String uri = (String) uriNode.getProperty("uri", null);
-            String type = (String) uriNode.getProperty("TYPE", null);
-            tx.success();
-            if (type != null && type.equals("TARGET")) {
-                return new Target(uri);
-            } else if (type != null && type.equals("RESOURCE")) {
-                return new Resource(uri);
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Store a new annotation in the store or update an existing one. Returns
-     * the stored annotation.
-     * 
-     * @param annot
-     * @return
-     */
-    public Annotation storeAnnotation(Annotation annot) {
-        Node annotNode = null;
-        try (Transaction tx = graphDb.beginTx()) {
-            /*
-             * create or get the annotation
-             */
-            String id = annot.getUri();
-            if (id == null) {
-                id = createRessourceURI("annot:");
-            }
-            annotNode = getOrCreateAnnotationNode(id);
-
-            /*
-             * the annotation body
-             */
-            String bodyText = annot.getBodyText();
-            if (bodyText != null) {
-                annotNode.setProperty("bodyText", bodyText);
-            }
-            String bodyUri = annot.getBodyUri();
-            if (bodyUri != null) {
-                annotNode.setProperty("bodyUri", bodyUri);
-            }
-            
-            /*
-             * the annotation quote
-             */
-            String quote = annot.getQuote();
-            if (quote != null) {
-                annotNode.setProperty("quote", quote);
-            }
-                
-            /*
-             * the annotation target
-             */
-            Target target = annot.getTarget();
-            Node targetNode = null;
-            if (target != null) {
-                targetNode = getOrCreateUriNode(target.getUri(), NodeTypes.TARGET);
-                getOrCreateRelation(annotNode, RelationTypes.ANNOTATES, targetNode);
-            }
-
-            /*
-             * The fragment part of the annotation target.
-             */
-            String targetFragment = annot.getTargetFragment();
-            FragmentTypes fragmentType = annot.getFragmentType();
-            if (targetFragment != null) {
-                annotNode.setProperty("targetFragment", targetFragment);
-                annotNode.setProperty("fragmentType", fragmentType.name());
-            }
-
-            /*
-             * the annotation resource
-             */
-            Resource resource = annot.getResource();
-            if (resource != null) {
-                Node resourceNode = getOrCreateUriNode(resource.getUri(), NodeTypes.RESOURCE);
-                getOrCreateRelation(annotNode, RelationTypes.ANNOTATES, resourceNode);
-                getOrCreateRelation(targetNode, RelationTypes.PART_OF, resourceNode);
-            }
-
-            /*
-             * The creator of this annotation.
-             */
-            Actor creator = annot.getCreator();
-            if (creator != null) {
-                Node creatorNode = getOrCreateActorNode(creator);
-                getOrCreateRelation(creatorNode, RelationTypes.CREATED, annotNode);
-            }
-
-            /*
-             * The creation and update date of this annotation.
-             */
-            String created = annot.getCreated();
-            if (created != null) {
-                annotNode.setProperty("created", created);
-            }
-            String updated = annot.getUpdated();
-            if (updated != null) {
-                annotNode.setProperty("updated", updated);
-            }
-
-            /*
-             * Permissions for this annotation.
-             */
-            setPermissionRelation(annotNode, RelationTypes.PERMITS_ADMIN, annot.getAdminPermission());
-            setPermissionRelation(annotNode, RelationTypes.PERMITS_DELETE, annot.getDeletePermission());
-            setPermissionRelation(annotNode, RelationTypes.PERMITS_UPDATE, annot.getUpdatePermission());
-            setPermissionRelation(annotNode, RelationTypes.PERMITS_READ, annot.getReadPermission());
-
-            /*
-             * Tags on this annotation.
-             */
-            Set<String> newTags = annot.getTags();
-            // we ignore existing tags if tags == null
-            if (newTags != null) {
-                List<Relationship> oldHasTags = new ArrayList<Relationship>();
-                for (Relationship rel : annotNode.getRelationships(RelationTypes.HAS_TAG)) {
-                    oldHasTags.add(rel);
-                }
-                // adjust to new tags
-                if (newTags.isEmpty()) {
-                    // remove old tags
-                    if (!oldHasTags.isEmpty()) {
-                        for (Relationship rel : oldHasTags) {
-                            rel.delete();
-                            // TODO: should we delete orphan nodes too?
-                        }
-                    }
-                } else {
-                    if (!oldHasTags.isEmpty()) {
-                        // adjust old tags
-                        for (Relationship rel : oldHasTags) {
-                            String oldTag = (String) rel.getEndNode().getProperty("name", null);
-                            if (newTags.contains(oldTag)) {
-                                // tag exists
-                                newTags.remove(oldTag);
-                            } else {
-                                // tag exists no longer
-                                rel.delete();
-                                // TODO: should we delete orphan nodes too?
-                            }
-                        }
-                    }
-                    if (!newTags.isEmpty()) {
-                        // still tags to add
-                        for (String tag : newTags) {
-                            // create new tag
-                            Node tagNode = getOrCreateTagNode(new Tag(null, null, tag));
-                            getOrCreateRelation(annotNode, RelationTypes.HAS_TAG, tagNode);
-                        }
-                    }
-
-                }
-            }
-            tx.success();
-        }
-
-        // re-read and return annotation
-        Annotation storedAnnot = createAnnotationFromNode(annotNode);
-        return storedAnnot;
-    }
-
-    /**
-     * Deletes the annotation with the given id.
-     * 
-     * @param id
-     */
-    public void deleteAnnotationById(String id) {
-        try (Transaction tx = graphDb.beginTx()) {
-            Node annotNode = getNodeIndex(NodeTypes.ANNOTATION).get("id", id).getSingle();
-            if (annotNode != null) {
-                // delete related objects
-                for (Relationship rel : annotNode.getRelationships()) {
-                    // delete relation and the related node if it has no other
-                    // relations and is not permanent
-                    Node other = rel.getOtherNode(annotNode);
-                    rel.delete();
-                    if (!(other.hasRelationship() || permanentNodeTypes.contains(other.getProperty("TYPE", null)))) {
-                        deleteNode(other);
-                    }
-                }
-                if (!annotNode.hasRelationship()) {
-                    deleteNode(annotNode);
-                } else {
-                    logger.severe("deleteById: unable to delete: Node still has relations.");
-                }
-            }
-            tx.success();
-        }
-    }
-
-    /**
-     * Returns all annotations with the given uri and/or user.
-     * 
-     * @param uri
-     * @param userUri
-     * @return
-     */
-    public List<Annotation> searchAnnotationByUriUser(String targetUri, String userUri) {
-        List<Annotation> annotations = new ArrayList<Annotation>();
-        if (targetUri != null) {
-            // there should be only one
-            Node target = getNodeFromIndex("uri", targetUri, NodeTypes.TARGET);
-            if (target != null) {
-                try (Transaction tx = graphDb.beginTx()) {
-                    Iterable<Relationship> relations = target.getRelationships(RelationTypes.ANNOTATES);
-                    for (Relationship relation : relations) {
-                        Node ann = relation.getStartNode();
-                        if (ann.getProperty("TYPE", "").equals("ANNOTATION")) {
-                            Annotation annot = createAnnotationFromNode(ann);
-                            annotations.add(annot);
-                        } else {
-                            logger.severe("ANNOTATES relation does not start with ANNOTATION: " + ann);
-                        }
-                    }
-                    tx.success();
-                }
-            }
-        }
-        if (userUri != null) {
-            // there should be only one
-            Node person = getPersonNodeByUri(userUri);
-            if (person != null) {
-                try (Transaction tx = graphDb.beginTx()) {
-                    Iterable<Relationship> relations = person.getRelationships(RelationTypes.CREATED);
-                    for (Relationship relation : relations) {
-                        Node ann = relation.getEndNode();
-                        if (ann.getProperty("TYPE", "").equals("ANNOTATION")) {
-                            Annotation annot = createAnnotationFromNode(ann);
-                            annotations.add(annot);
-                        } else {
-                            logger.severe("CREATED relation does not end with ANNOTATION: " + ann);
-                        }
-                    }
-                    tx.success();
-                }
-            }
-        }
-        // TODO: if both uri and user are given we should intersect
-
-        return annotations;
-    }
-
-    /**
-     * Returns Relationship of type from Node start to Node end. Creates one if
-     * it doesn't exist.
-     * 
-     * @param start
-     * @param type
-     * @param end
-     * @return
-     */
-    protected Relationship getOrCreateRelation(Node start, RelationshipType type, Node end) {
-        if (start == null || end == null)
-            return null;
-        if (start.hasRelationship()) {
-            // there are relations
-            try (Transaction tx = graphDb.beginTx()) {
-                Iterable<Relationship> rels = start.getRelationships(type, Direction.OUTGOING);
-                for (Relationship rel : rels) {
-                    if (rel.getEndNode().equals(end)) {
-                        // relation exists
-                        tx.success();
-                        return rel;
-                    }
-                }
-                tx.success();
-            }
-        }
-        // create new one
-        Relationship rel;
-        try (Transaction tx = graphDb.beginTx()) {
-            rel = start.createRelationshipTo(end, type);
-            tx.success();
-        }
-        return rel;
-    }
-
-    protected Node getOrCreateAnnotationNode(String id) {
-        Index<Node> idx = getNodeIndex(NodeTypes.ANNOTATION);
-        Node annotation;
-        try (Transaction tx = graphDb.beginTx()) {
-            IndexHits<Node> annotations = idx.get("id", id);
-            annotation = annotations.getSingle();
-            if (annotation == null) {
-                // does not exist yet
-                annotation = graphDb.createNode();
-                annotation.setProperty("TYPE", NodeTypes.ANNOTATION.name());
-                annotation.setProperty("id", id);
-                idx.add(annotation, "id", id);
-            }
-            tx.success();
-        }
-        return annotation;
-    }
-
-    protected Node getOrCreateUriNode(String uri, NodeTypes type) {
-        Index<Node> idx = getNodeIndex(type);
-        Node target;
-        try (Transaction tx = graphDb.beginTx()) {
-            IndexHits<Node> targets = idx.get("uri", uri);
-            target = targets.getSingle();
-            if (target == null) {
-                // does not exist yet
-                target = graphDb.createNode();
-                target.setProperty("TYPE", type.name());
-                target.setProperty("uri", uri);
-                idx.add(target, "uri", uri);
-            }
-            tx.success();
-        }
-        return target;
-    }
-
-    protected Node getActorNode(Actor actor) {
-        // Person/Group is identified by URI or id
-        String uri = actor.getUriString();
-        Index<Node> idx;
-        Node person;
-        if (actor.isGroup()) {
-            idx = getNodeIndex(NodeTypes.GROUP);
-        } else {
-            idx = getNodeIndex(NodeTypes.PERSON);
-        }
-        try (Transaction tx = graphDb.beginTx()) {
-            IndexHits<Node> persons = idx.get("uri", uri);
-            person = persons.getSingle();
-            tx.success();
-        }
-        return person;
-    }
-
-    protected Node getOrCreateActorNode(Actor actor) {
-        // Person/Group is identified by URI or id
-        String uri = actor.getUriString();
-        String name = actor.getName();
-        String id = actor.getId();
-        Node person;
-        try (Transaction tx = graphDb.beginTx()) {
-            Index<Node> idx;
-            if (actor.isGroup()) {
-                idx = getNodeIndex(NodeTypes.GROUP);
-            } else {
-                idx = getNodeIndex(NodeTypes.PERSON);
-            }
-            IndexHits<Node> persons = idx.get("uri", uri);
-            person = persons.getSingle();
-            if (person == null) {
-                // does not exist yet
-                person = graphDb.createNode();
-                if (actor.isGroup()) {
-                    person.setProperty("TYPE", NodeTypes.GROUP.name());
-                } else {
-                    person.setProperty("TYPE", NodeTypes.PERSON.name());
-                }
-                person.setProperty("uri", uri);
-                idx.add(person, "uri", uri);
-                if (name != null) {
-                    person.setProperty("name", name);
-                }
-                if (id != null) {
-                    person.setProperty("id", id);
-                }
-            }
-            tx.success();
-        }
-        return person;
-    }
-
-    protected Node getOrCreateTagNode(Tag inTag) {
-        Index<Node> idx = getNodeIndex(NodeTypes.TAG);
-        String tagname = inTag.getName();
-        Node tag;
-        try (Transaction tx = graphDb.beginTx()) {
-            IndexHits<Node> tags = idx.get("name", tagname);
-            tag = tags.getSingle();
-            if (tag == null) {
-                // does not exist yet
-                tag = graphDb.createNode();
-                tag.setProperty("TYPE", NodeTypes.TAG.name());
-                tag.setProperty("name", tagname);
-                idx.add(tag, "name", tagname);
-
-                tag.setProperty("id", inTag.getId());
-                tag.setProperty("uri", inTag.getUri());
-                idx.add(tag, "uri", inTag.getUri());
-            }
-            tx.success();
-        }
-        return tag;
-    }
-
-    /**
-     * Create or update permissions relations for an annotation.
-     * 
-     * @param annotNode
-     * @param type
-     * @param annot
-     */
-    protected void setPermissionRelation(Node annotNode, RelationTypes type, Actor actor) {
-        Node newActorNode = null;
-        if (actor != null) {
-            newActorNode = getOrCreateActorNode(actor);
-        }
-        Relationship rel = getRelation(annotNode, type, null);
-        if (rel != null) {
-            // relation exists
-            try (Transaction tx = graphDb.beginTx()) {
-                Node oldActorNode = rel.getEndNode();
-                if (!oldActorNode.equals(newActorNode)) {
-                    // new admin is different
-                    rel.delete();
-                    tx.success();
-                }
-                if (newActorNode != null) {
-                    rel = getOrCreateRelation(annotNode, type, newActorNode);
-                }
-                tx.success();
-            }
-        } else {
-            // no relation yet
-            if (newActorNode != null) {
-                rel = getOrCreateRelation(annotNode, type, newActorNode);
-            }
-        }
-    }
-
-    /**
-     * Unindexes and deletes given Node if it has no relations.
-     * 
-     * @param node
-     */
-    protected void deleteNode(Node node) {
-        try (Transaction tx = graphDb.beginTx()) {
-            if (node.hasRelationship()) {
-                logger.severe("deleteNode: unable to delete: Node still has relations.");
-            } else {
-                String ts = (String) node.getProperty("TYPE", null);
-                try {
-                    NodeTypes type = NodeTypes.valueOf(ts);
-                    getNodeIndex(type).remove(node);
-                } catch (Exception e) {
-                    logger.severe("deleteNode: unable to get TYPE of node: " + node);
-                }
-                node.delete();
-            }
-            tx.success();
-        }
-    }
-
-    /**
-     * returns the (first) Relationship of RelationTypes type from Node start.
-     * 
-     * @param start
-     * @param type
-     * @param direction
-     * @return
-     */
-    protected Relationship getRelation(Node start, RelationTypes type, Direction direction) {
-        Iterable<Relationship> rels;
-        try (Transaction tx = graphDb.beginTx()) {
-            if (direction == null) {
-                // ignore direction
-                rels = start.getRelationships(type);
-            } else {
-                rels = start.getRelationships(type, direction);
-            }
-            tx.success();
-            for (Relationship rel : rels) {
-                // just the first one
-                return rel;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Erzeuge eine urn aus der aktuellen Zeit in millis
-     * 
-     * @return
-     */
-    private String createRessourceURI(String prefix) {
-        Calendar cal = Calendar.getInstance();
-        long time = cal.getTimeInMillis();
-        return String.format("%s%s%s", ANNOTATION_URI_PREFIX, prefix, time);
-    }
-
-    public List<Annotation> getAnnotationsByTag(String tagUri) {
-        ArrayList<Annotation> ret = new ArrayList<Annotation>();
-        Node tag = getTagNodeByUri(tagUri);
-        if (tag != null) {
-            try (Transaction tx = graphDb.beginTx()) {
-                Iterable<Relationship> rels = tag.getRelationships(Direction.INCOMING, RelationTypes.HAS_TAG);
-                for (Relationship rel : rels) {
-                    Node node = rel.getStartNode();
-                    ret.add(createAnnotationFromNode(node));
-                }
-                tx.success();
-            }
-        }
-        return ret;
-    }
-
-    public List<Annotation> getAnnotationsByResource(String resourceUri) {
-        ArrayList<Annotation> ret = new ArrayList<Annotation>();
-        Node res = getNodeFromIndex("uri", resourceUri, NodeTypes.RESOURCE);
-        if (res != null) {
-            try (Transaction tx = graphDb.beginTx()) {
-                Iterable<Relationship> rels = res.getRelationships(Direction.INCOMING, RelationTypes.ANNOTATES);
-                for (Relationship rel : rels) {
-                    Node an = rel.getStartNode();
-                    Node rn = rel.getEndNode();
-                    if (rn.getProperty("TYPE", "").equals("RESOURCE")) {
-                        logger.severe("getAnnotationsByResource got ANNOTATES != RESOURCE");
-                    }
-                    ret.add(createAnnotationFromNode(an));
-                }
-                tx.success();
-            }
-        }
-        return ret;
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java	(revision 105)
+++ 	(revision )
@@ -1,301 +1,0 @@
-package de.mpiwg.itgroup.annotations.restlet;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.restlet.data.Form;
-import org.restlet.data.Status;
-import org.restlet.ext.json.JsonRepresentation;
-import org.restlet.representation.Representation;
-import org.restlet.resource.Delete;
-import org.restlet.resource.Get;
-import org.restlet.resource.Post;
-import org.restlet.resource.Put;
-
-import de.mpiwg.itgroup.annotations.Annotation;
-import de.mpiwg.itgroup.annotations.Annotation.Action;
-import de.mpiwg.itgroup.annotations.Person;
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-import de.mpiwg.itgroup.annotations.restlet.utils.JSONObjectComparator;
-
-/**
- * Implements the "annotations" uri of the Annotator API. see
- * <https://github.com/okfn/annotator/wiki/Storage>
- * 
- * @author dwinter, casties
- * 
- */
-public class AnnotatorAnnotations extends AnnotatorResourceImpl {
-
-    /**
-     * GET with JSON content-type.
-     * 
-     * @param entity
-     * @return
-     */
-    @Get("json")
-    public Representation doGetJSON(Representation entity) {
-        logger.fine("AnnotatorAnnotations doGetJSON!");
-        // id from URI /annotations/{id}
-        String id = null;
-        String jsonId = (String) getRequest().getAttributes().get("id");
-        if (jsonId != null) {
-            // URL decode
-            try {
-                jsonId = URLDecoder.decode(jsonId, "UTF-8");
-            } catch (UnsupportedEncodingException e) {
-                // this shouldn't happen
-            }
-            id = decodeJsonId(jsonId);
-            logger.fine("annotation-id=" + id);
-        }
-
-        // do authentication
-        Person authUser = getUserFromAuthToken(entity);
-        logger.fine("request authenticated=" + authUser);
-
-        if (id == null) {
-            // no id -- send all annotations
-            Form form = getRequest().getResourceRef().getQueryAsForm();
-            int limit = getInt(form.getFirstValue("limit", "1000"));
-            int offset = getInt(form.getFirstValue("offset", "0"));
-            String sortBy = form.getFirstValue("sortBy");
-            return getAllAnnotations(authUser, limit, offset, sortBy);
-        }
-
-        // send annotation with id
-        AnnotationStore store = getAnnotationStore();
-        Annotation annot = store.getAnnotationById(id);
-        if (annot != null) {
-            if (!annot.isActionAllowed(Action.read, authUser, store)) {
-                setStatus(Status.CLIENT_ERROR_FORBIDDEN, "Not Authorized!");
-                return null;
-            }
-            JSONObject result = createAnnotatorJson(annot, (authUser == null));
-            return new JsonRepresentation(result);
-        } else {
-            // not found
-            setStatus(Status.CLIENT_ERROR_NOT_FOUND);
-            return null;
-        }
-    }
-
-    private Representation getAllAnnotations(Person authUser, int limit, int offset, String sortBy) {
-        AnnotationStore store = getAnnotationStore();
-        ArrayList<JSONObject> results = new ArrayList<JSONObject>();
-
-        // read all annotations
-        List<Annotation> annotations = store.getAnnotations(null, null, 0, 0);
-        for (Annotation annotation : annotations) {
-            // check permission
-            if (!annotation.isActionAllowed(Action.read, authUser, store))
-                continue;
-            // add annotation to list
-            JSONObject jo = createAnnotatorJson(annotation, false);
-            results.add(jo);
-        }
-
-        // sort if necessary
-        if (sortBy != null) {
-            JSONObjectComparator.sortAnnotations(results, sortBy);
-        }
-
-        // put in JSON list
-        JSONArray rows = new JSONArray();
-        int cnt = 0;
-        int max = limit + offset;
-        for (JSONObject result : results) {
-            cnt += 1;
-            if (cnt < offset) continue;
-            rows.put(result);
-            if (limit > 0 && cnt >= max) break;
-        }
-
-        // assemble result object
-        JSONObject result = new JSONObject();
-        try {
-            result.put("rows", rows);
-            result.put("total", rows.length());
-        } catch (JSONException e) {
-            setStatus(Status.SERVER_ERROR_INTERNAL, "JSON Error");
-            return null;
-        }
-        return new JsonRepresentation(result);
-    }
-
-    /**
-     * POST with JSON content-type. Creates a new Annotation.
-     * 
-     * @return
-     */
-    @Post("json")
-    public Representation doPostJson(Representation entity) {
-        logger.fine("AnnotatorAnnotations doPostJSON!");
-
-        // do authentication TODO: who's allowed to create?
-        Person authUser = getUserFromAuthToken(entity);
-        logger.fine("request authenticated=" + authUser);
-        if (authUser == null) {
-            setStatus(Status.CLIENT_ERROR_FORBIDDEN, "Not Authorized!");
-            return null;
-        }
-
-        Annotation annot = null;
-        try {
-            JsonRepresentation jrep = new JsonRepresentation(entity);
-            JSONObject jo = jrep.getJsonObject();
-            if (jo == null) {
-                setStatus(Status.SERVER_ERROR_INTERNAL);
-                return null;
-            }
-            // make sure id is not set for POST
-            jo.remove("id");
-            // create Annotation object from posted JSON
-            annot = createAnnotation(jo, entity);
-        } catch (IOException e) {
-        	logger.warning(e.toString());
-            setStatus(Status.SERVER_ERROR_INTERNAL);
-            return null;
-        } catch (JSONException e) {
-        	logger.warning(e.toString());
-            setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
-            return null;
-        }
-        if (annot == null) {
-            setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
-            return null;
-        }
-        Annotation storedAnnot;
-        // store Annotation
-        storedAnnot = getAnnotationStore().storeAnnotation(annot);
-        /*
-         * according to https://github.com/okfn/annotator/wiki/Storage we should
-         * return 303: see other. For now we return the annotation.
-         */
-        JSONObject jo = createAnnotatorJson(storedAnnot, (authUser == null));
-        JsonRepresentation retRep = new JsonRepresentation(jo);
-        return retRep;
-    }
-
-    /**
-     * PUT with JSON content-type. Modifies an Annotation.
-     * 
-     * @param entity
-     * @return
-     */
-    @Put("json")
-    public Representation doPutJSON(Representation entity) {
-        logger.fine("AnnotatorAnnotations doPutJSON!");
-        // id from URI /annotations/{id}
-        String jsonId = (String) getRequest().getAttributes().get("id");
-        String id = decodeJsonId(jsonId);
-        logger.fine("annotation-id=" + id);
-
-        // do authentication
-        Person authUser = getUserFromAuthToken(entity);
-        logger.fine("request authenticated=" + authUser);
-
-        Annotation annot = null;
-        AnnotationStore store = getAnnotationStore();
-        try {
-            JsonRepresentation jrep = new JsonRepresentation(entity);
-            JSONObject jo = jrep.getJsonObject();
-            if (jo == null) {
-                setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
-                return null;
-            }
-            // get stored Annotation
-            Annotation storedAnnot = store.getAnnotationById(id);
-            if (storedAnnot == null) {
-                setStatus(Status.CLIENT_ERROR_NOT_FOUND);
-                return null;
-            }
-            if (!storedAnnot.isActionAllowed(Action.update, authUser, store)) {
-                setStatus(Status.CLIENT_ERROR_FORBIDDEN);
-                return null;
-            }
-            // update from posted JSON
-            annot = updateAnnotation(storedAnnot, jo, entity);
-            // store Annotation
-            storedAnnot = store.storeAnnotation(annot);
-            /*
-             * according to https://github.com/okfn/annotator/wiki/Storage we
-             * should return 303: see other. but the client doesn't like it
-             * setStatus(Status.REDIRECTION_SEE_OTHER); // go to same URL as
-             * this one Reference thisUrl = this.getReference();
-             * this.getResponse().setLocationRef(thisUrl);
-             */
-            // return new annotation
-            jo = createAnnotatorJson(storedAnnot, (authUser == null));
-            JsonRepresentation retRep = new JsonRepresentation(jo);
-            return retRep;
-        } catch (JSONException e) {
-            logger.severe("Error in doPutJSON: "+e);
-            setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
-        } catch (IOException e) {
-            logger.severe("Error in doPutJSON: "+e);
-            setStatus(Status.SERVER_ERROR_INTERNAL, "Other Error");
-        }
-        return null;
-    }
-
-    /**
-     * DELETE with JSON content-type. Deletes an Annotation.
-     * 
-     * @param entity
-     * @return
-     */
-    @Delete("json")
-    public Representation doDeleteJSON(Representation entity) {
-        logger.fine("AnnotatorAnnotations doDeleteJSON!");
-        // id from URI /annotations/{id}
-        String jsonId = (String) getRequest().getAttributes().get("id");
-        String id = decodeJsonId(jsonId);
-        logger.fine("annotation-id=" + id);
-
-        // do authentication
-        Person authUser = getUserFromAuthToken(entity);
-        logger.fine("request authenticated=" + authUser);
-        AnnotationStore store = getAnnotationStore();
-        Annotation annot = store.getAnnotationById(id);
-        if (annot != null) {
-            if (!annot.isActionAllowed(Action.delete, authUser, store)) {
-                setStatus(Status.CLIENT_ERROR_FORBIDDEN, "Not Authorized!");
-                return null;
-            }
-        }
-        // delete annotation
-        store.deleteAnnotationById(id);
-        setStatus(Status.SUCCESS_NO_CONTENT);
-        return null;
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotationsByResources.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotationsByResources.java	(revision 105)
+++ 	(revision )
@@ -1,121 +1,0 @@
-package de.mpiwg.itgroup.annotations.restlet;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.restlet.data.Form;
-import org.restlet.data.Parameter;
-import org.restlet.data.Status;
-import org.restlet.ext.json.JsonRepresentation;
-import org.restlet.representation.Representation;
-import org.restlet.resource.Get;
-
-import de.mpiwg.itgroup.annotations.Annotation;
-import de.mpiwg.itgroup.annotations.Annotation.Action;
-import de.mpiwg.itgroup.annotations.Person;
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-import de.mpiwg.itgroup.annotations.restlet.utils.JSONObjectComparator;
-
-/**
- * API for accessing tags in the Annotation store.
- * 
- * @author dwinter
- * 
- */
-public class AnnotatorAnnotationsByResources extends AnnotatorResourceImpl {
-
-    @Get("json")
-    public Representation doGetJSON(Representation entity) {
-        logger.fine("AnnotatorAnnotatonsByResource doGetJSON!");
-
-        // do authentication
-        Person authUser = getUserFromAuthToken(entity);
-        logger.fine("request authenticated=" + authUser);
-
-        String id = null;
-        String jsonId = (String) getRequest().getAttributes().get("id");
-        if (jsonId != null) {
-            // URL decode
-            try {
-                jsonId = URLDecoder.decode(jsonId, "UTF-8");
-            } catch (UnsupportedEncodingException e) {
-                // this shouldn't happen
-            }
-            id = decodeJsonId(jsonId);
-            // String id = jsonId;
-            logger.fine("ressource-id=" + id);
-        }
-
-        Form form = getRequest().getResourceRef().getQueryAsForm();
-        String sortBy = null;
-        for (Parameter parameter : form) {
-            if (parameter.getName().equals("sortBy")) {
-                sortBy = parameter.getValue();
-            }
-        }
-
-        AnnotationStore store = getAnnotationStore();
-        // String tagUri=NS.MPIWG_TAGS_URL+id;
-        List<Annotation> annotations = store.getAnnotationsByResource(id);
-
-        // JSONArray results = new JSONArray();
-        ArrayList<JSONObject> results = new ArrayList<JSONObject>();
-
-        for (Annotation annot : annotations) {
-            // check permission
-            if (!annot.isActionAllowed(Action.read, authUser, store))
-                continue;
-
-            JSONObject jo = createAnnotatorJson(annot, false);
-            results.add(jo);
-        }
-
-        if (sortBy != null) {
-            JSONObjectComparator.sortAnnotations(results, sortBy);
-        }
-
-        JSONArray resultsJa = new JSONArray();
-        for (JSONObject result : results) {
-            resultsJa.put(result);
-        }
-
-        // assemble result object
-        JSONObject result = new JSONObject();
-        try {
-            result.put("rows", resultsJa);
-            result.put("total", resultsJa.length());
-        } catch (JSONException e) {
-            setStatus(Status.SERVER_ERROR_INTERNAL, "JSON Error");
-            return null;
-        }
-        return new JsonRepresentation(result);
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotationsByTags.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotationsByTags.java	(revision 105)
+++ 	(revision )
@@ -1,110 +1,0 @@
-package de.mpiwg.itgroup.annotations.restlet;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.restlet.data.Form;
-import org.restlet.data.Status;
-import org.restlet.ext.json.JsonRepresentation;
-import org.restlet.representation.Representation;
-import org.restlet.resource.Get;
-
-import de.mpiwg.itgroup.annotations.Annotation;
-import de.mpiwg.itgroup.annotations.Annotation.Action;
-import de.mpiwg.itgroup.annotations.Person;
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-import de.mpiwg.itgroup.annotations.restlet.utils.JSONObjectComparator;
-
-/**
- * API for accessing tags in the Annotation store.
- * 
- * @author dwinter
- * 
- */
-public class AnnotatorAnnotationsByTags extends AnnotatorResourceImpl {
-
-    @Get("json")
-    public Representation doGetJSON(Representation entity) {
-        logger.fine("AnnotatorAnnotatonsBytag doGetJSON!");
-
-        // do authentication
-        Person authUser = getUserFromAuthToken(entity);
-        logger.fine("request authenticated=" + authUser);
-
-        String id = (String) getRequest().getAttributes().get("id");
-        // URL decode
-        try {
-            id = URLDecoder.decode(id, "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            // this shouldn't happen
-        }
-        logger.fine("annotation-id=" + id);
-
-        Form form = getRequest().getResourceRef().getQueryAsForm();
-        String sortBy = form.getFirstValue("sortBy");
-
-        AnnotationStore store = getAnnotationStore();
-        String tagUri = BaseRestlet.TAGS_URI_PREFIX + id;
-        List<Annotation> annotations = store.getAnnotationsByTag(tagUri);
-
-        // JSONArray results = new JSONArray();
-        ArrayList<JSONObject> results = new ArrayList<JSONObject>();
-
-        for (Annotation annot : annotations) {
-            // check permission
-            if (!annot.isActionAllowed(Action.read, authUser, store))
-                continue;
-
-            JSONObject jo = createAnnotatorJson(annot, false);
-            results.add(jo);
-        }
-
-        if (sortBy != null) {
-            JSONObjectComparator.sortAnnotations(results, sortBy);
-        }
-
-        JSONArray resultsJa = new JSONArray();
-        for (JSONObject result : results) {
-            resultsJa.put(result);
-        }
-
-        // assemble result object
-        JSONObject result = new JSONObject();
-        try {
-            result.put("rows", resultsJa);
-            result.put("total", resultsJa.length());
-        } catch (JSONException e) {
-            setStatus(Status.SERVER_ERROR_INTERNAL, "JSON Error");
-            return null;
-        }
-        return new JsonRepresentation(result);
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorGroups.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorGroups.java	(revision 91)
+++ 	(revision )
@@ -1,126 +1,0 @@
-package de.mpiwg.itgroup.annotations.restlet;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.neo4j.graphdb.Node;
-import org.restlet.data.Form;
-import org.restlet.data.Status;
-import org.restlet.ext.json.JsonRepresentation;
-import org.restlet.representation.Representation;
-import org.restlet.resource.Get;
-
-import de.mpiwg.itgroup.annotations.Actor;
-import de.mpiwg.itgroup.annotations.Group;
-import de.mpiwg.itgroup.annotations.Person;
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-
-
-/**
- * API for accessing groups in the Annotation store.
- * 
- * @author casties
- *
- */
-public class AnnotatorGroups extends AnnotatorResourceImpl {
-
-    /**
-     * GET with JSON content-type.
-     * Parameters: 
-     *   user: short user name
-     *   uri: user uri
-     *   
-     * @param entity
-     * @return
-     */
-    @Get("json")
-    public Representation doGetJSON(Representation entity) {
-        logger.fine("AnnotatorGroups doGetJSON!");
-        // get user from auth token (preferred)
-        Person authUser = getUserFromAuthToken(entity);
-        JSONArray results = null;
-        if (authUser != null && authUser.groups != null) {
-            results  = getGroupsFromPerson(authUser);
-        } else {
-            // get user or uri from request
-            Form form = getRequest().getResourceRef().getQueryAsForm();
-            String user = form.getFirstValue("user");
-            String uri = form.getFirstValue("uri");
-            results = getGroupsFromStore(uri, user);
-        }
-        // assemble result object
-        JSONObject result = new JSONObject();
-        try {
-            result.put("rows", results);
-            result.put("total", results.length());
-        } catch (JSONException e) {
-            setStatus(Status.SERVER_ERROR_INTERNAL, "JSON Error");
-            return null;
-        }
-        logger.fine("sending:");
-        logger.fine(result.toString());
-        return new JsonRepresentation(result);
-    }
-
-    public JSONArray getGroupsFromPerson(Person person) {
-        JSONArray results = new JSONArray();
-        for (String group : person.groups) {
-            JSONObject jo = new JSONObject();
-            try {
-                jo.put("id", group);
-                jo.put("name", group);
-            } catch (JSONException e) {
-            }
-            results.put(jo);
-        }
-        return results;
-    }
-
-    public JSONArray getGroupsFromStore(String uri, String user) {
-        JSONArray results = new JSONArray();
-        if (uri == null || uri.isEmpty()) {
-            // get uri from user-id
-            uri = Actor.getUriFromId(user, false);
-        }
-        AnnotationStore store = getAnnotationStore();
-        Node person = store.getPersonNodeByUri(uri);
-        if (person != null) {
-            List<Group> groups = store.getGroupsForPersonNode(person);
-            for (Group group : groups) {
-                JSONObject jo = new JSONObject();
-                try {
-                    jo.put("id", group.getId());
-                    jo.put("name", group.getName());
-                    jo.put("uri", group.getUriString());
-                } catch (JSONException e) {
-                }
-                results.put(jo);
-            }
-        }
-        return results;
-    }
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorInfo.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorInfo.java	(revision 70)
+++ 	(revision )
@@ -1,46 +1,0 @@
-package de.mpiwg.itgroup.annotations.restlet;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.io.InputStream;
-
-import org.restlet.data.MediaType;
-import org.restlet.representation.InputRepresentation;
-import org.restlet.representation.Representation;
-import org.restlet.resource.Get;
-import org.restlet.resource.ServerResource;
-
-
-public class AnnotatorInfo extends ServerResource {
-
-	@Get("html")
-	public Representation getHTML(){
-		InputStream is = getClass().getResourceAsStream("/de/mpiwg/itgroup/annotations/annotator-info.html");
-		
-		Representation rep = new InputRepresentation(is,MediaType.TEXT_HTML);
-		return rep;
-		
-	}
-	
-}
-
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResourceImpl.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResourceImpl.java	(revision 105)
+++ 	(revision )
@@ -1,758 +1,0 @@
-package de.mpiwg.itgroup.annotations.restlet;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.io.UnsupportedEncodingException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.logging.Logger;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import net.oauth.jsontoken.Checker;
-import net.oauth.jsontoken.JsonToken;
-import net.oauth.jsontoken.JsonTokenParser;
-import net.oauth.jsontoken.SystemClock;
-import net.oauth.jsontoken.crypto.HmacSHA256Verifier;
-import net.oauth.jsontoken.crypto.Verifier;
-
-import org.apache.commons.codec.binary.Base64;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.restlet.data.Header;
-import org.restlet.data.Status;
-import org.restlet.representation.Representation;
-import org.restlet.resource.ServerResource;
-import org.restlet.util.Series;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-
-import de.mpiwg.itgroup.annotations.Actor;
-import de.mpiwg.itgroup.annotations.Annotation;
-import de.mpiwg.itgroup.annotations.Annotation.Action;
-import de.mpiwg.itgroup.annotations.Annotation.FragmentTypes;
-import de.mpiwg.itgroup.annotations.Group;
-import de.mpiwg.itgroup.annotations.Person;
-import de.mpiwg.itgroup.annotations.Resource;
-import de.mpiwg.itgroup.annotations.Target;
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-
-/**
- * Base class for Annotator resource classes.
- * 
- * @author dwinter, casties
- * 
- */
-public abstract class AnnotatorResourceImpl extends ServerResource {
-
-	protected static Logger logger = Logger.getLogger(AnnotatorResourceImpl.class.getCanonicalName());
-
-    private AnnotationStore store;
-
-    protected AnnotationStore getAnnotationStore() {
-        if (store == null) {
-            store = ((BaseRestlet) getApplication()).getAnnotationStore();
-        }
-        return store;
-    }
-
-    public String encodeJsonId(String id) {
-        if (id == null)
-            return null;
-        try {
-            return Base64.encodeBase64URLSafeString(id.getBytes("UTF-8"));
-        } catch (UnsupportedEncodingException e) {
-            return null;
-        }
-    }
-
-    public String decodeJsonId(String id) {
-        if (id == null)
-            return null;
-        try {
-            return new String(Base64.decodeBase64(id), "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            return null;
-        }
-    }
-
-    /**
-     * returns if authentication information from headers is valid.
-     * 
-     * @param entity
-     * @return
-     */
-    public boolean isAuthenticated(Representation entity) {
-        return (getUserFromAuthToken(entity) != null);
-    }
-
-    /**
-     * Checks Annotator Auth plugin authentication information from headers.
-     * Returns userId if successful. Returns "anonymous" in non-authorization
-     * mode.
-     * 
-     * @param entity
-     * @return user-id
-     */
-    public Person getUserFromAuthToken(Representation entity) {
-        @SuppressWarnings("unchecked")
-        Series<Header> requestHeaders = (Series<Header>) getRequest().getAttributes().get("org.restlet.http.headers");
-        String authToken = requestHeaders.getFirstValue("x-annotator-auth-token", true);
-        if (authToken == null) {
-            if (!((BaseRestlet) getApplication()).isAuthorizationMode()) {
-            	// no token, no-auth mode -> anonymous
-                return Person.getAnonymous();
-            }
-            // no token, auth mode -> null 
-            return null;
-        }
-		try {
-			// decode token first to get consumer key
-            JsonToken token = new JsonTokenParser(null, null).deserialize(authToken);
-            String consumerKey = token.getParamAsPrimitive("consumerKey").getAsString();
-            // get stored consumer secret for key
-            BaseRestlet restServer = (BaseRestlet) getApplication();
-            String consumerSecret = restServer.getConsumerSecret(consumerKey);
-            logger.fine("requested consumer key=" + consumerKey + " secret=" + consumerSecret);
-			if (consumerSecret == null) {
-			    logger.warning("Error: unknown consumer key: "+consumerKey);
-				return null;
-			}
-			// logger.fine(String.format("token=%s tokenString=%s signatureAlgorithm=%s",token,token.getTokenString(),token.getSignatureAlgorithm()));
-            List<Verifier> verifiers = new ArrayList<Verifier>();
-            // we only do HS256 yet
-            verifiers.add(new HmacSHA256Verifier(consumerSecret.getBytes("UTF-8")));
-            // verify token signature(should really be static...)
-            new JsonTokenParser(new SystemClock(), null, (Checker[]) null).verify(token, verifiers);
-            // create Person
-            JsonObject payload = token.getPayloadAsJsonObject();
-            // userId is mandatory
-            String userId = payload.get("userId").getAsString();
-            Person user = new Person(userId);
-            // displayName is optional
-            if (payload.has("displayName")) {
-                user.name = payload.get("displayName").getAsString();
-            }
-            // memberOf groups is optional
-            if (payload.has("memberOf")) {
-                Set<String> groups = new HashSet<String>();
-                JsonArray jgroups = payload.get("memberOf").getAsJsonArray();
-                for (JsonElement jgroup : jgroups) {
-                    groups.add(jgroup.getAsString());
-                }
-                user.groups = groups;
-            }
-            logger.fine("auth OK! user=" + user);
-            return user;
-        } catch (Exception e) {
-            logger.warning("Error checking auth token: "+e.toString());
-        }
-        return null;
-    }
-
-    /**
-     * creates Annotator-JSON from an Annotation object.
-     * 
-     * @param annot annotation object
-     * @param forAnonymous
-     * @return Annotator-JSON
-     */
-    public JSONObject createAnnotatorJson(Annotation annot, boolean forAnonymous) {
-        // return user as a JSON object (otherwise just as string)
-        boolean makeUserObject = true;
-        JSONObject jo = new JSONObject();
-        try {
-            jo.put("text", annot.getBodyText());
-            jo.put("uri", annot.getTargetBaseUri());
-            if (annot.getResourceUri() != null) {
-                jo.put("resource", annot.getResourceUri());
-            }
-            if (annot.getQuote() != null) {
-                jo.put("quote", annot.getQuote());
-            }
-
-            /*
-             * user
-             */
-            Actor creator = annot.getCreator();
-            if (creator != null) {
-                if (makeUserObject) {
-                    // create user object
-                    JSONObject userObject = new JSONObject();
-                    // save creator as uri
-                    userObject.put("uri", creator.getUri());
-                    // make short user id
-                    String userId = creator.getIdString();
-                    // set as id
-                    userObject.put("id", userId);
-                    // get full name
-                    String userName = creator.getName();
-                    if (userName == null) {
-                        BaseRestlet restServer = (BaseRestlet) getApplication();
-                        userName = restServer.getFullNameForId(userId);
-                    }
-                    userObject.put("name", userName);
-                    // save user object
-                    jo.put("user", userObject);
-                } else {
-                    // save user as string
-                    jo.put("user", annot.getCreatorUri());
-                }
-            }
-
-            /*
-             * ranges
-             */
-            if (annot.getTargetFragment() != null) {
-                // we only look at the first xpointer
-                List<String> fragments = new ArrayList<String>();
-                fragments.add(annot.getTargetFragment());
-                FragmentTypes xt = annot.getFragmentType();
-                if (xt == FragmentTypes.XPOINTER) {
-                    jo.put("ranges", transformToRanges(fragments));
-                } else if (xt == FragmentTypes.AREA) {
-                    jo.put("shapes", transformToShapes(fragments));
-                } else if (xt == FragmentTypes.WKT) {
-                    jo.put("shapes", transformToShapes(fragments));
-                }
-            }
-
-            /*
-             * permissions
-             */
-            JSONObject perms = new JSONObject();
-            jo.put("permissions", perms);
-            // admin
-            JSONArray adminPerms = new JSONArray();
-            perms.put("admin", adminPerms);
-            Actor adminPerm = annot.getAdminPermission();
-            if (adminPerm != null) {
-                adminPerms.put(adminPerm.getIdString());
-            } else if (forAnonymous) {
-                // set something because its not allowed for anonymous
-                adminPerms.put("not-you");
-            }
-            // delete
-            JSONArray deletePerms = new JSONArray();
-            perms.put("delete", deletePerms);
-            Actor deletePerm = annot.getDeletePermission();
-            if (deletePerm != null) {
-                deletePerms.put(deletePerm.getIdString());
-            } else if (forAnonymous) {
-                // set something because its not allowed for anonymous
-                deletePerms.put("not-you");
-            }
-            // update
-            JSONArray updatePerms = new JSONArray();
-            perms.put("update", updatePerms);
-            Actor updatePerm = annot.getUpdatePermission();
-            if (updatePerm != null) {
-                updatePerms.put(updatePerm.getIdString());
-            } else if (forAnonymous) {
-                // set something because its not allowed for anonymous
-                updatePerms.put("not-you");
-            }
-            // read
-            JSONArray readPerms = new JSONArray();
-            perms.put("read", readPerms);
-            Actor readPerm = annot.getReadPermission();
-            if (readPerm != null) {
-                readPerms.put(readPerm.getIdString());
-            }
-
-            /*
-             * tags
-             */
-            Set<String> tagset = annot.getTags();
-            if (tagset != null) {
-                JSONArray tags = new JSONArray();
-                jo.put("tags", tags);
-                for (String tag : tagset) {
-                    tags.put(tag);
-                }
-            }
-
-            /*
-             * id
-             */
-            // encode Annotation URL (=id) in base64
-            String annotUrl = annot.getUri();
-            String annotId = encodeJsonId(annotUrl);
-            jo.put("id", annotId);
-            return jo;
-        } catch (JSONException e) {
-            logger.severe("Unable to create AnnotatorJSON! "+e);
-        }
-        return null;
-    }
-
-    private JSONArray transformToRanges(List<String> xpointers) {
-        JSONArray ja = new JSONArray();
-        Pattern rg = Pattern
-                .compile("xpointer\\(start-point\\(string-range\\(\"([^\"]*)\",([^,]*),1\\)\\)/range-to\\(end-point\\(string-range\\(\"([^\"]*)\",([^,]*),1\\)\\)\\)\\)");
-        Pattern rg1 = Pattern.compile("xpointer\\(start-point\\(string-range\\(\"([^\"]*)\",([^,]*),1\\)\\)\\)");
-        try {
-            for (String xpointer : xpointers) {
-                // String decoded = URLDecoder.decode(xpointer, "utf-8");
-                String decoded = xpointer;
-                Matcher m = rg.matcher(decoded);
-                if (m.find()) {
-                    JSONObject jo = new JSONObject();
-                    jo.put("start", m.group(1));
-                    jo.put("startOffset", m.group(2));
-                    jo.put("end", m.group(3));
-                    jo.put("endOffset", m.group(4));
-                    ja.put(jo);
-                }
-                m = rg1.matcher(xpointer);
-                if (m.find()) {
-                    JSONObject jo = new JSONObject();
-                    jo.put("start", m.group(1));
-                    jo.put("startOffset", m.group(2));
-                    ja.put(jo);
-                }
-            }
-        } catch (JSONException e) {
-            logger.severe("Unable to transform to ranges! "+e);
-        }
-        return ja;
-    }
-
-    private JSONArray transformToShapes(List<String> fragments) {
-        JSONArray ja = new JSONArray();
-        Pattern xywhPattern = Pattern.compile("xywh=(\\w*):([\\d\\.]+),([\\d\\.]+),([\\d\\.]+),([\\d\\.]+)");
-        Pattern wktPattern = Pattern.compile("wkt=(\\w+)\\(+([\\d\\.\\,\\ ]+)\\)+");
-        try {
-            for (String fragment : fragments) {
-                Matcher xywhMatch = xywhPattern.matcher(fragment);
-                Matcher wktMatch = wktPattern.matcher(fragment);
-                if (xywhMatch.find()) {
-                	// xywh rectangle fragment
-                    String units = xywhMatch.group(1);
-                    float x = getFloat(xywhMatch.group(2));
-                    float y = getFloat(xywhMatch.group(3));
-                    float width = getFloat(xywhMatch.group(4));
-                    float height = getFloat(xywhMatch.group(5));
-                    JSONObject shape = new JSONObject();
-                    JSONObject geom = new JSONObject();
-                    geom.put("units", units);
-                    geom.put("x", x);
-                    geom.put("y", y);
-                    if (width == 0 || height == 0) {
-                        shape.put("type", "point");
-                        shape.put("geometry", geom);
-                    } else {
-                        shape.put("type", "rectangle");
-                        geom.put("width", width);
-                        geom.put("height", height);
-                        shape.put("geometry", geom);
-                    }
-                    ja.put(shape);
-                } else if (wktMatch.find()) {
-                	// wkt shape fragment
-                	String type = wktMatch.group(1);
-                	String coordString = wktMatch.group(2);
-                    JSONObject shape = new JSONObject();
-                    JSONObject geom = new JSONObject();
-                    shape.put("type", type.toLowerCase());
-                    // TODO: add units/crs to fragment?
-                    geom.put("units", "fraction");
-                    JSONArray coords = new JSONArray();
-                    String[] coordPairs = coordString.split(", *");
-                    for (String coordPairString : coordPairs) {
-                    	String[] coordPair = coordPairString.split(" +");
-                    	coords.put(new JSONArray(coordPair));
-                    }
-                    geom.put("coordinates", coords);
-                	shape.put("geometry", geom);
-                	ja.put(shape);
-                }
-            }
-        } catch (JSONException e) {
-            logger.severe("Unable to transform to shapes! "+e);
-        }
-        return ja;
-    }
-
-    protected String parseShape(JSONObject shape) throws JSONException {
-        String fragment = null;
-        String type = shape.getString("type");
-        JSONObject geom = shape.getJSONObject("geometry");
-        if (type.equalsIgnoreCase("point")) {
-        	// point shape
-            String x = geom.getString("x");
-            String y = geom.getString("y");
-            fragment = String.format("xywh=fraction:%s,%s,0,0", x, y);
-        } else if (type.equalsIgnoreCase("rectangle")) {
-        	// rectangle shape
-            String x = geom.getString("x");
-            String y = geom.getString("y");
-            String width = geom.getString("width");
-            String height = geom.getString("height");
-            fragment = String.format("xywh=fraction:%s,%s,%s,%s", x, y, width, height);
-        } else if (type.equalsIgnoreCase("polygon")) {
-        	// polygon shape
-        	JSONArray coordArray = geom.getJSONArray("coordinates");
-            StringBuilder coords = new StringBuilder();
-            int numCoords = coordArray.length();
-        	for (int i = 0; i < numCoords; ++i) {
-        		JSONArray coordPair = coordArray.getJSONArray(i);
-        		coords.append(coordPair.getString(0));
-        		coords.append(" ");
-        		coords.append(coordPair.getString(1));
-        		if (i < numCoords-1) {
-        			coords.append(", ");
-        		}
-        	}
-        	// TODO: add units/crs to wkt
-        	// assume polygon with outer ring
-            fragment = String.format("wkt=POLYGON((%s))", coords);
-        } else if (type.equalsIgnoreCase("linestring")) {
-        	// linestring (polyline) shape
-        	JSONArray coordArray = geom.getJSONArray("coordinates");
-            StringBuilder coords = new StringBuilder();
-            int numCoords = coordArray.length();
-        	for (int i = 0; i < numCoords; ++i) {
-        		JSONArray coordPair = coordArray.getJSONArray(i);
-        		coords.append(coordPair.getString(0));
-        		coords.append(" ");
-        		coords.append(coordPair.getString(1));
-        		if (i < numCoords-1) {
-        			coords.append(", ");
-        		}
-        	}
-        	// TODO: add units/crs to wkt
-            fragment = String.format("wkt=LINESTRING(%s)", coords);
-        } else {
-            logger.severe("Unable to parse this shape: " + shape);
-        }
-        return fragment;
-    }
-
-    protected String parseArea(JSONObject area) throws JSONException {
-        String x = area.getString("x");
-        String y = area.getString("y");
-        String width = "0";
-        String height = "0";
-        if (area.has("width")) {
-            width = area.getString("width");
-            height = area.getString("height");
-        }
-        String fragment = String.format("xywh=fraction:%s,%s,%s,%s", x, y, width, height);
-        return fragment;
-    }
-
-    protected String parseRange(JSONObject range) throws JSONException {
-        String start = range.getString("start");
-        String end = range.getString("end");
-        String startOffset = range.getString("startOffset");
-        String endOffset = range.getString("endOffset");
-        String fragment = String.format(
-                "xpointer(start-point(string-range(\"%s\",%s,1))/range-to(end-point(string-range(\"%s\",%s,1))))", start,
-                startOffset, end, endOffset);
-        return fragment;
-    }
-
-    /**
-     * Creates an Annotation object with data from JSON.
-     * 
-     * uses the specification from the annotator project: {@link https
-     * ://github.com/okfn/annotator/wiki/Annotation-format}
-     * 
-     * The username will be transformed to an URI if not given already as URI,
-     * if not it will set to the MPIWG namespace defined in
-     * de.mpiwg.itgroup.annotationManager.Constants.NS
-     * 
-     * @param jo
-     * @return
-     * @throws JSONException
-     * @throws UnsupportedEncodingException
-     */
-    public Annotation createAnnotation(JSONObject jo, Representation entity) throws JSONException, UnsupportedEncodingException {
-        return updateAnnotation(new Annotation(), jo, entity);
-    }
-
-    /**
-     * Updates an Annotation object with data from JSON.
-     * 
-     * uses the specification from the annotator project: {@link https
-     * ://github.com/okfn/annotator/wiki/Annotation-format}
-     * 
-     * The username will be transformed to an URI if not given already as URI,
-     * if not it will set to the MPIWG namespace defined in
-     * de.mpiwg.itgroup.annotationManager.Constants.NS
-     * 
-     * @param annot
-     * @param jo
-     * @return
-     * @throws JSONException
-     * @throws UnsupportedEncodingException
-     */
-    public Annotation updateAnnotation(Annotation annot, JSONObject jo, Representation entity) throws JSONException,
-            UnsupportedEncodingException {
-        /*
-         * target uri
-         */
-        if (jo.has("uri")) {
-            annot.setTarget(new Target(jo.getString("uri")));
-        }
-        /*
-         * resource uri
-         */
-        if (jo.has("resource")) {
-            annot.setResource(new Resource(jo.getString("resource")));
-        }
-        /*
-         * annotation text
-         */
-        if (jo.has("text")) {
-            annot.setBodyText(jo.getString("text"));
-        }
-        /*
-         * annotation quote
-         */
-        if (jo.has("quote")) {
-            annot.setQuote(jo.getString("quote"));
-        }
-        /*
-         * check authentication
-         */
-        Person authUser = getUserFromAuthToken(entity);
-        if (authUser == null) {
-            /*
-             * // try http auth User httpUser = getHttpAuthUser(entity); if
-             * (httpUser == null) {
-             */
-            setStatus(Status.CLIENT_ERROR_FORBIDDEN);
-            return null;
-            /*
-             * } authUser = httpUser.getIdentifier();
-             */
-        }
-        /*
-         * get or create creator object
-         */
-        Actor creator = annot.getCreator();
-        if (creator == null) {
-            creator = new Person();
-            annot.setCreator(creator);
-        }
-        // username not required, if no username given authuser will be used
-        String username = null;
-        String userUri = creator.getUri();
-        if (jo.has("user")) {
-            if (jo.get("user") instanceof String) {
-                // user is just a String
-                username = jo.getString("user");
-                creator.setId(username);
-                // TODO: what if username and authUser are different?
-            } else {
-                // user is an object
-                JSONObject user = jo.getJSONObject("user");
-                if (user.has("id")) {
-                    String id = user.getString("id");
-                    creator.setId(id);
-                    username = id;
-                }
-                if (user.has("uri")) {
-                    userUri = user.getString("uri");
-                }
-            }
-        }
-        if (username == null) {
-            username = authUser.getName();
-        }
-        // try to get full name
-        if (creator.getName() == null && username != null) {
-            BaseRestlet restServer = (BaseRestlet) getApplication();
-            String fullName = restServer.getFullNameForId(username);
-            creator.setName(fullName);
-        }
-        // userUri should be a URI, if not it will set to the MPIWG namespace
-        if (userUri == null) {
-            if (username.startsWith("http")) {
-                userUri = username;
-            } else {
-                userUri = BaseRestlet.PERSONS_URI_PREFIX + username;
-            }
-        }
-        // TODO: should we overwrite the creator?
-        if (creator.getUri() == null) {
-            creator.setUri(userUri);
-        }
-        /*
-         * creation date
-         */
-        if (annot.getCreated() == null) {
-            // new - set creation date
-            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
-            String ct = format.format(Calendar.getInstance().getTime());
-            annot.setCreated(ct);
-        } else {
-	        /*
-	         * update date
-	         */
-	        // not new - set last update date
-	        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
-	        String ct = format.format(Calendar.getInstance().getTime());
-	        annot.setUpdated(ct);
-        }
-
-        /*
-         * create fragment from the first range/area
-         */
-        try {
-            if (jo.has("ranges")) {
-                JSONArray ranges = jo.getJSONArray("ranges");
-                if (ranges.length() > 0) {
-                    JSONObject range = ranges.getJSONObject(0);
-                    annot.setFragmentType(FragmentTypes.XPOINTER);
-                    String fragment = parseRange(range);
-                    annot.setTargetFragment(fragment);
-                }
-            }
-        } catch (JSONException e) {
-            logger.warning(e.toString());
-        }
-        try {
-            if (jo.has("shapes")) {
-                JSONArray shapes = jo.getJSONArray("shapes");
-                if (shapes.length() > 0) {
-                    JSONObject shape = shapes.getJSONObject(0);
-                    String fragment = parseShape(shape);
-                    annot.setTargetFragment(fragment);
-                    if (fragment.startsWith("wkt=")) {
-                    	annot.setFragmentType(FragmentTypes.WKT);
-                    } else {
-                    	annot.setFragmentType(FragmentTypes.AREA);
-                    }
-                }
-            }
-        } catch (JSONException e) {
-            logger.warning(e.toString());
-        }
-        // deprecated areas type
-        try {
-            if (jo.has("areas")) {
-                JSONArray areas = jo.getJSONArray("areas");
-                if (areas.length() > 0) {
-                    JSONObject area = areas.getJSONObject(0);
-                    annot.setFragmentType(FragmentTypes.AREA);
-                    String fragment = parseArea(area);
-                    annot.setTargetFragment(fragment);
-                }
-            }
-        } catch (JSONException e) {
-            logger.warning(e.toString());
-        }
-        // no fragment is an error
-        if (annot.getFragmentType() == null || annot.getTargetFragment() == null) {
-            throw new JSONException("Annotation has no valid target fragment!");
-        }
-
-        /*
-         * permissions
-         */
-		if (jo.has("permissions")) {
-			// change permissions only if user has admin permission
-			if (annot.isActionAllowed(Action.admin, authUser, getAnnotationStore())) {
-				JSONObject permissions = jo.getJSONObject("permissions");
-				if (permissions.has("admin")) {
-					JSONArray perms = permissions.getJSONArray("admin");
-					Actor actor = getActorFromPermissions(perms);
-					annot.setAdminPermission(actor);
-				}
-				if (permissions.has("delete")) {
-					JSONArray perms = permissions.getJSONArray("delete");
-					Actor actor = getActorFromPermissions(perms);
-					annot.setDeletePermission(actor);
-				}
-				if (permissions.has("update")) {
-					JSONArray perms = permissions.getJSONArray("update");
-					Actor actor = getActorFromPermissions(perms);
-					annot.setUpdatePermission(actor);
-				}
-				if (permissions.has("read")) {
-					JSONArray perms = permissions.getJSONArray("read");
-					Actor actor = getActorFromPermissions(perms);
-					annot.setReadPermission(actor);
-				}
-			}
-		}
-
-        /*
-         * tags
-         */
-        if (jo.has("tags")) {
-            HashSet<String> tagset = new HashSet<String>();
-            JSONArray tags = jo.getJSONArray("tags");
-            for (int i = 0; i < tags.length(); ++i) {
-                tagset.add(tags.getString(i));
-            }
-            annot.setTags(tagset);
-        }
-
-        return annot;
-    }
-
-    @SuppressWarnings("unused")
-    // i in for loop
-    protected Actor getActorFromPermissions(JSONArray perms) throws JSONException {
-        Actor actor = null;
-        for (int i = 0; i < perms.length(); ++i) {
-            String perm = perms.getString(i);
-            if (perm.toLowerCase().startsWith("group:")) {
-                String groupId = perm.substring(6);
-                actor = new Group(groupId);
-            } else {
-                actor = new Person(perm);
-            }
-            // we just take the first one
-            break;
-        }
-        return actor;
-    }
-
-    public static float getFloat(String s) {
-        try {
-            return Float.parseFloat(s);
-        } catch (NumberFormatException e) {
-        }
-        return 0f;
-    }
-
-    public static int getInt(String s) {
-        try {
-            return Integer.parseInt(s);
-        } catch (NumberFormatException e) {
-        }
-        return 0;
-    }
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResources.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResources.java	(revision 91)
+++ 	(revision )
@@ -1,126 +1,0 @@
-/**
- * ReST API for accessing groups in the Annotation store.
- */
-package de.mpiwg.itgroup.annotations.restlet;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.neo4j.graphdb.Node;
-import org.restlet.data.Status;
-import org.restlet.ext.json.JsonRepresentation;
-import org.restlet.representation.Representation;
-import org.restlet.resource.Get;
-
-import de.mpiwg.itgroup.annotations.Resource;
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-
-/**
- * API for accessing resource objects in the Annotation store.
- * 
- * @author dwinter
- * 
- */
-public class AnnotatorResources extends AnnotatorResourceImpl {
-
-    /**
-     * GET with JSON content-type. 
-     * Parameters: user: short user name uri: user uri
-     * 
-     * @param entity
-     * @return
-     */
-    @Get("json")
-    public Representation doGetJSON(Representation entity) {
-        logger.fine("AnnotatorResources doGetJSON!");
-
-        String jsonId = (String) getRequest().getAttributes().get("id");
-        if (jsonId != null) {
-            // URL decode
-            try {
-                jsonId = URLDecoder.decode(jsonId, "UTF-8");
-            } catch (UnsupportedEncodingException e) {
-                // this shouldn't happen
-            }
-        }
-        String uri = decodeJsonId(jsonId);
-
-        logger.fine("resources-id=" + uri);
-
-        if (uri == null) {
-            return getAllResources();
-        } else {
-            return getResource(uri);
-        }
-    }
-
-    protected Representation getResource(String uri) {
-        AnnotationStore store = getAnnotationStore();
-        Node resNode = store.getResourceNodeByUri(uri);
-        Resource resource = store.createResourceFromNode(resNode);
-        JSONObject jo = new JSONObject();
-        try {
-            jo.put("id", encodeJsonId(resource.getUri()));
-            jo.put("uri", resource.getUri());
-        } catch (JSONException e) {
-        }
-
-        return new JsonRepresentation(jo);
-    }
-
-    protected Representation getAllResources() {
-        JSONArray results = new JSONArray();
-        AnnotationStore store = getAnnotationStore();
-
-        List<Resource> resources = store.getResources(null, null);
-        for (Resource resource : resources) {
-            JSONObject jo = new JSONObject();
-            try {
-                jo.put("id", encodeJsonId(resource.getUri()));
-                jo.put("uri", resource.getUri());
-            } catch (JSONException e) {
-            }
-            results.put(jo);
-        }
-
-        // assemble result object
-        JSONObject result = new JSONObject();
-        try {
-            result.put("rows", results);
-            result.put("total", results.length());
-        } catch (JSONException e) {
-            setStatus(Status.SERVER_ERROR_INTERNAL, "JSON Error");
-            return null;
-        }
-        logger.fine("sending:");
-        logger.fine(result.toString());
-        return new JsonRepresentation(result);
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorRestlet.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorRestlet.java	(revision 104)
+++ 	(revision )
@@ -1,96 +1,0 @@
-package de.mpiwg.itgroup.annotations.restlet;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.util.Arrays;
-import java.util.HashSet;
-
-import org.restlet.Restlet;
-import org.restlet.engine.application.CorsFilter;
-import org.restlet.routing.Router;
-
-import de.mpiwg.itgroup.annotations.restlet.utils.UrlPrefixFilter;
-
-/**
- * @author casties
- *
- */
-public class AnnotatorRestlet extends BaseRestlet {
-
-    public final String version = "AnnotationManagerN4J/Annotator 0.5.2";
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.restlet.Application#createInboundRoot()
-     */
-    @Override
-    public Restlet createInboundRoot() {
-
-    	Restlet root = null;
-        Router router = new Router(getContext());
-        
-        router.attach("/annotations", AnnotatorAnnotations.class);
-        router.attach("/annotations/{id}", AnnotatorAnnotations.class);
-        router.attach("/search", AnnotatorSearch.class);
-        router.attach("/groups", AnnotatorGroups.class);
-        router.attach("/tags", AnnotatorTags.class);
-        router.attach("/tags/{id}", AnnotatorTags.class);
-        router.attach("/tags/{id}/annotations", AnnotatorAnnotationsByTags.class);
-        router.attach("/resources", AnnotatorResources.class);
-        router.attach("/resources/{id}", AnnotatorResources.class);
-        router.attach("/resources/{id}/annotations", AnnotatorAnnotationsByResources.class);
-        router.attach("/", AnnotatorInfo.class);
-        root = router;
-
-        // this.authenticator = createAuthenticator();
-        // authenticator.setNext(router);
-        
-        if (this.webappUriPrefix != null) {
-	        // add prefix path to url
-	        UrlPrefixFilter prefixFilter = new UrlPrefixFilter();
-	        prefixFilter.setPrefix(this.webappUriPrefix);;
-	        prefixFilter.setNext(root);
-	        root = prefixFilter;
-        }
-
-        // handle Cross-Origin-Resource-Security headers
-        CorsFilter corsFilter = new CorsFilter(getContext(), router);
-        corsFilter.setAllowedOrigins(new HashSet<String>(Arrays.asList("*")));
-        corsFilter.setAllowedCredentials(true);
-        corsFilter.setNext(root);
-        root = corsFilter;
-
-        return root;
-
-    }
-
-    /* (non-Javadoc)
-     * @see de.mpiwg.itgroup.annotations.restlet.RestletImpl#getVersion()
-     */
-    @Override
-    public String getVersion() {
-        return version;
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorSearch.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorSearch.java	(revision 105)
+++ 	(revision )
@@ -1,120 +1,0 @@
-package de.mpiwg.itgroup.annotations.restlet;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.restlet.data.Form;
-import org.restlet.data.Status;
-import org.restlet.ext.json.JsonRepresentation;
-import org.restlet.representation.Representation;
-import org.restlet.resource.Get;
-
-import de.mpiwg.itgroup.annotations.Annotation;
-import de.mpiwg.itgroup.annotations.Annotation.Action;
-import de.mpiwg.itgroup.annotations.Person;
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-import de.mpiwg.itgroup.annotations.restlet.utils.JSONObjectComparator;
-
-/**
- * Implements the "search" uri of the Annotator API. see
- * <https://github.com/okfn/annotator/wiki/Storage>
- * 
- * @author casties
- * 
- */
-public class AnnotatorSearch extends AnnotatorResourceImpl {
-
-    /**
-     * result for JSON content-type. optional search parameters: uri, user, limit,
-     * offset, sortBy.
-     * 
-     * @param entity
-     * @return
-     */
-    @Get("json")
-    public Representation doGetJSON(Representation entity) {
-        logger.fine("AnnotatorSearch doGetJSON!");
-        // do authentication
-        Person authUser = getUserFromAuthToken(entity);
-        logger.fine("request authenticated=" + authUser);
-
-        Form form = getRequest().getResourceRef().getQueryAsForm();
-        String uri = form.getFirstValue("uri");
-        String user = form.getFirstValue("user");
-        int limit = getInt(form.getFirstValue("limit"));
-        int offset = getInt(form.getFirstValue("offset"));
-        String sortBy = form.getFirstValue("sortBy");
-
-        // do search
-        ArrayList<JSONObject> results = new ArrayList<JSONObject>();
-        logger.fine(String.format("searching for uri=%s user=%s", uri, user));
-        AnnotationStore store = getAnnotationStore();
-        List<Annotation> annots = store.searchAnnotationByUriUser(uri, user);
-        for (Annotation annot : annots) {
-            // check permission
-            if (!annot.isActionAllowed(Action.read, authUser, store)) continue;
-            JSONObject jo = createAnnotatorJson(annot, (authUser == null));
-            if (jo != null) {
-                results.add(jo);
-            } else {
-                setStatus(Status.SERVER_ERROR_INTERNAL, "JSON Error");
-                return null;
-            }
-        }
-
-        // sort if necessary
-        if (sortBy != null) {
-            JSONObjectComparator.sortAnnotations(results, sortBy);
-        }
-        
-        // put in JSON list
-        JSONArray rows = new JSONArray();
-        int cnt = 0;
-        for (JSONObject result : results) {
-            cnt += 1;
-            if (offset > 0 && cnt < offset) continue;
-            rows.put(result);
-            if (limit > 0 && cnt >= limit) break;
-        }
-
-        // assemble result object
-        JSONObject result = new JSONObject();
-        try {
-            result.put("rows", rows);
-            result.put("total", rows.length());
-        } catch (JSONException e) {
-            setStatus(Status.SERVER_ERROR_INTERNAL, "JSON Error");
-            return null;
-        }
-
-        logger.fine("sending response");
-        logger.finest(result.toString());
-        return new JsonRepresentation(result);
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorTags.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorTags.java	(revision 91)
+++ 	(revision )
@@ -1,126 +1,0 @@
-package de.mpiwg.itgroup.annotations.restlet;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.neo4j.graphdb.Node;
-import org.restlet.data.Status;
-import org.restlet.ext.json.JsonRepresentation;
-import org.restlet.representation.Representation;
-import org.restlet.resource.Get;
-
-import de.mpiwg.itgroup.annotations.Tag;
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-
-/**
- * API for accessing tags in the Annotation store.
- * 
- * @author dwinter
- * 
- */
-public class AnnotatorTags extends AnnotatorResourceImpl {
-
-    /**
-     * GET with JSON content-type. 
-     * Parameters: 
-     *   user: short user name 
-     *   uri: user uri
-     * 
-     * @param entity
-     * @return
-     */
-    @Get("json")
-    public Representation doGetJSON(Representation entity) {
-        logger.fine("AnnotatorGroups doGetJSON!");
-
-        String jsonId = (String) getRequest().getAttributes().get("id");
-        // String id = decodeJsonId(jsonId);
-        String id = jsonId;
-        logger.fine("annotation-id=" + id);
-
-        if (id == null) {
-            return getAllTags();
-        } else {
-            // URL decode
-            try {
-                id = URLDecoder.decode(id, "UTF-8");
-            } catch (UnsupportedEncodingException e) {
-                // this shouldn't happen
-            }
-            return getTag(id);
-        }
-    }
-
-    protected Representation getTag(String id) {
-        AnnotationStore store = getAnnotationStore();
-        String tagUri = BaseRestlet.TAGS_URI_PREFIX + id;
-        Node tagNode = store.getTagNodeByUri(tagUri);
-        Tag tag = store.createTagFromNode(tagNode);
-        JSONObject jo = new JSONObject();
-        try {
-            jo.put("id", tag.getId());
-            jo.put("name", tag.getName());
-            jo.put("uri", tag.getUri());
-        } catch (JSONException e) {
-        }
-
-        return new JsonRepresentation(jo);
-    }
-
-    protected Representation getAllTags() {
-        JSONArray results = new JSONArray();
-        AnnotationStore store = getAnnotationStore();
-
-        List<Tag> tags = store.getTags(null, null);
-        for (Tag tag : tags) {
-            JSONObject jo = new JSONObject();
-            try {
-                jo.put("id", tag.getId());
-                jo.put("name", tag.getName());
-                jo.put("uri", tag.getUri());
-            } catch (JSONException e) {
-            }
-            results.put(jo);
-        }
-
-        // assemble result object
-        JSONObject result = new JSONObject();
-        try {
-            result.put("rows", results);
-            result.put("total", results.length());
-        } catch (JSONException e) {
-            setStatus(Status.SERVER_ERROR_INTERNAL, "JSON Error");
-            return null;
-        }
-        logger.fine("sending:");
-        logger.fine(result.toString());
-        return new JsonRepresentation(result);
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/BaseRestlet.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/BaseRestlet.java	(revision 94)
+++ 	(revision )
@@ -1,454 +1,0 @@
-package de.mpiwg.itgroup.annotations.restlet;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- * Author: Robert Casties (casties@mpiwg-berlin.mpg.de),
- *         Dirk Wintergruen (dwinter@mpiwg-berlin.mpg.de)
- */
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Hashtable;
-import java.util.Properties;
-import java.util.concurrent.ConcurrentMap;
-import java.util.logging.Logger;
-
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.InitialDirContext;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-import javax.servlet.ServletContext;
-
-import org.neo4j.graphdb.GraphDatabaseService;
-import org.neo4j.graphdb.factory.GraphDatabaseBuilder;
-import org.neo4j.graphdb.factory.GraphDatabaseFactory;
-import org.neo4j.graphdb.factory.GraphDatabaseSettings;
-import org.neo4j.kernel.GraphDatabaseAPI;
-import org.neo4j.server.WrappingNeoServerBootstrapper;
-import org.restlet.Application;
-import org.restlet.Context;
-
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-
-public abstract class BaseRestlet extends Application {
-
-    public static Logger logger = Logger.getLogger(BaseRestlet.class.getCanonicalName());
-
-    /**
-     * Properties holding consumer keys and secrets.
-     */
-    protected Properties consumerKeys;
-    public String CONSUMER_KEYS_PATH = "consumerkeys.property";
-    public static final String CONSUMERKEYS_KEY = "annotationmanager.consumerkeys";
-
-    /**
-     * Properties holding server config.
-     */
-    protected Properties serverConfig;
-    public String CONFIG_PROPS_PATH = "serverconfig.property";
-    public static final String SERVERCONFIG_KEY = "annotationmanager.serverconfig";
-
-    /** 
-     * database instance;
-     */
-    protected GraphDatabaseService graphDb;
-    public static final String GRAPHDB_KEY = "annotationmanager.graphdb";
-    public static final String GRAPHDB_PATH_KEY = "annotationmanager.graphdb.path";
-    public String graphdbPath = "neo4j-annotation-db";
-
-    /**
-     * database interface server instance.
-     */
-    protected WrappingNeoServerBootstrapper srv;
-    public static final String GRAPHDBSRV_KEY = "annotationmanager.graphdb.srv";
-
-    /**
-     * annotation store instance.
-     */
-    protected AnnotationStore store;
-    public static final String ANNSTORE_KEY = "annotationmanager.store";
-
-    /**
-     * LDAP server URI (for looking up full user names).
-     */
-    protected String ldapServerUrl;
-    public static final String LDAP_SERVER_KEY = "annotationmanager.ldapserver.url";
-
-    /**
-     * web frontend admin user name
-     */
-    public static final String ADMIN_USER_KEY = "annotationmanager.admin.user";
-    /**
-     * web frontend admin user password
-     */
-    public static final String ADMIN_PASSWORD_KEY = "annotationmanager.admin.password";
-
-    /**
-     * run in authorization mode i.e. with tokens.
-     */
-    protected boolean authorizationMode = false;
-    public static final String AUTHORIZATION_MODE_KEY = "annotationmanager.authorization";
-    
-    /**
-     * prefix for webapp URLs (if needed by proxying).
-     */
-    protected String webappUriPrefix = null;
-    public static final String WEBAPP_PREFIX = "annotationmanager.webapp.prefix";
-    
-    /**
-     * prefix to create uris for tags in store.
-     */
-    public static String TAGS_URI_PREFIX = "";
-    public static final String TAGS_URI_KEY = "annotationmanager.uris.tags";
-
-    /**
-     * prefix to create uris for persons in store.
-     */
-    public static String PERSONS_URI_PREFIX = "";
-    public static final String PERSONS_URI_KEY = "annotationmanager.uris.persons";
-
-    /**
-     * prefix to create uris for groups in store.
-     */
-    public static String GROUPS_URI_PREFIX = ""; 
-    public static final String GROUPS_URI_KEY = "annotationmanager.uris.groups";
-
-    public static final String ANNOTATIONS_URI_KEY = "annotationmanager.uris.annotations";
-
-
-    /* (non-Javadoc)
-     * @see org.restlet.Application#start()
-     */
-    @Override
-    public synchronized void start() throws Exception {
-        configure(getContext());
-        super.start();
-    }
-
-    /**
-     * Configures the restlet.
-     * Reads serverConfig, consumerKeys and graphDb config from config files and starts graphDb.
-     * Uses config from webapp context if already initialized. 
-     * @param context 
-     */
-    protected void configure(Context context) {
-        ConcurrentMap<String, Object> attrs = context.getAttributes();
-        ServletContext sc = (ServletContext) attrs.get("org.restlet.ext.servlet.ServletContext");
-        if (sc != null) {
-           logger.info(getVersion() + " starting...");
-
-            /*
-             * read config from webapp
-             */
-            serverConfig = (Properties) sc.getAttribute(SERVERCONFIG_KEY);
-            if (serverConfig == null) {
-                serverConfig = new Properties();
-                InputStream ps = getResourceAsStream(sc, CONFIG_PROPS_PATH);
-                if (ps != null) {
-                    logger.fine("loading config from " + CONFIG_PROPS_PATH);
-                    try {
-                        serverConfig.load(ps);
-                        /*
-                         * read serverconfig options
-                         */
-                        graphdbPath = serverConfig.getProperty(GRAPHDB_PATH_KEY, graphdbPath);
-                        ldapServerUrl = serverConfig.getProperty(LDAP_SERVER_KEY, null);
-                        webappUriPrefix = serverConfig.getProperty(WEBAPP_PREFIX, null);
-                        /*
-                         * uri prefixes
-                         */
-                        if (serverConfig.containsKey(PERSONS_URI_KEY)) {
-                            BaseRestlet.PERSONS_URI_PREFIX = serverConfig.getProperty(PERSONS_URI_KEY);
-                        }
-                        if (serverConfig.containsKey(GROUPS_URI_KEY)) {
-                            BaseRestlet.GROUPS_URI_PREFIX = serverConfig.getProperty(GROUPS_URI_KEY);
-                        }
-                        if (serverConfig.containsKey(TAGS_URI_KEY)) {
-                            BaseRestlet.TAGS_URI_PREFIX = serverConfig.getProperty(TAGS_URI_KEY);
-                        }
-                        if (serverConfig.containsKey(ANNOTATIONS_URI_KEY)) {
-                            AnnotationStore.ANNOTATION_URI_PREFIX = serverConfig.getProperty(ANNOTATIONS_URI_KEY);
-                        }
-                    } catch (IOException e) {
-                        logger.warning("Error loading server config: "+e.toString());
-                    }
-                    logger.fine("config: " + serverConfig);
-                } else {
-                    logger.severe("Unable to get resource " + CONFIG_PROPS_PATH);
-                }
-                // store config
-                sc.setAttribute(SERVERCONFIG_KEY, serverConfig);
-            }
-            // look for database service in context
-            graphDb = (GraphDatabaseService) sc.getAttribute(GRAPHDB_KEY);
-            if (graphDb == null) {
-                /*
-                 * open database
-                 */
-                String dbFn = getResourcePath(sc, graphdbPath);
-                if (dbFn != null) {
-                    logger.fine("opening DB " + dbFn);
-                    GraphDatabaseBuilder graphDbBuilder = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(dbFn);
-                    graphDbBuilder.setConfig(GraphDatabaseSettings.allow_store_upgrade, "true");
-                    graphDb = graphDbBuilder.newGraphDatabase();
-                    registerShutdownHook(graphDb);
-                    // store in context
-                    sc.setAttribute(GRAPHDB_KEY, graphDb);
-                    // AnnotationStore
-                    store = new AnnotationStore(graphDb);
-                    sc.setAttribute(ANNSTORE_KEY, store);
-                    // admin server
-                    srv = new WrappingNeoServerBootstrapper((GraphDatabaseAPI) graphDb);
-                    logger.fine("Starting DB admin server...");
-                    // store in context
-                    sc.setAttribute(GRAPHDBSRV_KEY, srv);
-                    srv.start();
-                } else {
-                    logger.severe("Unable to get resource " + dbFn);
-                }
-            } else {
-                // get existing AnnotationStore
-                store = (AnnotationStore) sc.getAttribute(ANNSTORE_KEY);
-            }
-            /*
-             * read consumerKeys from webapp
-             */
-            consumerKeys = (Properties) sc.getAttribute(CONSUMERKEYS_KEY);
-            if (consumerKeys == null) {
-                consumerKeys = new Properties();
-                InputStream ps = getResourceAsStream(sc, CONSUMER_KEYS_PATH);
-                if (ps != null) {
-                    logger.fine("loading consumer keys from " + CONSUMER_KEYS_PATH);
-                    try {
-                        consumerKeys.load(ps);
-                    } catch (IOException e) {
-                        logger.fine("Error loading consumer keys: "+e);
-                    }
-                    logger.fine("consumer keys: " + consumerKeys);
-                } else {
-                    logger.severe("Unable to get resource " + CONSUMER_KEYS_PATH);
-                }
-                // store config
-                sc.setAttribute(CONSUMERKEYS_KEY, consumerKeys);
-            }
-        } else {
-            logger.severe("Unable to get ServletContext!");
-        }
-    }
-
-    public abstract String getVersion();
-
-    /**
-     * @return the authorizationMode
-     */
-    public boolean isAuthorizationMode() {
-        return authorizationMode;
-    }
-
-    /**
-     * @return the store
-     */
-    public AnnotationStore getAnnotationStore() {
-        return store;
-    }
-
-    /**
-     * returns consumer secret for consumer key. returns null if consumer key
-     * doesn't exist.
-     * 
-     * @param consumerKey
-     * @return
-     */
-    public String getConsumerSecret(String consumerKey) {
-        return consumerKeys.getProperty(consumerKey);
-    }
-
-    /**
-     * Return the full name (String) of the person with the given user-id.
-     * 
-     * Contacts a naming service (currently LDAP).
-     * 
-     * @param userId
-     * @return full-name
-     */
-    public String getFullNameForId(String userId) {
-    	return getFullNameFromLdap(userId);
-    }	
-    
-    /**
-     * Hole den vollen Benutzernamen aus dem LDAP
-     * 
-     * @param creator
-     * @return
-     */
-    public String getFullNameFromLdap(String creator) {
-        String retString = creator; // falls nichts gefunden wird einfach den
-                                    // creator zurueckgeben
-        if (ldapServerUrl == null) {
-            return retString;
-        }
-        Hashtable<String, String> env = new Hashtable<String, String>();
-        String sp = "com.sun.jndi.ldap.LdapCtxFactory";
-        env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, sp);
-        env.put(javax.naming.Context.PROVIDER_URL, ldapServerUrl);
-
-        DirContext dctx;
-        try {
-            dctx = new InitialDirContext(env);
-        } catch (NamingException e) {
-            logger.warning("Error in getFullNameFromLDAP! "+e);
-            return retString;
-        }
-
-        String base = "ou=people";
-
-        SearchControls sc = new SearchControls();
-        String[] attributeFilter = { "cn", "mail" };
-        sc.setReturningAttributes(attributeFilter);
-        sc.setSearchScope(SearchControls.SUBTREE_SCOPE);
-
-        String filter = "(uid=" + creator + ")";
-
-        try {
-            NamingEnumeration<SearchResult> results = dctx.search(base, filter, sc);
-            while (results.hasMore()) {
-                SearchResult sr = (SearchResult) results.next();
-                javax.naming.directory.Attributes attrs = sr.getAttributes();
-
-                Attribute attr = attrs.get("cn");
-                retString = (String) attr.get();
-            }
-        } catch (NamingException e) {
-            logger.warning("Error in getFullNameFromLDAP!"+e);
-        }
-
-        try {
-            dctx.close();
-        } catch (NamingException e) {
-            logger.warning("Error in getFullNameFromLDAP!"+e);
-        }
-        return retString;
-    }
-
-    /**
-     * returns resource from path as InputStream.
-     * 
-     * Tries path in webapp first, then uses classpath loader.
-     * Relative paths in webapp start in /WEB-INF/.
-     * 
-     * @param sc
-     * @param path
-     * @return
-     */
-    protected InputStream getResourceAsStream(ServletContext sc, String path) {
-        InputStream ps = null;
-        if (sc == null) {
-            // no servlet context -> use class loader
-            ps = Thread.currentThread().getContextClassLoader().getResourceAsStream(path);
-        } else {
-            // try path in webapp first
-            String webPath = path;
-            if (!webPath.startsWith("/")) {
-                // relative path in webapp starts in WEB-INF
-                webPath = "/WEB-INF/" + webPath;
-            }
-            ps = sc.getResourceAsStream(webPath);
-            if (ps == null) {
-                // try as file
-                File pf = new File(sc.getRealPath(webPath));
-                if (pf.canRead()) {
-                    logger.fine("trying file for: " + pf);
-                    try {
-                        ps = new FileInputStream(pf);
-                    } catch (FileNotFoundException e) {
-                        logger.severe(e.toString());
-                    }
-                } else {
-                    // use class loader
-                    ps = Thread.currentThread().getContextClassLoader().getResourceAsStream(path);                    
-                }
-            }
-        }
-        return ps;
-    }
-
-    /**
-     * get a real file name for a web app file pathname.
-     * 
-     * If filename starts with "/" its treated as absolute else the path is
-     * appended to the /WEB-INF/ directory in the web-app.
-     * 
-     * @param filename
-     * @param sc
-     * @return
-     */
-    public static String getResourcePath(ServletContext sc, String filename) {
-        File f = new File(filename);
-        // is the filename absolute?
-        if (!f.isAbsolute() && sc != null) {
-            // relative path -> use getRealPath to resolve in webapp
-            filename = sc.getRealPath("/WEB-INF/" + filename);
-        }
-        return filename;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.restlet.Application#stop()
-     */
-    @Override
-    public synchronized void stop() throws Exception {
-        /*
-         * trying to clean up databases, not sure if this is the right way...
-         */
-        if (srv != null) {
-            logger.info("Stopping DB admin server...");
-            srv.stop();
-            srv = null;
-        }
-        if (graphDb != null) {
-            logger.info("Stopping DB...");
-            graphDb.shutdown();
-            graphDb = null;
-        }
-        super.stop();
-    }
-
-    private static void registerShutdownHook(final GraphDatabaseService graphDb) {
-        // Registers a shutdown hook for the Neo4j instance so that it
-        // shuts down nicely when the VM exits (even if you "Ctrl-C" the
-        // running example before it's completed)
-        Runtime.getRuntime().addShutdownHook(new Thread() {
-            @Override
-            public void run() {
-                graphDb.shutdown();
-            }
-        });
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationResource.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationResource.java	(revision 99)
+++ 	(revision )
@@ -1,214 +1,0 @@
-/**
- * 
- */
-package de.mpiwg.itgroup.annotations.restlet.annotations_ui;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.logging.Logger;
-
-import org.restlet.data.Form;
-import org.restlet.data.MediaType;
-import org.restlet.data.Reference;
-import org.restlet.data.Status;
-import org.restlet.representation.Representation;
-import org.restlet.representation.StringRepresentation;
-import org.restlet.resource.Delete;
-import org.restlet.resource.Get;
-import org.restlet.resource.Put;
-import org.restlet.resource.ResourceException;
-import org.restlet.resource.ServerResource;
-
-import de.mpiwg.itgroup.annotations.Annotation;
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-import de.mpiwg.itgroup.annotations.restlet.BaseRestlet;
-
-/**
- * Resource class for a single annotation.
- * 
- * @author casties
- * 
- */
-public class AnnotationResource extends ServerResource {
-
-    public static Logger logger = Logger.getLogger(AnnotationResource.class.getCanonicalName());
-
-    protected AnnotationStore store;
-
-    protected String requestId;
-
-    protected Annotation annotation;
-
-    @Override
-    protected void doInit() throws ResourceException {
-        super.doInit();
-        // id from URI /annotations/annotation/{id}
-        requestId = (String) getRequest().getAttributes().get("id");
-        logger.fine("annoation-id=" + requestId);
-        // get store instance
-        if (store == null) {
-            store = ((BaseRestlet) getApplication()).getAnnotationStore();
-        }
-        // get annotation from store
-        if (requestId != null) {
-            // URL decode
-            try {
-                requestId = URLDecoder.decode(requestId, "UTF-8");
-            } catch (UnsupportedEncodingException e) {
-                // this shouldn't happen
-            }
-            // the ID in the path is encoded
-            String id = Annotation.decodeId(requestId);
-            annotation = store.getAnnotationById(id);
-        }
-    }
-
-    /**
-     * GET with HTML content type. Shows the annotation.
-     * 
-     * @param entity
-     * @return
-     */
-    @Get("html")
-    public Representation doGetHTML(Representation entity) {
-        if (annotation == null) {
-            // invalid id
-            setStatus(Status.CLIENT_ERROR_NOT_FOUND);
-            return null;
-        }
-        String result = null;
-        // get form parameter
-        Form f = this.getQuery();
-        String form = f.getFirstValue("form");
-        if (form != null && form.equals("edit")) {
-            /*
-            // output edit form
-            result = "<html><body>\n";
-            result += String.format("<h1>Edit person %s</h1>\n", annotation.getId());
-            result += String.format("<p><a href=\"%s\">All persons</a></p>", this.getReference().getParentRef());
-            // tunnel PUT method through POST
-            result += String.format("<form method=\"post\" action=\"%s?method=PUT\">\n", this.getReference().getHierarchicalPart());
-            result += "<table>";
-            result += String.format("<tr><td><b>name</b></td><td><input type=\"text\" name=\"name\" value=\"%s\"/></td></tr>\n",
-                    annotation.getName());
-            result += String.format("<tr><td><b>uri</b></td><td><input type=\"text\" name=\"uri\" value=\"%s\"/></td></tr>\n",
-                    annotation.getUriString());
-            result += "</table>\n";
-            result += "<p><input type=\"submit\"/></p>";
-            result += "</table>\n</form>\n</body>\n</html>";
-            */
-        } else {
-            // output content
-            result = "<html><body>\n<h1>Annotation</h1>\n";
-            result += String.format("<p><a href=\"%s\">All annotations</a></p>", this.getReference().getParentRef());
-            result += "<table>";
-            result += String.format("<tr><td><b>uri</b></td><td>%s</td></tr>\n", annotation.getUri());
-            result += String.format("<tr><td><b>text</b></td><td>%s</td></tr>\n", annotation.getBodyText());
-            result += String.format("<tr><td><b>target</b></td><td><a href=\"%s\" target=\"_blank\">%s</a></td></tr>\n", annotation.getTargetBaseUri(), annotation.getTargetBaseUri());
-            result += String.format("<tr><td><b>fragment</b></td><td>%s</td></tr>\n", annotation.getTargetFragment());
-            result += String.format("<tr><td><b>quote</b></td><td>%s</td></tr>\n", annotation.getQuote());
-            result += String.format("<tr><td><b>resource</b></td><td>%s</td></tr>\n", annotation.getResourceUri());
-            result += String.format("<tr><td><b>creator</b></td><td>%s</td></tr>\n", annotation.getCreatorName());
-            result += String.format("<tr><td><b>created</b></td><td>%s</td></tr>\n", annotation.getCreated());
-            result += String.format("<tr><td><b>updated</b></td><td>%s</td></tr>\n", annotation.getUpdated());
-            result += "</table>\n";
-            result += "<br/>\n";
-            result += "<table>";
-            result += String.format("<tr><td><b>admin permission</b></td><td>%s</td></tr>\n", annotation.getAdminPermission() != null ? annotation.getAdminPermission().getIdString() : "null");
-            result += String.format("<tr><td><b>delete permission</b></td><td>%s</td></tr>\n", annotation.getDeletePermission() != null ? annotation.getDeletePermission().getIdString() : "null");
-            result += String.format("<tr><td><b>update permission</b></td><td>%s</td></tr>\n", annotation.getUpdatePermission() != null ? annotation.getUpdatePermission().getIdString() : "null");
-            result += String.format("<tr><td><b>read permission</b></td><td>%s</td></tr>\n", annotation.getReadPermission() != null ? annotation.getReadPermission().getIdString() : "null");
-            result += "</table>\n";
-            //result += "<p><a href=\"?form=edit\">Edit annotation</a></p>\n";
-            // tunnel POST as DELETE
-            result += String.format(
-                    "<form method=\"post\" action=\"%s?method=DELETE\"><input type=\"submit\" value=\"Delete annotation\"/></form>\n",
-                    this.getReference().getHierarchicalPart());
-            result += "</body>\n</html>";
-        }
-        return new StringRepresentation(result, MediaType.TEXT_HTML);
-    }
-
-    /**
-     * PUT updates the annotation.
-     * 
-     * @param entity
-     * @return
-     */
-    @Put
-    public Representation doPut(Representation entity) {
-        logger.fine("AnnotationResource.doPut!");
-        if (annotation == null) {
-            // invalid id
-            setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
-            return null;
-        }
-        // NOT YET
-        return null;
-        /*
-        // TODO: do authentication
-        Form form = new Form(entity);
-        String name = form.getFirstValue("name");
-        String uri = form.getFirstValue("uri");
-        if (name != null && !name.isEmpty()) {
-            annotation.setName(name);
-        }
-        if (uri != null && !uri.isEmpty()) {
-            annotation.setUri(uri);
-        }
-        store.storeActor(annotation);
-        // return 303: see other
-        setStatus(Status.REDIRECTION_SEE_OTHER);
-        // go GET same URL
-        Reference url = this.getReference();
-        this.getResponse().setLocationRef(url);
-        return null;
-        */
-    }
-
-    /**
-     * DELETE deletes the annotation.
-     * 
-     * @param entity
-     * @return
-     */
-    @Delete
-    public Representation doDelete(Representation entity) {
-        logger.fine("AnnotationResource.doDelete!");
-        if (annotation == null) {
-            // invalid id
-            setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
-            return null;
-        }
-        // TODO: do authentication
-        store.deleteAnnotationById(annotation.getUri());
-        // return 303: see other
-        setStatus(Status.REDIRECTION_SEE_OTHER);
-        // go GET parent URL
-        Reference url = this.getReference().getParentRef();
-        this.getResponse().setLocationRef(url);
-        return null;
-    }
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationsResource.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationsResource.java	(revision 101)
+++ 	(revision )
@@ -1,107 +1,0 @@
-/**
- * 
- */
-package de.mpiwg.itgroup.annotations.restlet.annotations_ui;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.restlet.data.Form;
-import org.restlet.data.MediaType;
-import org.restlet.data.Reference;
-import org.restlet.representation.Representation;
-import org.restlet.representation.StringRepresentation;
-import org.restlet.resource.Get;
-import org.restlet.resource.ResourceException;
-import org.restlet.resource.ServerResource;
-
-import de.mpiwg.itgroup.annotations.Annotation;
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-import de.mpiwg.itgroup.annotations.restlet.AnnotatorResourceImpl;
-import de.mpiwg.itgroup.annotations.restlet.BaseRestlet;
-
-/**
- * Resource class for the list of annotations.
- * 
- * @author casties
- * 
- */
-public class AnnotationsResource extends ServerResource {
-
-    public static Logger logger = Logger.getLogger(AnnotationsResource.class.getCanonicalName());
-
-    private AnnotationStore store;
-
-    @Override
-    protected void doInit() throws ResourceException {
-        super.doInit();
-        // get store instance
-        if (store == null) {
-            store = ((BaseRestlet) getApplication()).getAnnotationStore();
-        }
-    }
-
-    /**
-     * GET with HTML content type. Lists all annotations.
-     * 
-     * @param entity
-     * @return
-     */
-    @Get("html")
-    public Representation doGetHTML(Representation entity) {
-        Form form = getRequest().getResourceRef().getQueryAsForm();
-        int limit = AnnotatorResourceImpl.getInt(form.getFirstValue("limit", "100"));
-        int offset = AnnotatorResourceImpl.getInt(form.getFirstValue("offset", "0"));
-        int max = offset + limit;
-        int numannots = store.getAnnotationCount();
-        String baseUrl = this.getReference().getHierarchicalPart();
-        StringBuilder result = null;
-        // list all annotations
-        result = new StringBuilder("<html><body>\n<h1>Annotations</h1>\n");
-        result.append("<p>");
-        if (offset > 0) {
-            result.append(String.format(" <a href=\"%s?offset=%s&limit=%s\">prev</a> ", baseUrl, Math.max(offset - limit, 0), limit));
-        }
-        result.append(String.format("| %s - %s of %s annotations |", offset, (offset + limit), numannots));
-        if (max < numannots) {
-            result.append(String.format(" <a href=\"%s?offset=%s&limit=%s\">next</a>", baseUrl, Math.min(max, numannots), limit));
-        }
-        result.append("</p>\n");
-        result.append("<table>");
-        result.append("<tr><th>uri</th><th>text</th><th>target</th><th>fragment</th><th>creator</th></tr>");
-        List<Annotation> annotations = store.getAnnotations("id", "*", limit, offset);
-        for (Annotation annotation : annotations) {
-            Reference url = this.getReference().clone();
-            url.addSegment(annotation.getUrlId());
-            result.append(String.format("<tr><td><a href=\"%s\">%s</a></td><td>%s</td><td><a href=\"%s\">%s</a></td><td>%s</td><td>%s</td></tr>\n", url,
-                    annotation.getUri(), annotation.getBodyText(), annotation.getTargetBaseUri(), annotation.getTargetBaseUri(), 
-                    annotation.getTargetFragment(), annotation.getCreatorName()));
-        }
-        result.append("</table>\n");
-        result.append("</body>\n</html>");
-        return new StringRepresentation(result, MediaType.TEXT_HTML);
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationsUiRestlet.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationsUiRestlet.java	(revision 97)
+++ 	(revision )
@@ -1,109 +1,0 @@
-/**
- * 
- */
-package de.mpiwg.itgroup.annotations.restlet.annotations_ui;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.util.logging.Logger;
-
-import org.restlet.Restlet;
-import org.restlet.data.ChallengeScheme;
-import org.restlet.routing.Router;
-import org.restlet.security.ChallengeAuthenticator;
-import org.restlet.security.MapVerifier;
-
-import de.mpiwg.itgroup.annotations.restlet.BaseRestlet;
-import de.mpiwg.itgroup.annotations.restlet.utils.UrlPrefixFilter;
-
-/**
- * @author casties
- * 
- */
-public class AnnotationsUiRestlet extends BaseRestlet {
-
-    public final String version = "AnnotationManagerN4J/AnnotationsUI 0.3";
-
-    public static Logger logger = Logger.getLogger("de.mpiwg.itgroup.annotations.restlet.annotations_ui.AnnotationsUiRestlet");
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.restlet.Application#createInboundRoot()
-     */
-    @Override
-    public Restlet createInboundRoot() {
-        // this.authenticator = createAuthenticator();
-    	Restlet root = null;
-    	
-        Router router = new Router(getContext());
-        router.attach("/groups", GroupsResource.class);
-        router.attach("/groups/", GroupsResource.class);
-        router.attach("/groups/{id}", GroupResource.class);
-        router.attach("/groups/{id}/", GroupResource.class);
-        router.attach("/groups/{id}/members", GroupMembersResource.class);
-        router.attach("/persons", PersonsResource.class);
-        router.attach("/persons/", PersonsResource.class);
-        router.attach("/persons/{id}", PersonResource.class);
-        router.attach("/persons/{id}/", PersonResource.class);
-        router.attach("/annotations", AnnotationsResource.class);
-        router.attach("/annotations/", AnnotationsResource.class);
-        router.attach("/annotations/{id}", AnnotationResource.class);
-        router.attach("/annotations/{id}/", AnnotationResource.class);
-        router.attach("/", InfoResource.class);
-        root = router;
-        
-        if (this.webappUriPrefix != null) {
-	        // add prefix path to url
-	        UrlPrefixFilter prefixFilter = new UrlPrefixFilter();
-	        prefixFilter.setPrefix(this.webappUriPrefix);;
-	        prefixFilter.setNext(root);
-	        root = prefixFilter;
-        }
-
-        // use simple password verifier
-        MapVerifier verifier = new MapVerifier();
-        // get user name and password
-        String user = serverConfig.getProperty(BaseRestlet.ADMIN_USER_KEY);
-        String pw = serverConfig.getProperty(BaseRestlet.ADMIN_PASSWORD_KEY);
-        if (user != null && pw != null) {
-            verifier.getLocalSecrets().put(user, pw.toCharArray());
-        } else {
-            logger.severe("Admin user and password missing in serverconfig!");
-        }
-        // Create a Guard
-        ChallengeAuthenticator guard = new ChallengeAuthenticator(getContext(), ChallengeScheme.HTTP_BASIC, "Annotation Server Admin");
-        guard.setVerifier(verifier);
-        // put everything through guard
-        guard.setNext(root);
-        root = guard;
-        
-        return root;
-    }
-
-    @Override
-    public String getVersion() {
-        return version;
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/GroupMembersResource.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/GroupMembersResource.java	(revision 75)
+++ 	(revision )
@@ -1,129 +1,0 @@
-/**
- * 
- */
-package de.mpiwg.itgroup.annotations.restlet.annotations_ui;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.util.List;
-
-import org.restlet.data.Form;
-import org.restlet.data.MediaType;
-import org.restlet.data.Reference;
-import org.restlet.data.Status;
-import org.restlet.representation.Representation;
-import org.restlet.representation.StringRepresentation;
-import org.restlet.resource.Get;
-import org.restlet.resource.Post;
-
-import de.mpiwg.itgroup.annotations.Person;
-
-/**
- * Resource class for the members of an annotation group.
- * 
- * @author casties
- * 
- */
-public class GroupMembersResource extends GroupResource {
-
-    /**
-     * GET with HTML content type. Shows the members of the group.
-     * 
-     * @param entity
-     * @return
-     */
-    @Get("html")
-    public Representation doGetHTML(Representation entity) {
-        // id from URI /annotations/groups/{id}/members
-        if (requestId == null || requestId.isEmpty()) {
-            // invalid id
-            setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
-            return null;
-        }
-        String result = null;
-        Reference thisUrl = this.getReference();
-        Reference groupsUrl = thisUrl.getParentRef();
-        result = "<html><body>\n<h1>Group members</h1>\n";
-        result += String.format("<p>Group: %s <a href=\"%s\">(%s)</a></p>\n", group.getName(), groupsUrl, group.getId());
-        result += "<p>Members:</p>\n";
-        result += String.format("<form method=\"post\" action=\"%s\">", thisUrl);
-        result += "<table>";
-        List<Person> members = store.getMembersOfGroup(group);
-        for (Person p : members) {
-            result += String.format("<tr><td>%s</td><td>(%s)</td>", p.getName(), p.getIdString());
-            result += String.format("<td><input type=\"submit\" name=\"del_member\" value=\"delete:%s\"></td></tr>\n", p.getIdString());
-        }
-        result += "</table>\n";
-        result += "</form>\n";
-        result += String.format("<form method=\"post\" action=\"%s\">\n", thisUrl);
-        result += "<p>Add new member: <select name=\"add_member\">\n";
-        for (Person p : store.getPersons("uri", "*")) {
-            result += String.format("<option value=\"%s\">%s</option>\n", p.getIdString(), p.getName());
-        }
-        result += "</select>\n";
-        result += "<input type=\"submit\"/>\n";
-        result += "</form>\n";
-        result += "</body>\n</html>";
-
-        return new StringRepresentation(result, MediaType.TEXT_HTML);
-    }
-
-    /**
-     * POST adds or deletes members of the Group.
-     * 
-     * @return
-     */
-    @Post
-    public Representation doPost(Representation entity) {
-        logger.fine("GroupMembersResource doPost!");
-        // TODO: do authentication
-        Form form = new Form(entity);
-        String addMemberId = form.getFirstValue("add_member");
-        String delMemberId = form.getFirstValue("del_member");
-        if (group == null || ((addMemberId == null || addMemberId.isEmpty()) 
-                && (delMemberId == null || delMemberId.isEmpty()))) {
-            // no id
-            setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
-            return null;
-        }
-        if (addMemberId != null) {
-            logger.fine("adding member: "+addMemberId);
-            Person member = new Person(addMemberId);
-            store.addGroupMember(group, member);
-        } else if (delMemberId != null) {
-            if (delMemberId.startsWith("delete:")) {
-                delMemberId = delMemberId.substring(7);
-            }
-            logger.fine("deleting member: "+delMemberId);
-            Person member = new Person(delMemberId);
-            store.deleteGroupMember(group, member);
-        }
-        // return 303: see other
-        setStatus(Status.REDIRECTION_SEE_OTHER);
-        // go get same URL
-        Reference thisUrl = this.getReference();
-        this.getResponse().setLocationRef(thisUrl);
-        return null;
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/GroupResource.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/GroupResource.java	(revision 75)
+++ 	(revision )
@@ -1,195 +1,0 @@
-/**
- * 
- */
-package de.mpiwg.itgroup.annotations.restlet.annotations_ui;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.logging.Logger;
-
-import org.restlet.data.Form;
-import org.restlet.data.MediaType;
-import org.restlet.data.Reference;
-import org.restlet.data.Status;
-import org.restlet.representation.Representation;
-import org.restlet.representation.StringRepresentation;
-import org.restlet.resource.Delete;
-import org.restlet.resource.Get;
-import org.restlet.resource.Put;
-import org.restlet.resource.ResourceException;
-import org.restlet.resource.ServerResource;
-
-import de.mpiwg.itgroup.annotations.Group;
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-import de.mpiwg.itgroup.annotations.restlet.BaseRestlet;
-
-/**
- * Resource class for a single group.
- * 
- * @author casties
- * 
- */
-public class GroupResource extends ServerResource {
-
-    public static Logger logger = Logger.getLogger("de.mpiwg.itgroup.annotations.restlet.annotations_ui.GroupResource");
-
-    protected AnnotationStore store;
-
-    protected String requestId;
-
-    protected Group group;
-
-    @Override
-    protected void doInit() throws ResourceException {
-        super.doInit();
-        // id from URI /annotations/groups/{id}
-        requestId = (String) getRequest().getAttributes().get("id");
-        logger.fine("group-id=" + requestId);
-        // get store instance
-        if (store == null) {
-            store = ((BaseRestlet) getApplication()).getAnnotationStore();
-        }
-        // get group from store
-        if (requestId != null) {
-            // URL decode
-            try {
-                requestId = URLDecoder.decode(requestId, "UTF-8");
-            } catch (UnsupportedEncodingException e) {
-                // this shouldn't happen
-            }
-            group = (Group) store.getActor(new Group(requestId));
-        }
-    }
-
-    /**
-     * GET with HTML content type. Shows the group.
-     * 
-     * @param entity
-     * @return
-     */
-    @Get("html")
-    public Representation doGetHTML(Representation entity) {
-        if (group == null) {
-            // invalid id
-            setStatus(Status.CLIENT_ERROR_NOT_FOUND);
-            return null;
-        }
-        String result = null;
-        // get form parameter
-        Form f = this.getQuery();
-        String form = f.getFirstValue("form");
-        if (form != null && form.equals("edit")) {
-            // output edit form
-            result = "<html><body>\n";
-            result += String.format("<h1>Edit group %s</h1>\n", group.getId());
-            result += String.format("<p><a href=\"%s\">All groups</a></p>", this.getReference().getParentRef());
-            // tunnel PUT method through POST
-            result += String.format("<form method=\"post\" action=\"%s?method=PUT\">\n", this.getReference().getHierarchicalPart());
-            result += "<table>";
-            result += String.format("<tr><td><b>name</b></td><td><input type=\"text\" name=\"name\" value=\"%s\"/></td></tr>\n",
-                    group.getName());
-            result += String.format("<tr><td><b>uri</b></td><td><input type=\"text\" name=\"uri\" value=\"%s\"/></td></tr>\n",
-                    group.getUriString());
-            result += "</table>\n";
-            result += "<p><input type=\"submit\"/></p>";
-            result += "</table>\n</form>\n</body>\n</html>";
-        } else {
-            // output group content
-            result = "<html><body>\n<h1>Group</h1>\n";
-            result += String.format("<p><a href=\"%s\">All groups</a></p>", this.getReference().getParentRef());
-            result += "<table>";
-            result += String.format("<tr><td><b>id</b></td><td>%s</td></tr>\n", group.getId());
-            result += String.format("<tr><td><b>name</b></td><td>%s</td></tr>\n", group.getName());
-            result += String.format("<tr><td><b>uri</b></td><td>%s</td></tr>\n", group.getUri());
-            result += String.format("<tr><td><b>members</b></td><td><a href=\"%s\">view members</a></td></tr>\n", this
-                    .getReference().addSegment("members"));
-            result += "</table>\n";
-            result += "<p><a href=\"?form=edit\">Edit group</a></p>\n";
-            // tunnel POST as DELETE
-            result += String.format(
-                    "<form method=\"post\" action=\"%s?method=DELETE\"><input type=\"submit\" value=\"Delete group\"/></form>\n",
-                    this.getReference().getHierarchicalPart());
-            result += "</body>\n</html>";
-        }
-        return new StringRepresentation(result, MediaType.TEXT_HTML);
-    }
-
-    /**
-     * PUT updates the group.
-     * 
-     * @param entity
-     * @return
-     */
-    @Put
-    public Representation doPut(Representation entity) {
-        logger.fine("GroupResource.doPut!");
-        if (group == null) {
-            // invalid id
-            setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
-            return null;
-        }
-        // TODO: do authentication
-        Form form = new Form(entity);
-        String name = form.getFirstValue("name");
-        String uri = form.getFirstValue("uri");
-        if (name != null && !name.isEmpty()) {
-            group.setName(name);
-        }
-        if (uri != null && !uri.isEmpty()) {
-            group.setUri(uri);
-        }
-        store.storeActor(group);
-        // return 303: see other
-        setStatus(Status.REDIRECTION_SEE_OTHER);
-        // go GET same URL
-        Reference url = this.getReference();
-        this.getResponse().setLocationRef(url);
-        return null;
-    }
-
-    /**
-     * DELETE deletes the group.
-     * 
-     * @param entity
-     * @return
-     */
-    @Delete
-    public Representation doDelete(Representation entity) {
-        logger.fine("GroupResource.doDelete!");
-        if (group == null) {
-            // invalid id
-            setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
-            return null;
-        }
-        // TODO: do authentication
-        store.deleteActor(group);
-        // return 303: see other
-        setStatus(Status.REDIRECTION_SEE_OTHER);
-        // go GET parent URL
-        Reference url = this.getReference().getParentRef();
-        this.getResponse().setLocationRef(url);
-        return null;
-    }
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/GroupsResource.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/GroupsResource.java	(revision 75)
+++ 	(revision )
@@ -1,160 +1,0 @@
-/**
- * 
- */
-package de.mpiwg.itgroup.annotations.restlet.annotations_ui;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.restlet.data.Form;
-import org.restlet.data.MediaType;
-import org.restlet.data.Reference;
-import org.restlet.data.Status;
-import org.restlet.representation.Representation;
-import org.restlet.representation.StringRepresentation;
-import org.restlet.resource.Get;
-import org.restlet.resource.Post;
-import org.restlet.resource.ResourceException;
-import org.restlet.resource.ServerResource;
-
-import de.mpiwg.itgroup.annotations.Actor;
-import de.mpiwg.itgroup.annotations.Group;
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-import de.mpiwg.itgroup.annotations.restlet.BaseRestlet;
-
-/**
- * Resource class for the list of annotation groups.
- * 
- * @author casties
- * 
- */
-public class GroupsResource extends ServerResource {
-
-    public static Logger logger = Logger.getLogger("de.mpiwg.itgroup.annotations.restlet.annotations_ui.GroupsResource");
-
-    private AnnotationStore store;
-
-    @Override
-    protected void doInit() throws ResourceException {
-        super.doInit();
-        // get store instance
-        if (store == null) {
-            store = ((BaseRestlet) getApplication()).getAnnotationStore();
-        }
-    }
-
-    /**
-     * GET with HTML content type. Lists all groups.
-     * 
-     * @param entity
-     * @return
-     */
-    @Get("html")
-    public Representation doGetHTML(Representation entity) {
-        String result = null;
-        // get form parameter
-        Form f = this.getQuery();
-        String form = f.getFirstValue("form");
-        if (form != null && form.equals("new_group")) {
-            // output new group form
-            result = "<html><body>\n";
-            result += "<h1>New group</h1>\n";
-            result += String.format("<p><a href=\"%s\">All groups</a></p>", this.getReference());
-            result += String.format("<form method=\"post\" action=\"%s\">\n", this.getReference().getHierarchicalPart());
-            result += "<table>";
-            result += "<tr><td><b>id</b></td><td><input type=\"text\" name=\"id\"/></td></tr>\n";
-            result += "<tr><td><b>name</b></td><td><input type=\"text\" name=\"name\"/></td></tr>\n";
-            result += "</table>\n";
-            result += "<p><input type=\"submit\"/></p>\n";
-            result += "</form>\n</body>\n</html>";
-        } else {
-            // list all groups
-            result = "<html><body>\n<h1>Groups</h1>\n";
-            result += "<table>\n";
-            result += "<tr><th>id</th><th>name</th><th>uri</th></tr>";
-            List<Group> groups = store.getGroups("uri", "*");
-            for (Group group : groups) {
-                Reference groupUrl = this.getReference().clone();
-                groupUrl.addSegment(group.getId());
-                result += String.format("<tr><td><a href=\"%s\">%s</a></td><td>%s</td><td>%s</td></tr>\n", groupUrl, group.getId(),
-                        group.getName(), group.getUri());
-            }
-            result += "</table>\n";
-            result += "<p><a href=\"?form=new_group\">Add new group</a></p>\n";
-            result += "</body>\n</html>";
-        }
-        return new StringRepresentation(result, MediaType.TEXT_HTML);
-    }
-
-    /**
-     * POST creates a new Group.
-     * 
-     * @return
-     */
-    @Post
-    public Representation doPost(Representation entity) {
-        logger.fine("AnnotationsUiGroups doPost!");
-        // TODO: do authentication
-        Form form = new Form(entity);
-        String id = form.getFirstValue("id");
-        String name = form.getFirstValue("name");
-        if (id == null || id.isEmpty()) {
-            // invalid id
-            setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
-            return null;
-        }
-        String gid = makeGroupId(id);
-        Group newGroup = new Group(gid, null, name);
-        Actor storedGroup = store.storeActor(newGroup);
-        gid = storedGroup.getId();
-        // return 303: see other
-        setStatus(Status.REDIRECTION_SEE_OTHER);
-        // go GET URL for this group
-        Reference groupUrl = this.getReference();
-        groupUrl.addSegment(gid);
-        this.getResponse().setLocationRef(groupUrl);
-        return null;
-    }
-
-    /**
-     * Returns a group id based on the given id.
-     * 
-     * @param id
-     * @return
-     */
-    protected String makeGroupId(String id) {
-        // TODO: should we use different ids?
-        id = id.replaceAll("\\W", "_");
-        id = id.toLowerCase();
-        return id;
-    }
-
-    protected AnnotationStore getAnnotationStore() {
-        if (store == null) {
-            store = ((BaseRestlet) getApplication()).getAnnotationStore();
-        }
-        return store;
-    }
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/InfoResource.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/InfoResource.java	(revision 70)
+++ 	(revision )
@@ -1,46 +1,0 @@
-package de.mpiwg.itgroup.annotations.restlet.annotations_ui;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.io.InputStream;
-
-import org.restlet.data.MediaType;
-import org.restlet.representation.InputRepresentation;
-import org.restlet.representation.Representation;
-import org.restlet.resource.Get;
-import org.restlet.resource.ServerResource;
-
-
-public class InfoResource extends ServerResource {
-
-	@Get("html")
-	public Representation getHTML(){
-		InputStream is = getClass().getResourceAsStream("/de/mpiwg/itgroup/annotations/annotationstore-info.html");
-		
-		Representation rep = new InputRepresentation(is,MediaType.TEXT_HTML);
-		return rep;
-		
-	}
-	
-}
-
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/PersonResource.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/PersonResource.java	(revision 75)
+++ 	(revision )
@@ -1,193 +1,0 @@
-/**
- * 
- */
-package de.mpiwg.itgroup.annotations.restlet.annotations_ui;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.logging.Logger;
-
-import org.restlet.data.Form;
-import org.restlet.data.MediaType;
-import org.restlet.data.Reference;
-import org.restlet.data.Status;
-import org.restlet.representation.Representation;
-import org.restlet.representation.StringRepresentation;
-import org.restlet.resource.Delete;
-import org.restlet.resource.Get;
-import org.restlet.resource.Put;
-import org.restlet.resource.ResourceException;
-import org.restlet.resource.ServerResource;
-
-import de.mpiwg.itgroup.annotations.Person;
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-import de.mpiwg.itgroup.annotations.restlet.BaseRestlet;
-
-/**
- * Resource class for a single person.
- * 
- * @author casties
- * 
- */
-public class PersonResource extends ServerResource {
-
-    public static Logger logger = Logger.getLogger("de.mpiwg.itgroup.annotations.restlet.annotations_ui.PersonResource");
-
-    protected AnnotationStore store;
-
-    protected String requestId;
-
-    protected Person person;
-
-    @Override
-    protected void doInit() throws ResourceException {
-        super.doInit();
-        // id from URI /annotations/persons/{id}
-        requestId = (String) getRequest().getAttributes().get("id");
-        logger.fine("person-id=" + requestId);
-        // get store instance
-        if (store == null) {
-            store = ((BaseRestlet) getApplication()).getAnnotationStore();
-        }
-        // get person from store
-        if (requestId != null) {
-            // URL decode
-            try {
-                requestId = URLDecoder.decode(requestId, "UTF-8");
-            } catch (UnsupportedEncodingException e) {
-                // this shouldn't happen
-            }
-            person = (Person) store.getActor(new Person(requestId));
-        }
-    }
-
-    /**
-     * GET with HTML content type. Shows the person.
-     * 
-     * @param entity
-     * @return
-     */
-    @Get("html")
-    public Representation doGetHTML(Representation entity) {
-        if (person == null) {
-            // invalid id
-            setStatus(Status.CLIENT_ERROR_NOT_FOUND);
-            return null;
-        }
-        String result = null;
-        // get form parameter
-        Form f = this.getQuery();
-        String form = f.getFirstValue("form");
-        if (form != null && form.equals("edit")) {
-            // output edit form
-            result = "<html><body>\n";
-            result += String.format("<h1>Edit person %s</h1>\n", person.getId());
-            result += String.format("<p><a href=\"%s\">All persons</a></p>", this.getReference().getParentRef());
-            // tunnel PUT method through POST
-            result += String.format("<form method=\"post\" action=\"%s?method=PUT\">\n", this.getReference().getHierarchicalPart());
-            result += "<table>";
-            result += String.format("<tr><td><b>name</b></td><td><input type=\"text\" name=\"name\" value=\"%s\"/></td></tr>\n",
-                    person.getName());
-            result += String.format("<tr><td><b>uri</b></td><td><input type=\"text\" name=\"uri\" value=\"%s\"/></td></tr>\n",
-                    person.getUriString());
-            result += "</table>\n";
-            result += "<p><input type=\"submit\"/></p>";
-            result += "</table>\n</form>\n</body>\n</html>";
-        } else {
-            // output person content
-            result = "<html><body>\n<h1>Person</h1>\n";
-            result += String.format("<p><a href=\"%s\">All persons</a></p>", this.getReference().getParentRef());
-            result += "<table>";
-            result += String.format("<tr><td><b>id</b></td><td>%s</td></tr>\n", person.getId());
-            result += String.format("<tr><td><b>name</b></td><td>%s</td></tr>\n", person.getName());
-            result += String.format("<tr><td><b>uri</b></td><td>%s</td></tr>\n", person.getUri());
-            result += "</table>\n";
-            result += "<p><a href=\"?form=edit\">Edit person</a></p>\n";
-            // tunnel POST as DELETE
-            result += String.format(
-                    "<form method=\"post\" action=\"%s?method=DELETE\"><input type=\"submit\" value=\"Delete person\"/></form>\n",
-                    this.getReference().getHierarchicalPart());
-            result += "</body>\n</html>";
-        }
-        return new StringRepresentation(result, MediaType.TEXT_HTML);
-    }
-
-    /**
-     * PUT updates the person.
-     * 
-     * @param entity
-     * @return
-     */
-    @Put
-    public Representation doPut(Representation entity) {
-        logger.fine("PersonResource.doPut!");
-        if (person == null) {
-            // invalid id
-            setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
-            return null;
-        }
-        // TODO: do authentication
-        Form form = new Form(entity);
-        String name = form.getFirstValue("name");
-        String uri = form.getFirstValue("uri");
-        if (name != null && !name.isEmpty()) {
-            person.setName(name);
-        }
-        if (uri != null && !uri.isEmpty()) {
-            person.setUri(uri);
-        }
-        store.storeActor(person);
-        // return 303: see other
-        setStatus(Status.REDIRECTION_SEE_OTHER);
-        // go GET same URL
-        Reference url = this.getReference();
-        this.getResponse().setLocationRef(url);
-        return null;
-    }
-
-    /**
-     * DELETE deletes the person.
-     * 
-     * @param entity
-     * @return
-     */
-    @Delete
-    public Representation doDelete(Representation entity) {
-        logger.fine("PersonResource.doDelete!");
-        if (person == null) {
-            // invalid id
-            setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
-            return null;
-        }
-        // TODO: do authentication
-        store.deleteActor(person);
-        // return 303: see other
-        setStatus(Status.REDIRECTION_SEE_OTHER);
-        // go GET parent URL
-        Reference url = this.getReference().getParentRef();
-        this.getResponse().setLocationRef(url);
-        return null;
-    }
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/PersonsResource.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/PersonsResource.java	(revision 86)
+++ 	(revision )
@@ -1,144 +1,0 @@
-/**
- * 
- */
-package de.mpiwg.itgroup.annotations.restlet.annotations_ui;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.restlet.data.Form;
-import org.restlet.data.MediaType;
-import org.restlet.data.Reference;
-import org.restlet.data.Status;
-import org.restlet.representation.Representation;
-import org.restlet.representation.StringRepresentation;
-import org.restlet.resource.Get;
-import org.restlet.resource.Post;
-import org.restlet.resource.ResourceException;
-import org.restlet.resource.ServerResource;
-
-import de.mpiwg.itgroup.annotations.Actor;
-import de.mpiwg.itgroup.annotations.Person;
-import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
-import de.mpiwg.itgroup.annotations.restlet.BaseRestlet;
-
-/**
- * Resource class for the list of annotation users (Person class).
- * 
- * @author casties
- * 
- */
-public class PersonsResource extends ServerResource {
-
-    public static Logger logger = Logger.getLogger("de.mpiwg.itgroup.annotations.restlet.annotations_ui.PersonsResource");
-
-    private AnnotationStore store;
-
-    @Override
-    protected void doInit() throws ResourceException {
-        super.doInit();
-        // get store instance
-        if (store == null) {
-            store = ((BaseRestlet) getApplication()).getAnnotationStore();
-        }
-    }
-
-    /**
-     * GET with HTML content type. Lists all persons.
-     * 
-     * @param entity
-     * @return
-     */
-    @Get("html")
-    public Representation doGetHTML(Representation entity) {
-        String result = null;
-        // get form parameter
-        Form f = this.getQuery();
-        String form = f.getFirstValue("form");
-        if (form != null && form.equals("new_person")) {
-            // output new person form
-            result = "<html><body>\n";
-            result += "<h1>New person</h1>\n";
-            result += String.format("<p><a href=\"%s\">All persons</a></p>", this.getReference());
-            result += String.format("<form method=\"post\" action=\"%s\">\n", this.getReference().getHierarchicalPart());
-            result += "<table>";
-            result += "<tr><td><b>id</b></td><td><input type=\"text\" name=\"id\"/></td></tr>\n";
-            result += "<tr><td><b>name</b></td><td><input type=\"text\" name=\"name\"/></td></tr>\n";
-            result += "</table>\n";
-            result += "<p><input type=\"submit\"/></p>\n";
-            result += "</form>\n</body>\n</html>";
-        } else {
-            // list all persons
-            result = "<html><body>\n<h1>Persons</h1>\n<table>";
-            result += "<tr><th>id</th><th>name</th><th>uri</th></tr>";
-            List<Person> persons = store.getPersons("uri", "*");
-            for (Person person : persons) {
-                Reference url = this.getReference().clone();
-                url.addSegment(person.getIdString());
-                result += String.format("<tr><td><a href=\"%s\">%s</a></td><td>%s</td><td>%s</td></tr>\n", url,
-                        person.getIdString(), person.getName(), person.getUri());
-            }
-            result += "</table>\n";
-            result += "<p><a href=\"?form=new_person\">Add new person</a></p>\n";
-            result += "</body>\n</html>";
-        }
-        return new StringRepresentation(result, MediaType.TEXT_HTML);
-    }
-
-    /**
-     * POST creates a new person.
-     * 
-     * @return
-     */
-    @Post
-    public Representation doPost(Representation entity) {
-        logger.fine("PersonsResource doPost!");
-        // TODO: do authentication
-        Form form = new Form(entity);
-        String id = form.getFirstValue("id");
-        if (id == null || id.isEmpty() || id.matches("\\W")) {
-            // invalid id
-            setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
-            return null;
-        }
-        String name = form.getFirstValue("name");
-        if (name == null || name.isEmpty()) {
-            name = ((BaseRestlet) getApplication()).getFullNameForId(id);
-        }
-        String uri = form.getFirstValue("uri");
-        if (uri != null && uri.isEmpty()) uri = null;
-        Person newPerson = new Person(id, uri, name);
-        Actor storedPerson = store.storeActor(newPerson);
-        id = storedPerson.getId();
-        // return 303: see other
-        setStatus(Status.REDIRECTION_SEE_OTHER);
-        // go GET URL for this person
-        Reference url = this.getReference().clone();
-        url.addSegment(id);
-        this.getResponse().setLocationRef(url);
-        return null;
-    }
-
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/utils/JSONObjectComparator.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/utils/JSONObjectComparator.java	(revision 70)
+++ 	(revision )
@@ -1,74 +1,0 @@
-package de.mpiwg.itgroup.annotations.restlet.utils;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2014 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- * Author: Dirk Wintergruen (dwinter@mpiwg-berlin.mpg.de)
- */
-
-import java.util.Comparator;
-import java.util.List;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-public class JSONObjectComparator implements Comparator<JSONObject>{
-   
-	private String attributeToSort;
-	public JSONObjectComparator(String attribute){
-		this.attributeToSort=attribute;
-	}
-	
-	public int compare( JSONObject a, JSONObject b ) {
-        // je quadratischer, desto grösser
-		String sortA;
-		try {
-			sortA = a.getString(attributeToSort);
-		} catch (JSONException e) {
-			sortA ="";
-		}
-		String sortB;
-		try {
-			sortB = b.getString(attributeToSort);
-		} catch (JSONException e) {
-			sortB="";
-		}
-        
-		
-        return sortA.compareToIgnoreCase(sortB);
-    }
-        
-	/**
-	 * Sortiere array nach einem Parameter in den Annotationen
-	 * @param results
-	 * @return
-	 */
-	public static void sortAnnotations(List<JSONObject> results,String attribute) {
-		JSONObjectComparator comp = new JSONObjectComparator(attribute);
-		
-		
-	
-		java.util.Collections.sort( results, comp);
-		
-		
-
-	}        
-	
-}
Index: rc/main/java/de/mpiwg/itgroup/annotations/restlet/utils/UrlPrefixFilter.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/utils/UrlPrefixFilter.java	(revision 96)
+++ 	(revision )
@@ -1,67 +1,0 @@
-package de.mpiwg.itgroup.annotations.restlet.utils;
-
-/*
- * #%L
- * AnnotationManager
- * %%
- * Copyright (C) 2012 - 2015 MPIWG Berlin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as 
- * published by the Free Software Foundation, either version 3 of the 
- * License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Lesser Public License for more details.
- * 
- * You should have received a copy of the GNU General Lesser Public 
- * License along with this program.  If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * #L%
- */
-
-import org.restlet.Request;
-import org.restlet.Response;
-import org.restlet.data.Reference;
-import org.restlet.routing.Filter;
-
-/**
- * Filter that adds a prefix path to all internally generated URLs.
- * 
- * @author casties
- *
- */
-public class UrlPrefixFilter extends Filter {
-
-    private String prefix = null;
-
-    /**
-     * Set the prefix to add.
-     * 
-     * @param prefix
-     */
-    public void setPrefix(String prefix) {
-        if (!prefix.startsWith("/")) {
-            prefix = "/" + prefix;
-        }
-        this.prefix = prefix;
-    }
-
-    @Override
-    protected int beforeHandle(Request request, Response response) {
-        // get ref to change
-        Reference ref = request.getResourceRef();
-        String path = ref.getPath();
-        // add prefix to path
-        ref.setPath(prefix + path);
-        // change baseRef as well
-        Reference baseRef = ref.getBaseRef();
-        String basePath = baseRef.getPath();
-        // add prefix to base ref path
-        baseRef.setPath(prefix + basePath);
-        return super.beforeHandle(request, response);
-    }
-
-}
Index: rc/main/resources/de/mpiwg/itgroup/annotations/annotationstore-info.html
===================================================================
--- src/main/resources/de/mpiwg/itgroup/annotations/annotationstore-info.html	(revision 18)
+++ 	(revision )
@@ -1,6 +1,0 @@
-<html>
-<body>
-<h2>Annotation manager</h2>
-<p><a href="annotations">Annotation store overview</a></p>
-</body>
-</html>
Index: rc/main/resources/de/mpiwg/itgroup/annotations/annotator-info.html
===================================================================
--- src/main/resources/de/mpiwg/itgroup/annotations/annotator-info.html	(revision 3)
+++ 	(revision )
@@ -1,6 +1,0 @@
-<html>
-<body>
-<h2>Annotation manager</h2>
-<p><a href="annotations">Annotations overview</a></p>
-</body>
-</html>
Index: rc/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- src/main/webapp/META-INF/MANIFEST.MF	(revision 1)
+++ 	(revision )
@@ -1,3 +1,0 @@
-Manifest-Version: 1.0
-Class-Path: 
-
Index: rc/main/webapp/WEB-INF/consumerkeys.property.template
===================================================================
--- src/main/webapp/WEB-INF/consumerkeys.property.template	(revision 56)
+++ 	(revision )
@@ -1,3 +1,0 @@
-# consumer keys and secrets for annotation server clients
-# format: consumerKey = consumerSecret
-abcd = efghi
Index: rc/main/webapp/WEB-INF/etc.jaasAuth.conf
===================================================================
--- src/main/webapp/WEB-INF/etc.jaasAuth.conf	(revision 1)
+++ 	(revision )
@@ -1,10 +1,0 @@
-BasicJaasAuthenticationApplication {
-    com.sun.security.auth.module.LdapLoginModule REQUIRED
-    userProvider="ldap://ldap.mpiwg-berlin.mpg.de/ou=people,dc=mpiwg-berlin,dc=mpg,dc=de"
-    userFilter="(&(uid={USERNAME})(objectClass=inetOrgPerson))"
-    debug=true
-    useSSL=false
-;
-};
-
-
Index: rc/main/webapp/WEB-INF/serverconfig.property.template
===================================================================
--- src/main/webapp/WEB-INF/serverconfig.property.template	(revision 94)
+++ 	(revision )
@@ -1,12 +1,0 @@
-# AnnotationManager server config
-# format: key = value
-annotationmanager.graphdb.path = /usr/local/neo4j/dbs/AnnotationManager
-annotationmanager.authorization = true
-annotationmanager.ldapserver.url = ldap://ldap.mpiwg-berlin.mpg.de/dc=mpiwg-berlin,dc=mpg,dc=de
-annotationmanager.admin.user = adminuser
-annotationmanager.admin.password = adminpw
-annotationmanager.uris.tags = http://entities.mpiwg-berlin.mpg.de/tags/
-annotationmanager.uris.persons = http://entities.mpiwg-berlin.mpg.de/persons/
-annotationmanager.uris.groups = http://entities.mpiwg-berlin.mpg.de/groups/
-annotationmanager.uris.annotations = http://entities.mpiwg-berlin.mpg.de/annotations/
-#annotationmanager.webapp.prefix = /annotations
Index: rc/main/webapp/WEB-INF/web.xml
===================================================================
--- src/main/webapp/WEB-INF/web.xml	(revision 23)
+++ 	(revision )
@@ -1,45 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app id="WebApp_ID" version="2.4"
-xmlns="http://java.sun.com/xml/ns/j2ee"
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
-http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-	<display-name>AnnotationManager-Restlet</display-name>
-	<!-- Restletadapter -->
-	<servlet>
-		<servlet-name>AnnotatorRestlet</servlet-name>
-		<servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
-		<!-- Application classname -->
-		<init-param>
-			<param-name>org.restlet.application</param-name>
-			<param-value>de.mpiwg.itgroup.annotations.restlet.AnnotatorRestlet</param-value>
-		</init-param>
-        <!-- Load this servlet at server startup time -->
-        <load-on-startup>1</load-on-startup>
-	</servlet>
-	<!-- Restletadapter -->
-	<servlet>
-		<servlet-name>AnnotationStoreRestlet</servlet-name>
-		<servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
-		<!-- Application classname -->
-		<init-param>
-			<param-name>org.restlet.application</param-name>
-			<param-value>de.mpiwg.itgroup.annotations.restlet.annotations_ui.AnnotationsUiRestlet</param-value>
-		</init-param>
-        <!-- Load this servlet at server startup time -->
-        <load-on-startup>
-            10
-        </load-on-startup>
-	</servlet>
-	<!-- Catchallrequests -->
-	<servlet-mapping>
-		<servlet-name>AnnotatorRestlet</servlet-name>
-		<url-pattern>/annotator/*</url-pattern>
-		<!-- <url-pattern>/*</url-pattern> -->
-	</servlet-mapping>
-	<servlet-mapping>
-		<servlet-name>AnnotationStoreRestlet</servlet-name>
-		<url-pattern>/annotations/*</url-pattern>
-		<!-- <url-pattern>/*</url-pattern> -->
-	</servlet-mapping>
-</web-app>
Index: rc/main/webapp/WEB-INF/web.xml.template
===================================================================
--- src/main/webapp/WEB-INF/web.xml.template	(revision 1)
+++ 	(revision )
@@ -1,39 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app id="WebApp_ID" version="2.4"
-xmlns="http://java.sun.com/xml/ns/j2ee"
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
-http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-    <display-name>RESTfulJavaWebServices-Restlet</display-name>
-    <!-- Application classname -->
-    <context-param>
-        <param-name>org.restlet.application</param-name>
-        <param-value>de.mpiwg.itgroup.annotationManager.restlet.RestServer</param-value>
-    </context-param>
-    <context-param>
-        <param-name>de.mpiwg.itgroup.annotationManager.jaas.configFilePath</param-name>
-        <param-value>file:///etc/jaasAuth.conf</param-value>
-    </context-param>
-    <context-param>
-        <param-name>de.mpiwg.itgroup.annotationManager.virtuoso.tripleStoreUser</param-name>
-        <param-value>USERNAME</param-value>
-    </context-param>
-    <context-param>
-        <param-name>de.mpiwg.itgroup.annotationManager.virtuoso.tripleStoreUserPassword</param-name>
-        <param-value>PASSWORD</param-value>
-    </context-param>
-    <context-param>
-        <param-name>de.mpiwg.itgroup.annotationManager.virtuoso.tripleStoreConnectionURL</param-name>
-        <param-value>jdbc:virtuoso://virtuoso.mpiwg-berlin.mpg.de:1111</param-value>
-    </context-param>
-    <!-- Restletadapter -->
-    <servlet>
-        <servlet-name>RestletServlet</servlet-name>
-        <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
-    </servlet>
-    <!-- Catchallrequests -->
-    <servlet-mapping>
-        <servlet-name>RestletServlet</servlet-name>
-        <url-pattern>/annotator/*</url-pattern>
-    </servlet-mapping>
-</web-app>
Index: rc/main/webapp/annotationBrowser/css/annotation.css
===================================================================
--- src/main/webapp/annotationBrowser/css/annotation.css	(revision 31)
+++ 	(revision )
@@ -1,31 +1,0 @@
-/*
-Cascading Style Sheets, level 2 revision 1. 
-CSS 2.1 Specification is available at 
-http://www.w3.org/TR/2006/WD-CSS21-20061106/
-*/
-
-#viewer {display:table-row}
-#tagList { display:table-cell;
-padding:40px;
-border-right:2px solid;
-}
-
-
-#annotations { display:table-cell}
-
-.annotationRow {padding-bottom:10px;
-border-bottom:2px solid;
-display:table-row}
-
-.annotationCol {
-display:table-cell;
-padding-left:20px;
-padding-bottom:10px;
-}
-.dcMetaData {
-display:table-row;
-}
-
-.annotatonMetaData{
-padding-bottom:30px;
-}
Index: rc/main/webapp/annotationBrowser/css/resource.css
===================================================================
--- src/main/webapp/annotationBrowser/css/resource.css	(revision 44)
+++ 	(revision )
@@ -1,31 +1,0 @@
-/*
-Cascading Style Sheets, level 2 revision 1. 
-CSS 2.1 Specification is available at 
-http://www.w3.org/TR/2006/WD-CSS21-20061106/
-*/
-
-#viewer {display:table-row}
-#tagList { display:table-cell;
-padding:40px;
-border-right:2px solid;
-}
-
-
-#annotations { display:table-cell}
-
-.annotationRow {padding-bottom:10px;
-border-bottom:2px solid;
-display:table-row}
-
-.annotationCol {
-display:table-cell;
-padding-left:20px;
-padding-bottom:10px;
-}
-.dcMetaData {
-display:table-row;
-}
-
-.annotatonMetaData{
-padding-bottom:30px;
-}
Index: rc/main/webapp/annotationBrowser/css/tag.css
===================================================================
--- src/main/webapp/annotationBrowser/css/tag.css	(revision 37)
+++ 	(revision )
@@ -1,31 +1,0 @@
-/*
-Cascading Style Sheets, level 2 revision 1. 
-CSS 2.1 Specification is available at 
-http://www.w3.org/TR/2006/WD-CSS21-20061106/
-*/
-
-#viewer {display:table-row}
-#tagList { display:table-cell;
-padding:40px;
-border-right:2px solid;
-}
-
-
-#annotations { display:table-cell}
-
-.annotationRow {padding-bottom:10px;
-border-bottom:2px solid;
-display:table-row}
-
-.annotationCol {
-display:table-cell;
-padding-left:20px;
-padding-bottom:10px;
-}
-.dcMetaData {
-display:table-row;
-}
-
-.annotatonMetaData{
-padding-bottom:30px;
-}
Index: rc/main/webapp/annotationBrowser/index.html
===================================================================
--- src/main/webapp/annotationBrowser/index.html	(revision 56)
+++ 	(revision )
@@ -1,26 +1,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>Annotation browser</title>
-<script type="text/javascript" src="js/jquery.min.js"></script>
-<script type="text/javascript" src="js/annotation-core.js"></script>
-<script type="text/javascript" src="js/annotation.js"></script>
-<link rel="stylesheet" type="text/css" href="css/annotation.css" />
-<script type="text/javascript">
-    var annotServer = "../annotator/";
-	//var annotServer = "http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager/annotator/";
-	//var viewerAddress = "http://libcoll.mpiwg-berlin.mpg.de/libviewa?url=";
-	//var docNamespace = "http://echo.mpiwg-berlin.mpg.de/documents/";
-	//var dcDataPath = "http://libcoll.mpiwg-berlin.mpg.de/metadata/getDCDataFromPath?path=";
-	//var textPath = "http://digilib.mpiwg-berlin.mpg.de/digitallibrary/servlet/Texter?fn=";
-</script>
-</head>
-<body>
-  <h2>Annotations</h2>
-  <div id="viewer">
-    <div id="tagList"></div>
-    <div id="annotations"></div>
-  </div>
-</body>
-</html>
Index: rc/main/webapp/annotationBrowser/js/annotation-core.js
===================================================================
--- src/main/webapp/annotationBrowser/js/annotation-core.js	(revision 67)
+++ 	(revision )
@@ -1,45 +1,0 @@
-var annotServer;
-var viewerAddress;
-var docNamespace;
-
-var dcDataPath;
-var textPath;
-
-var tokenGenerator="";
-var username="";
-var token="";
-
-function getToken(tokenGenerator,username){
-	$.get(tokenGenerator+"?user="+username,function(data){
-		
-		token=data;
-	});
-}
-
-function createLinkFromURI(uri){
-    if (uri == null) return "";
-	var docUri = uri.replace(docNamespace,viewerAddress);
-	docUri = docUri.replace("?pn","&pn");
-	return docUri;
-}
-
-function getDCdata(path,obj){
-    if (path == null) return;
-	var splitted = path.split("?");
-	var docUri=splitted[0];
-	
-	docUri = docUri.replace(docNamespace,textPath);
-	var md = dcDataPath+docUri+"/index.meta";
-	
-	 $('<div/>', {
-		    'class': 'annotationMetaData',
-		  }).load(md, function (){
-			 $(this).children().children().addClass('dcMetaData');
-		  }).appendTo(obj);
-	
-}
-
-function tokenGeneratorInit(tok,un){
-	tokenGenerator=tok;
-	username=un;
-}
Index: rc/main/webapp/annotationBrowser/js/annotation.js
===================================================================
--- src/main/webapp/annotationBrowser/js/annotation.js	(revision 68)
+++ 	(revision )
@@ -1,65 +1,0 @@
-function annotations(){
-	
-	
-	if (token==""){
-		setTimeout(function(){annotations();},500);
-		return;
-	}
-	
-	var headers = {'x-annotator-auth-token':token};
-	
-	$.ajax({
-		  url: annotServer+'annotations?sortBy=uri',
-		  dataType: 'json',
-		  headers:headers,
-		  success: function(data) {
-		//var items = [];
-		  var rows = data["rows"];
-		  
-		  $('#annotations').html("");
-		  for (var i=0;i<rows.length;i++){
-			  var text=rows[i]['text'];
-			  var author= (rows[i]['user'] != null) ? rows[i]['user']['name'] : 'NO USER';
-			  var docUri=createLinkFromURI(rows[i]['uri']);
-			  
-			  var ret = '<div id="an_'+i+'" class="annotationRow">';
-			  ret +='<div class="annotationCol">'+text+'</div>';
-			  ret +='<div class="annotationCol">'+author+'</div>';
-			  ret +='<div class="annotationCol"><a target="libcoll" href="'+docUri+'">'+docUri+'</a></div>';
-			  ret+="</div>";
-				
-			  $('#annotations').append(ret);
-			  //items.push(ret);
-			  getDCdata(rows[i]['uri'],$('#an_'+i));
-		  }
-		  //$('#annotations').html(items.join(''));
-		 
-		  }
-	});
-}
-
-
-$(document).ready(function(){
-	
-	getToken(tokenGenerator,username);
-	$.getJSON(annotServer+'tags', function(data) {
-		  var items = [];
-		  var rows = data["rows"];
-		 
-//		  for (var i=0;i<rows.length;i++){
-//			  	 val=rows[i]['name'];
-//				 items.push('<div class="tagLink" onclick="javascript: annotations(\''+rows[i]["id"]+'\');">'+val+'</div>');
-//			
-//		  }
-		  
-		  items.push('<div class="tagLink" onclick="javascript: annotations();">all</div>');
-		  $('#tagList').html(items.join(''));
-		  annotations();		 
-		});
-
-
-	
- });
-
-
-
Index: rc/main/webapp/annotationBrowser/js/jquery-1.8.2.min.js
===================================================================
--- src/main/webapp/annotationBrowser/js/jquery-1.8.2.min.js	(revision 31)
+++ 	(revision )
@@ -1,2 +1,0 @@
-/*! jQuery v1.8.2 jquery.com | jquery.org/license */
-(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bY(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bW.length;while(e--){b=bW[e]+c;if(b in a)return b}return d}function bZ(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function b$(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bZ(c)&&(e[f]=p._data(c,"olddisplay",cc(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b_(a,b,c){var d=bP.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function ca(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bV[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bV[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bV[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bV[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bV[e]+"Width"))||0));return f}function cb(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0||d==null){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bQ.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+ca(a,b,c||(f?"border":"content"),e)+"px"}function cc(a){if(bS[a])return bS[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cA(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cv;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cA(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cA(a,c,d,e,"*",g)),h}function cB(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cC(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cD(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cL(){try{return new a.XMLHttpRequest}catch(b){}}function cM(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cU(){return setTimeout(function(){cN=b},0),cN=p.now()}function cV(a,b){p.each(b,function(b,c){var d=(cT[b]||[]).concat(cT["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cW(a,b,c){var d,e=0,f=0,g=cS.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cN||cU(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cN||cU(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cX(k,j.opts.specialEasing);for(;e<g;e++){d=cS[e].call(j,a,k,j.opts);if(d)return d}return cV(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cX(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}}function cY(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bZ(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cc(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cP.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cZ(a,b,c,d,e){return new cZ.prototype.init(a,b,c,d,e)}function c$(a,b){var c,d={height:a},e=0;b=b?1:0;for(;e<4;e+=2-b)c=bV[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function da(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o&&!o.call("﻿ ")?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":(a+"").replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete")setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){var e=p.type(c);e==="function"&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&e!=="string"&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")||(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)d=p._data(g[h],a+"queueHooks"),d&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)f.indexOf(" "+b[g]+" ")<0&&(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(O," ").indexOf(b)>=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=b+""}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,needsContext:f&&p.expr.match.needsContext.test(f),namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=k.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click"))for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){h={},j=[];for(d=0;d<q;d++)l=o[d],m=l.selector,h[m]===b&&(h[m]=l.needsContext?p(m,this).index(f)>=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){i=u[d],c.currentTarget=i.elem;for(e=0;e<i.matches.length&&!c.isImmediatePropagationStopped();e++){l=i.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,g=((p.event.special[l.origType]||{}).handle||l.handler).apply(i.elem,r),g!==b&&(c.result=g,g===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(b,"_change_attached",!0))})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){return p.event.remove(this,"._change"),!V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length===1?this.off(a,"**"):this.off(b,a||"**",c)},trigger:function(a,b){return this.each(function(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),p.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h<i;h++)if(f=a[h])if(!c||c(f,d,e))g.push(f),j&&b.push(h);return g}function bl(a,b,c,d,e,f){return d&&!d[o]&&(d=bl(d)),e&&!e[o]&&(e=bl(e,f)),z(function(f,g,h,i){if(f&&e)return;var j,k,l,m=[],n=[],o=g.length,p=f||bo(b||"*",h.nodeType?[h]:h,[],f),q=a&&(f||!b)?bk(p,m,a,h,i):p,r=c?e||(f?a:o||d)?[]:g:q;c&&c(q,r,h,i);if(d){l=bk(r,n),d(l,[],h,i),j=l.length;while(j--)if(k=l[j])r[n[j]]=!(q[n[j]]=k)}if(f){j=a&&r.length;while(j--)if(k=r[j])f[m[j]]=!(g[m[j]]=k)}else r=bk(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):w.apply(g,r)})}function bm(a){var b,c,d,f=a.length,g=e.relative[a[0].type],h=g||e.relative[" "],i=g?1:0,j=bi(function(a){return a===b},h,!0),k=bi(function(a){return y.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i<f;i++)if(c=e.relative[a[i].type])m=[bi(bj(m),c)];else{c=e.filter[a[i].type].apply(null,a[i].matches);if(c[o]){d=++i;for(;d<f;d++)if(e.relative[a[d].type])break;return bl(i>1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i<d&&bm(a.slice(i,d)),d<f&&bm(a=a.slice(d)),d<f&&a.join(""))}m.push(c)}return bj(m)}function bn(a,b){var d=b.length>0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)bc(a,b[e],c,d);return c}function bp(a,b,c,d,f){var g,h,j,k,l,m=bh(a),n=m.length;if(!d&&m.length===1){h=m[0]=m[0].slice(0);if(h.length>2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;b<c;b++)if(this[b]===a)return b;return-1},z=function(a,b){return a[o]=b==null||b,a},A=function(){var a={},b=[];return z(function(c,d){return b.push(c)>e.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="<a name='"+o+"'></a><div name='"+o+"'></div>",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d<b;d+=2)a.push(d);return a}),odd:bf(function(a,b,c){for(var d=1;d<b;d+=2)a.push(d);return a}),lt:bf(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},j=s.compareDocumentPosition?function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,h=b.parentNode,i=g;if(g===h)return bg(a,b);if(!g)return-1;if(!h)return 1;while(i)e.unshift(i),i=i.parentNode;i=h;while(i)f.unshift(i),i=i.parentNode;c=e.length,d=f.length;for(var j=0;j<c&&j<d;j++)if(e[j]!==f[j])return bg(e[j],f[j]);return j===c?bg(a,f[j],-1):bg(e[j],b,1)},[0,0].sort(j),m=!k,bc.uniqueSort=function(a){var b,c=1;k=m,a.sort(j);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1);return a},bc.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},i=bc.compile=function(a,b){var c,d=[],e=[],f=D[o][a];if(!f){b||(b=bh(a)),c=b.length;while(c--)f=bm(b[c]),f[o]?d.push(f):e.push(f);f=D(a,bn(e,d))}return f},r.querySelectorAll&&function(){var a,b=bp,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[":focus"],f=[":active",":focus"],h=s.matchesSelector||s.mozMatchesSelector||s.webkitMatchesSelector||s.oMatchesSelector||s.msMatchesSelector;X(function(a){a.innerHTML="<select><option selected=''></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'/>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{ck=f.href}catch(cy){ck=e.createElement("a"),ck.href="",ck=ck.href}cj=ct.exec(ck.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:ck,isLocal:cn.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=(c||y)+"",k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase())||!1,l.crossDomain=i&&i.join(":")+(i[3]?"":i[1]==="http:"?80:443)!==cj.join(":")+(cj[3]?"":cj[1]==="http:"?80:443)),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=cQ.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){c=+f[2],d=f[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&h){h=p.css(e.elem,a,!0)||c||1;do i=i||".5",h=h/i,p.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&i!==1&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cT[c]=cT[c]||[],cT[c].unshift(b)},prefilter:function(a,b){b?cS.unshift(a):cS.push(a)}}),p.Tween=cZ,cZ.prototype={constructor:cZ,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(p.cssNumber[c]?"":"px")},cur:function(){var a=cZ.propHooks[this.prop];return a&&a.get?a.get(this):cZ.propHooks._default.get(this)},run:function(a){var b,c=cZ.propHooks[this.prop];return this.options.duration?this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):cZ.propHooks._default.set(this),this}},cZ.prototype.init.prototype=cZ.prototype,cZ.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cZ.propHooks.scrollTop=cZ.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,arguments):this.animate(c$(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bZ).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cW(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=a!=null&&a+"queueHooks",f=p.timers,g=p._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cR.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&p.dequeue(this,a)})}}),p.each({slideDown:c$("show"),slideUp:c$("hide"),slideToggle:c$("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){p.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),p.speed=function(a,b,c){var d=a&&typeof a=="object"?p.extend({},a):{complete:c||!c&&b||p.isFunction(a)&&a,duration:a,easing:c&&b||b&&!p.isFunction(b)&&b};d.duration=p.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in p.fx.speeds?p.fx.speeds[d.duration]:p.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(){p.isFunction(d.old)&&d.old.call(this),d.queue&&p.dequeue(this,d.queue)},d},p.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},p.timers=[],p.fx=cZ.prototype.init,p.fx.tick=function(){var a,b=p.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||p.fx.stop()},p.fx.timer=function(a){a()&&p.timers.push(a)&&!cO&&(cO=setInterval(p.fx.tick,p.fx.interval))},p.fx.interval=13,p.fx.stop=function(){clearInterval(cO),cO=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fx.step={},p.expr&&p.expr.filters&&(p.expr.filters.animated=function(a){return p.grep(p.timers,function(b){return a===b.elem}).length});var c_=/^(?:body|html)$/i;p.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){p.offset.setOffset(this,a,b)});var c,d,e,f,g,h,i,j={top:0,left:0},k=this[0],l=k&&k.ownerDocument;if(!l)return;return(d=l.body)===k?p.offset.bodyOffset(k):(c=l.documentElement,p.contains(c,k)?(typeof k.getBoundingClientRect!="undefined"&&(j=k.getBoundingClientRect()),e=da(l),f=c.clientTop||d.clientTop||0,g=c.clientLeft||d.clientLeft||0,h=e.pageYOffset||c.scrollTop,i=e.pageXOffset||c.scrollLeft,{top:j.top+h-f,left:j.left+i-g}):j)},p.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return p.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(p.css(a,"marginTop"))||0,c+=parseFloat(p.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=p.css(a,"position");d==="static"&&(a.style.position="relative");var e=p(a),f=e.offset(),g=p.css(a,"top"),h=p.css(a,"left"),i=(d==="absolute"||d==="fixed")&&p.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window);
Index: rc/main/webapp/annotationBrowser/js/jquery.min.js
===================================================================
--- src/main/webapp/annotationBrowser/js/jquery.min.js	(revision 56)
+++ 	(revision )
@@ -1,2 +1,0 @@
-/*! jQuery v1.8.2 jquery.com | jquery.org/license */
-(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bY(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bW.length;while(e--){b=bW[e]+c;if(b in a)return b}return d}function bZ(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function b$(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bZ(c)&&(e[f]=p._data(c,"olddisplay",cc(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b_(a,b,c){var d=bP.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function ca(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bV[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bV[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bV[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bV[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bV[e]+"Width"))||0));return f}function cb(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0||d==null){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bQ.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+ca(a,b,c||(f?"border":"content"),e)+"px"}function cc(a){if(bS[a])return bS[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cA(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cv;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cA(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cA(a,c,d,e,"*",g)),h}function cB(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cC(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cD(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cL(){try{return new a.XMLHttpRequest}catch(b){}}function cM(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cU(){return setTimeout(function(){cN=b},0),cN=p.now()}function cV(a,b){p.each(b,function(b,c){var d=(cT[b]||[]).concat(cT["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cW(a,b,c){var d,e=0,f=0,g=cS.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cN||cU(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cN||cU(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cX(k,j.opts.specialEasing);for(;e<g;e++){d=cS[e].call(j,a,k,j.opts);if(d)return d}return cV(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cX(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}}function cY(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bZ(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cc(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cP.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cZ(a,b,c,d,e){return new cZ.prototype.init(a,b,c,d,e)}function c$(a,b){var c,d={height:a},e=0;b=b?1:0;for(;e<4;e+=2-b)c=bV[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function da(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o&&!o.call("﻿ ")?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":(a+"").replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete")setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){var e=p.type(c);e==="function"&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&e!=="string"&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")||(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)d=p._data(g[h],a+"queueHooks"),d&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)f.indexOf(" "+b[g]+" ")<0&&(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(O," ").indexOf(b)>=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=b+""}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,needsContext:f&&p.expr.match.needsContext.test(f),namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=k.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click"))for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){h={},j=[];for(d=0;d<q;d++)l=o[d],m=l.selector,h[m]===b&&(h[m]=l.needsContext?p(m,this).index(f)>=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){i=u[d],c.currentTarget=i.elem;for(e=0;e<i.matches.length&&!c.isImmediatePropagationStopped();e++){l=i.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,g=((p.event.special[l.origType]||{}).handle||l.handler).apply(i.elem,r),g!==b&&(c.result=g,g===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(b,"_change_attached",!0))})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){return p.event.remove(this,"._change"),!V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length===1?this.off(a,"**"):this.off(b,a||"**",c)},trigger:function(a,b){return this.each(function(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),p.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h<i;h++)if(f=a[h])if(!c||c(f,d,e))g.push(f),j&&b.push(h);return g}function bl(a,b,c,d,e,f){return d&&!d[o]&&(d=bl(d)),e&&!e[o]&&(e=bl(e,f)),z(function(f,g,h,i){if(f&&e)return;var j,k,l,m=[],n=[],o=g.length,p=f||bo(b||"*",h.nodeType?[h]:h,[],f),q=a&&(f||!b)?bk(p,m,a,h,i):p,r=c?e||(f?a:o||d)?[]:g:q;c&&c(q,r,h,i);if(d){l=bk(r,n),d(l,[],h,i),j=l.length;while(j--)if(k=l[j])r[n[j]]=!(q[n[j]]=k)}if(f){j=a&&r.length;while(j--)if(k=r[j])f[m[j]]=!(g[m[j]]=k)}else r=bk(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):w.apply(g,r)})}function bm(a){var b,c,d,f=a.length,g=e.relative[a[0].type],h=g||e.relative[" "],i=g?1:0,j=bi(function(a){return a===b},h,!0),k=bi(function(a){return y.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i<f;i++)if(c=e.relative[a[i].type])m=[bi(bj(m),c)];else{c=e.filter[a[i].type].apply(null,a[i].matches);if(c[o]){d=++i;for(;d<f;d++)if(e.relative[a[d].type])break;return bl(i>1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i<d&&bm(a.slice(i,d)),d<f&&bm(a=a.slice(d)),d<f&&a.join(""))}m.push(c)}return bj(m)}function bn(a,b){var d=b.length>0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)bc(a,b[e],c,d);return c}function bp(a,b,c,d,f){var g,h,j,k,l,m=bh(a),n=m.length;if(!d&&m.length===1){h=m[0]=m[0].slice(0);if(h.length>2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;b<c;b++)if(this[b]===a)return b;return-1},z=function(a,b){return a[o]=b==null||b,a},A=function(){var a={},b=[];return z(function(c,d){return b.push(c)>e.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="<a name='"+o+"'></a><div name='"+o+"'></div>",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d<b;d+=2)a.push(d);return a}),odd:bf(function(a,b,c){for(var d=1;d<b;d+=2)a.push(d);return a}),lt:bf(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},j=s.compareDocumentPosition?function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,h=b.parentNode,i=g;if(g===h)return bg(a,b);if(!g)return-1;if(!h)return 1;while(i)e.unshift(i),i=i.parentNode;i=h;while(i)f.unshift(i),i=i.parentNode;c=e.length,d=f.length;for(var j=0;j<c&&j<d;j++)if(e[j]!==f[j])return bg(e[j],f[j]);return j===c?bg(a,f[j],-1):bg(e[j],b,1)},[0,0].sort(j),m=!k,bc.uniqueSort=function(a){var b,c=1;k=m,a.sort(j);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1);return a},bc.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},i=bc.compile=function(a,b){var c,d=[],e=[],f=D[o][a];if(!f){b||(b=bh(a)),c=b.length;while(c--)f=bm(b[c]),f[o]?d.push(f):e.push(f);f=D(a,bn(e,d))}return f},r.querySelectorAll&&function(){var a,b=bp,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[":focus"],f=[":active",":focus"],h=s.matchesSelector||s.mozMatchesSelector||s.webkitMatchesSelector||s.oMatchesSelector||s.msMatchesSelector;X(function(a){a.innerHTML="<select><option selected=''></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'/>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{ck=f.href}catch(cy){ck=e.createElement("a"),ck.href="",ck=ck.href}cj=ct.exec(ck.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:ck,isLocal:cn.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=(c||y)+"",k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase())||!1,l.crossDomain=i&&i.join(":")+(i[3]?"":i[1]==="http:"?80:443)!==cj.join(":")+(cj[3]?"":cj[1]==="http:"?80:443)),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=cQ.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){c=+f[2],d=f[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&h){h=p.css(e.elem,a,!0)||c||1;do i=i||".5",h=h/i,p.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&i!==1&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cT[c]=cT[c]||[],cT[c].unshift(b)},prefilter:function(a,b){b?cS.unshift(a):cS.push(a)}}),p.Tween=cZ,cZ.prototype={constructor:cZ,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(p.cssNumber[c]?"":"px")},cur:function(){var a=cZ.propHooks[this.prop];return a&&a.get?a.get(this):cZ.propHooks._default.get(this)},run:function(a){var b,c=cZ.propHooks[this.prop];return this.options.duration?this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):cZ.propHooks._default.set(this),this}},cZ.prototype.init.prototype=cZ.prototype,cZ.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cZ.propHooks.scrollTop=cZ.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,arguments):this.animate(c$(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bZ).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cW(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=a!=null&&a+"queueHooks",f=p.timers,g=p._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cR.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&p.dequeue(this,a)})}}),p.each({slideDown:c$("show"),slideUp:c$("hide"),slideToggle:c$("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){p.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),p.speed=function(a,b,c){var d=a&&typeof a=="object"?p.extend({},a):{complete:c||!c&&b||p.isFunction(a)&&a,duration:a,easing:c&&b||b&&!p.isFunction(b)&&b};d.duration=p.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in p.fx.speeds?p.fx.speeds[d.duration]:p.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(){p.isFunction(d.old)&&d.old.call(this),d.queue&&p.dequeue(this,d.queue)},d},p.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},p.timers=[],p.fx=cZ.prototype.init,p.fx.tick=function(){var a,b=p.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||p.fx.stop()},p.fx.timer=function(a){a()&&p.timers.push(a)&&!cO&&(cO=setInterval(p.fx.tick,p.fx.interval))},p.fx.interval=13,p.fx.stop=function(){clearInterval(cO),cO=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fx.step={},p.expr&&p.expr.filters&&(p.expr.filters.animated=function(a){return p.grep(p.timers,function(b){return a===b.elem}).length});var c_=/^(?:body|html)$/i;p.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){p.offset.setOffset(this,a,b)});var c,d,e,f,g,h,i,j={top:0,left:0},k=this[0],l=k&&k.ownerDocument;if(!l)return;return(d=l.body)===k?p.offset.bodyOffset(k):(c=l.documentElement,p.contains(c,k)?(typeof k.getBoundingClientRect!="undefined"&&(j=k.getBoundingClientRect()),e=da(l),f=c.clientTop||d.clientTop||0,g=c.clientLeft||d.clientLeft||0,h=e.pageYOffset||c.scrollTop,i=e.pageXOffset||c.scrollLeft,{top:j.top+h-f,left:j.left+i-g}):j)},p.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return p.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(p.css(a,"marginTop"))||0,c+=parseFloat(p.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=p.css(a,"position");d==="static"&&(a.style.position="relative");var e=p(a),f=e.offset(),g=p.css(a,"top"),h=p.css(a,"left"),i=(d==="absolute"||d==="fixed")&&p.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window);
Index: rc/main/webapp/annotationBrowser/js/resource.js
===================================================================
--- src/main/webapp/annotationBrowser/js/resource.js	(revision 46)
+++ 	(revision )
@@ -1,83 +1,0 @@
-function annotations(ressourceId){
-	
-	
-	if (token==""){
-		setTimeout(function(){annotations();},500);
-		return;
-	}
-	
-	var headers = {'x-annotator-auth-token':token};
-	
-	$.ajax({
-		  url: annotServer+'resources/'+ressourceId+'/annotations?sortBy=uri',
-		  dataType: 'json',
-		  headers:headers,
-		  success: function(data) {
-		//var items = [];
-		  var rows = data["rows"];
-		  
-		  $('#annotations').html("");
-		  for (var i=0;i<rows.length;i++){
-			  var text=rows[i]['text'];
-			  var author=rows[i]['user']['name'];
-			  var docUri=createLinkFromURI(rows[i]['uri']);
-			  
-			  var ret = '<div id="an_'+i+'" class="annotationRow">';
-			  ret +='<div class="annotationCol">'+text+'</div>';
-			  ret +='<div class="annotationCol">'+author+'</div>';
-			  ret +='<div class="annotationCol"><a target="libcoll" href="'+docUri+'">'+docUri+'</a></div>';
-			  ret+="</div>";
-				
-			  $('#annotations').append(ret);
-			  //items.push(ret);
-			  //getDCdata(rows[i]['uri'],$('#an_'+i));
-		  }
-		  //$('#annotations').html(items.join(''));
-		 
-		  }
-	});
-}
-
-
-$(document).ready(function(){
-	
-	getToken(tokenGenerator,username);
-	$.getJSON(annotServer+'resources', function(data) {
-		  var items = [];
-		  var rows = data["rows"];
-		 
-		  
-		  $('#tagList').html("");
-		  for (var i=0;i<rows.length;i++){
-			  	 val=rows[i]['uri'];
-				 ret='<div  id="res_'+i+'" class="tagLink" onclick="javascript: annotations(\''+rows[i]["id"]+'\');"></div>';
-				 $('#tagList').append(ret);
-				 
-				 var splitted = val.split("?");
-				 var docUri=splitted[0];
-					
-				docUri = docUri.replace(docNamespace,textPath);
-				var md = dcDataPath+docUri+"/index.meta";
-					
-				$('<div/>', {
-						    'class': 'annotationMetaData',
-						  }).load(md, function (){
-							 $(this).children().children().addClass('dcMetaData');
-						  }).appendTo("#res_"+i);
-					
-				 
-				 
-				 
-		  }
-		  
-		
-		  //$('#tagList').html(items.join(''));
-		 
-		});
-
-
-	
- });
-
-
-
Index: rc/main/webapp/annotationBrowser/js/tag.js
===================================================================
--- src/main/webapp/annotationBrowser/js/tag.js	(revision 37)
+++ 	(revision )
@@ -1,58 +1,0 @@
-
-
-
-
-function annotations(tagId){
-	var id = tagId;
-	if (token==""){
-		setTimeout(function(){annotations(id);},500);
-		return;
-	}
-	var headers = {'x-annotator-auth-token':token};
-	
-	$.ajax({
-		  url: annotServer+'tags/'+tagId+"/annotations?sortBy=uri",
-		  dataType: 'json',
-		  headers:headers,
-		  success: function(data) {
-				//var items = [];
-			  var rows = data["rows"];
-			  
-			  $('#annotations').html("");
-			  for (var i=0;i<rows.length;i++){
-				  var text=rows[i]['text'];
-				  var author=rows[i]['user']['name'];
-				  var docUri=createLinkFromURI(rows[i]['uri']);
-				  
-				  var ret = '<div id="an_'+i+'" class="annotationRow">';
-				  ret +='<div class="annotationCol">'+text+'</div>';
-				  ret +='<div class="annotationCol">'+author+'</div>';
-				  ret +='<div class="annotationCol"><a target="libcoll" href="'+docUri+'">'+docUri+'</a></div>';
-				  ret+="</div>";
-					
-				  $('#annotations').append(ret);
-				  //items.push(ret);
-				  getDCdata(rows[i]['uri'],$('#an_'+i));
-			  }
-		  }});
-}
-
-
-$(document).ready(function(){
-	$.getJSON(annotServer+'tags', function(data) {
-		getToken(tokenGenerator,username);
-		
-		  var items = [];
-		  var rows = data["rows"];
-		 
-		  for (var i=0;i<rows.length;i++){
-			  	 val=rows[i]['name'];
-				 items.push('<div class="tagLink" onclick="javascript: annotations(\''+rows[i]["id"]+'\');">'+val+'</div>');
-			
-		  }
-		  $('#tagList').html(items.join(''));
-		 
-	});
-	
-	
-});
Index: rc/main/webapp/index.html
===================================================================
--- src/main/webapp/index.html	(revision 100)
+++ 	(revision )
@@ -1,32 +1,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
-<title>Annotation Server</title>
-
-</head>
-
-<body>
-  <h1>Annotation Server</h1>
-  <h2>View public Annotations</h2>
-  <ul>
-    <li><a href="tags/">View tags</a></li>
-    <li><a href="annotationBrowser/">All Annotations</a></li>
-  </ul>
-  <!-- TODO: should be configurable
-  <h2>View non-public Annotations with log-in</h2>
-  <ul>
-    <li><a href="http://libcoll.mpiwg-berlin.mpg.de/annotations">http://libcoll.mpiwg-berlin.mpg.de/annotations</a></li>
-  </ul>
--->
-  <h2>Admin</h2>
-  <ul>
-    <li><a href="annotations/groups/">View and edit groups</a></li>
-    <li><a href="annotations/persons/">View and edit persons</a></li>
-    <li><a href="annotations/annotations/">View and edit annotations</a></li>
-  </ul>
-</body>
-</html>
Index: rc/main/webapp/tags/index.html
===================================================================
--- src/main/webapp/tags/index.html	(revision 56)
+++ 	(revision )
@@ -1,25 +1,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>Browse By Tags</title>
-<script type="text/javascript" src="../annotationBrowser/js/jquery.min.js"></script>
-<script type="text/javascript" src="../annotationBrowser/js/annotation-core.js"></script>
-<script type="text/javascript" src="../annotationBrowser/js/tag.js"></script>
-<link rel="stylesheet" type="text/css" href="../annotationBrowser/css/tag.css" />
-<script type="text/javascript">
-  var annotServer = "../annotator/";
-  //var viewerAddress = "http://libcoll.mpiwg-berlin.mpg.de/libviewa?url=";
-  //var docNamespace = "http://echo.mpiwg-berlin.mpg.de/documents/";
-  //var dcDataPath = "http://libcoll.mpiwg-berlin.mpg.de/metadata/getDCDataFromPath?path=";
-  //var textPath = "http://digilib.mpiwg-berlin.mpg.de/digitallibrary/servlet/Texter?fn=";
-</script>
-</head>
-<body>
-  <h2>Tags</h2>
-  <div id="viewer">
-    <div id="tagList"></div>
-    <div id="annotations"></div>
-  </div>
-</body>
-</html>
