Index: /Vago/trunk/Vago/Vago.pro
===================================================================
--- /Vago/trunk/Vago/Vago.pro	(revision 771)
+++ /Vago/trunk/Vago/Vago.pro	(revision 771)
@@ -0,0 +1,85 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2012-07-07T18:13:16
+#
+#-------------------------------------------------
+
+QT       += core gui
+QT       += network #network communication
+QT       += script #for json parse
+
+INCLUDEPATH += ./libs
+INCLUDEPATH += ./packageWizard
+INCLUDEPATH += ./soundWizard
+
+TARGET = Vago
+TEMPLATE = app
+RC_FILE = icon_resource.rc #for windows explorer icon
+
+SOURCES += \
+    util.cpp \
+    preferences.cpp \
+    manualcommands.cpp \
+    mainwindow.cpp \
+    main.cpp \
+    logger.cpp \
+    droptablewidget.cpp \
+    converter.cpp \
+    about.cpp \
+    libs/zipglobal.cpp \
+    libs/zip.cpp \
+    libs/unzip.cpp \
+    packageWizard/packagewizard.cpp \
+    packageWizard/packagepagefinal.cpp \
+    packageWizard/packagepage4.cpp \
+    packageWizard/packagepage3.cpp \
+    packageWizard/packagepage2.cpp \
+    soundWizard/soundpage2.cpp \
+    soundWizard/soundpage3.cpp \
+    soundWizard/soundpage4.cpp \
+    soundWizard/soundpagefinal.cpp \
+    soundWizard/soundwizard.cpp \
+    xmlprocessor.cpp
+
+HEADERS  += \
+    util.h \
+    preferences.h \
+    manualcommands.h \
+    mainwindow.h \
+    logger.h \
+    droptablewidget.h \
+    converter.h \
+    about.h \
+    libs/zipglobal.h \
+    libs/zipentry_p.h \
+    libs/zip_p.h \
+    libs/zip.h \
+    libs/unzip_p.h \
+    libs/unzip.h \
+    packageWizard/packagewizard.h \
+    packageWizard/packagepagefinal.h \
+    packageWizard/packagepage4.h \
+    packageWizard/packagepage3.h \
+    packageWizard/packagepage2.h \
+    soundWizard/soundpage2.h \
+    soundWizard/soundpage3.h \
+    soundWizard/soundpage4.h \
+    soundWizard/soundpagefinal.h \
+    soundWizard/soundwizard.h \
+    xmlprocessor.h
+
+FORMS    += mainwindow.ui \
+    preferences.ui \
+    manualcommands.ui \
+    about.ui \
+    packageWizard/packagepagefinal.ui \
+    packageWizard/packagepage4.ui \
+    packageWizard/packagepage3.ui \
+    packageWizard/packagepage2.ui \
+    soundWizard/soundpage2.ui \
+    soundWizard/soundpage3.ui \
+    soundWizard/soundpage4.ui \
+    soundWizard/soundpagefinal.ui
+
+RESOURCES += \
+    resources.qrc \
Index: /Vago/trunk/Vago/Vago.pro.user
===================================================================
--- /Vago/trunk/Vago/Vago.pro.user	(revision 771)
+++ /Vago/trunk/Vago/Vago.pro.user	(revision 771)
@@ -0,0 +1,365 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE QtCreatorProject>
+<!-- Written by Qt Creator 2.4.1, 2013-03-31T19:50:55. -->
+<qtcreator>
+ <data>
+  <variable>ProjectExplorer.Project.ActiveTarget</variable>
+  <value type="int">0</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.EditorSettings</variable>
+  <valuemap type="QVariantMap">
+   <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
+   <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
+   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
+    <value type="QString" key="language">Cpp</value>
+    <valuemap type="QVariantMap" key="value">
+     <value type="QString" key="CurrentPreferences">CppGlobal</value>
+    </valuemap>
+   </valuemap>
+   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
+    <value type="QString" key="language">QmlJS</value>
+    <valuemap type="QVariantMap" key="value">
+     <value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
+    </valuemap>
+   </valuemap>
+   <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
+   <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
+   <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
+   <value type="int" key="EditorConfiguration.IndentSize">4</value>
+   <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
+   <value type="int" key="EditorConfiguration.PaddingMode">1</value>
+   <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
+   <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
+   <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
+   <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
+   <value type="int" key="EditorConfiguration.TabSize">8</value>
+   <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
+   <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
+   <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
+   <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
+   <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
+   <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.PluginSettings</variable>
+  <valuemap type="QVariantMap"/>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.0</variable>
+  <valuemap type="QVariantMap">
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.DesktopTarget</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
+    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Mingw:C:/MinGW/bin/g++.exe.x86-windows-msys-pe-32bit.C:/QtSDK/pythongdb/python_2.7based/gdb-i686-pc-mingw32.exe</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.1 for Desktop - MinGW (Qt SDK) Debug</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">C:/Users/home/qtWorkspace/Vago-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">5</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
+    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Mingw:C:/MinGW/bin/g++.exe.x86-windows-msys-pe-32bit.C:/QtSDK/pythongdb/python_2.7based/gdb-i686-pc-mingw32.exe</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.1 for Desktop - MinGW (Qt SDK) Release</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">C:/Users/home/qtWorkspace/Vago-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Release</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">5</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
+    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">INVALID</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.0 for Desktop - MinGW (Qt SDK) Debug</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">C:/Users/home/qtWorkspace/Vago-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Debug</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">-1</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
+    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">INVALID</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.0 for Desktop - MinGW (Qt SDK) Release</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">C:/Users/home/qtWorkspace/Vago-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Release</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">-1</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">4</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
+    <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
+    <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+    <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+    <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+     <value type="int">0</value>
+     <value type="int">1</value>
+     <value type="int">2</value>
+     <value type="int">3</value>
+     <value type="int">4</value>
+     <value type="int">5</value>
+     <value type="int">6</value>
+     <value type="int">7</value>
+     <value type="int">8</value>
+     <value type="int">9</value>
+     <value type="int">10</value>
+     <value type="int">11</value>
+     <value type="int">12</value>
+     <value type="int">13</value>
+     <value type="int">14</value>
+    </valuelist>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+     <value type="int">0</value>
+     <value type="int">1</value>
+     <value type="int">2</value>
+     <value type="int">3</value>
+     <value type="int">4</value>
+     <value type="int">5</value>
+     <value type="int">6</value>
+     <value type="int">7</value>
+     <value type="int">8</value>
+     <value type="int">9</value>
+     <value type="int">10</value>
+     <value type="int">11</value>
+     <value type="int">12</value>
+     <value type="int">13</value>
+     <value type="int">14</value>
+    </valuelist>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Vago</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase">2</value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">Vago.pro</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
+    <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
+    <valuelist type="QVariantList" key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
+    <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
+    <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.TargetCount</variable>
+  <value type="int">1</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
+  <value type="QString">{d1d804e5-7180-479f-b853-a9ffac018cf5}</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
+  <value type="int">10</value>
+ </data>
+</qtcreator>
Index: /Vago/trunk/Vago/about.cpp
===================================================================
--- /Vago/trunk/Vago/about.cpp	(revision 771)
+++ /Vago/trunk/Vago/about.cpp	(revision 771)
@@ -0,0 +1,23 @@
+#include "about.h"
+#include "ui_about.h"
+
+About::About(QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::About)
+{
+    ui->setupUi(this);
+    this->setAttribute(Qt::WA_DeleteOnClose,true ); //destroy itself once finished.
+    this->layout()->setSizeConstraint( QLayout::SetFixedSize ); //fixed size
+    ui->lbAbout->setOpenExternalLinks(true); //allow navigate to oni central
+    ui->lbAbout->setText(ui->lbAbout->text().replace("Vago GUI","Vago GUI "+GlobalVars::AppVersion));
+}
+
+About::~About()
+{
+    delete ui;
+}
+
+void About::on_pushButton_clicked()
+{
+    this->close();
+}
Index: /Vago/trunk/Vago/about.h
===================================================================
--- /Vago/trunk/Vago/about.h	(revision 771)
+++ /Vago/trunk/Vago/about.h	(revision 771)
@@ -0,0 +1,26 @@
+#ifndef ABOUT_H
+#define ABOUT_H
+
+#include <QDialog>
+#include <util.h>
+
+namespace Ui {
+class About;
+}
+
+class About : public QDialog
+{
+    Q_OBJECT
+    
+public:
+    explicit About(QWidget *parent = 0);
+    ~About();
+    
+private slots:
+    void on_pushButton_clicked();
+
+private:
+    Ui::About *ui;
+};
+
+#endif // ABOUT_H
Index: /Vago/trunk/Vago/about.ui
===================================================================
--- /Vago/trunk/Vago/about.ui	(revision 771)
+++ /Vago/trunk/Vago/about.ui	(revision 771)
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>About</class>
+ <widget class="QDialog" name="About">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>515</width>
+    <height>369</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle">
+   <string>About Vago GUI</string>
+  </property>
+  <layout class="QHBoxLayout" name="horizontalLayout_2">
+   <item>
+    <widget class="QLabel" name="lbImage">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string/>
+     </property>
+     <property name="pixmap">
+      <pixmap resource="resources.qrc">:/new/about/about.png</pixmap>
+     </property>
+     <property name="scaledContents">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <layout class="QVBoxLayout" name="verticalLayout_2">
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <item>
+        <widget class="QLabel" name="lbAbout">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:9pt; font-weight:600;&quot;&gt;Vago GUI&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;&lt;br /&gt;Written by s10k&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;&lt;br /&gt;Thanks to:&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Neo for OniSplit&lt;br /&gt;EdT for testing, suggestions and icon &lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;demos_kratos for original OniSplit GUI&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Samer/Mukade/EdT for allow me to use Jubei as icon&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Alloc for AIE2 and support&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Paradox for Sound excel plugin and documentation&lt;br /&gt;Wiki&lt;/span&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt; &lt;/span&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;contributors for the documentation &lt;br /&gt;AE&lt;/span&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt; &lt;/span&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;contributors&lt;br /&gt;and in general to&lt;/span&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt; &lt;/span&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;all OniCentral Community&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;&lt;br /&gt;Also thanks to: &lt;br /&gt;StackOverflow&lt;/span&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt; &lt;/span&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Community&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Fabrizio&lt;/span&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt; &lt;/span&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Angius for PKZIP 2.0 for zip handling&lt;br /&gt;smashingmagazine for the folder icon :)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
+&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Visit us at:&lt;br /&gt;&lt;/span&gt;&lt;a href=&quot;http://oni.bungie.org&quot;&gt;&lt;span style=&quot; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;oni.bungie.org&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="verticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>10</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout">
+       <item>
+        <spacer name="horizontalSpacer">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pushButton">
+         <property name="minimumSize">
+          <size>
+           <width>100</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>Close</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="resources.qrc"/>
+ </resources>
+ <connections/>
+</ui>
Index: /Vago/trunk/Vago/converter.cpp
===================================================================
--- /Vago/trunk/Vago/converter.cpp	(revision 771)
+++ /Vago/trunk/Vago/converter.cpp	(revision 771)
@@ -0,0 +1,69 @@
+#include "converter.h"
+
+Converter::Converter(Logger *myLogger, QStringList *myData)
+{
+    this->myLogger=myLogger;
+    this->myData=myData;
+}
+
+void Converter::run()
+{
+    QProcess *myProcess = new QProcess();
+    QString result = QString();
+    QString errorMessage = "";
+    int numErrors=0;
+
+    if(this->myData->size()!=1){
+        emit setupPB(this->myData->size());
+    }
+    else{
+        emit setupPB(0); //Intermitent bar, we don't have any estimation when the task is done
+    }
+
+    //myProcess->setProcessChannelMode(QProcess::MergedChannels); //we want both stdout and stderr
+
+    for(int i=0; i<this->myData->size(); i++){
+
+        QString commands=this->myData->at(i);
+        QString commandToExec;
+
+        int currentIndex=0, nextIndex=0;
+
+        while(true){
+            nextIndex=commands.indexOf(GlobalVars::OniSplitProcSeparator,currentIndex+1);
+
+            commandToExec=commands.mid(currentIndex,(nextIndex-currentIndex));
+            myProcess->start(GlobalVars::OniSplitExeName+" "+commandToExec);
+            myProcess->waitForFinished(-1);
+            result=myProcess->readAllStandardError();
+
+            if(!result.isEmpty()){ //if(!result.startsWith("Importing",Qt::CaseSensitive) && !result.startsWith("Importing",Qt::CaseSensitive)){ //case sensitive is faster
+                //catch exception
+                myLogger->writeString("Oni Split Error: \n"+this->myData->at(i)+"\n"+result);
+                errorMessage=result;
+                numErrors++;
+            }
+
+            if(nextIndex==-1){ //we got to the end, stop proccessing commands
+                break;
+            }
+            currentIndex=nextIndex+1; //update currentIndex +1 for start after the separator
+        }
+
+        emit taskDone();
+    }
+
+    delete myProcess; //delete object and make pointer invalid
+    this->myData->clear(); //clean list
+
+    //let's cut it a bit, complete error is in log file.
+    if(errorMessage.size()>600){
+        //limit it at 400 characters (not counting the warning at the begin)
+        errorMessage.remove(299,errorMessage.size()-600);
+        errorMessage.insert(299,"\n \t ... \n");
+        errorMessage.insert(0,"This error was been shortened. \nSee the complete error at Vago log file.\n\n");
+    }
+
+    emit resultConversion(errorMessage,numErrors);
+}
+
Index: /Vago/trunk/Vago/converter.h
===================================================================
--- /Vago/trunk/Vago/converter.h	(revision 771)
+++ /Vago/trunk/Vago/converter.h	(revision 771)
@@ -0,0 +1,30 @@
+#ifndef CONVERTER_H
+#define CONVERTER_H
+#include <QProcess>
+#include <logger.h>
+#include <QProgressBar>
+#include <QThread>
+#include <util.h>
+#include <QDebug>
+
+class Converter : public QThread
+{
+     Q_OBJECT
+public:
+    Converter(Logger *myLogger, QStringList *myData);
+private:
+    Logger *myLogger;
+    QStringList *myData;
+
+protected:
+    void run(); //for thread
+private slots:
+signals:
+    void setupPB(int numberTasks);
+    void taskDone();
+    void resultConversion(QString result, int numErrors);
+};
+
+
+
+#endif // CONVERTER_H
Index: /Vago/trunk/Vago/droptablewidget.cpp
===================================================================
--- /Vago/trunk/Vago/droptablewidget.cpp	(revision 771)
+++ /Vago/trunk/Vago/droptablewidget.cpp	(revision 771)
@@ -0,0 +1,175 @@
+#include <QtGui>
+#include "droptablewidget.h"
+
+//Original dn'd from here: http://www.qtcentre.org/threads/17536-Drag-and-Drop-QTableWidget-in-UI-file
+//This constructor also initialize c++ constants (http://stackoverflow.com/questions/1423696/how-to-initialize-a-const-field-in-constructor)
+
+DropTableWidget::DropTableWidget(QWidget *parent, QBrush _disabledBackStyle,
+                                 QBrush _disabledTextStyle) : QTableWidget(parent),
+    disabledBackStyle(_disabledBackStyle),
+    disabledTextStyle(_disabledTextStyle){
+
+    //set widget default properties:
+    //    setFrameStyle(QFrame::Sunken | QFrame::StyledPanel);
+    //    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+    setEditTriggers(QAbstractItemView::NoEditTriggers);
+    setDragDropMode(QAbstractItemView::DropOnly);
+    setAlternatingRowColors(true);
+    //    setSelectionMode(QAbstractItemView::NoSelection);
+    //    setShowGrid(false);
+    //    setWordWrap(false);
+    setAcceptDrops(true);
+
+    //Custom added for Vago
+    setColumnCount(3);
+
+    //set Header of tables
+    setHorizontalHeaderLabels(QStringList()<<"File/Folder"<<"From/To"<<"Command");
+    horizontalHeader()->setStretchLastSection(true);
+}
+
+void DropTableWidget::dragEnterEvent(QDragEnterEvent *event) {
+    event->acceptProposedAction();
+    emit changed(event->mimeData());
+}
+
+void DropTableWidget::dragMoveEvent(QDragMoveEvent *event) {
+    event->acceptProposedAction();
+}
+
+void DropTableWidget::dropEvent(QDropEvent *event) {
+
+    const QMimeData* mimeData = event->mimeData();
+
+    event->acceptProposedAction();
+
+    QStringList pathList = QStringList();
+
+    // check for our needed mime type, here a file or a list of files
+    if (mimeData->hasUrls())
+    {
+        QList<QUrl> urlList = mimeData->urls();
+
+        // extract the local paths of the files
+        for (int i = 0; i < urlList.size() && i < 2048; ++i)
+        {
+            pathList.append(urlList.at(i).toLocalFile());
+        }
+    }
+
+    emit dropped(this, pathList);
+}
+
+void DropTableWidget::dragLeaveEvent(QDragLeaveEvent *event) {
+    event->accept();
+}
+
+void DropTableWidget::clear() {
+    emit changed();
+}
+
+//Context menu actions
+void DropTableWidget::contextMenuEvent(QContextMenuEvent *event){
+    //All the context menu is processed at the mainwindow class
+    emit dtContextMenu(this,event);
+}
+
+//Custom function to swap items positions in the table
+void DropTableWidget::swapPositions(QList<int> rowsSelected, int numUnitsToMove){
+    QList<tableRowProperties> orderedList = QList<tableRowProperties>();
+
+    //Make a copy of the actual list to swap
+    for(int i=0; i<this->rowCount(); i++){
+        orderedList.append(tableRowProperties()); //Add each row property (initialize)
+        for(int j=0; j<this->columnCount(); j++){
+            orderedList[i].cells.append(this->item(i,j)->text());
+
+            if(this->item(i,j)->background()==this->disabledBackStyle){ //Is it disabled?
+                orderedList[i].isDisabled=true;
+            }
+
+        }
+    }
+
+    //Swap the copied list for each item
+    if(numUnitsToMove<0){ //if going up we need to start from the first item
+        for(int i=0; i<rowsSelected.size(); i++){
+            orderedList.swap(rowsSelected.at(i),rowsSelected.at(i)+numUnitsToMove);
+        }
+    }
+    else{ //if going down we need to start from the last item
+        for(int i=rowsSelected.size()-1; i>=0; i--){
+            orderedList.swap(rowsSelected.at(i),rowsSelected.at(i)+numUnitsToMove);
+        }
+    }
+
+    this->clear(); //clear previous selections
+
+    //Switch with the ordered one
+    for(int i=0; i<this->rowCount(); i++){
+        for(int j=0; j<this->columnCount(); j++){
+            QTableWidgetItem *orderedItem = new QTableWidgetItem(orderedList[i].cells.at(j));
+            this->setItem(i,j,orderedItem);
+
+            if(orderedList[i].isDisabled){ //Restored disabled style
+                setDisableStyleWidgetItem(orderedItem);
+            }
+        }
+        this->updateTableToolTips(i);
+    }
+
+    this->clearSelection(); //clear previous selections
+
+    //Select the moved rows
+    this->setRangeSelected(QTableWidgetSelectionRange(rowsSelected.at(0)+numUnitsToMove,this->columnCount()-1,rowsSelected.at(rowsSelected.size()-1)+numUnitsToMove,0),true);
+    //Top > top row number, Left > num colums to select to left, Bottom > bottom row number, Right > start at each column (from right)
+}
+
+//Reset a item to its initial style
+void DropTableWidget::resetStyleWidgetItem(QTableWidgetItem *currentItem){
+    if((currentItem->row()+1)%2==0){ //if the row number is par it use the alternate color scheme
+        currentItem->setBackground(QPalette().brush(QPalette::Normal,QPalette::AlternateBase));
+    }
+    else{
+        currentItem->setBackground(QPalette().brush(QPalette::Normal,QPalette::Base));
+    }
+    currentItem->setForeground(QPalette().brush(QPalette::Normal,QPalette::WindowText));
+}
+
+//Disable a table widget item
+void DropTableWidget::setDisableStyleWidgetItem(QTableWidgetItem *currentItem){
+    currentItem->setBackground(this->disabledBackStyle);
+    currentItem->setForeground(this->disabledTextStyle);
+}
+
+QString DropTableWidget::getFileAbsolute(int row){
+    QString fileCommand=this->item(row,2)->text();
+
+    int idxFileName=fileCommand.indexOf(this->item(row,0)->text()); //Search first for the file name
+    int fileAbsoluteStartIdx=Util::indexOfBackward(fileCommand,"\"",idxFileName);
+
+    fileCommand.remove(0,fileAbsoluteStartIdx);
+    int fileAbsoluteEndIdx=fileCommand.indexOf('"',1); //1 to find the end quoate and not the start
+
+    return fileCommand.remove(fileAbsoluteEndIdx,(fileCommand.size()-1)-fileAbsoluteEndIdx);
+}
+
+QString DropTableWidget::getOutputAbsolute(int row){
+    QString command=this->item(row,2)->text();
+
+    int fileAbsoluteEndIdx=command.indexOf("/\"",0); //let's find the /" (end of path)
+
+    command.remove(fileAbsoluteEndIdx,command.size()-1);
+
+    int fileAbsoluteStartIdx=Util::indexOfBackward(command,"\"",command.size()-1)+1;
+
+    return command.remove(0,fileAbsoluteStartIdx);
+}
+
+
+void DropTableWidget::updateTableToolTips(int row){
+    for(int i=0; i<this->columnCount(); i++){
+        this->item(row,i)->setToolTip(this->item(row,i)->text());
+    }
+}
+
Index: /Vago/trunk/Vago/droptablewidget.h
===================================================================
--- /Vago/trunk/Vago/droptablewidget.h	(revision 771)
+++ /Vago/trunk/Vago/droptablewidget.h	(revision 771)
@@ -0,0 +1,61 @@
+#ifndef DROPTABLEWIDGET_H
+#define DROPTABLEWIDGET_H
+
+#include <QTableWidget>
+#include <util.h>
+
+
+//Used in swapPositions function, for switching orders and maintain the disabled style
+struct tableRowProperties{ //No need for typedef in c++ :)
+    QStringList cells;
+    bool isDisabled;
+
+    tableRowProperties(){
+        cells = QStringList(); //initialize the list on the constructor
+        isDisabled=false; //if you don't initialize a variable at c++ it is random assigned!
+    }
+};
+
+class QMimeData;
+
+class DropTableWidget : public QTableWidget {
+
+    Q_OBJECT
+
+public:
+    DropTableWidget(QWidget *parent = 0,
+                    QBrush _disabledBackStyle = QPalette().brush(QPalette::Disabled,QPalette::Base),
+                    QBrush _disabledTextStyle = QPalette().brush(QPalette::Disabled,QPalette::WindowText));
+
+    const QBrush disabledBackStyle;
+    const QBrush disabledTextStyle;
+
+    void swapPositions(QList<int> rowsSelected, int numUnitsToMove);
+    void resetStyleWidgetItem(QTableWidgetItem *currentItem);
+    void setDisableStyleWidgetItem(QTableWidgetItem *currentItem);
+    void updateTableToolTips(int row);
+    QString getFileAbsolute(int row);
+    QString getOutputAbsolute(int row);
+
+public slots:
+    void clear();
+
+signals:
+    void changed(const QMimeData *mimeData = 0);
+    void dropped(DropTableWidget *myTable, QStringList pathList);
+    QString getTypeConversion(DropTableWidget *thisTable);
+    void changeToCurrentSettings(int rows[], DropTableWidget* thisTable);
+    void dtContextMenu(DropTableWidget* thisTable, QContextMenuEvent *event);
+
+protected:
+    void dragEnterEvent(QDragEnterEvent *event);
+    void dragMoveEvent(QDragMoveEvent *event);
+    void dragLeaveEvent(QDragLeaveEvent *event);
+    void dropEvent(QDropEvent *event);
+    void contextMenuEvent(QContextMenuEvent * event);
+
+private:
+    QTableWidget *tablewidget;
+};
+
+#endif // DROPTABLEWIDGET_H
Index: /Vago/trunk/Vago/help/XMLSNDD.html
===================================================================
--- /Vago/trunk/Vago/help/XMLSNDD.html	(revision 771)
+++ /Vago/trunk/Vago/help/XMLSNDD.html	(revision 771)
@@ -0,0 +1,829 @@
+<!DOCTYPE html>
+<!-- saved from url=(0050)http://wiki.oni2.net/XML:SNDD#Source_file_creation -->
+<html lang="en" dir="ltr" class="client-js"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>XML:SNDD - OniGalore</title>
+<meta charset="UTF-8">
+<meta name="generator" content="MediaWiki 1.19.2">
+<link rel="shortcut icon" href="http://wiki.oni2.net/favicon.ico">
+<link rel="search" type="application/opensearchdescription+xml" href="http://wiki.oni2.net/w/opensearch_desc.php" title="OniGalore (en)">
+<link rel="EditURI" type="application/rsd+xml" href="http://wiki.oni2.net/w/api.php?action=rsd">
+<link rel="copyright" href="http://www.gnu.org/copyleft/fdl.html">
+<link rel="alternate" type="application/atom+xml" title="OniGalore Atom feed" href="http://wiki.oni2.net/w/index.php?title=Special:RecentChanges&feed=atom">
+<link rel="stylesheet" href="http://wiki.oni2.net/w/load.php?debug=false&lang=en&modules=mediawiki.legacy.commonPrint%2Cshared%7Cskins.vector&only=styles&skin=vector&*">
+<style type="text/css" media="all">.js-messagebox{margin:1em 5%;padding:0.5em 2.5%;border:1px solid #ccc;background-color:#fcfcfc;font-size:0.8em}.js-messagebox .js-messagebox-group{margin:1px;padding:0.5em 2.5%;border-bottom:1px solid #ddd}.js-messagebox .js-messagebox-group:last-child{border-bottom:thin none transparent}
+
+/* cache key: oni_wiki:resourceloader:filter:minify-css:7:8b08bdc91c52a9ffba396dccfb5b473c */
+
+
+.mw-collapsible-toggle{float:right} li .mw-collapsible-toggle{float:none} .mw-collapsible-toggle-li{list-style:none}
+
+/* cache key: oni_wiki:resourceloader:filter:minify-css:7:4250852ed2349a0d4d0fc6509a3e7d4c */
+</style><meta name="ResourceLoaderDynamicStyles" content="">
+<link rel="stylesheet" href="http://wiki.oni2.net/w/load.php?debug=false&lang=en&modules=site&only=styles&skin=vector&*">
+<style>a:lang(ar),a:lang(ckb),a:lang(fa),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}a.new,#quickbar a.new{color:#ba0000}
+
+/* cache key: oni_wiki:resourceloader:filter:minify-css:7:c88e2bcd56513749bec09a7e29cb3ffa */
+</style>
+
+<script src="./XMLSNDD_files/load.php"></script><script src="./XMLSNDD_files/load(1).php"></script>
+<script>if(window.mw){
+mw.config.set({"wgCanonicalNamespace":"XML","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":110,"wgPageName":"XML:SNDD","wgTitle":"SNDD","wgCurRevisionId":20983,"wgArticleId":4759,"wgIsArticle":true,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Articles that need finishing","XML data docs"],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgRelevantPageName":"XML:SNDD","wgRestrictionEdit":[],"wgRestrictionMove":[],"wgSearchNamespaces":[0,100,102,104,108,110],"wgCategoryTreePageCategoryOptions":"{\"mode\":20,\"hideprefix\":20,\"showcount\":true,\"namespaces\":false}"});
+}</script><script>if(window.mw){
+mw.loader.implement("user.options",function($){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"disablesuggest":0,"editfont":"default","editondblclick":0,"editsection":1,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":0,"extendwatchlist":0,"externaldiff":0,"externaleditor":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"highlightbroken":1,"imagesize":2,"justify":0,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nocache":0,"noconvertlink":0,"norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"quickbar":5,"rcdays":7,"rclimit":50,"rememberpassword":0,"rows":25,"searchlimit":20,"showhiddencats":0,"showjumplinks":1,"shownumberswatching":1,"showtoc":1,"showtoolbar":1,"skin":"vector","stubthreshold":0,"thumbsize":2,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":0,"watchdefault":0,"watchdeletion":0,
+"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"wllimit":250,"variant":"en","language":"en","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"searchNs100":true,"searchNs101":false,"searchNs102":true,"searchNs103":false,"searchNs104":true,"searchNs105":false,"searchNs108":true,"searchNs109":false,"searchNs110":true,"searchNs111":false});;},{},{});mw.loader.implement("user.tokens",function($){mw.user.tokens.set({"editToken":"+\\","watchToken":false});;},{},{});
+
+/* cache key: oni_wiki:resourceloader:filter:minify-js:7:44206a5a8afa2f45ed1bbfd2f5a9bece */
+}</script>
+<script>if(window.mw){
+mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax"]);
+}</script><script type="text/javascript" src="./XMLSNDD_files/load(2).php"></script>
+<!--[if lt IE 7]><style type="text/css">body{behavior:url("/w/skins/vector/csshover.min.htc")}</style><![endif]--></head>
+<body class="mediawiki ltr sitedir-ltr ns-110 ns-subject page-XML_SNDD skin-vector action-view">
+		<div id="mw-page-base" class="noprint"></div>
+		<div id="mw-head-base" class="noprint"></div>
+		<!-- content -->
+		<div id="content" class="mw-body">
+			<a id="top"></a>
+			<div id="mw-js-message" style="display:none;" class="js-messagebox"></div>
+						<!-- firstHeading -->
+			<h1 id="firstHeading" class="firstHeading">
+				<span dir="auto">XML:SNDD</span>
+			</h1>
+			<!-- /firstHeading -->
+			<!-- bodyContent -->
+			<div id="bodyContent">
+								<!-- tagline -->
+				<div id="siteSub">From OniGalore</div>
+				<!-- /tagline -->
+								<!-- subtitle -->
+				<div id="contentSub"></div>
+				<!-- /subtitle -->
+																<!-- jumpto -->
+				<div id="jump-to-nav" class="mw-jump">
+					Jump to: <a href="http://wiki.oni2.net/XML:SNDD#mw-head">navigation</a>,
+					<a href="http://wiki.oni2.net/XML:SNDD#p-search">search</a>
+				</div>
+				<!-- /jumpto -->
+								<!-- bodycontent -->
+				<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><table class="wikitable" style="width: 100%; border-width:4px 1px; border-style:solid; border-collapse:collapse; border-spacing:0px; empty-cells:show; text-align:center">
+<tbody><tr>
+<th style="width: 256px;"> SNDD&nbsp;: Sound Data
+</th>
+<td rowspan="2">
+<dl><dd><b>modding hints</b>
+<ul><li> XML documentations sometimes feature <i>&lt;Oni Version"..."&gt;</i>.<br><a rel="nofollow" class="external text" href="http://mods.oni2.net/node/38">New onisplit</a> (v0.9.56.0 or above) uses &lt;Oni&gt; tag.
+</li><li> See <a href="http://wiki.oni2.net/XML_basic_tutorial" title="XML basic tutorial">HERE</a> if you don't know how to convert an oni file into XML and vice versa.
+</li><li> See <a href="http://wiki.oni2.net/OBD_talk:BINA/OBJC" title="OBD talk:BINA/OBJC">HERE</a> if you are searching for more general information such as how to handle object coordinates.
+</li><li> See <a href="http://wiki.oni2.net/Modding_errors" title="Modding errors">HERE</a> for some typical modding errors.
+</li></ul>
+</dd></dl>
+</td>
+<td rowspan="2" style="width:128px; background-color:#000000;"> <a href="http://wiki.oni2.net/File:XML.png" class="image"><img alt="XML.png" src="./XMLSNDD_files/XML.png" width="128" height="128"></a>
+</td></tr>
+<tr>
+<td> <b><a href="http://wiki.oni2.net/XML_basic_tutorial" title="XML basic tutorial">XML</a></b>
+<p><a href="http://wiki.oni2.net/w/index.php?title=XML:PSUI&action=edit&redlink=1" class="new" title="XML:PSUI (page does not exist)">PSUI</a> &lt;&lt; <a href="http://wiki.oni2.net/XML_basic_tutorial#Others" title="XML basic tutorial">Other file types</a> &gt;&gt; <a href="http://wiki.oni2.net/XML:TRAC" title="XML:TRAC">TRAC</a>
+</p><p><a href="http://wiki.oni2.net/OBD:SNDD" title="OBD:SNDD">switch to OBD page</a>
+</p>
+</td></tr></tbody></table>
+<table cellpadding="0" style="border:1px solid black; border-spacing:0px; padding:0px; empty-cells:show; margin-left:auto; margin-right:auto; text-align:center; width:700pt;">
+<tbody><tr>
+<td style="background-color:gray; width:1%;">
+</td>
+<td style="width:1%;"> <a href="http://wiki.oni2.net/File:Unfinished_building-60px.jpg" class="image"><img alt="Unfinished building-60px.jpg" src="./XMLSNDD_files/Unfinished_building-60px.jpg" width="60" height="60"></a>
+</td>
+<td style="width:98%;">
+<p><b>This page is unfinished. Can you fill in any missing information?</b><br>If it is not clear which part of the page is unfinished, ask on the talk page.
+</p>
+</td></tr></tbody></table>
+<table border="0" cellspacing="20" cellpadding="0" style="margin-left:auto; margin-right:auto">
+<tbody><tr>
+<td> More OSBD .grp / .amb information could be useful and .imp is completely left out so far.
+<p>The xml code on this page is based on onisplit <b>v0.9.61.0</b>
+</p>
+</td></tr></tbody></table>
+<table id="toc" class="toc"><tbody><tr><td><div id="toctitle"><h2>Contents</h2><span class="toctoggle">&nbsp;[<a href="http://wiki.oni2.net/XML:SNDD#" class="internal" id="togglelink">hide</a>]&nbsp;</span></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="./XMLSNDD_files/XMLSNDD.html"><span class="tocnumber">1</span> <span class="toctext">Source file creation</span></a></li>
+<li class="toclevel-1 tocsection-2"><a href="http://wiki.oni2.net/XML:SNDD#Oni_file_creation"><span class="tocnumber">2</span> <span class="toctext">Oni file creation</span></a>
+<ul>
+<li class="toclevel-2 tocsection-3"><a href="http://wiki.oni2.net/XML:SNDD#via_Excel_macro"><span class="tocnumber">2.1</span> <span class="toctext">via Excel macro</span></a></li>
+<li class="toclevel-2 tocsection-4"><a href="http://wiki.oni2.net/XML:SNDD#via_batch_files"><span class="tocnumber">2.2</span> <span class="toctext">via batch files</span></a></li>
+<li class="toclevel-2 tocsection-5"><a href="http://wiki.oni2.net/XML:SNDD#via_command_lines"><span class="tocnumber">2.3</span> <span class="toctext">via command lines</span></a></li>
+</ul>
+</li>
+<li class="toclevel-1 tocsection-6"><a href="http://wiki.oni2.net/XML:SNDD#OSBD_information"><span class="tocnumber">3</span> <span class="toctext">OSBD information</span></a>
+<ul>
+<li class="toclevel-2 tocsection-7"><a href="http://wiki.oni2.net/XML:SNDD#OSBDfile.amb.xml"><span class="tocnumber">3.1</span> <span class="toctext">OSBDfile.amb.xml</span></a></li>
+<li class="toclevel-2 tocsection-8"><a href="http://wiki.oni2.net/XML:SNDD#OSBDfile.grp.xml"><span class="tocnumber">3.2</span> <span class="toctext">OSBDfile.grp.xml</span></a></li>
+</ul>
+</li>
+<li class="toclevel-1 tocsection-9"><a href="http://wiki.oni2.net/XML:SNDD#BINACJBOSound.xml"><span class="tocnumber">4</span> <span class="toctext">BINACJBOSound.xml</span></a></li>
+<li class="toclevel-1 tocsection-10"><a href="http://wiki.oni2.net/XML:SNDD#sound-related_BSL_commands"><span class="tocnumber">5</span> <span class="toctext">sound-related BSL commands</span></a></li>
+<li class="toclevel-1 tocsection-11"><a href="http://wiki.oni2.net/XML:SNDD#OCF_thread_about_new_music"><span class="tocnumber">6</span> <span class="toctext">OCF thread about new music</span></a></li>
+<li class="toclevel-1 tocsection-12"><a href="http://wiki.oni2.net/XML:SNDD#How_to_register_sounds_to_characters"><span class="tocnumber">7</span> <span class="toctext">How to register sounds to characters</span></a>
+<ul>
+<li class="toclevel-2 tocsection-13"><a href="http://wiki.oni2.net/XML:SNDD#step_1:_preparing_the_TRAM"><span class="tocnumber">7.1</span> <span class="toctext">step 1: preparing the TRAM</span></a></li>
+<li class="toclevel-2 tocsection-14"><a href="http://wiki.oni2.net/XML:SNDD#step_2:_preparing_the_ONCC"><span class="tocnumber">7.2</span> <span class="toctext">step 2: preparing the ONCC</span></a></li>
+<li class="toclevel-2 tocsection-15"><a href="http://wiki.oni2.net/XML:SNDD#step_3:_preparing_the_OSBD.amb"><span class="tocnumber">7.3</span> <span class="toctext">step 3: preparing the OSBD.amb</span></a></li>
+<li class="toclevel-2 tocsection-16"><a href="http://wiki.oni2.net/XML:SNDD#step_4:_preparing_the_OSBD.grp"><span class="tocnumber">7.4</span> <span class="toctext">step 4: preparing the OSBD.grp</span></a></li>
+<li class="toclevel-2 tocsection-17"><a href="http://wiki.oni2.net/XML:SNDD#step_5:_everything_else_what.27s_left"><span class="tocnumber">7.5</span> <span class="toctext">step 5: everything else what's left</span></a></li>
+</ul>
+</li>
+</ul>
+</td></tr></tbody></table>
+<p><br>
+</p>
+<dl><dd> <i><b>How do I get sounds into Oni?</b></i>
+</dd></dl>
+<p><b>In order to make your sounds available on both sides - pc and mac - you need to create them twice (one time from a wav source and another time from an aif/aifc/afc source).</b>
+</p><p><br>
+</p>
+<h2> <span class="mw-headline" id="Source_file_creation">Source file creation</span></h2>
+<p>These are the requirements of your source file(s).
+</p>
+<table class="wikitable" style="width: 100%;">
+<tbody><tr>
+<th> PC retail
+</th>
+<th> MAC
+</th></tr>
+<tr>
+<td style="vertical-align: top; width: 50%;">
+<dl><dd> .wav
+</dd><dd> 22.05KHz (mono / stereo) or 44.1KHz (mono)
+</dd><dd> uncompressed (PCM) or compressed (MS-ADPCM)
+</dd></dl>
+</td>
+<td style="vertical-align: top;">
+<dl><dd> .aif / .aifc / .afc
+</dd><dd> 22.05KHz (mono / stereo)
+</dd><dd> compressed (ima4)
+</dd></dl>
+</td></tr></tbody></table>
+<p><br>
+To create suitable files you could use audacity and its ffmpeg Export Library.
+</p>
+<table class="wikitable" style="width: 100%;">
+<tbody><tr>
+<th style="width: 33%;">
+</th>
+<th style="text-align: right;">PC version
+</th>
+<th style="text-align: right;">Mac version
+</th></tr>
+<tr>
+<td style="width: 33%;">audacity
+</td>
+<td><a rel="nofollow" class="external text" href="http://audacity.sourceforge.net/download/beta_windows#recdown">link</a>
+</td>
+<td><a rel="nofollow" class="external text" href="http://audacity.sourceforge.net/download/beta_mac#recdown">link</a>
+</td></tr>
+<tr>
+<td>ffmpeg Export Library
+</td>
+<td><a rel="nofollow" class="external text" href="http://manual.audacityteam.org/index.php?title=FAQ:Installation_and_Plug-Ins#installffmpeg">link</a>
+</td>
+<td><a rel="nofollow" class="external text" href="http://manual.audacityteam.org/index.php?title=FAQ:Installation_and_Plug-Ins#installffmpeg">link</a>
+</td></tr>
+<tr>
+<td>mirror links
+</td>
+<td><a rel="nofollow" class="external text" href="http://dl.dropbox.com/u/139715/OniGalore/audacity%2BFFmpeg_library_for_PC.zip">audacity (1.3 beta) + library</a>
+</td>
+<td><a rel="nofollow" class="external text" href="http://dl.dropbox.com/u/139715/OniGalore/audacity%2BFFmpeg_library_for_MAC.zip">audacity (1.3 beta) + library</a>
+</td></tr>
+<tr>
+<td style="vertical-align: top;">installation
+</td>
+<td colspan="2">After you installed Audacity and the library goto <b>Edit &gt; Preferences... &gt; Libraries</b> - click on Locate... button and find the installed library file.
+</td></tr>
+<tr>
+<td style="vertical-align: top;">source file creation
+</td>
+<td><b>wav</b> for PC oni file
+<p><br>
+Open your sound file then goto File &gt; Export... &gt; Save As: <i><b>yourfile.<font color="#CC0000">wav</font></b></i>; Format: Custom FFmpeg Export; Options... &gt; wav; <b>pcm_s16le</b>; Sample Rate: 22050; OK and save the file<br>(adpcm_ms doesn't work with Audacity 1.3 Beta)
+</p><p><a rel="nofollow" class="external text" href="http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/Audacity_wav.png"><img src="./XMLSNDD_files/Audacity_wav_tn.png" alt="Audacity_wav_tn.png"></a>
+</p>
+</td>
+<td><b>aif</b> for Mac oni file
+<p><br>
+Open your sound file then goto File &gt; Export... &gt; Save As: <i><b>yourfile.<font color="#CC0000">aif</font></b></i>; Format: Custom FFmpeg Export; Options... &gt; aiff; adpcm_ima_qt; Sample Rate: 22050; OK and save the file
+</p><p><a rel="nofollow" class="external text" href="http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/Audacity.png"><img src="./XMLSNDD_files/Audacity_tn.png" alt="Audacity_tn.png"></a>
+</p>
+</td></tr></tbody></table>
+<p><br>
+</p>
+<h2> <span class="mw-headline" id="Oni_file_creation">Oni file creation</span></h2>
+<h3> <span class="mw-headline" id="via_Excel_macro">via Excel macro</span></h3>
+<table border="0" cellspacing="20" cellpadding="0" style="text-align: right;">
+<tbody><tr>
+<td> macro GUI<br><a rel="nofollow" class="external text" href="http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/VBA/sound_setup_assistant.png"><img src="./XMLSNDD_files/sound_setup_assistant_tn.png" alt="sound_setup_assistant_tn.png"></a>
+</td></tr></tbody></table>
+<p>You can use this <a rel="nofollow" class="external text" href="http://dl.dropbox.com/u/139715/OniGalore/SNDD_OSBD_macro.zip">macro</a> to create single sounds with few clicks.
+</p><p>It lets you generate the OSBD (.amb + .grp) and SNDD file in one go.
+</p><p>No need to buy Windows version of Excel. The trail version will also do it.
+</p><p><br>
+</p>
+<h3> <span class="mw-headline" id="via_batch_files">via batch files</span></h3>
+<p>Get them <a rel="nofollow" class="external text" href="http://dl.dropbox.com/u/139715/OniGalore/sound_creation_via_batch_files.zip">HERE</a>, includes a short readme.
+</p><p><br>
+</p>
+<h3> <span class="mw-headline" id="via_command_lines">via command lines</span></h3>
+<p>For those who want to do it on their own.
+</p><p>onisplit
+</p>
+<dl><dd> -create output_directory_<b>MAC</b> input_directory/<b>*.aif</b>
+</dd><dd> -create output_directory_<b>PC</b> input_directory/<b>*.wav</b>
+</dd><dd> -create output_directory input_directory/*.xml
+</dd></dl>
+<p>For fast xml text changes and naming give them all <i>yourfile</i> as name if you have only one sound:
+</p>
+<dl><dd> <font color="#AAAAAA">SNDD</font>yourfile<font color="#AAAAAA">.oni</font>
+</dd><dd> <font color="#AAAAAA">OSBD</font>yourfile<font color="#AAAAAA"><b>.grp</b>.oni</font>
+</dd><dd> <font color="#AAAAAA">OSBD</font>yourfile<font color="#AAAAAA"><b>.amb</b>.oni</font>
+</dd></dl>
+<p><br>
+</p>
+<h2> <span class="mw-headline" id="OSBD_information">OSBD information</span></h2>
+<p><b>when use what</b>
+</p>
+<ul><li> OSBD*.<b>amb</b>
+<ul><li> music (call OSBD from BSL)
+</li><li> sound dialogs (call OSBD from BSL)
+</li><li> <a href="http://wiki.oni2.net/XML:BINA/PAR3" title="XML:BINA/PAR3">BINA3RAP</a> &lt;AmbientSound&gt; (action type)
+</li><li> <a href="http://wiki.oni2.net/XML:SNDD#BINACJBOSound">BINACJBOSound.xml</a> (area-fixed sounds)
+</li><li> <a href="http://wiki.oni2.net/XML:TRIG" title="XML:TRIG">TRIG</a> &lt;ActiveSound&gt;
+</li><li> <a href="http://wiki.oni2.net/XML:TURR" title="XML:TURR">TURR</a> &lt;ActiveSound&gt;
+</li></ul>
+</li></ul>
+<ul><li> OSBD*.<b>imp</b>
+<ul><li> <a href="http://wiki.oni2.net/XML:BINA/PAR3" title="XML:BINA/PAR3">BINA3RAP</a> &lt;FlyBySoundName&gt; and &lt;ImpulseSound&gt; (action type)
+</li><li> <a href="http://wiki.oni2.net/XML:BINA/ONIE" title="XML:BINA/ONIE">BINA/ONIE</a> &lt;Sound&gt;&lt;Name&gt;
+</li><li> <a href="http://wiki.oni2.net/XML:BINA/SABD" title="XML:BINA/SABD">BINADBAS</a> &lt;Sound&gt;
+</li><li> <a href="http://wiki.oni2.net/XML:ONCC" title="XML:ONCC">ONCC</a> hurt sounds (also indirectly with chr_pain) and &lt;SoundConstants&gt;
+</li><li> <a href="http://wiki.oni2.net/XML:ONWC" title="XML:ONWC">ONWC</a> &lt;EmptyWeaponSound&gt;
+</li><li> <a href="http://wiki.oni2.net/XML:TRAM" title="XML:TRAM">TRAM</a> &lt;Sound&gt;&lt;Name&gt;
+</li><li> <a href="http://wiki.oni2.net/XML:TRIG" title="XML:TRIG">TRIG</a> &lt;TriggerSound&gt;
+</li></ul>
+</li></ul>
+<p><br>
+<b>details on music</b>
+</p>
+<dl><dd> OSBD_newmusic.amb.oni (The main file, links to the group, intro and ending files)
+</dd><dd> OSBD_newmusic.grp.oni (Contain links to the music files)
+</dd><dd> OSBD_newmusic_in.grp.oni (Links to intro part of the music - Optional)
+</dd><dd> OSBD_newmusic_out.grp.oni (Links to the ending of the music - Optional)
+</dd><dd> SNDD_newmusic1.oni (The individual music files - Its best to break up the music into segments of perhaps 30 secs to a minute each - Oni may crash or become sluggish if you use a single file for the music -- EdT) (What are the limits? --<a href="http://wiki.oni2.net/User:Paradox-01" title="User:Paradox-01">Paradox-01</a>)
+</dd></dl>
+<p><br>
+</p>
+<h3> <span class="mw-headline" id="OSBDfile.amb.xml">OSBDfile.amb.xml</span></h3>
+<p>In case you want to create a simple sound file you can basically copy the code and change the red marked stuff. 
+</p><p>(OSBDfile.grp.xml, OSBDfile.amb.xml, BINACJBOSound.xml are actully showing the code from the <a rel="nofollow" class="external text" href="http://mods.oni2.net/node/177"><b>nyan cat mod</b></a>.)
+</p><p><br>
+The .amb file can be called from BSL or from area-fixed sound object. (See level-specific file <a href="http://wiki.oni2.net/XML:SNDD#BINACJBOSound.xml">BINACJBOSound.xml</a>.)
+</p><p>The .amb file links to .grp file(s).
+</p>
+<ul><li> &lt;Priority&gt;
+</li></ul>
+<dl><dd> Low
+</dd><dd> Normal
+</dd><dd> High
+</dd><dd> Highest
+</dd></dl>
+<ul><li> &lt;Flags&gt;
+</li></ul>
+<dl><dd> InterruptTracksOnStop - this flag must be set if you want to use BSL command <i>sound_music_stop</i>
+</dd><dd> PlayOnce
+</dd><dd> CanPan
+</dd></dl>
+<ul><li> &lt;BaseTrack1&gt; - this links to the .grp file (for example: <font color="#AAAAAA">OSBD</font>nyan<font color="#AAAAAA">.grp.oni</font>), file prefix and suffix aren't used
+</li></ul>
+<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;Oni&gt;
+   &lt;AmbientSound&gt;
+       &lt;Priority&gt;Normal&lt;/Priority&gt;
+       &lt;Flags&gt;InterruptTracksOnStop&lt;/Flags&gt;
+       &lt;DetailTrackProperties&gt;
+           &lt;SphereRadius&gt;10&lt;/SphereRadius&gt;
+           &lt;ElapsedTime&gt;
+               &lt;Min&gt;0&lt;/Min&gt;
+               &lt;Max&gt;0&lt;/Max&gt;
+           &lt;/ElapsedTime&gt;
+       &lt;/DetailTrackProperties&gt;
+       &lt;Volume&gt;
+           &lt;Distance&gt;
+               &lt;Min&gt;10&lt;/Min&gt;
+               &lt;Max&gt;50&lt;/Max&gt;
+           &lt;/Distance&gt;
+       &lt;/Volume&gt;
+       &lt;DetailTrack&gt;&lt;/DetailTrack&gt;
+       <b>&lt;BaseTrack1&gt;<font color="#FF0000">nyan</font>&lt;/BaseTrack1&gt;</b>
+       &lt;BaseTrack2&gt;&lt;/BaseTrack2&gt;
+       &lt;InSound&gt;&lt;/InSound&gt;
+       &lt;OutSound&gt;&lt;/OutSound&gt;
+       &lt;Treshold&gt;3&lt;/Treshold&gt;
+       &lt;MinOcclusion&gt;0&lt;/MinOcclusion&gt;
+   &lt;/AmbientSound&gt;
+&lt;/Oni&gt;
+</pre>
+<p><br>
+</p>
+<h3> <span class="mw-headline" id="OSBDfile.grp.xml">OSBDfile.grp.xml</span></h3>
+<ul><li> &lt;Flags&gt;
+</li></ul>
+<dl><dd> PreventRepeat - forces to play different sounds if more than one permutations are present
+</dd></dl>
+<ul><li> &lt;NumberOfChannels&gt; - here you tell Oni if your sound file is "1" (22.05 kHz, mono) or "2" (22.05 kHz, stereo; (PC-only:) 44.1 kHz, mono), if you set the wrong value the music will sound distorted
+</li><li> &lt;Sound&gt; - this is the sound file (for example: <font color="#AAAAAA">SNDD</font>nyan<font color="#AAAAAA">.oni</font>), file prefix and suffix aren't used
+</li></ul>
+<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;Oni&gt;
+   &lt;SoundGroup&gt;
+       &lt;Volume&gt;1&lt;/Volume&gt;
+       &lt;Pitch&gt;1&lt;/Pitch&gt;
+       &lt;Flags&gt;PreventRepeat&lt;/Flags&gt;
+       &lt;NumberOfChannels&gt;2&lt;/NumberOfChannels&gt;
+       &lt;Permutations&gt;
+           &lt;Permutation&gt;
+               &lt;Weight&gt;10&lt;/Weight&gt;
+               &lt;Volume&gt;
+                   &lt;Min&gt;1&lt;/Min&gt;
+                   &lt;Max&gt;1&lt;/Max&gt;
+               &lt;/Volume&gt;
+               &lt;Pitch&gt;
+                   &lt;Min&gt;1&lt;/Min&gt;
+                   &lt;Max&gt;1&lt;/Max&gt;
+               &lt;/Pitch&gt;
+               <b>&lt;Sound&gt;<font color="#FF0000">nyan</font>&lt;/Sound&gt;</b>
+           &lt;/Permutation&gt;
+       &lt;/Permutations&gt;
+   &lt;/SoundGroup&gt;
+&lt;/Oni&gt;
+</pre>
+<p><br>
+</p>
+<h2> <span class="mw-headline" id="BINACJBOSound.xml">BINACJBOSound.xml</span></h2>
+<p>This is for area-fixed sounds.
+</p>
+<ul><li> &lt;Position&gt; - here you tell Oni where you want the sound to be <a href="http://wiki.oni2.net/OBD_talk:BINA/OBJC" title="OBD talk:BINA/OBJC">located</a>
+</li><li> &lt;Class&gt; - this is the amb sound file (for example: <font color="#AAAAAA">SNDD</font>nyan<font color="#AAAAAA">.amb.oni</font>), file prefix and suffix aren't used
+</li><li> &lt;Sphere&gt;
+</li></ul>
+<dl><dd><ul><li> &lt;MinRadius&gt; - between min radius and sound origin (&lt;Position&gt;) is the sound volume equally strong
+</li><li> &lt;MaxRadius&gt; - between max and min radius is a transition of the sound volume
+</li></ul>
+</dd></dl>
+<ul><li> &lt;Box&gt; - alternative to &lt;Sphere&gt;
+</li></ul>
+<dl><dd><ul><li> &lt;Min&gt;<i>X1 Y1 Z1</i>&lt;/Min&gt;
+</li><li> &lt;Max&gt;<i>X2 Y2 Z2</i>&lt;/Max&gt;
+</li></ul>
+</dd></dl>
+<pre>       &lt;SNDG Id="8805"&gt;
+           &lt;Header&gt;
+               &lt;Flags&gt;&lt;/Flags&gt;
+               &lt;Position&gt;125 10 2231&lt;/Position&gt;
+               &lt;Rotation&gt;0 0 0&lt;/Rotation&gt;
+           &lt;/Header&gt;
+           &lt;OSD&gt;
+               <b>&lt;Class&gt;<font color="#FF0000">nyan</font>&lt;/Class&gt;</b>
+               &lt;Sphere&gt;
+                   &lt;MinRadius&gt;7&lt;/MinRadius&gt;
+                   &lt;MaxRadius&gt;21&lt;/MaxRadius&gt;
+               &lt;/Sphere&gt;
+               &lt;Volume&gt;0.75&lt;/Volume&gt;
+               &lt;Pitch&gt;1&lt;/Pitch&gt;
+           &lt;/OSD&gt;
+       &lt;/SNDG&gt;
+</pre>
+<p><br>
+</p>
+<h2> <span class="mw-headline" id="sound-related_BSL_commands">sound-related BSL commands</span></h2>
+<ul><li> <a href="http://wiki.oni2.net/BSL:Functions#sound" title="BSL:Functions">on this wiki</a>
+</li><li> <a rel="nofollow" class="external text" href="http://ssg.oni2.net/commands.htm#sound">on ssg's website</a>
+</li></ul>
+<p><br>
+sound_music_stop <i>soundtrack</i> - can only be used if .amb file has the InterruptTracksOnStop flag<br>
+sound_music_stop <i>soundtrack</i> 1 - soundtrack stop after 1 second while it gets quieter
+</p><p>You need a custom function if you want to fade out a soundtrack over more than one seconds. It could look like this:
+</p>
+<pre>var float x = 1;
+var int y = 0;
+
+# don't test this function with the console, it could happen that the function stops working after 4 cycles
+func fade_music
+{
+ 	# if statement with float values doesn't seem to work therefore the int y
+	y = y + 1
+	x = x - .01
+	sound_music_volume (soundtrack, x)
+	sleep 10
+ 	if (y eq 99)
+	{
+		# dmsg "stop music"
+		sound_music_stop soundtrack
+	}
+	if (y &lt; 99)
+	{
+		fork fade_music
+	}
+}
+</pre>
+<p><br>
+</p><p><br>
+</p>
+<h2> <span class="mw-headline" id="OCF_thread_about_new_music"><a rel="nofollow" class="external text" href="http://oni.bungie.org/community/forum/viewtopic.php?id=798">OCF thread about new music</a></span></h2>
+<h2> <span class="mw-headline" id="How_to_register_sounds_to_characters">How to register sounds to characters</span></h2>
+<p>... such as sounds of heavy attacks and taunts.
+</p><p><br>
+<b>Let's see how sounds become picked up:</b><br>Schemata:
+</p>
+<dl><dd> TRAM -&gt; ONCC -&gt; OSBD.amb -&gt; OSBD.grp -&gt; SNDD
+</dd></dl>
+<p>Explanation:
+</p>
+<ul><li> The character performs a move / attack whereby the TRAM file holds a sound ID (&lt;Vocalization&gt;).
+</li><li> A link (OSBD.amb name) in ONCC file becomes looked up based on the sound ID.<br>Note that the ONCC file has also a probability value that decides whether a sound becomes played or not.
+</li><li> The game engine looks into OSBD.amb and follows the link into OSBD.grp.
+</li><li> <b>OSBD.grp can hold multiple links to SNDD files.</b> That's why Konoko can have multiple taunt sounds.
+</li></ul>
+<p><br>
+</p>
+<h3> <span class="mw-headline" id="step_1:_preparing_the_TRAM">step 1: preparing the TRAM</span></h3>
+<p><b>Search for &lt;Vocalization&gt; in the TRAM file</b> and give it an ID according to the following table.
+</p><p><br>
+</p>
+<table class="wikitable" style="width: 100%;">
+<tbody><tr>
+<th colspan="2"> TRAM &lt;Vocalization&gt; IDs refer to these ONCC SoundConstants tags
+</th></tr>
+<tr>
+<td style="width: 30px;"> ID
+</td>
+<td> link to ...
+</td></tr>
+<tr>
+<td> 0
+</td>
+<td> &lt;TauntProbability&gt; - <b>taunt(s)</b>
+</td></tr>
+<tr>
+<td> 1
+</td>
+<td> &lt;AlertProbability&gt; - AI being surprised by a sound
+</td></tr>
+<tr>
+<td> 2
+</td>
+<td> &lt;StartleProbability&gt; - AI being surprised by an enemy
+</td></tr>
+<tr>
+<td> 3
+</td>
+<td> &lt;CheckBodyProbability&gt; - (AI only?) death taunt (when enemy / player dies)
+</td></tr>
+<tr>
+<td> 4
+</td>
+<td> &lt;PursueProbability&gt; - sound when character lost track of enemy
+</td></tr>
+<tr>
+<td> 5
+</td>
+<td> &lt;CoverProbability&gt; - being afraid (E.g. "Dont't hurt me.")
+</td></tr>
+<tr>
+<td> 6
+</td>
+<td> &lt;SuperPunchSound&gt; - <b>sound of ######punch_heavy.oni</b>, super punches don't have sound IDs
+</td></tr>
+<tr>
+<td> 7
+</td>
+<td> &lt;SuperKickSound&gt; - <b>sound of ######kick_heavy.oni</b>, super kicks don't have sound IDs
+</td></tr>
+<tr>
+<td> 8
+</td>
+<td> &lt;Super3Sound&gt; - AI specialty, Mukade use it for his devil star attack
+</td></tr>
+<tr>
+<td> <font color="#777777">9</font>
+</td>
+<td> <font color="#777777">&lt;Super4Sound&gt; - unused</font>
+</td></tr></tbody></table>
+<p><br>
+</p>
+<h3> <span class="mw-headline" id="step_2:_preparing_the_ONCC">step 2: preparing the ONCC</span></h3>
+<p>Search for &lt;SoundConstants&gt; and set a value between 0 and 100. 100 will make the engine play a sound always the taunt animation is played.
+</p><p>Let's compare with Konoko (and in the following steps especially the with her taunt files.)
+In ONCCkonoko_generic.xml it looks like this:
+</p>
+<pre>           &lt;SoundConstants&gt;
+               &lt;TauntProbability&gt;100&lt;/TauntProbability&gt;
+               &lt;AlertProbability&gt;0&lt;/AlertProbability&gt;
+               &lt;StartleProbability&gt;0&lt;/StartleProbability&gt;
+               &lt;CheckBodyProbability&gt;0&lt;/CheckBodyProbability&gt;
+               &lt;PursueProbability&gt;0&lt;/PursueProbability&gt;
+               &lt;CoverProbability&gt;0&lt;/CoverProbability&gt;
+               &lt;SuperPunchProbability&gt;100&lt;/SuperPunchProbability&gt;
+               &lt;SuperKickProbability&gt;100&lt;/SuperKickProbability&gt;
+               &lt;Super3Probability&gt;0&lt;/Super3Probability&gt;
+               &lt;Super4Probability&gt;0&lt;/Super4Probability&gt;
+               &lt;TauntSound&gt;c17_99_28konoko&lt;/TauntSound&gt;
+               &lt;AlertSound&gt;&lt;/AlertSound&gt;
+               &lt;StartleSound&gt;&lt;/StartleSound&gt;
+               &lt;CheckBodySound&gt;&lt;/CheckBodySound&gt;
+               &lt;PursueSound&gt;&lt;/PursueSound&gt;
+               &lt;CoverSound&gt;&lt;/CoverSound&gt;
+               &lt;SuperPunchSound&gt;c18_79_14konoko&lt;/SuperPunchSound&gt;
+               &lt;SuperKickSound&gt;c18_79_15konoko&lt;/SuperKickSound&gt;
+               &lt;Super3Sound&gt;&lt;/Super3Sound&gt;
+               &lt;Super4Sound&gt;&lt;/Super4Sound&gt;
+           &lt;/SoundConstants&gt;
+</pre>
+<p><br>
+</p>
+<h3> <span class="mw-headline" id="step_3:_preparing_the_OSBD.amb">step 3: preparing the OSBD.amb</span></h3>
+<p>You basically need such a file...
+</p><p>Do you see the &lt;BaseTrack1&gt; tag? In this case it holds the link <font color="#AAAAAA">OSBD</font>c17_99_28konoko<font color="#AAAAAA">.grp.oni</font>.
+</p><p><br>
+</p>
+<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;Oni&gt;
+   &lt;AmbientSound&gt;
+       &lt;Priority&gt;Highest&lt;/Priority&gt;
+       &lt;Flags&gt;InterruptTracksOnStop PlayOnce&lt;/Flags&gt;
+       &lt;DetailTrackProperties&gt;
+           &lt;SphereRadius&gt;10&lt;/SphereRadius&gt;
+           &lt;ElapsedTime&gt;
+               &lt;Min&gt;0&lt;/Min&gt;
+               &lt;Max&gt;0&lt;/Max&gt;
+           &lt;/ElapsedTime&gt;
+       &lt;/DetailTrackProperties&gt;
+       &lt;Volume&gt;
+           &lt;Distance&gt;
+               &lt;Min&gt;10&lt;/Min&gt;
+               &lt;Max&gt;50&lt;/Max&gt;
+           &lt;/Distance&gt;
+       &lt;/Volume&gt;
+       &lt;DetailTrack&gt;&lt;/DetailTrack&gt;
+       &lt;BaseTrack1&gt;c17_99_28konoko&lt;/BaseTrack1&gt;
+       &lt;BaseTrack2&gt;&lt;/BaseTrack2&gt;
+       &lt;InSound&gt;&lt;/InSound&gt;
+       &lt;OutSound&gt;&lt;/OutSound&gt;
+       &lt;Treshold&gt;3&lt;/Treshold&gt;
+       &lt;MinOcclusion&gt;0&lt;/MinOcclusion&gt;
+   &lt;/AmbientSound&gt;
+&lt;/Oni&gt;
+</pre>
+<p><br>
+</p>
+<h3> <span class="mw-headline" id="step_4:_preparing_the_OSBD.grp">step 4: preparing the OSBD.grp</span></h3>
+<p>Since &lt;NumberOfChannels&gt; is only once presented all the SNDD files must have the same number of channels.
+</p>
+<dl><dd> 1 (22.05 kHz, mono)
+</dd><dd> 2 (22.05 kHz, stereo)
+</dd><dd> 2 (44.1 kHz, mono) [PC-only]
+</dd></dl>
+<p>(It's possible to speed up sounds with &lt;Pitch&gt;. E.g. Fury's taunt is speeded up by 1.14 to <i>brighten</i> the voice. But in most cases you probably want to keep it as "1".)
+</p>
+<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;Oni&gt;
+   &lt;SoundGroup&gt;
+       &lt;Volume&gt;1&lt;/Volume&gt;
+       &lt;Pitch&gt;1&lt;/Pitch&gt;
+       &lt;Flags&gt;PreventRepeat&lt;/Flags&gt;
+       &lt;NumberOfChannels&gt;1&lt;/NumberOfChannels&gt;
+       &lt;Permutations&gt;
+           &lt;Permutation&gt;
+               &lt;Weight&gt;10&lt;/Weight&gt;
+               &lt;Volume&gt;
+                   &lt;Min&gt;1&lt;/Min&gt;
+                   &lt;Max&gt;1&lt;/Max&gt;
+               &lt;/Volume&gt;
+               &lt;Pitch&gt;
+                   &lt;Min&gt;1&lt;/Min&gt;
+                   &lt;Max&gt;1&lt;/Max&gt;
+               &lt;/Pitch&gt;
+               &lt;Sound&gt;c17_99_28konoko.aif&lt;/Sound&gt;
+           &lt;/Permutation&gt;
+           &lt;Permutation&gt;
+               &lt;Weight&gt;10&lt;/Weight&gt;
+               &lt;Volume&gt;
+                   &lt;Min&gt;1&lt;/Min&gt;
+                   &lt;Max&gt;1&lt;/Max&gt;
+               &lt;/Volume&gt;
+               &lt;Pitch&gt;
+                   &lt;Min&gt;1&lt;/Min&gt;
+                   &lt;Max&gt;1&lt;/Max&gt;
+               &lt;/Pitch&gt;
+               &lt;Sound&gt;c17_99_29konoko.aif&lt;/Sound&gt;
+           &lt;/Permutation&gt;
+           <i><b>[...]</b></i>
+       &lt;/Permutations&gt;
+   &lt;/SoundGroup&gt;
+&lt;/Oni&gt;
+</pre>
+<p><br>
+As you can see
+</p>
+<ul><li> <font color="#AAAAAA">SNDD</font>c17_99_28konoko.aif<font color="#AAAAAA">.oni</font> ("You're gonna get beat(en) by a girl!")
+</li><li> <font color="#AAAAAA">SNDD</font>c17_99_29konoko.aif<font color="#AAAAAA">.oni</font> ("Ready to lose?") (You can play sounds with (PC) onisplit GUI or (Mac) AETools.
+</li><li> <i>[...]</i>
+</li></ul>
+<p>are used for Konoko. ("aif" is here part of the name, don't get bothered by it.)
+This file is the magic why Konoko has multiple sounds through one and the same taunt animation.
+</p><p><br>
+</p>
+<h3> <span class="mw-headline" id="step_5:_everything_else_what.27s_left">step 5: everything else what's left</span></h3>
+<ul><li> <a href="./XMLSNDD_files/XMLSNDD.html">create your SNDD</a> if you haven't yet
+</li><li> put your files into a package
+</li><li> test your stuff in-game
+</li></ul>
+
+<!-- 
+NewPP limit report
+Preprocessor node count: 131/1000000
+Post-expand include size: 1944/2097152 bytes
+Template argument size: 223/2097152 bytes
+Expensive parser function count: 0/100
+-->
+
+<!-- Saved in parser cache with key oni_wiki:pcache:idhash:4759-0!*!0!!en!2!* and timestamp 20130330145055 -->
+</div>				<!-- /bodycontent -->
+								<!-- printfooter -->
+				<div class="printfooter">
+				Retrieved from "<a href="http://wiki.oni2.net/w/index.php?title=XML:SNDD&oldid=20983">http://wiki.oni2.net/w/index.php?title=XML:SNDD&amp;oldid=20983</a>"				</div>
+				<!-- /printfooter -->
+												<!-- catlinks -->
+				<div id="catlinks" class="catlinks"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="http://wiki.oni2.net/Special:Categories" title="Special:Categories">Categories</a>: <ul><li><a href="http://wiki.oni2.net/Category:Articles_that_need_finishing" title="Category:Articles that need finishing">Articles that need finishing</a></li><li><a href="http://wiki.oni2.net/Category:XML_data_docs" title="Category:XML data docs">XML data docs</a></li></ul></div></div>				<!-- /catlinks -->
+												<div class="visualClear"></div>
+				<!-- debughtml -->
+								<!-- /debughtml -->
+			</div>
+			<!-- /bodyContent -->
+		</div>
+		<!-- /content -->
+		<!-- header -->
+		<div id="mw-head" class="noprint">
+			
+<!-- 0 -->
+<div id="p-personal" class="">
+	<h5>Personal tools</h5>
+	<ul>
+		<li id="pt-login"><a href="http://wiki.oni2.net/w/index.php?title=Special:UserLogin&returnto=XML%3ASNDD" title="You are encouraged to log in; however, it is not mandatory [alt-shift-o]" accesskey="o">Log in / create account</a></li>
+	</ul>
+</div>
+
+<!-- /0 -->
+			<div id="left-navigation">
+				
+<!-- 0 -->
+<div id="p-namespaces" class="vectorTabs">
+	<h5>Namespaces</h5>
+	<ul>
+					<li id="ca-nstab-xml" class="selected"><span><a href="http://wiki.oni2.net/XML:SNDD">XML</a></span></li>
+					<li id="ca-talk" class="new"><span><a href="http://wiki.oni2.net/w/index.php?title=XML_talk:SNDD&action=edit&redlink=1" title="Discussion about the content page [alt-shift-t]" accesskey="t">Discussion</a></span></li>
+			</ul>
+</div>
+
+<!-- /0 -->
+
+<!-- 1 -->
+<div id="p-variants" class="vectorMenu emptyPortlet">
+	<h4>
+		</h4>
+	<h5><span>Variants</span><a href="http://wiki.oni2.net/XML:SNDD#"></a></h5>
+	<div class="menu">
+		<ul>
+					</ul>
+	</div>
+</div>
+
+<!-- /1 -->
+			</div>
+			<div id="right-navigation">
+				
+<!-- 0 -->
+<div id="p-views" class="vectorTabs">
+	<h5>Views</h5>
+	<ul>
+					<li id="ca-view" class="selected"><span><a href="http://wiki.oni2.net/XML:SNDD">Read</a></span></li>
+					<li id="ca-viewsource"><span><a href="http://wiki.oni2.net/w/index.php?title=XML:SNDD&action=edit" title="This page is protected.
+You can view its source [alt-shift-e]" accesskey="e">View source</a></span></li>
+					<li id="ca-history" class="collapsible"><span><a href="http://wiki.oni2.net/w/index.php?title=XML:SNDD&action=history" title="Past revisions of this page [alt-shift-h]" accesskey="h">View history</a></span></li>
+			</ul>
+</div>
+
+<!-- /0 -->
+
+<!-- 1 -->
+<div id="p-cactions" class="vectorMenu emptyPortlet">
+	<h5><span>Actions</span><a href="http://wiki.oni2.net/XML:SNDD#"></a></h5>
+	<div class="menu">
+		<ul>
+					</ul>
+	</div>
+</div>
+
+<!-- /1 -->
+
+<!-- 2 -->
+<div id="p-search">
+	<h5><label for="searchInput">Search</label></h5>
+	<form action="http://wiki.oni2.net/w/index.php" id="searchform">
+				<div>
+			<input type="search" name="search" title="Search OniGalore [alt-shift-f]" accesskey="f" id="searchInput" autocomplete="off">			<input type="submit" name="go" value="Go" title="Go to a page with this exact name if exists" id="searchGoButton" class="searchButton">			<input type="submit" name="fulltext" value="Search" title="Search the pages for this text" id="mw-searchButton" class="searchButton">					<input type="hidden" name="title" value="Special:Search">
+		</div>
+	</form>
+</div>
+
+<!-- /2 -->
+			</div>
+		</div>
+		<!-- /header -->
+		<!-- panel -->
+			<div id="mw-panel" class="noprint">
+				<!-- logo -->
+					<div id="p-logo"><a style="background-image: url(/w/wiki.png);" href="http://wiki.oni2.net/Main_Page" title="Visit the main page"></a></div>
+				<!-- /logo -->
+				
+<!-- navigation -->
+<div class="portal" id="p-navigation">
+	<h5>Navigation</h5>
+	<div class="body">
+		<ul>
+			<li id="n-mainpage"><a href="http://wiki.oni2.net/Main_Page" title="Visit the main page [alt-shift-z]" accesskey="z">Main Page</a></li>
+			<li id="n-Site-Map"><a href="http://wiki.oni2.net/Site_Map">Site Map</a></li>
+			<li id="n-portal"><a href="http://wiki.oni2.net/OniGalore:Community_portal" title="About the project, what you can do, where to find things">Community portal</a></li>
+			<li id="n-currentevents"><a href="http://wiki.oni2.net/OniGalore:Current_events" title="Find background information on current events">Current events</a></li>
+			<li id="n-recentchanges"><a href="http://wiki.oni2.net/Special:RecentChanges" title="A list of recent changes in the wiki [alt-shift-r]" accesskey="r">Recent changes</a></li>
+			<li id="n-randompage"><a href="http://wiki.oni2.net/Special:Random" title="Load a random page [alt-shift-x]" accesskey="x">Random page</a></li>
+			<li id="n-help"><a href="http://wiki.oni2.net/Help:Contents" title="Learn about the wiki!">Help</a></li>
+		</ul>
+	</div>
+</div>
+
+<!-- /navigation -->
+
+<!-- SEARCH -->
+
+<!-- /SEARCH -->
+
+<!-- TOOLBOX -->
+<div class="portal" id="p-tb">
+	<h5>Toolbox</h5>
+	<div class="body">
+		<ul>
+			<li id="t-whatlinkshere"><a href="http://wiki.oni2.net/Special:WhatLinksHere/XML:SNDD" title="A list of all wiki pages that link here [alt-shift-j]" accesskey="j">What links here</a></li>
+			<li id="t-recentchangeslinked"><a href="http://wiki.oni2.net/Special:RecentChangesLinked/XML:SNDD" title="Recent changes in pages linked from this page [alt-shift-k]" accesskey="k">Related changes</a></li>
+			<li id="t-specialpages"><a href="http://wiki.oni2.net/Special:SpecialPages" title="A list of all special pages [alt-shift-q]" accesskey="q">Special pages</a></li>
+			<li><a href="http://wiki.oni2.net/w/index.php?title=XML:SNDD&printable=yes" rel="alternate">Printable version</a></li>
+			<li id="t-permalink"><a href="http://wiki.oni2.net/w/index.php?title=XML:SNDD&oldid=20983" title="Permanent link to this revision of the page">Permanent link</a></li>
+		</ul>
+	</div>
+</div>
+
+<!-- /TOOLBOX -->
+
+<!-- LANGUAGES -->
+
+<!-- /LANGUAGES -->
+			</div>
+		<!-- /panel -->
+		<!-- footer -->
+		<div id="footer">
+							<ul id="footer-info">
+											<li id="footer-info-lastmod"> This page was last modified on 16 November 2012, at 13:33.</li>
+											<li id="footer-info-viewcount">This page has been accessed 1,771 times.</li>
+											<li id="footer-info-copyright">Content is available under <a class="external" href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License 1.2</a>.</li>
+									</ul>
+							<ul id="footer-places">
+											<li id="footer-places-privacy"><a href="http://wiki.oni2.net/OniGalore:Privacy_policy" title="OniGalore:Privacy policy">Privacy policy</a></li>
+											<li id="footer-places-about"><a href="http://wiki.oni2.net/OniGalore:About" title="OniGalore:About">About OniGalore</a></li>
+											<li id="footer-places-disclaimer"><a href="http://wiki.oni2.net/OniGalore:General_disclaimer" title="OniGalore:General disclaimer">Disclaimers</a></li>
+									</ul>
+										<ul id="footer-icons" class="noprint">
+					<li id="footer-copyrightico">
+						<a href="http://www.gnu.org/copyleft/fdl.html"><img src="./XMLSNDD_files/gnu-fdl.png" alt="GNU Free Documentation License 1.2" width="88" height="31"></a>
+					</li>
+					<li id="footer-poweredbyico">
+						<a href="http://www.mediawiki.org/"><img src="./XMLSNDD_files/poweredby_mediawiki_88x31.png" alt="Powered by MediaWiki" width="88" height="31"></a>
+					</li>
+				</ul>
+						<div style="clear:both"></div>
+		</div>
+		<!-- /footer -->
+		<script src="./XMLSNDD_files/load(3).php"></script>
+<script>if(window.mw){
+mw.loader.load(["mediawiki.user","mediawiki.page.ready","mediawiki.legacy.mwsuggest"], null, true);
+}</script><script src="./XMLSNDD_files/load(4).php" type="text/javascript"></script>
+<script src="./XMLSNDD_files/load(5).php"></script>
+<!-- Served in 0.050 secs. -->
+	
+
+</body></html>
Index: /Vago/trunk/Vago/help/XMLSNDD_files/load(1).php
===================================================================
--- /Vago/trunk/Vago/help/XMLSNDD_files/load(1).php	(revision 771)
+++ /Vago/trunk/Vago/help/XMLSNDD_files/load(1).php	(revision 771)
@@ -0,0 +1,159 @@
+(function(window,undefined){var document=window.document,navigator=window.navigator,location=window.location;var jQuery=(function(){var jQuery=function(selector,context){return new jQuery.fn.init(selector,context,rootjQuery);},_jQuery=window.jQuery,_$=window.$,rootjQuery,quickExpr=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,rnotwhite=/\S/,trimLeft=/^\s+/,trimRight=/\s+$/,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,rvalidchars=/^[\],:{}\s]*$/,rvalidescape=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rvalidtokens=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rvalidbraces=/(?:^|:|,)(?:\s*\[)+/g,rwebkit=/(webkit)[ \/]([\w.]+)/,ropera=/(opera)(?:.*version)?[ \/]([\w.]+)/,rmsie=/(msie) ([\w.]+)/,rmozilla=/(mozilla)(?:.*? rv:([\w.]+))?/,rdashAlpha=/-([a-z]|[0-9])/ig,rmsPrefix=/^-ms-/,fcamelCase=function(all,letter){return(letter+"").toUpperCase();},userAgent=navigator.userAgent,browserMatch,readyList,DOMContentLoaded,toString=Object.prototype.toString,hasOwn=Object.prototype.
+hasOwnProperty,push=Array.prototype.push,slice=Array.prototype.slice,trim=String.prototype.trim,indexOf=Array.prototype.indexOf,class2type={};jQuery.fn=jQuery.prototype={constructor:jQuery,init:function(selector,context,rootjQuery){var match,elem,ret,doc;if(!selector){return this;}if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this;}if(selector==="body"&&!context&&document.body){this.context=document;this[0]=document.body;this.selector=selector;this.length=1;return this;}if(typeof selector==="string"){if(selector.charAt(0)==="<"&&selector.charAt(selector.length-1)===">"&&selector.length>=3){match=[null,selector,null];}else{match=quickExpr.exec(selector);}if(match&&(match[1]||!context)){if(match[1]){context=context instanceof jQuery?context[0]:context;doc=(context?context.ownerDocument||context:document);ret=rsingleTag.exec(selector);if(ret){if(jQuery.isPlainObject(context)){selector=[document.createElement(ret[1])];jQuery.fn.attr.call(selector,context,true);}
+else{selector=[doc.createElement(ret[1])];}}else{ret=jQuery.buildFragment([match[1]],[doc]);selector=(ret.cacheable?jQuery.clone(ret.fragment):ret.fragment).childNodes;}return jQuery.merge(this,selector);}else{elem=document.getElementById(match[2]);if(elem&&elem.parentNode){if(elem.id!==match[2]){return rootjQuery.find(selector);}this.length=1;this[0]=elem;}this.context=document;this.selector=selector;return this;}}else if(!context||context.jquery){return(context||rootjQuery).find(selector);}else{return this.constructor(context).find(selector);}}else if(jQuery.isFunction(selector)){return rootjQuery.ready(selector);}if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context;}return jQuery.makeArray(selector,this);},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length;},toArray:function(){return slice.call(this,0);},get:function(num){return num==null?this.toArray():(num<0?this[this.length+num]:this[num]);},pushStack:function(elems,
+name,selector){var ret=this.constructor();if(jQuery.isArray(elems)){push.apply(ret,elems);}else{jQuery.merge(ret,elems);}ret.prevObject=this;ret.context=this.context;if(name==="find"){ret.selector=this.selector+(this.selector?" ":"")+selector;}else if(name){ret.selector=this.selector+"."+name+"("+selector+")";}return ret;},each:function(callback,args){return jQuery.each(this,callback,args);},ready:function(fn){jQuery.bindReady();readyList.add(fn);return this;},eq:function(i){i=+i;return i===-1?this.slice(i):this.slice(i,i+1);},first:function(){return this.eq(0);},last:function(){return this.eq(-1);},slice:function(){return this.pushStack(slice.apply(this,arguments),"slice",slice.call(arguments).join(","));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},end:function(){return this.prevObject||this.constructor(null);},push:push,sort:[].sort,splice:[].splice};jQuery.fn.init.prototype=jQuery.fn;jQuery.extend=jQuery.fn.
+extend=function(){var options,name,src,copy,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=false;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2;}if(typeof target!=="object"&&!jQuery.isFunction(target)){target={};}if(length===i){target=this;--i;}for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){src=target[name];copy=options[name];if(target===copy){continue;}if(deep&&copy&&(jQuery.isPlainObject(copy)||(copyIsArray=jQuery.isArray(copy)))){if(copyIsArray){copyIsArray=false;clone=src&&jQuery.isArray(src)?src:[];}else{clone=src&&jQuery.isPlainObject(src)?src:{};}target[name]=jQuery.extend(deep,clone,copy);}else if(copy!==undefined){target[name]=copy;}}}}return target;};jQuery.extend({noConflict:function(deep){if(window.$===jQuery){window.$=_$;}if(deep&&window.jQuery===jQuery){window.jQuery=_jQuery;}return jQuery;},isReady:false,readyWait:1,holdReady:function(hold){if(hold){jQuery.readyWait++;}else{jQuery.ready(true);}}
+,ready:function(wait){if((wait===true&&!--jQuery.readyWait)||(wait!==true&&!jQuery.isReady)){if(!document.body){return setTimeout(jQuery.ready,1);}jQuery.isReady=true;if(wait!==true&&--jQuery.readyWait>0){return;}readyList.fireWith(document,[jQuery]);if(jQuery.fn.trigger){jQuery(document).trigger("ready").off("ready");}}},bindReady:function(){if(readyList){return;}readyList=jQuery.Callbacks("once memory");if(document.readyState==="complete"){return setTimeout(jQuery.ready,1);}if(document.addEventListener){document.addEventListener("DOMContentLoaded",DOMContentLoaded,false);window.addEventListener("load",jQuery.ready,false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",DOMContentLoaded);window.attachEvent("onload",jQuery.ready);var toplevel=false;try{toplevel=window.frameElement==null;}catch(e){}if(document.documentElement.doScroll&&toplevel){doScrollCheck();}}},isFunction:function(obj){return jQuery.type(obj)==="function";},isArray:Array.isArray||function(obj
+){return jQuery.type(obj)==="array";},isWindow:function(obj){return obj&&typeof obj==="object"&&"setInterval"in obj;},isNumeric:function(obj){return!isNaN(parseFloat(obj))&&isFinite(obj);},type:function(obj){return obj==null?String(obj):class2type[toString.call(obj)]||"object";},isPlainObject:function(obj){if(!obj||jQuery.type(obj)!=="object"||obj.nodeType||jQuery.isWindow(obj)){return false;}try{if(obj.constructor&&!hasOwn.call(obj,"constructor")&&!hasOwn.call(obj.constructor.prototype,"isPrototypeOf")){return false;}}catch(e){return false;}var key;for(key in obj){}return key===undefined||hasOwn.call(obj,key);},isEmptyObject:function(obj){for(var name in obj){return false;}return true;},error:function(msg){throw new Error(msg);},parseJSON:function(data){if(typeof data!=="string"||!data){return null;}data=jQuery.trim(data);if(window.JSON&&window.JSON.parse){return window.JSON.parse(data);}if(rvalidchars.test(data.replace(rvalidescape,"@").replace(rvalidtokens,"]").replace(rvalidbraces,
+""))){return(new Function("return "+data))();}jQuery.error("Invalid JSON: "+data);},parseXML:function(data){var xml,tmp;try{if(window.DOMParser){tmp=new DOMParser();xml=tmp.parseFromString(data,"text/xml");}else{xml=new ActiveXObject("Microsoft.XMLDOM");xml.async="false";xml.loadXML(data);}}catch(e){xml=undefined;}if(!xml||!xml.documentElement||xml.getElementsByTagName("parsererror").length){jQuery.error("Invalid XML: "+data);}return xml;},noop:function(){},globalEval:function(data){if(data&&rnotwhite.test(data)){(window.execScript||function(data){window["eval"].call(window,data);})(data);}},camelCase:function(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase);},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()===name.toUpperCase();},each:function(object,callback,args){var name,i=0,length=object.length,isObj=length===undefined||jQuery.isFunction(object);if(args){if(isObj){for(name in object){if(callback.apply(object[name],args)===
+false){break;}}}else{for(;i<length;){if(callback.apply(object[i++],args)===false){break;}}}}else{if(isObj){for(name in object){if(callback.call(object[name],name,object[name])===false){break;}}}else{for(;i<length;){if(callback.call(object[i],i,object[i++])===false){break;}}}}return object;},trim:trim?function(text){return text==null?"":trim.call(text);}:function(text){return text==null?"":text.toString().replace(trimLeft,"").replace(trimRight,"");},makeArray:function(array,results){var ret=results||[];if(array!=null){var type=jQuery.type(array);if(array.length==null||type==="string"||type==="function"||type==="regexp"||jQuery.isWindow(array)){push.call(ret,array);}else{jQuery.merge(ret,array);}}return ret;},inArray:function(elem,array,i){var len;if(array){if(indexOf){return indexOf.call(array,elem,i);}len=array.length;i=i?i<0?Math.max(0,len+i):i:0;for(;i<len;i++){if(i in array&&array[i]===elem){return i;}}}return-1;},merge:function(first,second){var i=first.length,j=0;if(typeof second.
+length==="number"){for(var l=second.length;j<l;j++){first[i++]=second[j];}}else{while(second[j]!==undefined){first[i++]=second[j++];}}first.length=i;return first;},grep:function(elems,callback,inv){var ret=[],retVal;inv=!!inv;for(var i=0,length=elems.length;i<length;i++){retVal=!!callback(elems[i],i);if(inv!==retVal){ret.push(elems[i]);}}return ret;},map:function(elems,callback,arg){var value,key,ret=[],i=0,length=elems.length,isArray=elems instanceof jQuery||length!==undefined&&typeof length==="number"&&((length>0&&elems[0]&&elems[length-1])||length===0||jQuery.isArray(elems));if(isArray){for(;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret[ret.length]=value;}}}else{for(key in elems){value=callback(elems[key],key,arg);if(value!=null){ret[ret.length]=value;}}}return ret.concat.apply([],ret);},guid:1,proxy:function(fn,context){if(typeof context==="string"){var tmp=fn[context];context=fn;fn=tmp;}if(!jQuery.isFunction(fn)){return undefined;}var args=slice.call(arguments,2
+),proxy=function(){return fn.apply(context,args.concat(slice.call(arguments)));};proxy.guid=fn.guid=fn.guid||proxy.guid||jQuery.guid++;return proxy;},access:function(elems,key,value,exec,fn,pass){var length=elems.length;if(typeof key==="object"){for(var k in key){jQuery.access(elems,k,key[k],exec,fn,value);}return elems;}if(value!==undefined){exec=!pass&&exec&&jQuery.isFunction(value);for(var i=0;i<length;i++){fn(elems[i],key,exec?value.call(elems[i],i,fn(elems[i],key)):value,pass);}return elems;}return length?fn(elems[0],key):undefined;},now:function(){return(new Date()).getTime();},uaMatch:function(ua){ua=ua.toLowerCase();var match=rwebkit.exec(ua)||ropera.exec(ua)||rmsie.exec(ua)||ua.indexOf("compatible")<0&&rmozilla.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"};},sub:function(){function jQuerySub(selector,context){return new jQuerySub.fn.init(selector,context);}jQuery.extend(true,jQuerySub,this);jQuerySub.superclass=this;jQuerySub.fn=jQuerySub.prototype=this();
+jQuerySub.fn.constructor=jQuerySub;jQuerySub.sub=this.sub;jQuerySub.fn.init=function init(selector,context){if(context&&context instanceof jQuery&&!(context instanceof jQuerySub)){context=jQuerySub(context);}return jQuery.fn.init.call(this,selector,context,rootjQuerySub);};jQuerySub.fn.init.prototype=jQuerySub.fn;var rootjQuerySub=jQuerySub(document);return jQuerySub;},browser:{}});jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(i,name){class2type["[object "+name+"]"]=name.toLowerCase();});browserMatch=jQuery.uaMatch(userAgent);if(browserMatch.browser){jQuery.browser[browserMatch.browser]=true;jQuery.browser.version=browserMatch.version;}if(jQuery.browser.webkit){jQuery.browser.safari=true;}if(rnotwhite.test("\xA0")){trimLeft=/^[\s\xA0]+/;trimRight=/[\s\xA0]+$/;}rootjQuery=jQuery(document);if(document.addEventListener){DOMContentLoaded=function(){document.removeEventListener("DOMContentLoaded",DOMContentLoaded,false);jQuery.ready();};}else if(
+document.attachEvent){DOMContentLoaded=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",DOMContentLoaded);jQuery.ready();}};}function doScrollCheck(){if(jQuery.isReady){return;}try{document.documentElement.doScroll("left");}catch(e){setTimeout(doScrollCheck,1);return;}jQuery.ready();}return jQuery;})();var flagsCache={};function createFlags(flags){var object=flagsCache[flags]={},i,length;flags=flags.split(/\s+/);for(i=0,length=flags.length;i<length;i++){object[flags[i]]=true;}return object;}jQuery.Callbacks=function(flags){flags=flags?(flagsCache[flags]||createFlags(flags)):{};var list=[],stack=[],memory,firing,firingStart,firingLength,firingIndex,add=function(args){var i,length,elem,type,actual;for(i=0,length=args.length;i<length;i++){elem=args[i];type=jQuery.type(elem);if(type==="array"){add(elem);}else if(type==="function"){if(!flags.unique||!self.has(elem)){list.push(elem);}}}},fire=function(context,args){args=args||[];memory=!flags.memory||
+[context,args];firing=true;firingIndex=firingStart||0;firingStart=0;firingLength=list.length;for(;list&&firingIndex<firingLength;firingIndex++){if(list[firingIndex].apply(context,args)===false&&flags.stopOnFalse){memory=true;break;}}firing=false;if(list){if(!flags.once){if(stack&&stack.length){memory=stack.shift();self.fireWith(memory[0],memory[1]);}}else if(memory===true){self.disable();}else{list=[];}}},self={add:function(){if(list){var length=list.length;add(arguments);if(firing){firingLength=list.length;}else if(memory&&memory!==true){firingStart=length;fire(memory[0],memory[1]);}}return this;},remove:function(){if(list){var args=arguments,argIndex=0,argLength=args.length;for(;argIndex<argLength;argIndex++){for(var i=0;i<list.length;i++){if(args[argIndex]===list[i]){if(firing){if(i<=firingLength){firingLength--;if(i<=firingIndex){firingIndex--;}}}list.splice(i--,1);if(flags.unique){break;}}}}}return this;},has:function(fn){if(list){var i=0,length=list.length;for(;i<length;i++){if(
+fn===list[i]){return true;}}}return false;},empty:function(){list=[];return this;},disable:function(){list=stack=memory=undefined;return this;},disabled:function(){return!list;},lock:function(){stack=undefined;if(!memory||memory===true){self.disable();}return this;},locked:function(){return!stack;},fireWith:function(context,args){if(stack){if(firing){if(!flags.once){stack.push([context,args]);}}else if(!(flags.once&&memory)){fire(context,args);}}return this;},fire:function(){self.fireWith(this,arguments);return this;},fired:function(){return!!memory;}};return self;};var sliceDeferred=[].slice;jQuery.extend({Deferred:function(func){var doneList=jQuery.Callbacks("once memory"),failList=jQuery.Callbacks("once memory"),progressList=jQuery.Callbacks("memory"),state="pending",lists={resolve:doneList,reject:failList,notify:progressList},promise={done:doneList.add,fail:failList.add,progress:progressList.add,state:function(){return state;},isResolved:doneList.fired,isRejected:failList.fired,
+then:function(doneCallbacks,failCallbacks,progressCallbacks){deferred.done(doneCallbacks).fail(failCallbacks).progress(progressCallbacks);return this;},always:function(){deferred.done.apply(deferred,arguments).fail.apply(deferred,arguments);return this;},pipe:function(fnDone,fnFail,fnProgress){return jQuery.Deferred(function(newDefer){jQuery.each({done:[fnDone,"resolve"],fail:[fnFail,"reject"],progress:[fnProgress,"notify"]},function(handler,data){var fn=data[0],action=data[1],returned;if(jQuery.isFunction(fn)){deferred[handler](function(){returned=fn.apply(this,arguments);if(returned&&jQuery.isFunction(returned.promise)){returned.promise().then(newDefer.resolve,newDefer.reject,newDefer.notify);}else{newDefer[action+"With"](this===deferred?newDefer:this,[returned]);}});}else{deferred[handler](newDefer[action]);}});}).promise();},promise:function(obj){if(obj==null){obj=promise;}else{for(var key in promise){obj[key]=promise[key];}}return obj;}},deferred=promise.promise({}),key;for(key in
+lists){deferred[key]=lists[key].fire;deferred[key+"With"]=lists[key].fireWith;}deferred.done(function(){state="resolved";},failList.disable,progressList.lock).fail(function(){state="rejected";},doneList.disable,progressList.lock);if(func){func.call(deferred,deferred);}return deferred;},when:function(firstParam){var args=sliceDeferred.call(arguments,0),i=0,length=args.length,pValues=new Array(length),count=length,pCount=length,deferred=length<=1&&firstParam&&jQuery.isFunction(firstParam.promise)?firstParam:jQuery.Deferred(),promise=deferred.promise();function resolveFunc(i){return function(value){args[i]=arguments.length>1?sliceDeferred.call(arguments,0):value;if(!(--count)){deferred.resolveWith(deferred,args);}};}function progressFunc(i){return function(value){pValues[i]=arguments.length>1?sliceDeferred.call(arguments,0):value;deferred.notifyWith(promise,pValues);};}if(length>1){for(;i<length;i++){if(args[i]&&args[i].promise&&jQuery.isFunction(args[i].promise)){args[i].promise().then(
+resolveFunc(i),deferred.reject,progressFunc(i));}else{--count;}}if(!count){deferred.resolveWith(deferred,args);}}else if(deferred!==firstParam){deferred.resolveWith(deferred,length?[firstParam]:[]);}return promise;}});jQuery.support=(function(){var support,all,a,select,opt,input,marginDiv,fragment,tds,events,eventName,i,isSupported,div=document.createElement("div"),documentElement=document.documentElement;div.setAttribute("className","t");div.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";all=div.getElementsByTagName("*");a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return{};}select=document.createElement("select");opt=select.appendChild(document.createElement("option"));input=div.getElementsByTagName("input")[0];support={leadingWhitespace:(div.firstChild.nodeType===3),tbody:!div.getElementsByTagName("tbody").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/top/.test(a.
+getAttribute("style")),hrefNormalized:(a.getAttribute("href")==="/a"),opacity:/^0.55/.test(a.style.opacity),cssFloat:!!a.style.cssFloat,checkOn:(input.value==="on"),optSelected:opt.selected,getSetAttribute:div.className!=="t",enctype:!!document.createElement("form").enctype,html5Clone:document.createElement("nav").cloneNode(true).outerHTML!=="<:nav></:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};input.checked=true;support.noCloneChecked=input.cloneNode(true).checked;select.disabled=true;support.optDisabled=!opt.disabled;try{delete div.test;}catch(e){support.deleteExpando=false;}if(!div.addEventListener&&div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function(){support.noCloneEvent=false;});div.cloneNode(true).fireEvent("onclick");}input=document.createElement("input");input.value="t";input.setAttribute("type","radio");support.radioValue=input
+.value==="t";input.setAttribute("checked","checked");div.appendChild(input);fragment=document.createDocumentFragment();fragment.appendChild(div.lastChild);support.checkClone=fragment.cloneNode(true).cloneNode(true).lastChild.checked;support.appendChecked=input.checked;fragment.removeChild(input);fragment.appendChild(div);div.innerHTML="";if(window.getComputedStyle){marginDiv=document.createElement("div");marginDiv.style.width="0";marginDiv.style.marginRight="0";div.style.width="2px";div.appendChild(marginDiv);support.reliableMarginRight=(parseInt((window.getComputedStyle(marginDiv,null)||{marginRight:0}).marginRight,10)||0)===0;}if(div.attachEvent){for(i in{submit:1,change:1,focusin:1}){eventName="on"+i;isSupported=(eventName in div);if(!isSupported){div.setAttribute(eventName,"return;");isSupported=(typeof div[eventName]==="function");}support[i+"Bubbles"]=isSupported;}}fragment.removeChild(div);fragment=select=opt=marginDiv=div=input=null;jQuery(function(){var container,outer,inner,
+table,td,offsetSupport,conMarginTop,ptlm,vb,style,html,body=document.getElementsByTagName("body")[0];if(!body){return;}conMarginTop=1;ptlm="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";vb="visibility:hidden;border:0;";style="style='"+ptlm+"border:5px solid #000;padding:0;'";html="<div "+style+"><div></div></div>"+"<table "+style+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>";container=document.createElement("div");container.style.cssText=vb+"width:0;height:0;position:static;top:0;margin-top:"+conMarginTop+"px";body.insertBefore(container,body.firstChild);div=document.createElement("div");container.appendChild(div);div.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";tds=div.getElementsByTagName("td");isSupported=(tds[0].offsetHeight===0);tds[0].style.display="";tds[1].style.display="none";support.reliableHiddenOffsets=isSupported&&(tds[0].offsetHeight===0);div.innerHTML="";div.style.width=div.style.
+paddingLeft="1px";jQuery.boxModel=support.boxModel=div.offsetWidth===2;if(typeof div.style.zoom!=="undefined"){div.style.display="inline";div.style.zoom=1;support.inlineBlockNeedsLayout=(div.offsetWidth===2);div.style.display="";div.innerHTML="<div style='width:4px;'></div>";support.shrinkWrapBlocks=(div.offsetWidth!==2);}div.style.cssText=ptlm+vb;div.innerHTML=html;outer=div.firstChild;inner=outer.firstChild;td=outer.nextSibling.firstChild.firstChild;offsetSupport={doesNotAddBorder:(inner.offsetTop!==5),doesAddBorderForTableAndCells:(td.offsetTop===5)};inner.style.position="fixed";inner.style.top="20px";offsetSupport.fixedPosition=(inner.offsetTop===20||inner.offsetTop===15);inner.style.position=inner.style.top="";outer.style.overflow="hidden";outer.style.position="relative";offsetSupport.subtractsBorderForOverflowNotVisible=(inner.offsetTop===-5);offsetSupport.doesNotIncludeMarginInBodyOffset=(body.offsetTop!==conMarginTop);body.removeChild(container);div=container=null;jQuery.extend
+(support,offsetSupport);});return support;})();var rbrace=/^(?:\{.*\}|\[.*\])$/,rmultiDash=/([A-Z])/g;jQuery.extend({cache:{},uuid:0,expando:"jQuery"+(jQuery.fn.jquery+Math.random()).replace(/\D/g,""),noData:{"embed":true,"object":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000","applet":true},hasData:function(elem){elem=elem.nodeType?jQuery.cache[elem[jQuery.expando]]:elem[jQuery.expando];return!!elem&&!isEmptyDataObject(elem);},data:function(elem,name,data,pvt){if(!jQuery.acceptData(elem)){return;}var privateCache,thisCache,ret,internalKey=jQuery.expando,getByName=typeof name==="string",isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[internalKey]:elem[internalKey]&&internalKey,isEvents=name==="events";if((!id||!cache[id]||(!isEvents&&!pvt&&!cache[id].data))&&getByName&&data===undefined){return;}if(!id){if(isNode){elem[internalKey]=id=++jQuery.uuid;}else{id=internalKey;}}if(!cache[id]){cache[id]={};if(!isNode){cache[id].toJSON=jQuery.noop;}}if(typeof name==="object"||
+typeof name==="function"){if(pvt){cache[id]=jQuery.extend(cache[id],name);}else{cache[id].data=jQuery.extend(cache[id].data,name);}}privateCache=thisCache=cache[id];if(!pvt){if(!thisCache.data){thisCache.data={};}thisCache=thisCache.data;}if(data!==undefined){thisCache[jQuery.camelCase(name)]=data;}if(isEvents&&!thisCache[name]){return privateCache.events;}if(getByName){ret=thisCache[name];if(ret==null){ret=thisCache[jQuery.camelCase(name)];}}else{ret=thisCache;}return ret;},removeData:function(elem,name,pvt){if(!jQuery.acceptData(elem)){return;}var thisCache,i,l,internalKey=jQuery.expando,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[internalKey]:internalKey;if(!cache[id]){return;}if(name){thisCache=pvt?cache[id]:cache[id].data;if(thisCache){if(!jQuery.isArray(name)){if(name in thisCache){name=[name];}else{name=jQuery.camelCase(name);if(name in thisCache){name=[name];}else{name=name.split(" ");}}}for(i=0,l=name.length;i<l;i++){delete thisCache[name[i]];}if(!(pvt?
+isEmptyDataObject:jQuery.isEmptyObject)(thisCache)){return;}}}if(!pvt){delete cache[id].data;if(!isEmptyDataObject(cache[id])){return;}}if(jQuery.support.deleteExpando||!cache.setInterval){delete cache[id];}else{cache[id]=null;}if(isNode){if(jQuery.support.deleteExpando){delete elem[internalKey];}else if(elem.removeAttribute){elem.removeAttribute(internalKey);}else{elem[internalKey]=null;}}},_data:function(elem,name,data){return jQuery.data(elem,name,data,true);},acceptData:function(elem){if(elem.nodeName){var match=jQuery.noData[elem.nodeName.toLowerCase()];if(match){return!(match===true||elem.getAttribute("classid")!==match);}}return true;}});jQuery.fn.extend({data:function(key,value){var parts,attr,name,data=null;if(typeof key==="undefined"){if(this.length){data=jQuery.data(this[0]);if(this[0].nodeType===1&&!jQuery._data(this[0],"parsedAttrs")){attr=this[0].attributes;for(var i=0,l=attr.length;i<l;i++){name=attr[i].name;if(name.indexOf("data-")===0){name=jQuery.camelCase(name.
+substring(5));dataAttr(this[0],name,data[name]);}}jQuery._data(this[0],"parsedAttrs",true);}}return data;}else if(typeof key==="object"){return this.each(function(){jQuery.data(this,key);});}parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length){data=jQuery.data(this[0],key);data=dataAttr(this[0],key,data);}return data===undefined&&parts[1]?this.data(parts[0]):data;}else{return this.each(function(){var self=jQuery(this),args=[parts[0],value];self.triggerHandler("setData"+parts[1]+"!",args);jQuery.data(this,key,value);self.triggerHandler("changeData"+parts[1]+"!",args);});}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});}});function dataAttr(elem,key,data){if(data===undefined&&elem.nodeType===1){var name="data-"+key.replace(rmultiDash,"-$1").toLowerCase();data=elem.getAttribute(name);if(typeof data==="string"){try{data=data==="true"?
+true:data==="false"?false:data==="null"?null:jQuery.isNumeric(data)?parseFloat(data):rbrace.test(data)?jQuery.parseJSON(data):data;}catch(e){}jQuery.data(elem,key,data);}else{data=undefined;}}return data;}function isEmptyDataObject(obj){for(var name in obj){if(name==="data"&&jQuery.isEmptyObject(obj[name])){continue;}if(name!=="toJSON"){return false;}}return true;}function handleQueueMarkDefer(elem,type,src){var deferDataKey=type+"defer",queueDataKey=type+"queue",markDataKey=type+"mark",defer=jQuery._data(elem,deferDataKey);if(defer&&(src==="queue"||!jQuery._data(elem,queueDataKey))&&(src==="mark"||!jQuery._data(elem,markDataKey))){setTimeout(function(){if(!jQuery._data(elem,queueDataKey)&&!jQuery._data(elem,markDataKey)){jQuery.removeData(elem,deferDataKey,true);defer.fire();}},0);}}jQuery.extend({_mark:function(elem,type){if(elem){type=(type||"fx")+"mark";jQuery._data(elem,type,(jQuery._data(elem,type)||0)+1);}},_unmark:function(force,elem,type){if(force!==true){type=elem;elem=force;
+force=false;}if(elem){type=type||"fx";var key=type+"mark",count=force?0:((jQuery._data(elem,key)||1)-1);if(count){jQuery._data(elem,key,count);}else{jQuery.removeData(elem,key,true);handleQueueMarkDefer(elem,type,"mark");}}},queue:function(elem,type,data){var q;if(elem){type=(type||"fx")+"queue";q=jQuery._data(elem,type);if(data){if(!q||jQuery.isArray(data)){q=jQuery._data(elem,type,jQuery.makeArray(data));}else{q.push(data);}}return q||[];}},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),fn=queue.shift(),hooks={};if(fn==="inprogress"){fn=queue.shift();}if(fn){if(type==="fx"){queue.unshift("inprogress");}jQuery._data(elem,type+".run",hooks);fn.call(elem,function(){jQuery.dequeue(elem,type);},hooks);}if(!queue.length){jQuery.removeData(elem,type+"queue "+type+".run",true);handleQueueMarkDefer(elem,type,"queue");}}});jQuery.fn.extend({queue:function(type,data){if(typeof type!=="string"){data=type;type="fx";}if(data===undefined){return jQuery.queue(this[0],
+type);}return this.each(function(){var queue=jQuery.queue(this,type,data);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type);}});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});},delay:function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(next,hooks){var timeout=setTimeout(next,time);hooks.stop=function(){clearTimeout(timeout);};});},clearQueue:function(type){return this.queue(type||"fx",[]);},promise:function(type,object){if(typeof type!=="string"){object=type;type=undefined;}type=type||"fx";var defer=jQuery.Deferred(),elements=this,i=elements.length,count=1,deferDataKey=type+"defer",queueDataKey=type+"queue",markDataKey=type+"mark",tmp;function resolve(){if(!(--count)){defer.resolveWith(elements,[elements]);}}while(i--){if((tmp=jQuery.data(elements[i],deferDataKey,undefined,true)||(jQuery.data(elements[i],queueDataKey,undefined,true)||jQuery.data(elements[i],markDataKey,
+undefined,true))&&jQuery.data(elements[i],deferDataKey,jQuery.Callbacks("once memory"),true))){count++;tmp.add(resolve);}}resolve();return defer.promise();}});var rclass=/[\n\t\r]/g,rspace=/\s+/,rreturn=/\r/g,rtype=/^(?:button|input)$/i,rfocusable=/^(?:button|input|object|select|textarea)$/i,rclickable=/^a(?:rea)?$/i,rboolean=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,getSetAttribute=jQuery.support.getSetAttribute,nodeHook,boolHook,fixSpecified;jQuery.fn.extend({attr:function(name,value){return jQuery.access(this,name,value,true,jQuery.attr);},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name);});},prop:function(name,value){return jQuery.access(this,name,value,true,jQuery.prop);},removeProp:function(name){name=jQuery.propFix[name]||name;return this.each(function(){try{this[name]=undefined;delete this[name];}catch(e){}});},addClass:function(value){var classNames,i,l,elem,
+setClass,c,cl;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).addClass(value.call(this,j,this.className));});}if(value&&typeof value==="string"){classNames=value.split(rspace);for(i=0,l=this.length;i<l;i++){elem=this[i];if(elem.nodeType===1){if(!elem.className&&classNames.length===1){elem.className=value;}else{setClass=" "+elem.className+" ";for(c=0,cl=classNames.length;c<cl;c++){if(!~setClass.indexOf(" "+classNames[c]+" ")){setClass+=classNames[c]+" ";}}elem.className=jQuery.trim(setClass);}}}}return this;},removeClass:function(value){var classNames,i,l,elem,className,c,cl;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).removeClass(value.call(this,j,this.className));});}if((value&&typeof value==="string")||value===undefined){classNames=(value||"").split(rspace);for(i=0,l=this.length;i<l;i++){elem=this[i];if(elem.nodeType===1&&elem.className){if(value){className=(" "+elem.className+" ").replace(rclass," ");for(c=0,cl=classNames.length;c<cl;
+c++){className=className.replace(" "+classNames[c]+" "," ");}elem.className=jQuery.trim(className);}else{elem.className="";}}}}return this;},toggleClass:function(value,stateVal){var type=typeof value,isBool=typeof stateVal==="boolean";if(jQuery.isFunction(value)){return this.each(function(i){jQuery(this).toggleClass(value.call(this,i,this.className,stateVal),stateVal);});}return this.each(function(){if(type==="string"){var className,i=0,self=jQuery(this),state=stateVal,classNames=value.split(rspace);while((className=classNames[i++])){state=isBool?state:!self.hasClass(className);self[state?"addClass":"removeClass"](className);}}else if(type==="undefined"||type==="boolean"){if(this.className){jQuery._data(this,"__className__",this.className);}this.className=this.className||value===false?"":jQuery._data(this,"__className__")||"";}});},hasClass:function(selector){var className=" "+selector+" ",i=0,l=this.length;for(;i<l;i++){if(this[i].nodeType===1&&(" "+this[i].className+" ").replace(
+rclass," ").indexOf(className)>-1){return true;}}return false;},val:function(value){var hooks,ret,isFunction,elem=this[0];if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.nodeName.toLowerCase()]||jQuery.valHooks[elem.type];if(hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined){return ret;}ret=elem.value;return typeof ret==="string"?ret.replace(rreturn,""):ret==null?"":ret;}return;}isFunction=jQuery.isFunction(value);return this.each(function(i){var self=jQuery(this),val;if(this.nodeType!==1){return;}if(isFunction){val=value.call(this,i,self.val());}else{val=value;}if(val==null){val="";}else if(typeof val==="number"){val+="";}else if(jQuery.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+"";});}hooks=jQuery.valHooks[this.nodeName.toLowerCase()]||jQuery.valHooks[this.type];if(!hooks||!("set"in hooks)||hooks.set(this,val,"value")===undefined){this.value=val;}});}});jQuery.extend({valHooks:{option:{get:function(elem){var val=elem.
+attributes.value;return!val||val.specified?elem.value:elem.text;}},select:{get:function(elem){var value,i,max,option,index=elem.selectedIndex,values=[],options=elem.options,one=elem.type==="select-one";if(index<0){return null;}i=one?index:0;max=one?index+1:options.length;for(;i<max;i++){option=options[i];if(option.selected&&(jQuery.support.optDisabled?!option.disabled:option.getAttribute("disabled")===null)&&(!option.parentNode.disabled||!jQuery.nodeName(option.parentNode,"optgroup"))){value=jQuery(option).val();if(one){return value;}values.push(value);}}if(one&&!values.length&&options.length){return jQuery(options[index]).val();}return values;},set:function(elem,value){var values=jQuery.makeArray(value);jQuery(elem).find("option").each(function(){this.selected=jQuery.inArray(jQuery(this).val(),values)>=0;});if(!values.length){elem.selectedIndex=-1;}return values;}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(elem,name,
+value,pass){var ret,hooks,notxml,nType=elem.nodeType;if(!elem||nType===3||nType===8||nType===2){return;}if(pass&&name in jQuery.attrFn){return jQuery(elem)[name](value);}if(typeof elem.getAttribute==="undefined"){return jQuery.prop(elem,name,value);}notxml=nType!==1||!jQuery.isXMLDoc(elem);if(notxml){name=name.toLowerCase();hooks=jQuery.attrHooks[name]||(rboolean.test(name)?boolHook:nodeHook);}if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name);return;}else if(hooks&&"set"in hooks&&notxml&&(ret=hooks.set(elem,value,name))!==undefined){return ret;}else{elem.setAttribute(name,""+value);return value;}}else if(hooks&&"get"in hooks&&notxml&&(ret=hooks.get(elem,name))!==null){return ret;}else{ret=elem.getAttribute(name);return ret===null?undefined:ret;}},removeAttr:function(elem,value){var propName,attrNames,name,l,i=0;if(value&&elem.nodeType===1){attrNames=value.toLowerCase().split(rspace);l=attrNames.length;for(;i<l;i++){name=attrNames[i];if(name){propName=jQuery.propFix[
+name]||name;jQuery.attr(elem,name,"");elem.removeAttribute(getSetAttribute?name:propName);if(rboolean.test(name)&&propName in elem){elem[propName]=false;}}}}},attrHooks:{type:{set:function(elem,value){if(rtype.test(elem.nodeName)&&elem.parentNode){jQuery.error("type property can't be changed");}else if(!jQuery.support.radioValue&&value==="radio"&&jQuery.nodeName(elem,"input")){var val=elem.value;elem.setAttribute("type",value);if(val){elem.value=val;}return value;}}},value:{get:function(elem,name){if(nodeHook&&jQuery.nodeName(elem,"button")){return nodeHook.get(elem,name);}return name in elem?elem.value:null;},set:function(elem,value,name){if(nodeHook&&jQuery.nodeName(elem,"button")){return nodeHook.set(elem,value,name);}elem.value=value;}}},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(elem,name,value){var ret,hooks,notxml,nType=elem.nodeType;if(!elem||nType===3||nType===8||nType===2){return;}notxml=nType!==1||!jQuery.isXMLDoc(elem);if(notxml){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name];}if(value!==undefined){if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;}else{return(elem[name]=value);}}else{if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret;}else{return elem[name];}}},propHooks:{tabIndex:{get:function(elem){var attributeNode=elem.getAttributeNode("tabindex");return attributeNode&&attributeNode.specified?parseInt(attributeNode.value,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined;}}}});jQuery.attrHooks.tabindex=jQuery.propHooks.tabIndex;boolHook={get:function(elem,name){var attrNode,property=jQuery.prop(elem,name);return property===true||typeof property!=="boolean"&&(attrNode=elem.getAttributeNode(name))&&
+attrNode.nodeValue!==false?name.toLowerCase():undefined;},set:function(elem,value,name){var propName;if(value===false){jQuery.removeAttr(elem,name);}else{propName=jQuery.propFix[name]||name;if(propName in elem){elem[propName]=true;}elem.setAttribute(name,name.toLowerCase());}return name;}};if(!getSetAttribute){fixSpecified={name:true,id:true};nodeHook=jQuery.valHooks.button={get:function(elem,name){var ret;ret=elem.getAttributeNode(name);return ret&&(fixSpecified[name]?ret.nodeValue!=="":ret.specified)?ret.nodeValue:undefined;},set:function(elem,value,name){var ret=elem.getAttributeNode(name);if(!ret){ret=document.createAttribute(name);elem.setAttributeNode(ret);}return(ret.nodeValue=value+"");}};jQuery.attrHooks.tabindex.set=nodeHook.set;jQuery.each(["width","height"],function(i,name){jQuery.attrHooks[name]=jQuery.extend(jQuery.attrHooks[name],{set:function(elem,value){if(value===""){elem.setAttribute(name,"auto");return value;}}});});jQuery.attrHooks.contenteditable={get:nodeHook.get
+,set:function(elem,value,name){if(value===""){value="false";}nodeHook.set(elem,value,name);}};}if(!jQuery.support.hrefNormalized){jQuery.each(["href","src","width","height"],function(i,name){jQuery.attrHooks[name]=jQuery.extend(jQuery.attrHooks[name],{get:function(elem){var ret=elem.getAttribute(name,2);return ret===null?undefined:ret;}});});}if(!jQuery.support.style){jQuery.attrHooks.style={get:function(elem){return elem.style.cssText.toLowerCase()||undefined;},set:function(elem,value){return(elem.style.cssText=""+value);}};}if(!jQuery.support.optSelected){jQuery.propHooks.selected=jQuery.extend(jQuery.propHooks.selected,{get:function(elem){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex;}}return null;}});}if(!jQuery.support.enctype){jQuery.propFix.enctype="encoding";}if(!jQuery.support.checkOn){jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={get:function(elem){return elem.getAttribute("value")===null?
+"on":elem.value;}};});}jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]=jQuery.extend(jQuery.valHooks[this],{set:function(elem,value){if(jQuery.isArray(value)){return(elem.checked=jQuery.inArray(jQuery(elem).val(),value)>=0);}}});});var rformElems=/^(?:textarea|input|select)$/i,rtypenamespace=/^([^\.]*)?(?:\.(.+))?$/,rhoverHack=/\bhover(\.\S+)?\b/,rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|contextmenu)|click/,rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,rquickIs=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,quickParse=function(selector){var quick=rquickIs.exec(selector);if(quick){quick[1]=(quick[1]||"").toLowerCase();quick[3]=quick[3]&&new RegExp("(?:^|\\s)"+quick[3]+"(?:\\s|$)");}return quick;},quickIs=function(elem,m){var attrs=elem.attributes||{};return((!m[1]||elem.nodeName.toLowerCase()===m[1])&&(!m[2]||(attrs.id||{}).value===m[2])&&(!m[3]||m[3].test((attrs["class"]||{}).value)));},hoverHack=function(events){return jQuery.event.special.hover?events:events.replace(
+rhoverHack,"mouseenter$1 mouseleave$1");};jQuery.event={add:function(elem,types,handler,data,selector){var elemData,eventHandle,events,t,tns,type,namespaces,handleObj,handleObjIn,quick,handlers,special;if(elem.nodeType===3||elem.nodeType===8||!types||!handler||!(elemData=jQuery._data(elem))){return;}if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;}if(!handler.guid){handler.guid=jQuery.guid++;}events=elemData.events;if(!events){elemData.events=events={};}eventHandle=elemData.handle;if(!eventHandle){elemData.handle=eventHandle=function(e){return typeof jQuery!=="undefined"&&(!e||jQuery.event.triggered!==e.type)?jQuery.event.dispatch.apply(eventHandle.elem,arguments):undefined;};eventHandle.elem=elem;}types=jQuery.trim(hoverHack(types)).split(" ");for(t=0;t<types.length;t++){tns=rtypenamespace.exec(types[t])||[];type=tns[1];namespaces=(tns[2]||"").split(".").sort();special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;
+special=jQuery.event.special[type]||{};handleObj=jQuery.extend({type:type,origType:tns[1],data:data,handler:handler,guid:handler.guid,selector:selector,quick:quickParse(selector),namespace:namespaces.join(".")},handleObjIn);handlers=events[type];if(!handlers){handlers=events[type]=[];handlers.delegateCount=0;if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle,false);}else if(elem.attachEvent){elem.attachEvent("on"+type,eventHandle);}}}if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid;}}if(selector){handlers.splice(handlers.delegateCount++,0,handleObj);}else{handlers.push(handleObj);}jQuery.event.global[type]=true;}elem=null;},global:{},remove:function(elem,types,handler,selector,mappedTypes){var elemData=jQuery.hasData(elem)&&jQuery._data(elem),t,tns,type,origType,namespaces,origCount,j,events,special,handle,eventType,handleObj;if(
+!elemData||!(events=elemData.events)){return;}types=jQuery.trim(hoverHack(types||"")).split(" ");for(t=0;t<types.length;t++){tns=rtypenamespace.exec(types[t])||[];type=origType=tns[1];namespaces=tns[2];if(!type){for(type in events){jQuery.event.remove(elem,type+types[t],handler,selector,true);}continue;}special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;eventType=events[type]||[];origCount=eventType.length;namespaces=namespaces?new RegExp("(^|\\.)"+namespaces.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(j=0;j<eventType.length;j++){handleObj=eventType[j];if((mappedTypes||origType===handleObj.origType)&&(!handler||handler.guid===handleObj.guid)&&(!namespaces||namespaces.test(handleObj.namespace))&&(!selector||selector===handleObj.selector||selector==="**"&&handleObj.selector)){eventType.splice(j--,1);if(handleObj.selector){eventType.delegateCount--;}if(special.remove){special.remove.call(elem,handleObj);}}}if(eventType.length
+===0&&origCount!==eventType.length){if(!special.teardown||special.teardown.call(elem,namespaces)===false){jQuery.removeEvent(elem,type,elemData.handle);}delete events[type];}}if(jQuery.isEmptyObject(events)){handle=elemData.handle;if(handle){handle.elem=null;}jQuery.removeData(elem,["events","handle"],true);}},customEvent:{"getData":true,"setData":true,"changeData":true},trigger:function(event,data,elem,onlyHandlers){if(elem&&(elem.nodeType===3||elem.nodeType===8)){return;}var type=event.type||event,namespaces=[],cache,exclusive,i,cur,old,ontype,special,handle,eventPath,bubbleType;if(rfocusMorph.test(type+jQuery.event.triggered)){return;}if(type.indexOf("!")>=0){type=type.slice(0,-1);exclusive=true;}if(type.indexOf(".")>=0){namespaces=type.split(".");type=namespaces.shift();namespaces.sort();}if((!elem||jQuery.event.customEvent[type])&&!jQuery.event.global[type]){return;}event=typeof event==="object"?event[jQuery.expando]?event:new jQuery.Event(type,event):new jQuery.Event(type);event.
+type=type;event.isTrigger=true;event.exclusive=exclusive;event.namespace=namespaces.join(".");event.namespace_re=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;ontype=type.indexOf(":")<0?"on"+type:"";if(!elem){cache=jQuery.cache;for(i in cache){if(cache[i].events&&cache[i].events[type]){jQuery.event.trigger(event,data,cache[i].handle.elem,true);}}return;}event.result=undefined;if(!event.target){event.target=elem;}data=data!=null?jQuery.makeArray(data):[];data.unshift(event);special=jQuery.event.special[type]||{};if(special.trigger&&special.trigger.apply(elem,data)===false){return;}eventPath=[[elem,special.bindType||type]];if(!onlyHandlers&&!special.noBubble&&!jQuery.isWindow(elem)){bubbleType=special.delegateType||type;cur=rfocusMorph.test(bubbleType+type)?elem:elem.parentNode;old=null;for(;cur;cur=cur.parentNode){eventPath.push([cur,bubbleType]);old=cur;}if(old&&old===elem.ownerDocument){eventPath.push([old.defaultView||old.parentWindow||window,
+bubbleType]);}}for(i=0;i<eventPath.length&&!event.isPropagationStopped();i++){cur=eventPath[i][0];event.type=eventPath[i][1];handle=(jQuery._data(cur,"events")||{})[event.type]&&jQuery._data(cur,"handle");if(handle){handle.apply(cur,data);}handle=ontype&&cur[ontype];if(handle&&jQuery.acceptData(cur)&&handle.apply(cur,data)===false){event.preventDefault();}}event.type=type;if(!onlyHandlers&&!event.isDefaultPrevented()){if((!special._default||special._default.apply(elem.ownerDocument,data)===false)&&!(type==="click"&&jQuery.nodeName(elem,"a"))&&jQuery.acceptData(elem)){if(ontype&&elem[type]&&((type!=="focus"&&type!=="blur")||event.target.offsetWidth!==0)&&!jQuery.isWindow(elem)){old=elem[ontype];if(old){elem[ontype]=null;}jQuery.event.triggered=type;elem[type]();jQuery.event.triggered=undefined;if(old){elem[ontype]=old;}}}}return event.result;},dispatch:function(event){event=jQuery.event.fix(event||window.event);var handlers=((jQuery._data(this,"events")||{})[event.type]||[]),
+delegateCount=handlers.delegateCount,args=[].slice.call(arguments,0),run_all=!event.exclusive&&!event.namespace,handlerQueue=[],i,j,cur,jqcur,ret,selMatch,matched,matches,handleObj,sel,related;args[0]=event;event.delegateTarget=this;if(delegateCount&&!event.target.disabled&&!(event.button&&event.type==="click")){jqcur=jQuery(this);jqcur.context=this.ownerDocument||this;for(cur=event.target;cur!=this;cur=cur.parentNode||this){selMatch={};matches=[];jqcur[0]=cur;for(i=0;i<delegateCount;i++){handleObj=handlers[i];sel=handleObj.selector;if(selMatch[sel]===undefined){selMatch[sel]=(handleObj.quick?quickIs(cur,handleObj.quick):jqcur.is(sel));}if(selMatch[sel]){matches.push(handleObj);}}if(matches.length){handlerQueue.push({elem:cur,matches:matches});}}}if(handlers.length>delegateCount){handlerQueue.push({elem:this,matches:handlers.slice(delegateCount)});}for(i=0;i<handlerQueue.length&&!event.isPropagationStopped();i++){matched=handlerQueue[i];event.currentTarget=matched.elem;for(j=0;j<
+matched.matches.length&&!event.isImmediatePropagationStopped();j++){handleObj=matched.matches[j];if(run_all||(!event.namespace&&!handleObj.namespace)||event.namespace_re&&event.namespace_re.test(handleObj.namespace)){event.data=handleObj.data;event.handleObj=handleObj;ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}}}return event.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(event,original){if(event.which==null){event.which=original.charCode!=null?original.charCode:original.keyCode;}return event;}},mouseHooks:{props:
+"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(event,original){var eventDoc,doc,body,button=original.button,fromElement=original.fromElement;if(event.pageX==null&&original.clientX!=null){eventDoc=event.target.ownerDocument||document;doc=eventDoc.documentElement;body=eventDoc.body;event.pageX=original.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=original.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0);}if(!event.relatedTarget&&fromElement){event.relatedTarget=fromElement===event.target?original.toElement:fromElement;}if(!event.which&&button!==undefined){event.which=(button&1?1:(button&2?3:(button&4?2:0)));}return event;}},fix:function(event){if(event[jQuery.expando]){return event;}var i,prop,originalEvent=event,fixHook=jQuery.event.fixHooks[event.type]||{},copy=fixHook.props?this.props.
+concat(fixHook.props):this.props;event=jQuery.Event(originalEvent);for(i=copy.length;i;){prop=copy[--i];event[prop]=originalEvent[prop];}if(!event.target){event.target=originalEvent.srcElement||document;}if(event.target.nodeType===3){event.target=event.target.parentNode;}if(event.metaKey===undefined){event.metaKey=event.ctrlKey;}return fixHook.filter?fixHook.filter(event,originalEvent):event;},special:{ready:{setup:jQuery.bindReady},load:{noBubble:true},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(data,namespaces,eventHandle){if(jQuery.isWindow(this)){this.onbeforeunload=eventHandle;}},teardown:function(namespaces,eventHandle){if(this.onbeforeunload===eventHandle){this.onbeforeunload=null;}}}},simulate:function(type,elem,event,bubble){var e=jQuery.extend(new jQuery.Event(),event,{type:type,isSimulated:true,originalEvent:{}});if(bubble){jQuery.event.trigger(e,null,elem);}else{jQuery.event.dispatch.call(elem,e);}if(e.isDefaultPrevented()){
+event.preventDefault();}}};jQuery.event.handle=jQuery.event.dispatch;jQuery.removeEvent=document.removeEventListener?function(elem,type,handle){if(elem.removeEventListener){elem.removeEventListener(type,handle,false);}}:function(elem,type,handle){if(elem.detachEvent){elem.detachEvent("on"+type,handle);}};jQuery.Event=function(src,props){if(!(this instanceof jQuery.Event)){return new jQuery.Event(src,props);}if(src&&src.type){this.originalEvent=src;this.type=src.type;this.isDefaultPrevented=(src.defaultPrevented||src.returnValue===false||src.getPreventDefault&&src.getPreventDefault())?returnTrue:returnFalse;}else{this.type=src;}if(props){jQuery.extend(this,props);}this.timeStamp=src&&src.timeStamp||jQuery.now();this[jQuery.expando]=true;};function returnFalse(){return false;}function returnTrue(){return true;}jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e){return;}if(e.preventDefault){e.preventDefault();}else{e.
+returnValue=false;}},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e){return;}if(e.stopPropagation){e.stopPropagation();}e.cancelBubble=true;},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation();},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(orig,fix){jQuery.event.special[orig]={delegateType:fix,bindType:fix,handle:function(event){var target=this,related=event.relatedTarget,handleObj=event.handleObj,selector=handleObj.selector,ret;if(!related||(related!==target&&!jQuery.contains(target,related))){event.type=handleObj.origType;ret=handleObj.handler.apply(this,arguments);event.type=fix;}return ret;}};});if(!jQuery.support.submitBubbles){jQuery.event.special.submit={setup:function(){if(jQuery.nodeName(this,"form")){return false;}jQuery.event.add(this,
+"click._submit keypress._submit",function(e){var elem=e.target,form=jQuery.nodeName(elem,"input")||jQuery.nodeName(elem,"button")?elem.form:undefined;if(form&&!form._submit_attached){jQuery.event.add(form,"submit._submit",function(event){if(this.parentNode&&!event.isTrigger){jQuery.event.simulate("submit",this.parentNode,event,true);}});form._submit_attached=true;}});},teardown:function(){if(jQuery.nodeName(this,"form")){return false;}jQuery.event.remove(this,"._submit");}};}if(!jQuery.support.changeBubbles){jQuery.event.special.change={setup:function(){if(rformElems.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio"){jQuery.event.add(this,"propertychange._change",function(event){if(event.originalEvent.propertyName==="checked"){this._just_changed=true;}});jQuery.event.add(this,"click._change",function(event){if(this._just_changed&&!event.isTrigger){this._just_changed=false;jQuery.event.simulate("change",this,event,true);}});}return false;}jQuery.event.add(this,
+"beforeactivate._change",function(e){var elem=e.target;if(rformElems.test(elem.nodeName)&&!elem._change_attached){jQuery.event.add(elem,"change._change",function(event){if(this.parentNode&&!event.isSimulated&&!event.isTrigger){jQuery.event.simulate("change",this.parentNode,event,true);}});elem._change_attached=true;}});},handle:function(event){var elem=event.target;if(this!==elem||event.isSimulated||event.isTrigger||(elem.type!=="radio"&&elem.type!=="checkbox")){return event.handleObj.handler.apply(this,arguments);}},teardown:function(){jQuery.event.remove(this,"._change");return rformElems.test(this.nodeName);}};}if(!jQuery.support.focusinBubbles){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){var attaches=0,handler=function(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event),true);};jQuery.event.special[fix]={setup:function(){if(attaches++===0){document.addEventListener(orig,handler,true);}},teardown:function(){if(--attaches===0){document.
+removeEventListener(orig,handler,true);}}};});}jQuery.fn.extend({on:function(types,selector,data,fn,one){var origFn,type;if(typeof types==="object"){if(typeof selector!=="string"){data=selector;selector=undefined;}for(type in types){this.on(type,selector,data,types[type],one);}return this;}if(data==null&&fn==null){fn=selector;data=selector=undefined;}else if(fn==null){if(typeof selector==="string"){fn=data;data=undefined;}else{fn=data;data=selector;selector=undefined;}}if(fn===false){fn=returnFalse;}else if(!fn){return this;}if(one===1){origFn=fn;fn=function(event){jQuery().off(event);return origFn.apply(this,arguments);};fn.guid=origFn.guid||(origFn.guid=jQuery.guid++);}return this.each(function(){jQuery.event.add(this,types,fn,data,selector);});},one:function(types,selector,data,fn){return this.on.call(this,types,selector,data,fn,1);},off:function(types,selector,fn){if(types&&types.preventDefault&&types.handleObj){var handleObj=types.handleObj;jQuery(types.delegateTarget).off(
+handleObj.namespace?handleObj.type+"."+handleObj.namespace:handleObj.type,handleObj.selector,handleObj.handler);return this;}if(typeof types==="object"){for(var type in types){this.off(type,selector,types[type]);}return this;}if(selector===false||typeof selector==="function"){fn=selector;selector=undefined;}if(fn===false){fn=returnFalse;}return this.each(function(){jQuery.event.remove(this,types,fn,selector);});},bind:function(types,data,fn){return this.on(types,null,data,fn);},unbind:function(types,fn){return this.off(types,null,fn);},live:function(types,data,fn){jQuery(this.context).on(types,this.selector,data,fn);return this;},die:function(types,fn){jQuery(this.context).off(types,this.selector||"**",fn);return this;},delegate:function(selector,types,data,fn){return this.on(types,selector,data,fn);},undelegate:function(selector,types,fn){return arguments.length==1?this.off(selector,"**"):this.off(types,selector,fn);},trigger:function(type,data){return this.each(function(){jQuery.
+event.trigger(type,data,this);});},triggerHandler:function(type,data){if(this[0]){return jQuery.event.trigger(type,data,this[0],true);}},toggle:function(fn){var args=arguments,guid=fn.guid||jQuery.guid++,i=0,toggler=function(event){var lastToggle=(jQuery._data(this,"lastToggle"+fn.guid)||0)%i;jQuery._data(this,"lastToggle"+fn.guid,lastToggle+1);event.preventDefault();return args[lastToggle].apply(this,arguments)||false;};toggler.guid=guid;while(i<args.length){args[i++].guid=guid;}return this.click(toggler);},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver);}});jQuery.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(i,name){jQuery.fn[name]=function(data,fn){if(fn==null){fn=data;data=null;}return arguments.length>0?this.on(name,null,data,fn):this.trigger(name);};if(
+jQuery.attrFn){jQuery.attrFn[name]=true;}if(rkeyEvent.test(name)){jQuery.event.fixHooks[name]=jQuery.event.keyHooks;}if(rmouseEvent.test(name)){jQuery.event.fixHooks[name]=jQuery.event.mouseHooks;}});(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,expando="sizcache"+(Math.random()+'').replace('.',''),done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true,rBackslash=/\\/g,rReturn=/\r\n/g,rNonWord=/\W/;[0,0].sort(function(){baseHasDuplicate=false;return 0;});var Sizzle=function(selector,context,results,seed){results=results||[];context=context||document;var origContext=context;if(context.nodeType!==1&&context.nodeType!==9){return[];}if(!selector||typeof selector!=="string"){return results;}var m,set,checkSet,extra,ret,cur,pop,i,prune=true,contextXML=Sizzle.isXML(context),parts=[],soFar=selector;do{chunker.exec("");m=chunker.exec(soFar);if(m){soFar=m[3]
+;parts.push(m[1]);if(m[2]){extra=m[3];break;}}}while(m);if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context,seed);}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector]){selector+=parts.shift();}set=posProcess(selector,set,seed);}}}else{if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length-1])){ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0];}if(context){ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Sizzle.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set);}else{prune=false;}while(parts.length){cur=parts.pop();
+pop=cur;if(!Expr.relative[cur]){cur="";}else{pop=parts.pop();}if(pop==null){pop=context;}Expr.relative[cur](checkSet,pop,contextXML);}}else{checkSet=parts=[];}}if(!checkSet){checkSet=set;}if(!checkSet){Sizzle.error(cur||selector);}if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet);}else if(context&&context.nodeType===1){for(i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&Sizzle.contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i]);}}}}else{makeArray(checkSet,results);}if(extra){Sizzle(extra,origContext,results,seed);Sizzle.uniqueSort(results);}return results;};Sizzle.uniqueSort=function(results){if(sortOrder){hasDuplicate=baseHasDuplicate;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1);}}}}return results;};Sizzle.matches=
+function(expr,set){return Sizzle(expr,null,null,set);};Sizzle.matchesSelector=function(node,expr){return Sizzle(expr,null,null,[node]).length>0;};Sizzle.find=function(expr,context,isXML){var set,i,len,match,type,left;if(!expr){return[];}for(i=0,len=Expr.order.length;i<len;i++){type=Expr.order[i];if((match=Expr.leftMatch[type].exec(expr))){left=match[1];match.splice(1,1);if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(rBackslash,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break;}}}}if(!set){set=typeof context.getElementsByTagName!=="undefined"?context.getElementsByTagName("*"):[];}return{set:set,expr:expr};};Sizzle.filter=function(expr,set,inplace,not){var match,anyFound,type,found,item,filter,left,i,pass,old=expr,result=[],curLoop=set,isXMLFilter=set&&set[0]&&Sizzle.isXML(set[0]);while(expr&&set.length){for(type in Expr.filter){if((match=Expr.leftMatch[type].exec(expr))!=null&&match[2]){filter=Expr.filter[type]
+;left=match[1];anyFound=false;match.splice(1,1);if(left.substr(left.length-1)==="\\"){continue;}if(curLoop===result){result=[];}if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true;}else if(match===true){continue;}}if(match){for(i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);pass=not^found;if(inplace&&found!=null){if(pass){anyFound=true;}else{curLoop[i]=false;}}else if(pass){result.push(item);anyFound=true;}}}}if(found!==undefined){if(!inplace){curLoop=result;}expr=expr.replace(Expr.match[type],"");if(!anyFound){return[];}break;}}}if(expr===old){if(anyFound==null){Sizzle.error(expr);}else{break;}}old=expr;}return curLoop;};Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg);};var getText=Sizzle.getText=function(elem){var i,node,nodeType=elem.nodeType,ret="";if(nodeType){if(nodeType===1||nodeType===9){if(typeof elem.textContent==='string'){
+return elem.textContent;}else if(typeof elem.innerText==='string'){return elem.innerText.replace(rReturn,'');}else{for(elem=elem.firstChild;elem;elem=elem.nextSibling){ret+=getText(elem);}}}else if(nodeType===3||nodeType===4){return elem.nodeValue;}}else{for(i=0;(node=elem[i]);i++){if(node.nodeType!==8){ret+=getText(node);}}}return ret;};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className",
+"for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href");},type:function(elem){return elem.getAttribute("type");}},relative:{"+":function(checkSet,part){var isPartStr=typeof part==="string",isTag=isPartStr&&!rNonWord.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag){part=part.toLowerCase();}for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}checkSet[i]=isPartStrNotTag||elem&&elem.nodeName.toLowerCase()===part?elem||false:elem===part;}}if(isPartStrNotTag){Sizzle.filter(part,checkSet,true);}},">":function(checkSet,part){var elem,isPartStr=typeof part==="string",i=0,l=checkSet.length;if(isPartStr&&!rNonWord.test(part)){part=part.toLowerCase();for(;i<l;i++){elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName.toLowerCase()===part?parent:false;}}}else{for(;i<l;i++){elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part;}}if(
+isPartStr){Sizzle.filter(part,checkSet,true);}}},"":function(checkSet,part,isXML){var nodeCheck,doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!rNonWord.test(part)){part=part.toLowerCase();nodeCheck=part;checkFn=dirNodeCheck;}checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML);},"~":function(checkSet,part,isXML){var nodeCheck,doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!rNonWord.test(part)){part=part.toLowerCase();nodeCheck=part;checkFn=dirNodeCheck;}checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML);}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m&&m.parentNode?[m]:[];}},NAME:function(match,context){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i]);}}return ret.length===0?null:
+ret;}},TAG:function(match,context){if(typeof context.getElementsByTagName!=="undefined"){return context.getElementsByTagName(match[1]);}}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(rBackslash,"")+" ";if(isXML){return match;}for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").replace(/[\t\n\r]/g," ").indexOf(match)>=0)){if(!inplace){result.push(elem);}}else if(inplace){curLoop[i]=false;}}}return false;},ID:function(match){return match[1].replace(rBackslash,"");},TAG:function(match,curLoop){return match[1].replace(rBackslash,"").toLowerCase();},CHILD:function(match){if(match[1]==="nth"){if(!match[2]){Sizzle.error(match[0]);}match[2]=match[2].replace(/^\+|\s*/g,'');var test=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(match[2]==="even"&&"2n"||match[2]==="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0;}else if(match[2]){Sizzle.error
+(match[0]);}match[0]=done++;return match;},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1]=match[1].replace(rBackslash,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name];}match[4]=(match[4]||match[5]||"").replace(rBackslash,"");if(match[2]==="~="){match[4]=" "+match[4]+" ";}return match;},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if((chunker.exec(match[3])||"").length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop);}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret);}return false;}}else if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true;}return match;},POS:function(match){match.unshift(true);return match;}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden";},disabled:function(elem){return elem.disabled===true;},checked:function(elem){return elem.checked===true;},selected:function(elem){if
+(elem.parentNode){elem.parentNode.selectedIndex;}return elem.selected===true;},parent:function(elem){return!!elem.firstChild;},empty:function(elem){return!elem.firstChild;},has:function(elem,i,match){return!!Sizzle(match[3],elem).length;},header:function(elem){return(/h\d/i).test(elem.nodeName);},text:function(elem){var attr=elem.getAttribute("type"),type=elem.type;return elem.nodeName.toLowerCase()==="input"&&"text"===type&&(attr===type||attr===null);},radio:function(elem){return elem.nodeName.toLowerCase()==="input"&&"radio"===elem.type;},checkbox:function(elem){return elem.nodeName.toLowerCase()==="input"&&"checkbox"===elem.type;},file:function(elem){return elem.nodeName.toLowerCase()==="input"&&"file"===elem.type;},password:function(elem){return elem.nodeName.toLowerCase()==="input"&&"password"===elem.type;},submit:function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&"submit"===elem.type;},image:function(elem){return elem.nodeName.toLowerCase
+()==="input"&&"image"===elem.type;},reset:function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&"reset"===elem.type;},button:function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&"button"===elem.type||name==="button";},input:function(elem){return(/input|select|textarea|button/i).test(elem.nodeName);},focus:function(elem){return elem===elem.ownerDocument.activeElement;}},setFilters:{first:function(elem,i){return i===0;},last:function(elem,i,match,array){return i===array.length-1;},even:function(elem,i){return i%2===0;},odd:function(elem,i){return i%2===1;},lt:function(elem,i,match){return i<match[3]-0;},gt:function(elem,i,match){return i>match[3]-0;},nth:function(elem,i,match){return match[3]-0===i;},eq:function(elem,i,match){return match[3]-0===i;}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array);}else if(name==="contains"){return(elem.
+textContent||elem.innerText||getText([elem])||"").indexOf(match[3])>=0;}else if(name==="not"){var not=match[3];for(var j=0,l=not.length;j<l;j++){if(not[j]===elem){return false;}}return true;}else{Sizzle.error(name);}},CHILD:function(elem,match){var first,last,doneName,parent,cache,count,diff,type=match[1],node=elem;switch(type){case"only":case"first":while((node=node.previousSibling)){if(node.nodeType===1){return false;}}if(type==="first"){return true;}node=elem;case"last":while((node=node.nextSibling)){if(node.nodeType===1){return false;}}return true;case"nth":first=match[2];last=match[3];if(first===1&&last===0){return true;}doneName=match[0];parent=elem.parentNode;if(parent&&(parent[expando]!==doneName||!elem.nodeIndex)){count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count;}}parent[expando]=doneName;}diff=elem.nodeIndex-last;if(first===0){return diff===0;}else{return(diff%first===0&&diff/first>=0);}}},ID:function(elem,match){
+return elem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||!!elem.nodeName&&elem.nodeName.toLowerCase()===match;},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1;},ATTR:function(elem,match){var name=match[1],result=Sizzle.attr?Sizzle.attr(elem,name):Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":!type&&Sizzle.attr?result!=null:type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!==check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false;},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name
+];if(filter){return filter(elem,i,match,array);}}}};var origPOS=Expr.match.POS,fescape=function(all,num){return"\\"+(num-0+1);};for(var type in Expr.match){Expr.match[type]=new RegExp(Expr.match[type].source+(/(?![^\[]*\])(?![^\(]*\))/.source));Expr.leftMatch[type]=new RegExp(/(^(?:.|\r|\n)*?)/.source+Expr.match[type].source.replace(/\\(\d+)/g,fescape));}var makeArray=function(array,results){array=Array.prototype.slice.call(array,0);if(results){results.push.apply(results,array);return results;}return array;};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType;}catch(e){makeArray=function(array,results){var i=0,ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array);}else{if(typeof array.length==="number"){for(var l=array.length;i<l;i++){ret.push(array[i]);}}else{for(;array[i];i++){ret.push(array[i]);}}}return ret;};}var sortOrder,siblingCheck;if(document.documentElement.compareDocumentPosition){sortOrder=function(a
+,b){if(a===b){hasDuplicate=true;return 0;}if(!a.compareDocumentPosition||!b.compareDocumentPosition){return a.compareDocumentPosition?-1:1;}return a.compareDocumentPosition(b)&4?-1:1;};}else{sortOrder=function(a,b){if(a===b){hasDuplicate=true;return 0;}else if(a.sourceIndex&&b.sourceIndex){return a.sourceIndex-b.sourceIndex;}var al,bl,ap=[],bp=[],aup=a.parentNode,bup=b.parentNode,cur=aup;if(aup===bup){return siblingCheck(a,b);}else if(!aup){return-1;}else if(!bup){return 1;}while(cur){ap.unshift(cur);cur=cur.parentNode;}cur=bup;while(cur){bp.unshift(cur);cur=cur.parentNode;}al=ap.length;bl=bp.length;for(var i=0;i<al&&i<bl;i++){if(ap[i]!==bp[i]){return siblingCheck(ap[i],bp[i]);}}return i===al?siblingCheck(a,bp[i],-1):siblingCheck(ap[i],b,1);};siblingCheck=function(a,b,ret){if(a===b){return ret;}var cur=a.nextSibling;while(cur){if(cur===b){return-1;}cur=cur.nextSibling;}return 1;};}(function(){var form=document.createElement("div"),id="script"+(new Date()).getTime(),root=document.
+documentElement;form.innerHTML="<a name='"+id+"'/>";root.insertBefore(form,root.firstChild);if(document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[];}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match;};}root.removeChild(form);root=form=null;})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i]);}}results=tmp;}return results;};}div.innerHTML=
+"<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2);};}div=null;})();if(document.querySelectorAll){(function(){var oldSizzle=Sizzle,div=document.createElement("div"),id="__sizzle__";div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;}Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&!Sizzle.isXML(context)){var match=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(query);if(match&&(context.nodeType===1||context.nodeType===9)){if(match[1]){return makeArray(context.getElementsByTagName(query),extra);}else if(match[2]&&Expr.find.CLASS&&context.getElementsByClassName){return makeArray(context.getElementsByClassName(match[2]),extra);}}if(context.nodeType===9){if(query==="body"&&context.body){return makeArray([context.body],extra);}else if(match&&match[3]){var elem
+=context.getElementById(match[3]);if(elem&&elem.parentNode){if(elem.id===match[3]){return makeArray([elem],extra);}}else{return makeArray([],extra);}}try{return makeArray(context.querySelectorAll(query),extra);}catch(qsaError){}}else if(context.nodeType===1&&context.nodeName.toLowerCase()!=="object"){var oldContext=context,old=context.getAttribute("id"),nid=old||id,hasParent=context.parentNode,relativeHierarchySelector=/^\s*[+~]/.test(query);if(!old){context.setAttribute("id",nid);}else{nid=nid.replace(/'/g,"\\$&");}if(relativeHierarchySelector&&hasParent){context=context.parentNode;}try{if(!relativeHierarchySelector||hasParent){return makeArray(context.querySelectorAll("[id='"+nid+"'] "+query),extra);}}catch(pseudoError){}finally{if(!old){oldContext.removeAttribute("id");}}}}return oldSizzle(query,context,extra,seed);};for(var prop in oldSizzle){Sizzle[prop]=oldSizzle[prop];}div=null;})();}(function(){var html=document.documentElement,matches=html.matchesSelector||html.
+mozMatchesSelector||html.webkitMatchesSelector||html.msMatchesSelector;if(matches){var disconnectedMatch=!matches.call(document.createElement("div"),"div"),pseudoWorks=false;try{matches.call(document.documentElement,"[test!='']:sizzle");}catch(pseudoError){pseudoWorks=true;}Sizzle.matchesSelector=function(node,expr){expr=expr.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!Sizzle.isXML(node)){try{if(pseudoWorks||!Expr.match.PSEUDO.test(expr)&&!/!=/.test(expr)){var ret=matches.call(node,expr);if(ret||!disconnectedMatch||node.document&&node.document.nodeType!==11){return ret;}}}catch(e){}}return Sizzle(expr,null,null,[node]).length>0;};}})();(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(!div.getElementsByClassName||div.getElementsByClassName("e").length===0){return;}div.lastChild.className="e";if(div.getElementsByClassName("e").length===1){return;}Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,
+isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1]);}};div=null;})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var match=false;elem=elem[dir];while(elem){if(elem[expando]===doneName){match=checkSet[elem.sizset];break;}if(elem.nodeType===1&&!isXML){elem[expando]=doneName;elem.sizset=i;}if(elem.nodeName.toLowerCase()===cur){match=elem;break;}elem=elem[dir];}checkSet[i]=match;}}}function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var match=false;elem=elem[dir];while(elem){if(elem[expando]===doneName){match=checkSet[elem.sizset];break;}if(elem.nodeType===1){if(!isXML){elem[expando]=doneName;elem.sizset=i;}if(typeof cur!=="string"){if(elem===cur){match=true;break;}}else if(Sizzle.filter(cur,[elem]).length>0){match=elem;break;}}elem=elem[dir];}checkSet[i]=
+match;}}}if(document.documentElement.contains){Sizzle.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):true);};}else if(document.documentElement.compareDocumentPosition){Sizzle.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16);};}else{Sizzle.contains=function(){return false;};}Sizzle.isXML=function(elem){var documentElement=(elem?elem.ownerDocument||elem:0).documentElement;return documentElement?documentElement.nodeName!=="HTML":false;};var posProcess=function(selector,context,seed){var match,tmpSet=[],later="",root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"");}selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet,seed);}return Sizzle.filter(later,tmpSet);};Sizzle.attr=jQuery.attr;Sizzle.selectors.attrMap={};jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters
+;jQuery.unique=Sizzle.uniqueSort;jQuery.text=Sizzle.getText;jQuery.isXMLDoc=Sizzle.isXML;jQuery.contains=Sizzle.contains;})();var runtil=/Until$/,rparentsprev=/^(?:parents|prevUntil|prevAll)/,rmultiselector=/,/,isSimple=/^.[^:#\[\.,]*$/,slice=Array.prototype.slice,POS=jQuery.expr.match.POS,guaranteedUnique={children:true,contents:true,next:true,prev:true};jQuery.fn.extend({find:function(selector){var self=this,i,l;if(typeof selector!=="string"){return jQuery(selector).filter(function(){for(i=0,l=self.length;i<l;i++){if(jQuery.contains(self[i],this)){return true;}}});}var ret=this.pushStack("","find",selector),length,n,r;for(i=0,l=this.length;i<l;i++){length=ret.length;jQuery.find(selector,this[i],ret);if(i>0){for(n=length;n<ret.length;n++){for(r=0;r<length;r++){if(ret[r]===ret[n]){ret.splice(n--,1);break;}}}}}return ret;},has:function(target){var targets=jQuery(target);return this.filter(function(){for(var i=0,l=targets.length;i<l;i++){if(jQuery.contains(this,targets[i])){return true;}
+}});},not:function(selector){return this.pushStack(winnow(this,selector,false),"not",selector);},filter:function(selector){return this.pushStack(winnow(this,selector,true),"filter",selector);},is:function(selector){return!!selector&&(typeof selector==="string"?POS.test(selector)?jQuery(selector,this.context).index(this[0])>=0:jQuery.filter(selector,this).length>0:this.filter(selector).length>0);},closest:function(selectors,context){var ret=[],i,l,cur=this[0];if(jQuery.isArray(selectors)){var level=1;while(cur&&cur.ownerDocument&&cur!==context){for(i=0;i<selectors.length;i++){if(jQuery(cur).is(selectors[i])){ret.push({selector:selectors[i],elem:cur,level:level});}}cur=cur.parentNode;level++;}return ret;}var pos=POS.test(selectors)||typeof selectors!=="string"?jQuery(selectors,context||this.context):0;for(i=0,l=this.length;i<l;i++){cur=this[i];while(cur){if(pos?pos.index(cur)>-1:jQuery.find.matchesSelector(cur,selectors)){ret.push(cur);break;}else{cur=cur.parentNode;if(!cur||!cur.
+ownerDocument||cur===context||cur.nodeType===11){break;}}}}ret=ret.length>1?jQuery.unique(ret):ret;return this.pushStack(ret,"closest",selectors);},index:function(elem){if(!elem){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1;}if(typeof elem==="string"){return jQuery.inArray(this[0],jQuery(elem));}return jQuery.inArray(elem.jquery?elem[0]:elem,this);},add:function(selector,context){var set=typeof selector==="string"?jQuery(selector,context):jQuery.makeArray(selector&&selector.nodeType?[selector]:selector),all=jQuery.merge(this.get(),set);return this.pushStack(isDisconnected(set[0])||isDisconnected(all[0])?all:jQuery.unique(all));},andSelf:function(){return this.add(this.prevObject);}});function isDisconnected(node){return!node||!node.parentNode||node.parentNode.nodeType===11;}jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null;},parents:function(elem){return jQuery.dir(elem,"parentNode");},parentsUntil:function(
+elem,i,until){return jQuery.dir(elem,"parentNode",until);},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},nextUntil:function(elem,i,until){return jQuery.dir(elem,"nextSibling",until);},prevUntil:function(elem,i,until){return jQuery.dir(elem,"previousSibling",until);},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);if(!runtil.test(name)){selector=until;}if(selector&&typeof selector==="string"){ret=jQuery.filter(selector,ret);}ret=this.length>1&&!
+guaranteedUnique[name]?jQuery.unique(ret):ret;if((this.length>1||rmultiselector.test(selector))&&rparentsprev.test(name)){ret=ret.reverse();}return this.pushStack(ret,name,slice.call(arguments).join(","));};});jQuery.extend({filter:function(expr,elems,not){if(not){expr=":not("+expr+")";}return elems.length===1?jQuery.find.matchesSelector(elems[0],expr)?[elems[0]]:[]:jQuery.find.matches(expr,elems);},dir:function(elem,dir,until){var matched=[],cur=elem[dir];while(cur&&cur.nodeType!==9&&(until===undefined||cur.nodeType!==1||!jQuery(cur).is(until))){if(cur.nodeType===1){matched.push(cur);}cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType===1&&++num===result){break;}}return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){r.push(n);}}return r;}});function winnow(elements,qualifier,keep){qualifier=qualifier||0;if(jQuery.isFunction(qualifier)){return jQuery.grep(
+elements,function(elem,i){var retVal=!!qualifier.call(elem,i,elem);return retVal===keep;});}else if(qualifier.nodeType){return jQuery.grep(elements,function(elem,i){return(elem===qualifier)===keep;});}else if(typeof qualifier==="string"){var filtered=jQuery.grep(elements,function(elem){return elem.nodeType===1;});if(isSimple.test(qualifier)){return jQuery.filter(qualifier,filtered,!keep);}else{qualifier=jQuery.filter(qualifier,filtered);}}return jQuery.grep(elements,function(elem,i){return(jQuery.inArray(elem,qualifier)>=0)===keep;});}function createSafeFragment(document){var list=nodeNames.split("|"),safeFrag=document.createDocumentFragment();if(safeFrag.createElement){while(list.length){safeFrag.createElement(list.pop());}}return safeFrag;}var nodeNames="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|"+"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",rinlinejQuery=/ jQuery\d+="(?:\d+|null)"/g,rleadingWhitespace=/^\s+/,rxhtmlTag=
+/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,rtagName=/<([\w:]+)/,rtbody=/<tbody/i,rhtml=/<|&#?\w+;/,rnoInnerhtml=/<(?:script|style)/i,rnocache=/<(?:script|object|embed|option|style)/i,rnoshimcache=new RegExp("<(?:"+nodeNames+")","i"),rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rscriptType=/\/(java|ecma)script/i,rcleanScript=/^\s*<!(?:\[CDATA\[|\-\-)/,wrapMap={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,"",""]},safeFragment=createSafeFragment(document);wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;if(!jQuery.support.htmlSerialize){wrapMap._default=[1,"div<div>","</div>"];}jQuery.fn.extend({text:function
+(text){if(jQuery.isFunction(text)){return this.each(function(i){var self=jQuery(this);self.text(text.call(this,i,self.text()));});}if(typeof text!=="object"&&text!==undefined){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));}return jQuery.text(this);},wrapAll:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i));});}if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0]);}wrap.map(function(){var elem=this;while(elem.firstChild&&elem.firstChild.nodeType===1){elem=elem.firstChild;}return elem;}).append(this);}return this;},wrapInner:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i));});}return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html);}else{self.append(html);}});},wrap:function(html){var
+isFunction=jQuery.isFunction(html);return this.each(function(i){jQuery(this).wrapAll(isFunction?html.call(this,i):html);});},unwrap:function(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes);}}).end();},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.appendChild(elem);}});},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.insertBefore(elem,this.firstChild);}});},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this);});}else if(arguments.length){var set=jQuery.clean(arguments);set.push.apply(set,this.toArray());return this.pushStack(set,"before",arguments);}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});}else if(arguments.length){var
+set=this.pushStack(this,"after",arguments);set.push.apply(set,jQuery.clean(arguments));return set;}},remove:function(selector,keepData){for(var i=0,elem;(elem=this[i])!=null;i++){if(!selector||jQuery.filter(selector,[elem]).length){if(!keepData&&elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"));jQuery.cleanData([elem]);}if(elem.parentNode){elem.parentNode.removeChild(elem);}}}return this;},empty:function(){for(var i=0,elem;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"));}while(elem.firstChild){elem.removeChild(elem.firstChild);}}return this;},clone:function(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?false:dataAndEvents;deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents);});},html:function(value){if(value===undefined){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(
+rinlinejQuery,""):null;}else if(typeof value==="string"&&!rnoInnerhtml.test(value)&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,"<$1></$2>");try{for(var i=0,l=this.length;i<l;i++){if(this[i].nodeType===1){jQuery.cleanData(this[i].getElementsByTagName("*"));this[i].innerHTML=value;}}}catch(e){this.empty().append(value);}}else if(jQuery.isFunction(value)){this.each(function(i){var self=jQuery(this);self.html(value.call(this,i,self.html()));});}else{this.empty().append(value);}return this;},replaceWith:function(value){if(this[0]&&this[0].parentNode){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this),old=self.html();self.replaceWith(value.call(this,i,old));});}if(typeof value!=="string"){value=jQuery(value).detach();}return this.each(function(){var next=this.nextSibling,parent=this.parentNode;jQuery(this).remove();if(next){jQuery(next).before(value
+);}else{jQuery(parent).append(value);}});}else{return this.length?this.pushStack(jQuery(jQuery.isFunction(value)?value():value),"replaceWith",value):this;}},detach:function(selector){return this.remove(selector,true);},domManip:function(args,table,callback){var results,first,fragment,parent,value=args[0],scripts=[];if(!jQuery.support.checkClone&&arguments.length===3&&typeof value==="string"&&rchecked.test(value)){return this.each(function(){jQuery(this).domManip(args,table,callback,true);});}if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);args[0]=value.call(this,i,table?self.html():undefined);self.domManip(args,table,callback);});}if(this[0]){parent=value&&value.parentNode;if(jQuery.support.parentNode&&parent&&parent.nodeType===11&&parent.childNodes.length===this.length){results={fragment:parent};}else{results=jQuery.buildFragment(args,this,scripts);}fragment=results.fragment;if(fragment.childNodes.length===1){first=fragment=fragment.firstChild;}else{
+first=fragment.firstChild;}if(first){table=table&&jQuery.nodeName(first,"tr");for(var i=0,l=this.length,lastIndex=l-1;i<l;i++){callback.call(table?root(this[i],first):this[i],results.cacheable||(l>1&&i<lastIndex)?jQuery.clone(fragment,true,true):fragment);}}if(scripts.length){jQuery.each(scripts,evalScript);}}return this;}});function root(elem,cur){return jQuery.nodeName(elem,"table")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem;}function cloneCopyEvent(src,dest){if(dest.nodeType!==1||!jQuery.hasData(src)){return;}var type,i,l,oldData=jQuery._data(src),curData=jQuery._data(dest,oldData),events=oldData.events;if(events){delete curData.handle;curData.events={};for(type in events){for(i=0,l=events[type].length;i<l;i++){jQuery.event.add(dest,type+(events[type][i].namespace?".":"")+events[type][i].namespace,events[type][i],events[type][i].data);}}}if(curData.data){curData.data=jQuery.extend({},curData.data);}}function
+cloneFixAttributes(src,dest){var nodeName;if(dest.nodeType!==1){return;}if(dest.clearAttributes){dest.clearAttributes();}if(dest.mergeAttributes){dest.mergeAttributes(src);}nodeName=dest.nodeName.toLowerCase();if(nodeName==="object"){dest.outerHTML=src.outerHTML;}else if(nodeName==="input"&&(src.type==="checkbox"||src.type==="radio")){if(src.checked){dest.defaultChecked=dest.checked=src.checked;}if(dest.value!==src.value){dest.value=src.value;}}else if(nodeName==="option"){dest.selected=src.defaultSelected;}else if(nodeName==="input"||nodeName==="textarea"){dest.defaultValue=src.defaultValue;}dest.removeAttribute(jQuery.expando);}jQuery.buildFragment=function(args,nodes,scripts){var fragment,cacheable,cacheresults,doc,first=args[0];if(nodes&&nodes[0]){doc=nodes[0].ownerDocument||nodes[0];}if(!doc.createDocumentFragment){doc=document;}if(args.length===1&&typeof first==="string"&&first.length<512&&doc===document&&first.charAt(0)==="<"&&!rnocache.test(first)&&(jQuery.support.checkClone||!
+rchecked.test(first))&&(jQuery.support.html5Clone||!rnoshimcache.test(first))){cacheable=true;cacheresults=jQuery.fragments[first];if(cacheresults&&cacheresults!==1){fragment=cacheresults;}}if(!fragment){fragment=doc.createDocumentFragment();jQuery.clean(args,doc,fragment,scripts);}if(cacheable){jQuery.fragments[first]=cacheresults?fragment:1;}return{fragment:fragment,cacheable:cacheable};};jQuery.fragments={};jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector),parent=this.length===1&&this[0].parentNode;if(parent&&parent.nodeType===11&&parent.childNodes.length===1&&insert.length===1){insert[original](this[0]);return this;}else{for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery(insert[i])[original](elems);ret=ret.concat(elems);}return this.pushStack(ret,name,insert.selector);}};});function
+getAll(elem){if(typeof elem.getElementsByTagName!=="undefined"){return elem.getElementsByTagName("*");}else if(typeof elem.querySelectorAll!=="undefined"){return elem.querySelectorAll("*");}else{return[];}}function fixDefaultChecked(elem){if(elem.type==="checkbox"||elem.type==="radio"){elem.defaultChecked=elem.checked;}}function findInputs(elem){var nodeName=(elem.nodeName||"").toLowerCase();if(nodeName==="input"){fixDefaultChecked(elem);}else if(nodeName!=="script"&&typeof elem.getElementsByTagName!=="undefined"){jQuery.grep(elem.getElementsByTagName("input"),fixDefaultChecked);}}function shimCloneNode(elem){var div=document.createElement("div");safeFragment.appendChild(div);div.innerHTML=elem.outerHTML;return div.firstChild;}jQuery.extend({clone:function(elem,dataAndEvents,deepDataAndEvents){var srcElements,destElements,i,clone=jQuery.support.html5Clone||!rnoshimcache.test("<"+elem.nodeName)?elem.cloneNode(true):shimCloneNode(elem);if((!jQuery.support.noCloneEvent||!jQuery.support.
+noCloneChecked)&&(elem.nodeType===1||elem.nodeType===11)&&!jQuery.isXMLDoc(elem)){cloneFixAttributes(elem,clone);srcElements=getAll(elem);destElements=getAll(clone);for(i=0;srcElements[i];++i){if(destElements[i]){cloneFixAttributes(srcElements[i],destElements[i]);}}}if(dataAndEvents){cloneCopyEvent(elem,clone);if(deepDataAndEvents){srcElements=getAll(elem);destElements=getAll(clone);for(i=0;srcElements[i];++i){cloneCopyEvent(srcElements[i],destElements[i]);}}}srcElements=destElements=null;return clone;},clean:function(elems,context,fragment,scripts){var checkScriptType;context=context||document;if(typeof context.createElement==="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;}var ret=[],j;for(var i=0,elem;(elem=elems[i])!=null;i++){if(typeof elem==="number"){elem+="";}if(!elem){continue;}if(typeof elem==="string"){if(!rhtml.test(elem)){elem=context.createTextNode(elem);}else{elem=elem.replace(rxhtmlTag,"<$1></$2>");var tag=(rtagName.exec(elem)
+||["",""])[1].toLowerCase(),wrap=wrapMap[tag]||wrapMap._default,depth=wrap[0],div=context.createElement("div");if(context===document){safeFragment.appendChild(div);}else{createSafeFragment(context).appendChild(div);}div.innerHTML=wrap[1]+elem+wrap[2];while(depth--){div=div.lastChild;}if(!jQuery.support.tbody){var hasBody=rtbody.test(elem),tbody=tag==="table"&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]==="<table>"&&!hasBody?div.childNodes:[];for(j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j]);}}}if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)){div.insertBefore(context.createTextNode(rleadingWhitespace.exec(elem)[0]),div.firstChild);}elem=div.childNodes;}}var len;if(!jQuery.support.appendChecked){if(elem[0]&&typeof(len=elem.length)==="number"){for(j=0;j<len;j++){findInputs(elem[j]);}}else{findInputs(elem);}}if(elem.nodeType){ret.push(elem);}else{ret=jQuery.merge(ret
+,elem);}}if(fragment){checkScriptType=function(elem){return!elem.type||rscriptType.test(elem.type);};for(i=0;ret[i];i++){if(scripts&&jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i]);}else{if(ret[i].nodeType===1){var jsTags=jQuery.grep(ret[i].getElementsByTagName("script"),checkScriptType);ret.splice.apply(ret,[i+1,0].concat(jsTags));}fragment.appendChild(ret[i]);}}}return ret;},cleanData:function(elems){var data,id,cache=jQuery.cache,special=jQuery.event.special,deleteExpando=jQuery.support.deleteExpando;for(var i=0,elem;(elem=elems[i])!=null;i++){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){continue;}id=elem[jQuery.expando];if(id){data=cache[id];if(data&&data.events){for(var type in data.events){if(special[type]){jQuery.event.remove(elem,type);}else{jQuery.removeEvent(elem,type,data.handle);}}if(data.handle){data.handle.elem=null;}}if(
+deleteExpando){delete elem[jQuery.expando];}else if(elem.removeAttribute){elem.removeAttribute(jQuery.expando);}delete cache[id];}}}});function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"});}else{jQuery.globalEval((elem.text||elem.textContent||elem.innerHTML||"").replace(rcleanScript,"/*$0*/"));}if(elem.parentNode){elem.parentNode.removeChild(elem);}}var ralpha=/alpha\([^)]*\)/i,ropacity=/opacity=([^)]*)/,rupper=/([A-Z]|^ms)/g,rnumpx=/^-?\d+(?:px)?$/i,rnum=/^-?\d/,rrelNum=/^([\-+])=([\-+.\de]+)/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssWidth=["Left","Right"],cssHeight=["Top","Bottom"],curCSS,getComputedStyle,currentStyle;jQuery.fn.css=function(name,value){if(arguments.length===2&&value===undefined){return this;}return jQuery.access(this,name,value,true,function(elem,name,value){return value!==undefined?jQuery.style(elem,name,value):jQuery.css(elem,name);});};jQuery.extend({cssHooks:{opacity:{get:function(elem,
+computed){if(computed){var ret=curCSS(elem,"opacity","opacity");return ret===""?"1":ret;}else{return elem.style.opacity;}}}},cssNumber:{"fillOpacity":true,"fontWeight":true,"lineHeight":true,"opacity":true,"orphans":true,"widows":true,"zIndex":true,"zoom":true},cssProps:{"float":jQuery.support.cssFloat?"cssFloat":"styleFloat"},style:function(elem,name,value,extra){if(!elem||elem.nodeType===3||elem.nodeType===8||!elem.style){return;}var ret,type,origName=jQuery.camelCase(name),style=elem.style,hooks=jQuery.cssHooks[origName];name=jQuery.cssProps[origName]||origName;if(value!==undefined){type=typeof value;if(type==="string"&&(ret=rrelNum.exec(value))){value=(+(ret[1]+1)*+ret[2])+parseFloat(jQuery.css(elem,name));type="number";}if(value==null||type==="number"&&isNaN(value)){return;}if(type==="number"&&!jQuery.cssNumber[origName]){value+="px";}if(!hooks||!("set"in hooks)||(value=hooks.set(elem,value))!==undefined){try{style[name]=value;}catch(e){}}}else{if(hooks&&"get"in hooks&&(ret=hooks.
+get(elem,false,extra))!==undefined){return ret;}return style[name];}},css:function(elem,name,extra){var ret,hooks;name=jQuery.camelCase(name);hooks=jQuery.cssHooks[name];name=jQuery.cssProps[name]||name;if(name==="cssFloat"){name="float";}if(hooks&&"get"in hooks&&(ret=hooks.get(elem,true,extra))!==undefined){return ret;}else if(curCSS){return curCSS(elem,name);}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(name in options){elem.style[name]=old[name];}}});jQuery.curCSS=jQuery.css;jQuery.each(["height","width"],function(i,name){jQuery.cssHooks[name]={get:function(elem,computed,extra){var val;if(computed){if(elem.offsetWidth!==0){return getWH(elem,name,extra);}else{jQuery.swap(elem,cssShow,function(){val=getWH(elem,name,extra);});}return val;}},set:function(elem,value){if(rnumpx.test(value)){value=parseFloat(value);if(value>=0){return value+"px";}}else{return value;}}};});if(!
+jQuery.support.opacity){jQuery.cssHooks.opacity={get:function(elem,computed){return ropacity.test((computed&&elem.currentStyle?elem.currentStyle.filter:elem.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":computed?"1":"";},set:function(elem,value){var style=elem.style,currentStyle=elem.currentStyle,opacity=jQuery.isNumeric(value)?"alpha(opacity="+value*100+")":"",filter=currentStyle&&currentStyle.filter||style.filter||"";style.zoom=1;if(value>=1&&jQuery.trim(filter.replace(ralpha,""))===""){style.removeAttribute("filter");if(currentStyle&&!currentStyle.filter){return;}}style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):filter+" "+opacity;}};}jQuery(function(){if(!jQuery.support.reliableMarginRight){jQuery.cssHooks.marginRight={get:function(elem,computed){var ret;jQuery.swap(elem,{"display":"inline-block"},function(){if(computed){ret=curCSS(elem,"margin-right","marginRight");}else{ret=elem.style.marginRight;}});return ret;}};}});if(document.defaultView&&document.
+defaultView.getComputedStyle){getComputedStyle=function(elem,name){var ret,defaultView,computedStyle;name=name.replace(rupper,"-$1").toLowerCase();if((defaultView=elem.ownerDocument.defaultView)&&(computedStyle=defaultView.getComputedStyle(elem,null))){ret=computedStyle.getPropertyValue(name);if(ret===""&&!jQuery.contains(elem.ownerDocument.documentElement,elem)){ret=jQuery.style(elem,name);}}return ret;};}if(document.documentElement.currentStyle){currentStyle=function(elem,name){var left,rsLeft,uncomputed,ret=elem.currentStyle&&elem.currentStyle[name],style=elem.style;if(ret===null&&style&&(uncomputed=style[name])){ret=uncomputed;}if(!rnumpx.test(ret)&&rnum.test(ret)){left=style.left;rsLeft=elem.runtimeStyle&&elem.runtimeStyle.left;if(rsLeft){elem.runtimeStyle.left=elem.currentStyle.left;}style.left=name==="fontSize"?"1em":(ret||0);ret=style.pixelLeft+"px";style.left=left;if(rsLeft){elem.runtimeStyle.left=rsLeft;}}return ret===""?"auto":ret;};}curCSS=getComputedStyle||currentStyle;
+function getWH(elem,name,extra){var val=name==="width"?elem.offsetWidth:elem.offsetHeight,which=name==="width"?cssWidth:cssHeight,i=0,len=which.length;if(val>0){if(extra!=="border"){for(;i<len;i++){if(!extra){val-=parseFloat(jQuery.css(elem,"padding"+which[i]))||0;}if(extra==="margin"){val+=parseFloat(jQuery.css(elem,extra+which[i]))||0;}else{val-=parseFloat(jQuery.css(elem,"border"+which[i]+"Width"))||0;}}}return val+"px";}val=curCSS(elem,name,name);if(val<0||val==null){val=elem.style[name]||0;}val=parseFloat(val)||0;if(extra){for(;i<len;i++){val+=parseFloat(jQuery.css(elem,"padding"+which[i]))||0;if(extra!=="padding"){val+=parseFloat(jQuery.css(elem,"border"+which[i]+"Width"))||0;}if(extra==="margin"){val+=parseFloat(jQuery.css(elem,extra+which[i]))||0;}}}return val+"px";}if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.hidden=function(elem){var width=elem.offsetWidth,height=elem.offsetHeight;return(width===0&&height===0)||(!jQuery.support.reliableHiddenOffsets&&((elem.style
+&&elem.style.display)||jQuery.css(elem,"display"))==="none");};jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem);};}var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rhash=/#.*$/,rheaders=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,rinput=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,rlocalProtocol=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,rquery=/\?/,rscript=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,rselectTextarea=/^(?:select|textarea)/i,rspacesAjax=/\s+/,rts=/([?&])_=[^&]*/,rurl=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,_load=jQuery.fn.load,prefilters={},transports={},ajaxLocation,ajaxLocParts,allTypes=["*/"]+["*"];try{ajaxLocation=location.href;}catch(e){ajaxLocation=document.createElement("a");ajaxLocation.href="";ajaxLocation=ajaxLocation.href;}ajaxLocParts=rurl.exec(ajaxLocation.toLowerCase())||[];function
+addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*";}if(jQuery.isFunction(func)){var dataTypes=dataTypeExpression.toLowerCase().split(rspacesAjax),i=0,length=dataTypes.length,dataType,list,placeBefore;for(;i<length;i++){dataType=dataTypes[i];placeBefore=/^\+/.test(dataType);if(placeBefore){dataType=dataType.substr(1)||"*";}list=structure[dataType]=structure[dataType]||[];list[placeBefore?"unshift":"push"](func);}}};}function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR,dataType,inspected){dataType=dataType||options.dataTypes[0];inspected=inspected||{};inspected[dataType]=true;var list=structure[dataType],i=0,length=list?list.length:0,executeOnly=(structure===prefilters),selection;for(;i<length&&(executeOnly||!selection);i++){selection=list[i](options,originalOptions,jqXHR);if(typeof selection==="string"){if(!executeOnly||inspected[selection]){
+selection=undefined;}else{options.dataTypes.unshift(selection);selection=inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR,selection,inspected);}}}if((executeOnly||!selection)&&!inspected["*"]){selection=inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR,"*",inspected);}return selection;}function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:(deep||(deep={})))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}}jQuery.fn.extend({load:function(url,params,callback){if(typeof url!=="string"&&_load){return _load.apply(this,arguments);}else if(!this.length){return this;}var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=undefined;}else if(typeof params==="object"){params=jQuery.param(params,jQuery.ajaxSettings.
+traditional);type="POST";}}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(jqXHR,status,responseText){responseText=jqXHR.responseText;if(jqXHR.isResolved()){jqXHR.done(function(r){responseText=r;});self.html(selector?jQuery("<div>").append(responseText.replace(rscript,"")).find(selector):responseText);}if(callback){self.each(callback,[responseText,status,jqXHR]);}}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||rselectTextarea.test(this.nodeName)||rinput.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val.replace(rCRLF,"\r\n")};}):{name:elem.name,value:val.replace(rCRLF,"\r\n")};}).get();}});jQuery.each(
+"ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(i,o){jQuery.fn[o]=function(f){return this.on(o,f);};});jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=undefined;}return jQuery.ajax({type:method,url:url,data:data,success:callback,dataType:type});};});jQuery.extend({getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},ajaxSetup:function(target,settings){if(settings){ajaxExtend(target,jQuery.ajaxSettings);}else{settings=target;target=jQuery.ajaxSettings;}ajaxExtend(target,settings);return target;},ajaxSettings:{url:ajaxLocation,isLocal:rlocalProtocol.test(ajaxLocParts[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",
+text:"text/plain",json:"application/json, text/javascript","*":allTypes},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":window.String,"text html":true,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){if(typeof url==="object"){options=url;url=undefined;}options=options||{};var s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=callbackContext!==s&&(callbackContext.nodeType||callbackContext instanceof jQuery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},ifModifiedKey,requestHeaders={},requestHeadersNames={},responseHeadersString,responseHeaders,transport,timeoutTimer,parts,state=0,fireGlobals,i,jqXHR={readyState:0,
+setRequestHeader:function(name,value){if(!state){var lname=name.toLowerCase();name=requestHeadersNames[lname]=requestHeadersNames[lname]||name;requestHeaders[name]=value;}return this;},getAllResponseHeaders:function(){return state===2?responseHeadersString:null;},getResponseHeader:function(key){var match;if(state===2){if(!responseHeaders){responseHeaders={};while((match=rheaders.exec(responseHeadersString))){responseHeaders[match[1].toLowerCase()]=match[2];}}match=responseHeaders[key.toLowerCase()];}return match===undefined?null:match;},overrideMimeType:function(type){if(!state){s.mimeType=type;}return this;},abort:function(statusText){statusText=statusText||"abort";if(transport){transport.abort(statusText);}done(0,statusText);return this;}};function done(status,nativeStatusText,responses,headers){if(state===2){return;}state=2;if(timeoutTimer){clearTimeout(timeoutTimer);}transport=undefined;responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;var isSuccess,success,error,
+statusText=nativeStatusText,response=responses?ajaxHandleResponses(s,jqXHR,responses):undefined,lastModified,etag;if(status>=200&&status<300||status===304){if(s.ifModified){if((lastModified=jqXHR.getResponseHeader("Last-Modified"))){jQuery.lastModified[ifModifiedKey]=lastModified;}if((etag=jqXHR.getResponseHeader("Etag"))){jQuery.etag[ifModifiedKey]=etag;}}if(status===304){statusText="notmodified";isSuccess=true;}else{try{success=ajaxConvert(s,response);statusText="success";isSuccess=true;}catch(e){statusText="parsererror";error=e;}}}else{error=statusText;if(!statusText||status){statusText="error";if(status<0){status=0;}}}jqXHR.status=status;jqXHR.statusText=""+(nativeStatusText||statusText);if(isSuccess){deferred.resolveWith(callbackContext,[success,statusText,jqXHR]);}else{deferred.rejectWith(callbackContext,[jqXHR,statusText,error]);}jqXHR.statusCode(statusCode);statusCode=undefined;if(fireGlobals){globalEventContext.trigger("ajax"+(isSuccess?"Success":"Error"),[jqXHR,s,isSuccess?
+success:error]);}completeDeferred.fireWith(callbackContext,[jqXHR,statusText]);if(fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!(--jQuery.active)){jQuery.event.trigger("ajaxStop");}}}deferred.promise(jqXHR);jqXHR.success=jqXHR.done;jqXHR.error=jqXHR.fail;jqXHR.complete=completeDeferred.add;jqXHR.statusCode=function(map){if(map){var tmp;if(state<2){for(tmp in map){statusCode[tmp]=[statusCode[tmp],map[tmp]];}}else{tmp=map[jqXHR.status];jqXHR.then(tmp,tmp);}}return this;};s.url=((url||s.url)+"").replace(rhash,"").replace(rprotocol,ajaxLocParts[1]+"//");s.dataTypes=jQuery.trim(s.dataType||"*").toLowerCase().split(rspacesAjax);if(s.crossDomain==null){parts=rurl.exec(s.url.toLowerCase());s.crossDomain=!!(parts&&(parts[1]!=ajaxLocParts[1]||parts[2]!=ajaxLocParts[2]||(parts[3]||(parts[1]==="http:"?80:443))!=(ajaxLocParts[3]||(ajaxLocParts[1]==="http:"?80:443))));}if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional);}
+inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(state===2){return false;}fireGlobals=s.global;s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);if(fireGlobals&&jQuery.active++===0){jQuery.event.trigger("ajaxStart");}if(!s.hasContent){if(s.data){s.url+=(rquery.test(s.url)?"&":"?")+s.data;delete s.data;}ifModifiedKey=s.url;if(s.cache===false){var ts=jQuery.now(),ret=s.url.replace(rts,"$1_="+ts);s.url=ret+((ret===s.url)?(rquery.test(s.url)?"&":"?")+"_="+ts:"");}}if(s.data&&s.hasContent&&s.contentType!==false||options.contentType){jqXHR.setRequestHeader("Content-Type",s.contentType);}if(s.ifModified){ifModifiedKey=ifModifiedKey||s.url;if(jQuery.lastModified[ifModifiedKey]){jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[ifModifiedKey]);}if(jQuery.etag[ifModifiedKey]){jqXHR.setRequestHeader("If-None-Match",jQuery.etag[ifModifiedKey]);}}jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+(s.dataTypes[
+0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i]);}if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===false||state===2)){jqXHR.abort();return false;}for(i in{success:1,error:1,complete:1}){jqXHR[i](s[i]);}transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,"No Transport");}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR,s]);}if(s.async&&s.timeout>0){timeoutTimer=setTimeout(function(){jqXHR.abort("timeout");},s.timeout);}try{state=1;transport.send(requestHeaders,done);}catch(e){if(state<2){done(-1,e);}else{throw e;}}}return jqXHR;},param:function(a,traditional){var s=[],add=function(key,value){value=jQuery.isFunction(value)?value():value;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value);};if(traditional===undefined){traditional=jQuery.ajaxSettings.traditional;}if(jQuery.isArray(a)||(a.jquery&&!jQuery.isPlainObject(a))){
+jQuery.each(a,function(){add(this.name,this.value);});}else{for(var prefix in a){buildParams(prefix,a[prefix],traditional,add);}}return s.join("&").replace(r20,"+");}});function buildParams(prefix,obj,traditional,add){if(jQuery.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v);}else{buildParams(prefix+"["+(typeof v==="object"||jQuery.isArray(v)?i:"")+"]",v,traditional,add);}});}else if(!traditional&&obj!=null&&typeof obj==="object"){for(var name in obj){buildParams(prefix+"["+name+"]",obj[name],traditional,add);}}else{add(prefix,obj);}}jQuery.extend({active:0,lastModified:{},etag:{}});function ajaxHandleResponses(s,jqXHR,responses){var contents=s.contents,dataTypes=s.dataTypes,responseFields=s.responseFields,ct,type,finalDataType,firstDataType;for(type in responseFields){if(type in responses){jqXHR[responseFields[type]]=responses[type];}}while(dataTypes[0]==="*"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(
+"content-type");}}if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}if(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}finalDataType=finalDataType||firstDataType;}if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}function ajaxConvert(s,response){if(s.dataFilter){response=s.dataFilter(response,s.dataType);}var dataTypes=s.dataTypes,converters={},i,key,length=dataTypes.length,tmp,current=dataTypes[0],prev,conversion,conv,conv1,conv2;for(i=1;i<length;i++){if(i===1){for(key in s.converters){if(typeof key==="string"){converters[key.toLowerCase()]=s.converters[key];}}}prev=current;current=dataTypes[i];if(current==="*"){current=prev;}else if(prev!=="*"&&prev!==current){conversion=prev+" "+current;conv=converters[
+conversion]||converters["* "+current];if(!conv){conv2=undefined;for(conv1 in converters){tmp=conv1.split(" ");if(tmp[0]===prev||tmp[0]==="*"){conv2=converters[tmp[1]+" "+current];if(conv2){conv1=converters[conv1];if(conv1===true){conv=conv2;}else if(conv2===true){conv=conv1;}break;}}}}if(!(conv||conv2)){jQuery.error("No conversion from "+conversion.replace(" "," to "));}if(conv!==true){response=conv?conv(response):conv2(conv1(response));}}}return response;}var jsc=jQuery.now(),jsre=/(\=)\?(&|$)|\?\?/i;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return jQuery.expando+"_"+(jsc++);}});jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var inspectData=s.contentType==="application/x-www-form-urlencoded"&&(typeof s.data==="string");if(s.dataTypes[0]==="jsonp"||s.jsonp!==false&&(jsre.test(s.url)||inspectData&&jsre.test(s.data))){var responseContainer,jsonpCallback=s.jsonpCallback=jQuery.isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback,previous=
+window[jsonpCallback],url=s.url,data=s.data,replace="$1"+jsonpCallback+"$2";if(s.jsonp!==false){url=url.replace(jsre,replace);if(s.url===url){if(inspectData){data=data.replace(jsre,replace);}if(s.data===data){url+=(/\?/.test(url)?"&":"?")+s.jsonp+"="+jsonpCallback;}}}s.url=url;s.data=data;window[jsonpCallback]=function(response){responseContainer=[response];};jqXHR.always(function(){window[jsonpCallback]=previous;if(responseContainer&&jQuery.isFunction(previous)){window[jsonpCallback](responseContainer[0]);}});s.converters["script json"]=function(){if(!responseContainer){jQuery.error(jsonpCallback+" was not called");}return responseContainer[0];};s.dataTypes[0]="json";return"script";}});jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(text){jQuery.globalEval(text);return text;}}});jQuery.ajaxPrefilter("script",function(s){if(s.cache
+===undefined){s.cache=false;}if(s.crossDomain){s.type="GET";s.global=false;}});jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,head=document.head||document.getElementsByTagName("head")[0]||document.documentElement;return{send:function(_,callback){script=document.createElement("script");script.async="async";if(s.scriptCharset){script.charset=s.scriptCharset;}script.src=s.url;script.onload=script.onreadystatechange=function(_,isAbort){if(isAbort||!script.readyState||/loaded|complete/.test(script.readyState)){script.onload=script.onreadystatechange=null;if(head&&script.parentNode){head.removeChild(script);}script=undefined;if(!isAbort){callback(200,"success");}}};head.insertBefore(script,head.firstChild);},abort:function(){if(script){script.onload(0,1);}}};}});var xhrOnUnloadAbort=window.ActiveXObject?function(){for(var key in xhrCallbacks){xhrCallbacks[key](0,1);}}:false,xhrId=0,xhrCallbacks;function createStandardXHR(){try{return new window.XMLHttpRequest();}catch
+(e){}}function createActiveXHR(){try{return new window.ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}jQuery.ajaxSettings.xhr=window.ActiveXObject?function(){return!this.isLocal&&createStandardXHR()||createActiveXHR();}:createStandardXHR;(function(xhr){jQuery.extend(jQuery.support,{ajax:!!xhr,cors:!!xhr&&("withCredentials"in xhr)});})(jQuery.ajaxSettings.xhr());if(jQuery.support.ajax){jQuery.ajaxTransport(function(s){if(!s.crossDomain||jQuery.support.cors){var callback;return{send:function(headers,complete){var xhr=s.xhr(),handle,i;if(s.username){xhr.open(s.type,s.url,s.async,s.username,s.password);}else{xhr.open(s.type,s.url,s.async);}if(s.xhrFields){for(i in s.xhrFields){xhr[i]=s.xhrFields[i];}}if(s.mimeType&&xhr.overrideMimeType){xhr.overrideMimeType(s.mimeType);}if(!s.crossDomain&&!headers["X-Requested-With"]){headers["X-Requested-With"]="XMLHttpRequest";}try{for(i in headers){xhr.setRequestHeader(i,headers[i]);}}catch(_){}xhr.send((s.hasContent&&s.data)||null);callback=function(_,
+isAbort){var status,statusText,responseHeaders,responses,xml;try{if(callback&&(isAbort||xhr.readyState===4)){callback=undefined;if(handle){xhr.onreadystatechange=jQuery.noop;if(xhrOnUnloadAbort){delete xhrCallbacks[handle];}}if(isAbort){if(xhr.readyState!==4){xhr.abort();}}else{status=xhr.status;responseHeaders=xhr.getAllResponseHeaders();responses={};xml=xhr.responseXML;if(xml&&xml.documentElement){responses.xml=xml;}responses.text=xhr.responseText;try{statusText=xhr.statusText;}catch(e){statusText="";}if(!status&&s.isLocal&&!s.crossDomain){status=responses.text?200:404;}else if(status===1223){status=204;}}}}catch(firefoxAccessException){if(!isAbort){complete(-1,firefoxAccessException);}}if(responses){complete(status,statusText,responses,responseHeaders);}};if(!s.async||xhr.readyState===4){callback();}else{handle=++xhrId;if(xhrOnUnloadAbort){if(!xhrCallbacks){xhrCallbacks={};jQuery(window).unload(xhrOnUnloadAbort);}xhrCallbacks[handle]=callback;}xhr.onreadystatechange=callback;}},
+abort:function(){if(callback){callback(0,1);}}};}});}var elemdisplay={},iframe,iframeDoc,rfxtypes=/^(?:toggle|show|hide)$/,rfxnum=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],fxNow;jQuery.fn.extend({show:function(speed,easing,callback){var elem,display;if(speed||speed===0){return this.animate(genFx("show",3),speed,easing,callback);}else{for(var i=0,j=this.length;i<j;i++){elem=this[i];if(elem.style){display=elem.style.display;if(!jQuery._data(elem,"olddisplay")&&display==="none"){display=elem.style.display="";}if(display===""&&jQuery.css(elem,"display")==="none"){jQuery._data(elem,"olddisplay",defaultDisplay(elem.nodeName));}}}for(i=0;i<j;i++){elem=this[i];if(elem.style){display=elem.style.display;if(display===""||display==="none"){elem.style.display=jQuery._data(elem,"olddisplay")||"";}}}return this;}},hide:function(speed,easing,
+callback){if(speed||speed===0){return this.animate(genFx("hide",3),speed,easing,callback);}else{var elem,display,i=0,j=this.length;for(;i<j;i++){elem=this[i];if(elem.style){display=jQuery.css(elem,"display");if(display!=="none"&&!jQuery._data(elem,"olddisplay")){jQuery._data(elem,"olddisplay",display);}}}for(i=0;i<j;i++){if(this[i].style){this[i].style.display="none";}}return this;}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2,callback){var bool=typeof fn==="boolean";if(jQuery.isFunction(fn)&&jQuery.isFunction(fn2)){this._toggle.apply(this,arguments);}else if(fn==null||bool){this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]();});}else{this.animate(genFx("toggle",3),fn,fn2,callback);}return this;},fadeTo:function(speed,to,easing,callback){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:to},speed,easing,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);
+if(jQuery.isEmptyObject(prop)){return this.each(optall.complete,[false]);}prop=jQuery.extend({},prop);function doAnimation(){if(optall.queue===false){jQuery._mark(this);}var opt=jQuery.extend({},optall),isElement=this.nodeType===1,hidden=isElement&&jQuery(this).is(":hidden"),name,val,p,e,parts,start,end,unit,method;opt.animatedProperties={};for(p in prop){name=jQuery.camelCase(p);if(p!==name){prop[name]=prop[p];delete prop[p];}val=prop[name];if(jQuery.isArray(val)){opt.animatedProperties[name]=val[1];val=prop[name]=val[0];}else{opt.animatedProperties[name]=opt.specialEasing&&opt.specialEasing[name]||opt.easing||'swing';}if(val==="hide"&&hidden||val==="show"&&!hidden){return opt.complete.call(this);}if(isElement&&(name==="height"||name==="width")){opt.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(jQuery.css(this,"display")==="inline"&&jQuery.css(this,"float")==="none"){if(!jQuery.support.inlineBlockNeedsLayout||defaultDisplay(this.nodeName)==="inline"){this
+.style.display="inline-block";}else{this.style.zoom=1;}}}}if(opt.overflow!=null){this.style.overflow="hidden";}for(p in prop){e=new jQuery.fx(this,opt,p);val=prop[p];if(rfxtypes.test(val)){method=jQuery._data(this,"toggle"+p)||(val==="toggle"?hidden?"show":"hide":0);if(method){jQuery._data(this,"toggle"+p,method==="show"?"hide":"show");e[method]();}else{e[val]();}}else{parts=rfxnum.exec(val);start=e.cur();if(parts){end=parseFloat(parts[2]);unit=parts[3]||(jQuery.cssNumber[p]?"":"px");if(unit!=="px"){jQuery.style(this,p,(end||1)+unit);start=((end||1)/e.cur())*start;jQuery.style(this,p,start+unit);}if(parts[1]){end=((parts[1]==="-="?-1:1)*end)+start;}e.custom(start,end,unit);}else{e.custom(start,val,"");}}}return true;}return optall.queue===false?this.each(doAnimation):this.queue(optall.queue,doAnimation);},stop:function(type,clearQueue,gotoEnd){if(typeof type!=="string"){gotoEnd=clearQueue;clearQueue=type;type=undefined;}if(clearQueue&&type!==false){this.queue(type||"fx",[]);}return this
+.each(function(){var index,hadTimers=false,timers=jQuery.timers,data=jQuery._data(this);if(!gotoEnd){jQuery._unmark(true,this);}function stopQueue(elem,data,index){var hooks=data[index];jQuery.removeData(elem,index,true);hooks.stop(gotoEnd);}if(type==null){for(index in data){if(data[index]&&data[index].stop&&index.indexOf(".run")===index.length-4){stopQueue(this,data,index);}}}else if(data[index=type+".run"]&&data[index].stop){stopQueue(this,data,index);}for(index=timers.length;index--;){if(timers[index].elem===this&&(type==null||timers[index].queue===type)){if(gotoEnd){timers[index](true);}else{timers[index].saveState();}hadTimers=true;timers.splice(index,1);}}if(!(gotoEnd&&hadTimers)){jQuery.dequeue(this,type);}});}});function createFxNow(){setTimeout(clearFxNow,0);return(fxNow=jQuery.now());}function clearFxNow(){fxNow=undefined;}function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type;});return obj;}jQuery.each({
+slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(name,props){jQuery.fn[name]=function(speed,easing,callback){return this.animate(props,speed,easing,callback);};});jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&typeof speed==="object"?jQuery.extend({},speed):{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:opt.duration in jQuery.fx.speeds?jQuery.fx.speeds[opt.duration]:jQuery.fx.speeds._default;if(opt.queue==null||opt.queue===true){opt.queue="fx";}opt.old=opt.complete;opt.complete=function(noUnmark){if(jQuery.isFunction(opt.old)){opt.old.call(this);}if(opt.queue){jQuery.dequeue(this,opt.queue);}else if(noUnmark!==false){jQuery._unmark(this);}};return opt;},easing:{linear:function(p,n,firstNum,
+diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;options.orig=options.orig||{};}});jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this);}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop];}var parsed,r=jQuery.css(this.elem,this.prop);return isNaN(parsed=parseFloat(r))?!r||r==="auto"?0:r:parsed;},custom:function(from,to,unit){var self=this,fx=jQuery.fx;this.startTime=fxNow||createFxNow();this.end=to;this.now=this.start=from;this.pos=this.state=0;this.unit=unit||this.unit||(jQuery.cssNumber[this.prop]?"":"px");function t(gotoEnd){return self.step(gotoEnd);}t.queue=this.options.queue;t.elem=this.elem;t.saveState=function(){if(self.options.
+hide&&jQuery._data(self.elem,"fxshow"+self.prop)===undefined){jQuery._data(self.elem,"fxshow"+self.prop,self.start);}};if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(fx.tick,fx.interval);}},show:function(){var dataShow=jQuery._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=dataShow||jQuery.style(this.elem,this.prop);this.options.show=true;if(dataShow!==undefined){this.custom(this.cur(),dataShow);}else{this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());}jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery._data(this.elem,"fxshow"+this.prop)||jQuery.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var p,n,complete,t=fxNow||createFxNow(),done=true,elem=this.elem,options=this.options;if(gotoEnd||t>=options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();options.animatedProperties[this.prop]=true;for(p in options.animatedProperties){
+if(options.animatedProperties[p]!==true){done=false;}}if(done){if(options.overflow!=null&&!jQuery.support.shrinkWrapBlocks){jQuery.each(["","X","Y"],function(index,value){elem.style["overflow"+value]=options.overflow[index];});}if(options.hide){jQuery(elem).hide();}if(options.hide||options.show){for(p in options.animatedProperties){jQuery.style(elem,p,options.orig[p]);jQuery.removeData(elem,"fxshow"+p,true);jQuery.removeData(elem,"toggle"+p,true);}}complete=options.complete;if(complete){options.complete=false;complete.call(elem);}}return false;}else{if(options.duration==Infinity){this.now=t;}else{n=t-this.startTime;this.state=n/options.duration;this.pos=jQuery.easing[options.animatedProperties[this.prop]](this.state,n,0,1,options.duration);this.now=this.start+((this.end-this.start)*this.pos);}this.update();}return true;}};jQuery.extend(jQuery.fx,{tick:function(){var timer,timers=jQuery.timers,i=0;for(;i<timers.length;i++){timer=timers[i];if(!timer()&&timers[i]===timer){timers.splice(i--
+,1);}}if(!timers.length){jQuery.fx.stop();}},interval:13,stop:function(){clearInterval(timerId);timerId=null;},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.style(fx.elem,"opacity",fx.now);},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null){fx.elem.style[fx.prop]=fx.now+fx.unit;}else{fx.elem[fx.prop]=fx.now;}}}});jQuery.each(["width","height"],function(i,prop){jQuery.fx.step[prop]=function(fx){jQuery.style(fx.elem,prop,Math.max(0,fx.now)+fx.unit);};});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};}function defaultDisplay(nodeName){if(!elemdisplay[nodeName]){var body=document.body,elem=jQuery("<"+nodeName+">").appendTo(body),display=elem.css("display");elem.remove();if(display==="none"||display===""){if(!iframe){iframe=document.createElement("iframe");iframe.frameBorder=iframe.width=iframe.height=0;}body.appendChild(iframe);if
+(!iframeDoc||!iframe.createElement){iframeDoc=(iframe.contentWindow||iframe.contentDocument).document;iframeDoc.write((document.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>");iframeDoc.close();}elem=iframeDoc.createElement(nodeName);iframeDoc.body.appendChild(elem);display=jQuery.css(elem,"display");body.removeChild(iframe);}elemdisplay[nodeName]=display;}return elemdisplay[nodeName];}var rtable=/^t(?:able|d|h)$/i,rroot=/^(?:body|html)$/i;if("getBoundingClientRect"in document.documentElement){jQuery.fn.offset=function(options){var elem=this[0],box;if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i);});}if(!elem||!elem.ownerDocument){return null;}if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem);}try{box=elem.getBoundingClientRect();}catch(e){}var doc=elem.ownerDocument,docElem=doc.documentElement;if(!box||!jQuery.contains(docElem,elem)){return box?{top:box.top,left:box.left}:{top:0,left:0};}var body=doc.body,win=
+getWindow(doc),clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,scrollTop=win.pageYOffset||jQuery.support.boxModel&&docElem.scrollTop||body.scrollTop,scrollLeft=win.pageXOffset||jQuery.support.boxModel&&docElem.scrollLeft||body.scrollLeft,top=box.top+scrollTop-clientTop,left=box.left+scrollLeft-clientLeft;return{top:top,left:left};};}else{jQuery.fn.offset=function(options){var elem=this[0];if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i);});}if(!elem||!elem.ownerDocument){return null;}if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem);}var computedStyle,offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle,top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){if(
+jQuery.support.fixedPosition&&prevComputedStyle.position==="fixed"){break;}computedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle;top-=elem.scrollTop;left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop;left+=elem.offsetLeft;if(jQuery.support.doesNotAddBorder&&!(jQuery.support.doesAddBorderForTableAndCells&&rtable.test(elem.nodeName))){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0;}prevOffsetParent=offsetParent;offsetParent=elem.offsetParent;}if(jQuery.support.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible"){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0;}prevComputedStyle=computedStyle;}if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static"){top+=body.offsetTop;left+=body.offsetLeft;}if(jQuery.support.fixedPosition&&prevComputedStyle.position==="fixed"){top+=Math.max(docElem.scrollTop,
+body.scrollTop);left+=Math.max(docElem.scrollLeft,body.scrollLeft);}return{top:top,left:left};};}jQuery.offset={bodyOffset:function(body){var top=body.offsetTop,left=body.offsetLeft;if(jQuery.support.doesNotIncludeMarginInBodyOffset){top+=parseFloat(jQuery.css(body,"marginTop"))||0;left+=parseFloat(jQuery.css(body,"marginLeft"))||0;}return{top:top,left:left};},setOffset:function(elem,options,i){var position=jQuery.css(elem,"position");if(position==="static"){elem.style.position="relative";}var curElem=jQuery(elem),curOffset=curElem.offset(),curCSSTop=jQuery.css(elem,"top"),curCSSLeft=jQuery.css(elem,"left"),calculatePosition=(position==="absolute"||position==="fixed")&&jQuery.inArray("auto",[curCSSTop,curCSSLeft])>-1,props={},curPosition={},curTop,curLeft;if(calculatePosition){curPosition=curElem.position();curTop=curPosition.top;curLeft=curPosition.left;}else{curTop=parseFloat(curCSSTop)||0;curLeft=parseFloat(curCSSLeft)||0;}if(jQuery.isFunction(options)){options=options.call(elem,i,
+curOffset);}if(options.top!=null){props.top=(options.top-curOffset.top)+curTop;}if(options.left!=null){props.left=(options.left-curOffset.left)+curLeft;}if("using"in options){options.using.call(elem,props);}else{curElem.css(props);}}};jQuery.fn.extend({position:function(){if(!this[0]){return null;}var elem=this[0],offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=rroot.test(offsetParent[0].nodeName)?{top:0,left:0}:offsetParent.offset();offset.top-=parseFloat(jQuery.css(elem,"marginTop"))||0;offset.left-=parseFloat(jQuery.css(elem,"marginLeft"))||0;parentOffset.top+=parseFloat(jQuery.css(offsetParent[0],"borderTopWidth"))||0;parentOffset.left+=parseFloat(jQuery.css(offsetParent[0],"borderLeftWidth"))||0;return{top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent||document.body;while(offsetParent&&(!rroot.test(offsetParent.nodeName)&&jQuery.css(offsetParent,"position")
+==="static")){offsetParent=offsetParent.offsetParent;}return offsetParent;});}});jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;jQuery.fn[method]=function(val){var elem,win;if(val===undefined){elem=this[0];if(!elem){return null;}win=getWindow(elem);return win?("pageXOffset"in win)?win[i?"pageYOffset":"pageXOffset"]:jQuery.support.boxModel&&win.document.documentElement[method]||win.document.body[method]:elem[method];}return this.each(function(){win=getWindow(this);if(win){win.scrollTo(!i?val:jQuery(win).scrollLeft(),i?val:jQuery(win).scrollTop());}else{this[method]=val;}});};});function getWindow(elem){return jQuery.isWindow(elem)?elem:elem.nodeType===9?elem.defaultView||elem.parentWindow:false;}jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn["inner"+name]=function(){var elem=this[0];return elem?elem.style?parseFloat(jQuery.css(elem,type,"padding")):this[type]():null;};jQuery.fn["outer"+name]=function(margin){var elem=this[0];
+return elem?elem.style?parseFloat(jQuery.css(elem,type,margin?"margin":"border")):this[type]():null;};jQuery.fn[type]=function(size){var elem=this[0];if(!elem){return size==null?null:this;}if(jQuery.isFunction(size)){return this.each(function(i){var self=jQuery(this);self[type](size.call(this,i,self[type]()));});}if(jQuery.isWindow(elem)){var docElemProp=elem.document.documentElement["client"+name],body=elem.document.body;return elem.document.compatMode==="CSS1Compat"&&docElemProp||body&&body["client"+name]||docElemProp;}else if(elem.nodeType===9){return Math.max(elem.documentElement["client"+name],elem.body["scroll"+name],elem.documentElement["scroll"+name],elem.body["offset"+name],elem.documentElement["offset"+name]);}else if(size===undefined){var orig=jQuery.css(elem,type),ret=parseFloat(orig);return jQuery.isNumeric(ret)?ret:orig;}else{return this.css(type,typeof size==="string"?size:size+"px");}};});window.jQuery=window.$=jQuery;if(typeof define==="function"&&define.amd&&define.
+amd.jQuery){define("jquery",[],function(){return jQuery;});}})(window);;var mw=(function($,undefined){"use strict";var hasOwn=Object.prototype.hasOwnProperty;function Map(global){this.values=global===true?window:{};return this;}Map.prototype={get:function(selection,fallback){var results,i;if($.isArray(selection)){selection=$.makeArray(selection);results={};for(i=0;i<selection.length;i+=1){results[selection[i]]=this.get(selection[i],fallback);}return results;}else if(typeof selection==='string'){if(this.values[selection]===undefined){if(fallback!==undefined){return fallback;}return null;}return this.values[selection];}if(selection===undefined){return this.values;}else{return null;}},set:function(selection,value){var s;if($.isPlainObject(selection)){for(s in selection){this.values[s]=selection[s];}return true;}else if(typeof selection==='string'&&value!==undefined){this.values[selection]=value;return true;}return false;},exists:function(selection){var s;if($.isArray(selection)){for(s=0;s
+<selection.length;s+=1){if(this.values[selection[s]]===undefined){return false;}}return true;}else{return this.values[selection]!==undefined;}}};function Message(map,key,parameters){this.format='plain';this.map=map;this.key=key;this.parameters=parameters===undefined?[]:$.makeArray(parameters);return this;}Message.prototype={parser:function(){var parameters=this.parameters;return this.map.get(this.key).replace(/\$(\d+)/g,function(str,match){var index=parseInt(match,10)-1;return parameters[index]!==undefined?parameters[index]:'$'+match;});},params:function(parameters){var i;for(i=0;i<parameters.length;i+=1){this.parameters.push(parameters[i]);}return this;},toString:function(){var text;if(!this.exists()){if(this.format!=='plain'){return mw.html.escape('<'+this.key+'>');}return'<'+this.key+'>';}if(this.format==='plain'){text=this.parser();}if(this.format==='escaped'){text=this.parser();text=mw.html.escape(text);}if(this.format==='parse'){text=this.parser();}return text;},parse:function(){
+this.format='parse';return this.toString();},plain:function(){this.format='plain';return this.toString();},escaped:function(){this.format='escaped';return this.toString();},exists:function(){return this.map.exists(this.key);}};return{log:function(){},Map:Map,Message:Message,config:null,libs:{},legacy:{},messages:new Map(),message:function(key,parameter_1){var parameters;if(parameter_1!==undefined){parameters=$.makeArray(arguments);parameters.shift();}else{parameters=[];}return new Message(mw.messages,key,parameters);},msg:function(key,parameters){return mw.message.apply(mw.message,arguments).toString();},loader:(function(){var registry={},sources={},batch=[],queue=[],jobs=[],ready=false,$marker=null;$(document).ready(function(){ready=true;});function getMarker(){if($marker){return $marker;}else{$marker=$('meta[name="ResourceLoaderDynamicStyles"]');if($marker.length){return $marker;}mw.log('getMarker> No <meta name="ResourceLoaderDynamicStyles"> found, inserting dynamically.');$marker=$
+('<meta>').attr('name','ResourceLoaderDynamicStyles').appendTo('head');return $marker;}}function addInlineCSS(css,media){var $style=getMarker().prev(),$newStyle,attrs={'type':'text/css','media':media};if($style.is('style')&&$style.data('ResourceLoaderDynamicStyleTag')===true){try{css=$(mw.html.element('style',{},new mw.html.Cdata("\n\n"+css))).html();$style.append(css);}catch(e){css=$style.html()+"\n\n"+css;$newStyle=$(mw.html.element('style',attrs,new mw.html.Cdata(css))).data('ResourceLoaderDynamicStyleTag',true);$style.after($newStyle);$style.remove();}}else{$style=$(mw.html.element('style',attrs,new mw.html.Cdata(css)));$style.data('ResourceLoaderDynamicStyleTag',true);getMarker().before($style);}}function compare(a,b){var i;if(a.length!==b.length){return false;}for(i=0;i<b.length;i+=1){if($.isArray(a[i])){if(!compare(a[i],b[i])){return false;}}if(a[i]!==b[i]){return false;}}return true;}function formatVersionNumber(timestamp){var pad=function(a,b,c){return[a<10?'0'+a:a,b<10?'0'+b:
+b,c<10?'0'+c:c].join('');},d=new Date();d.setTime(timestamp*1000);return[pad(d.getUTCFullYear(),d.getUTCMonth()+1,d.getUTCDate()),'T',pad(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds()),'Z'].join('');}function recurse(module,resolved,unresolved){var n,deps,len;if(registry[module]===undefined){throw new Error('Unknown dependency: '+module);}if($.isFunction(registry[module].dependencies)){registry[module].dependencies=registry[module].dependencies();if(typeof registry[module].dependencies!=='object'){registry[module].dependencies=[registry[module].dependencies];}}deps=registry[module].dependencies;len=deps.length;for(n=0;n<len;n+=1){if($.inArray(deps[n],resolved)===-1){if($.inArray(deps[n],unresolved)!==-1){throw new Error('Circular reference detected: '+module+' -> '+deps[n]);}unresolved[unresolved.length]=module;recurse(deps[n],resolved,unresolved);unresolved.pop();}}resolved[resolved.length]=module;}function resolve(module){var modules,m,deps,n,resolved;if($.isArray(module)){
+modules=[];for(m=0;m<module.length;m+=1){deps=resolve(module[m]);for(n=0;n<deps.length;n+=1){modules[modules.length]=deps[n];}}return modules;}else if(typeof module==='string'){resolved=[];recurse(module,resolved,[]);return resolved;}throw new Error('Invalid module argument: '+module);}function filter(states,modules){var list,module,s,m;if(typeof states==='string'){states=[states];}list=[];if(modules===undefined){modules=[];for(module in registry){modules[modules.length]=module;}}for(s=0;s<states.length;s+=1){for(m=0;m<modules.length;m+=1){if(registry[modules[m]]===undefined){if(states[s]==='unregistered'){list[list.length]=modules[m];}}else{if(registry[modules[m]].state===states[s]){list[list.length]=modules[m];}}}}return list;}function handlePending(module){var j,r;try{for(j=0;j<jobs.length;j+=1){if(compare(filter('ready',jobs[j].dependencies),jobs[j].dependencies)){var callback=jobs[j].ready;jobs.splice(j,1);j-=1;if($.isFunction(callback)){callback();}}}for(r in registry){if(
+registry[r].state==='loaded'){if(compare(filter(['ready'],registry[r].dependencies),registry[r].dependencies)){execute(r);}}}}catch(e){for(j=0;j<jobs.length;j+=1){if($.inArray(module,jobs[j].dependencies)!==-1){if($.isFunction(jobs[j].error)){jobs[j].error(e,module);}jobs.splice(j,1);j-=1;}}throw e;}}function addScript(src,callback,async){var done=false,script,head;if(ready||async){script=document.createElement('script');script.setAttribute('src',src);script.setAttribute('type','text/javascript');if($.isFunction(callback)){script.onload=script.onreadystatechange=function(){if(!done&&(!script.readyState||/loaded|complete/.test(script.readyState))){done=true;callback();try{script.onload=script.onreadystatechange=null;if(script.parentNode){script.parentNode.removeChild(script);}script=undefined;}catch(e){}}};}if(window.opera){$(function(){document.body.appendChild(script);});}else{head=document.getElementsByTagName('head')[0];(document.body||head).appendChild(script);}}else{document.write
+(mw.html.element('script',{'type':'text/javascript','src':src},''));if($.isFunction(callback)){callback();}}}function execute(module,callback){var style,media,i,script,markModuleReady,nestedAddScript;if(registry[module]===undefined){throw new Error('Module has not been registered yet: '+module);}else if(registry[module].state==='registered'){throw new Error('Module has not been requested from the server yet: '+module);}else if(registry[module].state==='loading'){throw new Error('Module has not completed loading yet: '+module);}else if(registry[module].state==='ready'){throw new Error('Module has already been loaded: '+module);}if($.isPlainObject(registry[module].style)){for(media in registry[module].style){style=registry[module].style[media];if($.isArray(style)){for(i=0;i<style.length;i+=1){getMarker().before(mw.html.element('link',{'type':'text/css','media':media,'rel':'stylesheet','href':style[i]}));}}else if(typeof style==='string'){addInlineCSS(style,media);}}}if($.isPlainObject(
+registry[module].messages)){mw.messages.set(registry[module].messages);}try{script=registry[module].script;markModuleReady=function(){registry[module].state='ready';handlePending(module);if($.isFunction(callback)){callback();}};nestedAddScript=function(arr,callback,async,i){if(i>=arr.length){callback();return;}addScript(arr[i],function(){nestedAddScript(arr,callback,async,i+1);},async);};if($.isArray(script)){registry[module].state='loading';nestedAddScript(script,markModuleReady,registry[module].async,0);}else if($.isFunction(script)){script($);markModuleReady();}}catch(e){if(window.console&&typeof window.console.log==='function'){console.log('mw.loader::execute> Exception thrown by '+module+': '+e.message);}registry[module].state='error';}}function request(dependencies,ready,error,async){var regItemDeps,regItemDepLen,n;if(typeof dependencies==='string'){dependencies=[dependencies];if(registry[dependencies[0]]!==undefined){regItemDeps=registry[dependencies[0]].dependencies;
+regItemDepLen=regItemDeps.length;for(n=0;n<regItemDepLen;n+=1){dependencies[dependencies.length]=regItemDeps[n];}}}if(arguments.length>1){jobs[jobs.length]={'dependencies':filter(['registered','loading','loaded'],dependencies),'ready':ready,'error':error};}dependencies=filter(['registered'],dependencies);for(n=0;n<dependencies.length;n+=1){if($.inArray(dependencies[n],queue)===-1){queue[queue.length]=dependencies[n];if(async){registry[dependencies[n]].async=true;}}}mw.loader.work();}function sortQuery(o){var sorted={},key,a=[];for(key in o){if(hasOwn.call(o,key)){a.push(key);}}a.sort();for(key=0;key<a.length;key+=1){sorted[a[key]]=o[a[key]];}return sorted;}function buildModulesString(moduleMap){var arr=[],p,prefix;for(prefix in moduleMap){p=prefix===''?'':prefix+'.';arr.push(p+moduleMap[prefix].join(','));}return arr.join('|');}function doRequest(moduleMap,currReqBase,sourceLoadScript,async){var request=$.extend({'modules':buildModulesString(moduleMap)},currReqBase);request=sortQuery(
+request);addScript(sourceLoadScript+'?'+$.param(request)+'&*',null,async);}return{work:function(){var reqBase,splits,maxQueryLength,q,b,bSource,bGroup,bSourceGroup,source,group,g,i,modules,maxVersion,sourceLoadScript,currReqBase,currReqBaseLength,moduleMap,l,lastDotIndex,prefix,suffix,bytesAdded,async;reqBase={skin:mw.config.get('skin'),lang:mw.config.get('wgUserLanguage'),debug:mw.config.get('debug')};splits={};maxQueryLength=mw.config.get('wgResourceLoaderMaxQueryLength',-1);for(q=0;q<queue.length;q+=1){if(registry[queue[q]]!==undefined&&registry[queue[q]].state==='registered'){if($.inArray(queue[q],batch)===-1){batch[batch.length]=queue[q];registry[queue[q]].state='loading';}}}if(!batch.length){return;}queue=[];batch.sort();for(b=0;b<batch.length;b+=1){bSource=registry[batch[b]].source;bGroup=registry[batch[b]].group;if(splits[bSource]===undefined){splits[bSource]={};}if(splits[bSource][bGroup]===undefined){splits[bSource][bGroup]=[];}bSourceGroup=splits[bSource][bGroup];
+bSourceGroup[bSourceGroup.length]=batch[b];}batch=[];for(source in splits){sourceLoadScript=sources[source].loadScript;for(group in splits[source]){modules=splits[source][group];maxVersion=0;for(g=0;g<modules.length;g+=1){if(registry[modules[g]].version>maxVersion){maxVersion=registry[modules[g]].version;}}currReqBase=$.extend({'version':formatVersionNumber(maxVersion)},reqBase);currReqBaseLength=$.param(currReqBase).length;async=true;l=currReqBaseLength+9;moduleMap={};for(i=0;i<modules.length;i+=1){lastDotIndex=modules[i].lastIndexOf('.');prefix=modules[i].substr(0,lastDotIndex);suffix=modules[i].substr(lastDotIndex+1);bytesAdded=moduleMap[prefix]!==undefined?suffix.length+3:modules[i].length+3;if(maxQueryLength>0&&!$.isEmptyObject(moduleMap)&&l+bytesAdded>maxQueryLength){doRequest(moduleMap,currReqBase,sourceLoadScript,async);moduleMap={};async=true;l=currReqBaseLength+9;}if(moduleMap[prefix]===undefined){moduleMap[prefix]=[];}moduleMap[prefix].push(suffix);if(!registry[modules[i]].
+async){async=false;}l+=bytesAdded;}if(!$.isEmptyObject(moduleMap)){doRequest(moduleMap,currReqBase,sourceLoadScript,async);}}}},addSource:function(id,props){var source;if(typeof id==='object'){for(source in id){mw.loader.addSource(source,id[source]);}return true;}if(sources[id]!==undefined){throw new Error('source already registered: '+id);}sources[id]=props;return true;},register:function(module,version,dependencies,group,source){var m;if(typeof module==='object'){for(m=0;m<module.length;m+=1){if(typeof module[m]==='string'){mw.loader.register(module[m]);}else if(typeof module[m]==='object'){mw.loader.register.apply(mw.loader,module[m]);}}return;}if(typeof module!=='string'){throw new Error('module must be a string, not a '+typeof module);}if(registry[module]!==undefined){throw new Error('module already registered: '+module);}registry[module]={'version':version!==undefined?parseInt(version,10):0,'dependencies':[],'group':typeof group==='string'?group:null,'source':typeof source===
+'string'?source:'local','state':'registered'};if(typeof dependencies==='string'){registry[module].dependencies=[dependencies];}else if(typeof dependencies==='object'||$.isFunction(dependencies)){registry[module].dependencies=dependencies;}},implement:function(module,script,style,msgs){if(typeof module!=='string'){throw new Error('module must be a string, not a '+typeof module);}if(!$.isFunction(script)&&!$.isArray(script)){throw new Error('script must be a function or an array, not a '+typeof script);}if(!$.isPlainObject(style)){throw new Error('style must be an object, not a '+typeof style);}if(!$.isPlainObject(msgs)){throw new Error('msgs must be an object, not a '+typeof msgs);}if(registry[module]===undefined){mw.loader.register(module);}if(registry[module]!==undefined&&registry[module].script!==undefined){throw new Error('module already implemented: '+module);}registry[module].state='loaded';registry[module].script=script;registry[module].style=style;registry[module].messages=msgs;
+if(compare(filter(['ready'],registry[module].dependencies),registry[module].dependencies)){execute(module);}},using:function(dependencies,ready,error){var tod=typeof dependencies;if(tod!=='object'&&tod!=='string'){throw new Error('dependencies must be a string or an array, not a '+tod);}if(tod==='string'){dependencies=[dependencies];}dependencies=resolve(dependencies);if(compare(filter(['ready'],dependencies),dependencies)){if($.isFunction(ready)){ready();}}else if(filter(['error'],dependencies).length){if($.isFunction(error)){error(new Error('one or more dependencies have state "error"'),dependencies);}}else{request(dependencies,ready,error);}},load:function(modules,type,async){var filtered,m;if(typeof modules!=='object'&&typeof modules!=='string'){throw new Error('modules must be a string or an array, not a '+typeof modules);}if(typeof modules==='string'){if(/^(https?:)?\/\//.test(modules)){if(async===undefined){async=true;}if(type==='text/css'){$('head').append($('<link>',{rel:
+'stylesheet',type:'text/css',href:modules}));return;}else if(type==='text/javascript'||type===undefined){addScript(modules,null,async);return;}throw new Error('invalid type for external url, must be text/css or text/javascript. not '+type);}modules=[modules];}for(filtered=[],m=0;m<modules.length;m+=1){if(registry[modules[m]]!==undefined){filtered[filtered.length]=modules[m];}}filtered=resolve(filtered);if(compare(filter(['ready'],filtered),filtered)){return;}else if(filter(['error'],filtered).length){return;}else{request(filtered,null,null,async);return;}},state:function(module,state){var m;if(typeof module==='object'){for(m in module){mw.loader.state(m,module[m]);}return;}if(registry[module]===undefined){mw.loader.register(module);}registry[module].state=state;},getVersion:function(module){if(registry[module]!==undefined&&registry[module].version!==undefined){return formatVersionNumber(registry[module].version);}return null;},version:function(){return mw.loader.getVersion.apply(mw.
+loader,arguments);},getState:function(module){if(registry[module]!==undefined&&registry[module].state!==undefined){return registry[module].state;}return null;},getModuleNames:function(){return $.map(registry,function(i,key){return key;});},go:function(){mw.loader.load('mediawiki.user');}};}()),html:(function(){function escapeCallback(s){switch(s){case"'":return'&#039;';case'"':return'&quot;';case'<':return'&lt;';case'>':return'&gt;';case'&':return'&amp;';}}return{escape:function(s){return s.replace(/['"<>&]/g,escapeCallback);},Raw:function(value){this.value=value;},Cdata:function(value){this.value=value;},element:function(name,attrs,contents){var v,attrName,s='<'+name;for(attrName in attrs){v=attrs[attrName];if(v===true){v=attrName;}else if(v===false){continue;}s+=' '+attrName+'="'+this.escape(String(v))+'"';}if(contents===undefined||contents===null){s+='/>';return s;}s+='>';switch(typeof contents){case'string':s+=this.escape(contents);break;case'number':case'boolean':s+=String(
+contents);break;default:if(contents instanceof this.Raw){s+=contents.value;}else if(contents instanceof this.Cdata){if(/<\/[a-zA-z]/.test(contents.value)){throw new Error('mw.html.element: Illegal end tag found in CDATA');}s+=contents.value;}else{throw new Error('mw.html.element: Invalid type of contents');}}s+='</'+name+'>';return s;}};})(),user:{options:new Map(),tokens:new Map()}};})(jQuery);window.$j=jQuery;window.mw=window.mediaWiki=mw;if(typeof startUp!=='undefined'&&jQuery.isFunction(startUp)){startUp();startUp=undefined;};mw.loader.state({"jquery":"ready","mediawiki":"ready"});
+
+/* cache key: oni_wiki:resourceloader:filter:minify-js:7:8f87392541be422f5616ba0b0d90b5dd */
Index: /Vago/trunk/Vago/help/XMLSNDD_files/load(2).php
===================================================================
--- /Vago/trunk/Vago/help/XMLSNDD_files/load(2).php	(revision 771)
+++ /Vago/trunk/Vago/help/XMLSNDD_files/load(2).php	(revision 771)
@@ -0,0 +1,32 @@
+mw.loader.implement("jquery.client",function($){(function($){var profileCache={};$.client={profile:function(nav){if(nav===undefined){nav=window.navigator;}if(profileCache[nav.userAgent]===undefined){var uk='unknown';var x='x';var wildUserAgents=['Opera','Navigator','Minefield','KHTML','Chrome','PLAYSTATION 3'];var userAgentTranslations=[[/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/,''],['Chrome Safari','Chrome'],['KHTML','Konqueror'],['Minefield','Firefox'],['Navigator','Netscape'],['PLAYSTATION 3','PS3']];var versionPrefixes=['camino','chrome','firefox','netscape','netscape6','opera','version','konqueror','lynx','msie','safari','ps3'];var versionSuffix='(\\/|\\;?\\s|)([a-z0-9\\.\\+]*?)(\\;|dev|rel|\\)|\\s|$)';var names=['camino','chrome','firefox','netscape','konqueror','lynx','msie','opera','safari','ipod','iphone','blackberry','ps3'];var nameTranslations=[];var layouts=['gecko','konqueror','msie','opera','webkit'];var layoutTranslations=[['konqueror','khtml'],['msie','trident'],[
+'opera','presto']];var layoutVersions=['applewebkit','gecko'];var platforms=['win','mac','linux','sunos','solaris','iphone'];var platformTranslations=[['sunos','solaris']];var translate=function(source,translations){for(var i=0;i<translations.length;i++){source=source.replace(translations[i][0],translations[i][1]);}return source;};var ua=nav.userAgent,match,name=uk,layout=uk,layoutversion=uk,platform=uk,version=x;if(match=new RegExp('('+wildUserAgents.join('|')+')').exec(ua)){ua=translate(ua,userAgentTranslations);}ua=ua.toLowerCase();if(match=new RegExp('('+names.join('|')+')').exec(ua)){name=translate(match[1],nameTranslations);}if(match=new RegExp('('+layouts.join('|')+')').exec(ua)){layout=translate(match[1],layoutTranslations);}if(match=new RegExp('('+layoutVersions.join('|')+')\\\/(\\d+)').exec(ua)){layoutversion=parseInt(match[2],10);}if(match=new RegExp('('+platforms.join('|')+')').exec(nav.platform.toLowerCase())){platform=translate(match[1],platformTranslations);}if(match=new
+RegExp('('+versionPrefixes.join('|')+')'+versionSuffix).exec(ua)){version=match[3];}if(name.match(/safari/)&&version>400){version='2.0';}if(name==='opera'&&version>=9.8){version=ua.match(/version\/([0-9\.]*)/i)[1]||10;}var versionNumber=parseFloat(version,10)||0.0;profileCache[nav.userAgent]={'name':name,'layout':layout,'layoutVersion':layoutversion,'platform':platform,'version':version,'versionBase':(version!==x?Math.floor(versionNumber).toString():x),'versionNumber':versionNumber};}return profileCache[nav.userAgent];},test:function(map,profile){profile=$.isPlainObject(profile)?profile:$.client.profile();var dir=$('body').is('.rtl')?'rtl':'ltr';if(typeof map[dir]!=='object'||typeof map[dir][profile.name]==='undefined'){return true;}var conditions=map[dir][profile.name];for(var i=0;i<conditions.length;i++){var op=conditions[i][0];var val=conditions[i][1];if(val===false){return false;}else if(typeof val=='string'){if(!(eval('profile.version'+op+'"'+val+'"'))){return false;}}else if(
+typeof val=='number'){if(!(eval('profile.versionNumber'+op+val))){return false;}}}return true;}};})(jQuery);;},{},{});mw.loader.implement("jquery.cookie",function($){jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}expires='; expires='+date.toUTCString();}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(
+cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}return cookieValue;}};;},{},{});mw.loader.implement("jquery.messageBox",function($){(function($){$.messageBoxNew=function(options){options=$.extend({'id':'js-messagebox','parent':'body','insert':'prepend'},options);var $curBox=$('#'+options.id);if($curBox.length>0){if($curBox.hasClass('js-messagebox')){return $curBox;}else{return $curBox.addClass('js-messagebox');}}else{var $newBox=$('<div>',{'id':options.id,'class':'js-messagebox','css':{'display':'none'}});if($(options.parent).length<1){options.parent='body';}if(options.insert==='append'){$newBox.appendTo(options.parent);return $newBox;}else{$newBox.prependTo(options.parent);return $newBox;}}};$.messageBox=function(options){options=$.extend({'message':'','group':'default','replace':false,'target':'js-messagebox'},options);var $target=$.messageBoxNew({id:options.target});var groupID=options.target+'-'+
+options.group;var $group=$('#'+groupID);if($group.length<1){$group=$('<div>',{'id':groupID,'class':'js-messagebox-group'});$target.prepend($group);}if(options.replace===true){$group.empty();}if(options.message===''||options.message===null){$group.hide();}else{$group.prepend($('<p>').append(options.message)).show();$target.slideDown();}if($target.find('> *:visible').length===0){$group.show();$target.slideUp();$group.hide();}else{$target.slideDown();}return $group;};})(jQuery);;},{"all":".js-messagebox{margin:1em 5%;padding:0.5em 2.5%;border:1px solid #ccc;background-color:#fcfcfc;font-size:0.8em}.js-messagebox .js-messagebox-group{margin:1px;padding:0.5em 2.5%;border-bottom:1px solid #ddd}.js-messagebox .js-messagebox-group:last-child{border-bottom:thin none transparent}\n\n/* cache key: oni_wiki:resourceloader:filter:minify-css:7:8b08bdc91c52a9ffba396dccfb5b473c */\n"},{});mw.loader.implement("jquery.mwExtension",function($){(function($){$.extend({trimLeft:function(str){return str===
+null?'':str.toString().replace(/^\s+/,'');},trimRight:function(str){return str===null?'':str.toString().replace(/\s+$/,'');},ucFirst:function(str){return str.charAt(0).toUpperCase()+str.substr(1);},escapeRE:function(str){return str.replace(/([\\{}()|.?*+\-^$\[\]])/g,"\\$1");},isDomElement:function(el){return!!el&&!!el.nodeType;},isEmpty:function(v){if(v===''||v===0||v==='0'||v===null||v===false||v===undefined){return true;}if(v.length===0){return true;}if(typeof v==='object'){for(var key in v){return false;}return true;}return false;},compareArray:function(arrThis,arrAgainst){if(arrThis.length!=arrAgainst.length){return false;}for(var i=0;i<arrThis.length;i++){if($.isArray(arrThis[i])){if(!$.compareArray(arrThis[i],arrAgainst[i])){return false;}}else if(arrThis[i]!==arrAgainst[i]){return false;}}return true;},compareObject:function(objectA,objectB){if(typeof objectA==typeof objectB){if(typeof objectA=='object'){if(objectA===objectB){return true;}else{var prop;for(prop in objectA){if(
+prop in objectB){var type=typeof objectA[prop];if(type==typeof objectB[prop]){switch(type){case'object':if(!$.compareObject(objectA[prop],objectB[prop])){return false;}break;case'function':if(objectA[prop].toString()!==objectB[prop].toString()){return false;}break;default:if(objectA[prop]!==objectB[prop]){return false;}break;}}else{return false;}}else{return false;}}for(prop in objectB){if(!(prop in objectA)){return false;}}}}}else{return false;}return true;}});})(jQuery);;},{},{});mw.loader.implement("mediawiki.legacy.ajax",function($){window.sajax_debug_mode=false;window.sajax_request_type='GET';window.sajax_debug=function(text){if(!sajax_debug_mode)return false;var e=document.getElementById('sajax_debug');if(!e){e=document.createElement('p');e.className='sajax_debug';e.id='sajax_debug';var b=document.getElementsByTagName('body')[0];if(b.firstChild){b.insertBefore(e,b.firstChild);}else{b.appendChild(e);}}var m=document.createElement('div');m.appendChild(document.createTextNode(text))
+;e.appendChild(m);return true;};window.sajax_init_object=function(){sajax_debug('sajax_init_object() called..');var A;try{A=new XMLHttpRequest();}catch(e){try{A=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{A=new ActiveXObject('Microsoft.XMLHTTP');}catch(oc){A=null;}}}if(!A){sajax_debug('Could not create connection object.');}return A;};window.sajax_do_call=function(func_name,args,target){var i,x,n;var uri;var post_data;uri=mw.util.wikiScript()+'?action=ajax';if(sajax_request_type=='GET'){if(uri.indexOf('?')==-1){uri=uri+'?rs='+encodeURIComponent(func_name);}else{uri=uri+'&rs='+encodeURIComponent(func_name);}for(i=0;i<args.length;i++){uri=uri+'&rsargs[]='+encodeURIComponent(args[i]);}post_data=null;}else{post_data='rs='+encodeURIComponent(func_name);for(i=0;i<args.length;i++){post_data=post_data+'&rsargs[]='+encodeURIComponent(args[i]);}}x=sajax_init_object();if(!x){alert('AJAX not supported');return false;}try{x.open(sajax_request_type,uri,true);}catch(e){if(window.location.
+hostname=='localhost'){alert("Your browser blocks XMLHttpRequest to 'localhost', try using a real hostname for development/testing.");}throw e;}if(sajax_request_type=='POST'){x.setRequestHeader('Method','POST '+uri+' HTTP/1.1');x.setRequestHeader('Content-Type','application/x-www-form-urlencoded');}x.setRequestHeader('Pragma','cache=yes');x.setRequestHeader('Cache-Control','no-transform');x.onreadystatechange=function(){if(x.readyState!=4){return;}sajax_debug('received ('+x.status+' '+x.statusText+') '+x.responseText);if(typeof(target)=='function'){target(x);}else if(typeof(target)=='object'){if(target.tagName=='INPUT'){if(x.status==200){target.value=x.responseText;}}else{if(x.status==200){target.innerHTML=x.responseText;}else{target.innerHTML='<div class="error">Error: '+x.status+' '+x.statusText+' ('+x.responseText+')</div>';}}}else{alert('bad target for sajax_do_call: not a function or object: '+target);}};sajax_debug(func_name+' uri = '+uri+' / post = '+post_data);x.send(post_data)
+;sajax_debug(func_name+' waiting..');delete x;return true;};window.wfSupportsAjax=function(){var request=sajax_init_object();var supportsAjax=request?true:false;delete request;return supportsAjax;};;},{},{});mw.loader.implement("mediawiki.legacy.wikibits",function($){(function(){window.clientPC=navigator.userAgent.toLowerCase();window.is_gecko=/gecko/.test(clientPC)&&!/khtml|spoofer|netscape\/7\.0/.test(clientPC);window.is_safari=window.is_safari_win=window.webkit_version=window.is_chrome=window.is_chrome_mac=false;window.webkit_match=clientPC.match(/applewebkit\/(\d+)/);if(webkit_match){window.is_safari=clientPC.indexOf('applewebkit')!=-1&&clientPC.indexOf('spoofer')==-1;window.is_safari_win=is_safari&&clientPC.indexOf('windows')!=-1;window.webkit_version=parseInt(webkit_match[1]);window.is_chrome=clientPC.indexOf('chrome')!==-1&&clientPC.indexOf('spoofer')===-1;window.is_chrome_mac=is_chrome&&clientPC.indexOf('mac')!==-1}window.is_ff2=/firefox\/[2-9]|minefield\/3/.test(clientPC);
+window.ff2_bugs=/firefox\/2/.test(clientPC);window.is_ff2_win=is_ff2&&clientPC.indexOf('windows')!=-1;window.is_ff2_x11=is_ff2&&clientPC.indexOf('x11')!=-1;window.is_opera=window.is_opera_preseven=window.is_opera_95=window.opera6_bugs=window.opera7_bugs=window.opera95_bugs=false;if(clientPC.indexOf('opera')!=-1){window.is_opera=true;window.is_opera_preseven=window.opera&&!document.childNodes;window.is_opera_seven=window.opera&&document.childNodes;window.is_opera_95=/opera\/(9\.[5-9]|[1-9][0-9])/.test(clientPC);window.opera6_bugs=is_opera_preseven;window.opera7_bugs=is_opera_seven&&!is_opera_95;window.opera95_bugs=/opera\/(9\.5)/.test(clientPC);}window.ie6_bugs=false;if(/msie ([0-9]{1,}[\.0-9]{0,})/.exec(clientPC)!=null&&parseFloat(RegExp.$1)<=6.0){ie6_bugs=true;}window.doneOnloadHook=undefined;if(!window.onloadFuncts){window.onloadFuncts=[];}window.addOnloadHook=function(hookFunct){if(!doneOnloadHook){onloadFuncts[onloadFuncts.length]=hookFunct;}else{hookFunct();}};window.importScript=
+function(page){var uri=mw.config.get('wgScript')+'?title='+mw.util.wikiUrlencode(page)+'&action=raw&ctype=text/javascript';return importScriptURI(uri);};window.loadedScripts={};window.importScriptURI=function(url){if(loadedScripts[url]){return null;}loadedScripts[url]=true;var s=document.createElement('script');s.setAttribute('src',url);s.setAttribute('type','text/javascript');document.getElementsByTagName('head')[0].appendChild(s);return s;};window.importStylesheet=function(page){return importStylesheetURI(mw.config.get('wgScript')+'?action=raw&ctype=text/css&title='+mw.util.wikiUrlencode(page));};window.importStylesheetURI=function(url,media){var l=document.createElement('link');l.type='text/css';l.rel='stylesheet';l.href=url;if(media){l.media=media;}document.getElementsByTagName('head')[0].appendChild(l);return l;};window.appendCSS=function(text){var s=document.createElement('style');s.type='text/css';s.rel='stylesheet';if(s.styleSheet){s.styleSheet.cssText=text;}else{s.appendChild(
+document.createTextNode(text+''));}document.getElementsByTagName('head')[0].appendChild(s);return s;};var skinpath=mw.config.get('stylepath')+'/'+mw.config.get('skin');if(mw.config.get('skin')==='monobook'){if(opera6_bugs){importStylesheetURI(skinpath+'/Opera6Fixes.css');}else if(opera7_bugs){importStylesheetURI(skinpath+'/Opera7Fixes.css');}else if(opera95_bugs){importStylesheetURI(skinpath+'/Opera9Fixes.css');}else if(ff2_bugs){importStylesheetURI(skinpath+'/FF2Fixes.css');}}if(mw.config.get('wgBreakFrames')){if(window.top!=window){window.top.location=window.location;}}window.changeText=function(el,newText){if(el.innerText){el.innerText=newText;}else if(el.firstChild&&el.firstChild.nodeValue){el.firstChild.nodeValue=newText;}};window.killEvt=function(evt){evt=evt||window.event||window.Event;if(typeof(evt.preventDefault)!='undefined'){evt.preventDefault();evt.stopPropagation();}else{evt.cancelBubble=true;}return false;};window.mwEditButtons=[];window.mwCustomEditButtons=[];window.
+escapeQuotes=function(text){var re=new RegExp("'","g");text=text.replace(re,"\\'");re=new RegExp("\\n","g");text=text.replace(re,"\\n");return escapeQuotesHTML(text);};window.escapeQuotesHTML=function(text){var re=new RegExp('&',"g");text=text.replace(re,"&amp;");re=new RegExp('"',"g");text=text.replace(re,"&quot;");re=new RegExp('<',"g");text=text.replace(re,"&lt;");re=new RegExp('>',"g");text=text.replace(re,"&gt;");return text;};window.tooltipAccessKeyPrefix='alt-';if(is_opera){tooltipAccessKeyPrefix='shift-esc-';}else if(is_chrome){tooltipAccessKeyPrefix=is_chrome_mac?'ctrl-option-':'alt-';}else if(!is_safari_win&&is_safari&&webkit_version>526){tooltipAccessKeyPrefix='ctrl-alt-';}else if(!is_safari_win&&(is_safari||clientPC.indexOf('mac')!=-1||clientPC.indexOf('konqueror')!=-1)){tooltipAccessKeyPrefix='ctrl-';}else if(is_ff2){tooltipAccessKeyPrefix='alt-shift-';}window.tooltipAccessKeyRegexp=/\[(ctrl-)?(alt-)?(shift-)?(esc-)?(.)\]$/;window.updateTooltipAccessKeys=function(nodeList)
+{if(!nodeList){var linkContainers=['column-one','mw-head','mw-panel','p-logo'];for(var i in linkContainers){var linkContainer=document.getElementById(linkContainers[i]);if(linkContainer){updateTooltipAccessKeys(linkContainer.getElementsByTagName('a'));}}updateTooltipAccessKeys(document.getElementsByTagName('input'));updateTooltipAccessKeys(document.getElementsByTagName('label'));return;}for(var i=0;i<nodeList.length;i++){var element=nodeList[i];var tip=element.getAttribute('title');if(tip&&tooltipAccessKeyRegexp.exec(tip)){tip=tip.replace(tooltipAccessKeyRegexp,'['+tooltipAccessKeyPrefix+"$5]");element.setAttribute('title',tip);}}};window.addPortletLink=function(portlet,href,text,id,tooltip,accesskey,nextnode){var root=document.getElementById(portlet);if(!root){return null;}var uls=root.getElementsByTagName('ul');var node;if(uls.length>0){node=uls[0];}else{node=document.createElement('ul');var lastElementChild=null;for(var i=0;i<root.childNodes.length;++i){if(root.childNodes[i].
+nodeType==1){lastElementChild=root.childNodes[i];}}if(lastElementChild&&lastElementChild.nodeName.match(/div/i)){lastElementChild.appendChild(node);}else{root.appendChild(node);}}if(!node){return null;}root.className=root.className.replace(/(^| )emptyPortlet( |$)/,"$2");var link=document.createElement('a');link.appendChild(document.createTextNode(text));link.href=href;var span=document.createElement('span');span.appendChild(link);var item=document.createElement('li');item.appendChild(span);if(id){item.id=id;}if(accesskey){link.setAttribute('accesskey',accesskey);tooltip+=' ['+accesskey+']';}if(tooltip){link.setAttribute('title',tooltip);}if(accesskey&&tooltip){updateTooltipAccessKeys([link]);}if(nextnode&&nextnode.parentNode==node){node.insertBefore(item,nextnode);}else{node.appendChild(item);}return item;};window.getInnerText=function(el){if(typeof el=='string'){return el;}if(typeof el=='undefined'){return el;}if(el.nodeType&&el.getAttribute('data-sort-value')!==null){return el.
+getAttribute('data-sort-value');}if(el.textContent){return el.textContent;}if(el.innerText){return el.innerText;}var str='';var cs=el.childNodes;var l=cs.length;for(var i=0;i<l;i++){switch(cs[i].nodeType){case 1:str+=getInnerText(cs[i]);break;case 3:str+=cs[i].nodeValue;break;}}return str;};window.checkboxes=undefined;window.lastCheckbox=undefined;window.setupCheckboxShiftClick=function(){checkboxes=[];lastCheckbox=null;var inputs=document.getElementsByTagName('input');addCheckboxClickHandlers(inputs);};window.addCheckboxClickHandlers=function(inputs,start){if(!start){start=0;}var finish=start+250;if(finish>inputs.length){finish=inputs.length;}for(var i=start;i<finish;i++){var cb=inputs[i];if(!cb.type||cb.type.toLowerCase()!='checkbox'||(' '+cb.className+' ').indexOf(' noshiftselect ')!=-1){continue;}var end=checkboxes.length;checkboxes[end]=cb;cb.index=end;addClickHandler(cb,checkboxClickHandler);}if(finish<inputs.length){setTimeout(function(){addCheckboxClickHandlers(inputs,finish);}
+,200);}};window.checkboxClickHandler=function(e){if(typeof e=='undefined'){e=window.event;}if(!e.shiftKey||lastCheckbox===null){lastCheckbox=this.index;return true;}var endState=this.checked;var start,finish;if(this.index<lastCheckbox){start=this.index+1;finish=lastCheckbox;}else{start=lastCheckbox;finish=this.index-1;}for(var i=start;i<=finish;++i){checkboxes[i].checked=endState;if(i>start&&typeof checkboxes[i].onchange=='function'){checkboxes[i].onchange();}}lastCheckbox=this.index;return true;};window.getElementsByClassName=function(oElm,strTagName,oClassNames){var arrReturnElements=[];if(typeof(oElm.getElementsByClassName)=='function'){var arrNativeReturn=oElm.getElementsByClassName(oClassNames);if(strTagName=='*'){return arrNativeReturn;}for(var h=0;h<arrNativeReturn.length;h++){if(arrNativeReturn[h].tagName.toLowerCase()==strTagName.toLowerCase()){arrReturnElements[arrReturnElements.length]=arrNativeReturn[h];}}return arrReturnElements;}var arrElements=(strTagName=='*'&&oElm.all)
+?oElm.all:oElm.getElementsByTagName(strTagName);var arrRegExpClassNames=[];if(typeof oClassNames=='object'){for(var i=0;i<oClassNames.length;i++){arrRegExpClassNames[arrRegExpClassNames.length]=new RegExp("(^|\\s)"+oClassNames[i].replace(/\-/g,"\\-")+"(\\s|$)");}}else{arrRegExpClassNames[arrRegExpClassNames.length]=new RegExp("(^|\\s)"+oClassNames.replace(/\-/g,"\\-")+"(\\s|$)");}var oElement;var bMatchesAll;for(var j=0;j<arrElements.length;j++){oElement=arrElements[j];bMatchesAll=true;for(var k=0;k<arrRegExpClassNames.length;k++){if(!arrRegExpClassNames[k].test(oElement.className)){bMatchesAll=false;break;}}if(bMatchesAll){arrReturnElements[arrReturnElements.length]=oElement;}}return(arrReturnElements);};window.redirectToFragment=function(fragment){var match=navigator.userAgent.match(/AppleWebKit\/(\d+)/);if(match){var webKitVersion=parseInt(match[1]);if(webKitVersion<420){return;}}if(window.location.hash==''){window.location.hash=fragment;if(is_gecko){addOnloadHook(function(){if(
+window.location.hash==fragment){window.location.hash=fragment;}});}}};window.jsMsg=function(message,className){if(!document.getElementById){return false;}var messageDiv=document.getElementById('mw-js-message');if(!messageDiv){messageDiv=document.createElement('div');if(document.getElementById('column-content')&&document.getElementById('content')){document.getElementById('content').insertBefore(messageDiv,document.getElementById('content').firstChild);}else if(document.getElementById('content')&&document.getElementById('article')){document.getElementById('article').insertBefore(messageDiv,document.getElementById('article').firstChild);}else{return false;}}messageDiv.setAttribute('id','mw-js-message');messageDiv.style.display='block';if(className){messageDiv.setAttribute('class','mw-js-message-'+className);}if(typeof message==='object'){while(messageDiv.hasChildNodes()){messageDiv.removeChild(messageDiv.firstChild);}messageDiv.appendChild(message);}else{messageDiv.innerHTML=message;}
+return true;};window.injectSpinner=function(element,id){var spinner=document.createElement('img');spinner.id='mw-spinner-'+id;spinner.src=mw.config.get('stylepath')+'/common/images/spinner.gif';spinner.alt=spinner.title='...';if(element.nextSibling){element.parentNode.insertBefore(spinner,element.nextSibling);}else{element.parentNode.appendChild(spinner);}};window.removeSpinner=function(id){var spinner=document.getElementById('mw-spinner-'+id);if(spinner){spinner.parentNode.removeChild(spinner);}};window.runOnloadHook=function(){if(doneOnloadHook||!(document.getElementById&&document.getElementsByTagName)){return;}doneOnloadHook=true;for(var i=0;i<onloadFuncts.length;i++){onloadFuncts[i]();}};window.addHandler=function(element,attach,handler){if(element.addEventListener){element.addEventListener(attach,handler,false);}else if(element.attachEvent){element.attachEvent('on'+attach,handler);}};window.hookEvent=function(hookName,hookFunct){addHandler(window,hookName,hookFunct);};window.
+addClickHandler=function(element,handler){addHandler(element,'click',handler);};window.removeHandler=function(element,remove,handler){if(window.removeEventListener){element.removeEventListener(remove,handler,false);}else if(window.detachEvent){element.detachEvent('on'+remove,handler);}};hookEvent('load',runOnloadHook);if(ie6_bugs){importScriptURI(mw.config.get('stylepath')+'/common/IEFixes.js');}})();;},{},{});mw.loader.implement("mediawiki.page.startup",function($){(function($){mw.page={};$('html').addClass('client-js').removeClass('client-nojs');$(mw.util.init);})(jQuery);;},{},{});mw.loader.implement("mediawiki.util",function($){(function($,mw){"use strict";var util={init:function(){var profile,$tocTitle,$tocToggleLink,hideTocCookie;$.messageBoxNew({id:'mw-js-message',parent:'#content'});profile=$.client.profile();if(profile.name==='opera'){util.tooltipAccessKeyPrefix='shift-esc-';}else if(profile.name==='chrome'){util.tooltipAccessKeyPrefix=(profile.platform==='mac'?'ctrl-option-':
+profile.platform==='win'?'alt-shift-':'alt-');}else if(profile.platform!=='win'&&profile.name==='safari'&&profile.layoutVersion>526){util.tooltipAccessKeyPrefix='ctrl-alt-';}else if(!(profile.platform==='win'&&profile.name==='safari')&&(profile.name==='safari'||profile.platform==='mac'||profile.name==='konqueror')){util.tooltipAccessKeyPrefix='ctrl-';}else if(profile.name==='firefox'&&profile.versionBase>'1'){util.tooltipAccessKeyPrefix='alt-shift-';}if($('#bodyContent').length){util.$content=$('#bodyContent');}else if($('#mw_contentholder').length){util.$content=$('#mw_contentholder');}else if($('#article').length){util.$content=$('#article');}else{util.$content=$('#content');}$tocTitle=$('#toctitle');$tocToggleLink=$('#togglelink');if($('#toc').length&&$tocTitle.length&&!$tocToggleLink.length){hideTocCookie=$.cookie('mw_hidetoc');$tocToggleLink=$('<a href="#" class="internal" id="togglelink"></a>').text(mw.msg('hidetoc')).click(function(e){e.preventDefault();util.toggleToc($(this));}
+);$tocTitle.append($tocToggleLink.wrap('<span class="toctoggle"></span>').parent().prepend('&nbsp;[').append(']&nbsp;'));if(hideTocCookie==='1'){util.toggleToc($tocToggleLink);}}},rawurlencode:function(str){str=String(str);return encodeURIComponent(str).replace(/!/g,'%21').replace(/'/g,'%27').replace(/\(/g,'%28').replace(/\)/g,'%29').replace(/\*/g,'%2A').replace(/~/g,'%7E');},wikiUrlencode:function(str){return util.rawurlencode(str).replace(/%20/g,'_').replace(/%3A/g,':').replace(/%2F/g,'/');},wikiGetlink:function(str){return mw.config.get('wgArticlePath').replace('$1',util.wikiUrlencode(typeof str==='string'?str:mw.config.get('wgPageName')));},wikiScript:function(str){return mw.config.get('wgScriptPath')+'/'+(str||'index')+mw.config.get('wgScriptExtension');},addCSS:function(text){var s=document.createElement('style');s.type='text/css';s.rel='stylesheet';document.getElementsByTagName('head')[0].appendChild(s);if(s.styleSheet){s.styleSheet.cssText=text;}else{s.appendChild(document.
+createTextNode(String(text)));}return s.sheet||s;},toggleToc:function($toggleLink,callback){var $tocList=$('#toc ul:first');if($tocList.length){if($tocList.is(':hidden')){$tocList.slideDown('fast',callback);$toggleLink.text(mw.msg('hidetoc'));$('#toc').removeClass('tochidden');$.cookie('mw_hidetoc',null,{expires:30,path:'/'});return true;}else{$tocList.slideUp('fast',callback);$toggleLink.text(mw.msg('showtoc'));$('#toc').addClass('tochidden');$.cookie('mw_hidetoc','1',{expires:30,path:'/'});return false;}}else{return null;}},getParamValue:function(param,url){url=url||document.location.href;var re=new RegExp('^[^#]*[&?]'+$.escapeRE(param)+'=([^&#]*)'),m=re.exec(url);if(m&&m.length>1){return decodeURIComponent(m[1].replace(/\+/g,'%20'));}return null;},tooltipAccessKeyPrefix:'alt-',tooltipAccessKeyRegexp:/\[(ctrl-)?(alt-)?(shift-)?(esc-)?(.)\]$/,updateTooltipAccessKeys:function($nodes){if(!$nodes){$nodes=$('#column-one a, #mw-head a, #mw-panel a, #p-logo a, input, label');}else if(!(
+$nodes instanceof $)){$nodes=$($nodes);}$nodes.attr('title',function(i,val){if(val&&util.tooltipAccessKeyRegexp.exec(val)){return val.replace(util.tooltipAccessKeyRegexp,'['+util.tooltipAccessKeyPrefix+'$5]');}return val;});},$content:null,addPortletLink:function(portlet,href,text,id,tooltip,accesskey,nextnode){var $item,$link,$portlet,$ul;if(arguments.length<3){return null;}$link=$('<a>').attr('href',href).text(text);if(tooltip){$link.attr('title',tooltip);}switch(mw.config.get('skin')){case'standard':case'cologneblue':$('#quickbar').append($link.after('<br/>'));return $link[0];case'nostalgia':$('#searchform').before($link).before(' &#124; ');return $link[0];default:$portlet=$('#'+portlet);if($portlet.length===0){return null;}$ul=$portlet.find('ul');if($ul.length===0){if($portlet.find('div:first').length===0){$portlet.append('<ul></ul>');}else{$portlet.find('div').eq(-1).append('<ul></ul>');}$ul=$portlet.find('ul').eq(0);}if($ul.length===0){return null;}$portlet.removeClass(
+'emptyPortlet');if($portlet.hasClass('vectorTabs')){$item=$link.wrap('<li><span></span></li>').parent().parent();}else{$item=$link.wrap('<li></li>').parent();}if(id){$item.attr('id',id);}if(accesskey){$link.attr('accesskey',accesskey);tooltip+=' ['+accesskey+']';$link.attr('title',tooltip);}if(accesskey&&tooltip){util.updateTooltipAccessKeys($link);}if(nextnode&&nextnode.parentNode===$ul[0]){$(nextnode).before($item);}else if(typeof nextnode==='string'&&$ul.find(nextnode).length!==0){$ul.find(nextnode).eq(0).before($item);}else{$ul.append($item);}return $item[0];}},jsMessage:function(message,className){if(!arguments.length||message===''||message===null){$('#mw-js-message').empty().hide();return true;}else{var $messageDiv=$('#mw-js-message');if(!$messageDiv.length){$messageDiv=$('<div id="mw-js-message"></div>');if(util.$content.parent().length){util.$content.parent().prepend($messageDiv);}else{return false;}}if(className){$messageDiv.prop('class','mw-js-message-'+className);}if(typeof
+message==='object'){$messageDiv.empty();$messageDiv.append(message);}else{$messageDiv.html(message);}$messageDiv.slideDown();return true;}},validateEmail:function(mailtxt){var rfc5322_atext,rfc1034_ldh_str,HTML5_email_regexp;if(mailtxt===''){return null;}rfc5322_atext="a-z0-9!#$%&'*+\\-/=?^_`{|}~";rfc1034_ldh_str="a-z0-9\\-";HTML5_email_regexp=new RegExp('^'+'['+rfc5322_atext+'\\.]+'+'@'+'['+rfc1034_ldh_str+']+'+'(?:\\.['+rfc1034_ldh_str+']+)*'+'$','i');return(null!==mailtxt.match(HTML5_email_regexp));},isIPv4Address:function(address,allowBlock){if(typeof address!=='string'){return false;}var block=allowBlock?'(?:\\/(?:3[0-2]|[12]?\\d))?':'',RE_IP_BYTE='(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|0?[0-9]?[0-9])',RE_IP_ADD='(?:'+RE_IP_BYTE+'\\.){3}'+RE_IP_BYTE;return address.search(new RegExp('^'+RE_IP_ADD+block+'$'))!==-1;},isIPv6Address:function(address,allowBlock){if(typeof address!=='string'){return false;}var block=allowBlock?'(?:\\/(?:12[0-8]|1[01][0-9]|[1-9]?\\d))?':'',RE_IPV6_ADD='(?:'+
+':(?::|(?::'+'[0-9A-Fa-f]{1,4}'+'){1,7})'+'|'+'[0-9A-Fa-f]{1,4}'+'(?::'+'[0-9A-Fa-f]{1,4}'+'){0,6}::'+'|'+'[0-9A-Fa-f]{1,4}'+'(?::'+'[0-9A-Fa-f]{1,4}'+'){7}'+')';if(address.search(new RegExp('^'+RE_IPV6_ADD+block+'$'))!==-1){return true;}RE_IPV6_ADD='[0-9A-Fa-f]{1,4}'+'(?:::?'+'[0-9A-Fa-f]{1,4}'+'){1,6}';return address.search(new RegExp('^'+RE_IPV6_ADD+block+'$'))!==-1&&address.search(/::/)!==-1&&address.search(/::.*::/)===-1;}};mw.util=util;})(jQuery,mediaWiki);;},{},{"showtoc":"show","hidetoc":"hide"});
+
+/* cache key: oni_wiki:resourceloader:filter:minify-js:7:1aa4243ba1ca1aec859d6ce378a84443 */
Index: /Vago/trunk/Vago/help/XMLSNDD_files/load(3).php
===================================================================
--- /Vago/trunk/Vago/help/XMLSNDD_files/load(3).php	(revision 771)
+++ /Vago/trunk/Vago/help/XMLSNDD_files/load(3).php	(revision 771)
@@ -0,0 +1,3 @@
+jQuery(function($){$('div.vectorMenu').each(function(){var self=this;$('h5:first a:first',this).click(function(e){$('.menu:first',self).toggleClass('menuForceShow');e.preventDefault();}).focus(function(){$(self).addClass('vectorMenuFocus');}).blur(function(){$(self).removeClass('vectorMenuFocus');});});});;mw.loader.state({"skins.vector":"ready"});
+
+/* cache key: oni_wiki:resourceloader:filter:minify-js:7:0fcba82177db6429d02096ea1f0465ed */
Index: /Vago/trunk/Vago/help/XMLSNDD_files/load(4).php
===================================================================
--- /Vago/trunk/Vago/help/XMLSNDD_files/load(4).php	(revision 771)
+++ /Vago/trunk/Vago/help/XMLSNDD_files/load(4).php	(revision 771)
@@ -0,0 +1,33 @@
+mw.loader.implement("jquery.checkboxShiftClick",function($){(function($){$.fn.checkboxShiftClick=function(text){var prevCheckbox=null;var $box=this;$box.click(function(e){if(prevCheckbox!==null&&e.shiftKey){$box.slice(Math.min($box.index(prevCheckbox),$box.index(e.target)),Math.max($box.index(prevCheckbox),$box.index(e.target))+1).prop('checked',e.target.checked?true:false);}prevCheckbox=e.target;});return $box;};})(jQuery);;},{},{});mw.loader.implement("jquery.makeCollapsible",function($){(function($,mw){$.fn.makeCollapsible=function(){return this.each(function(){var _fn='jquery.makeCollapsible> ';var $that=$(this).addClass('mw-collapsible'),that=this,collapsetext=$(this).attr('data-collapsetext'),expandtext=$(this).attr('data-expandtext'),toggleElement=function($collapsible,action,$defaultToggle,instantHide){if(!$collapsible.jquery){return;}if(action!='expand'&&action!='collapse'){return;}if(typeof $defaultToggle=='undefined'){$defaultToggle=null;}if($defaultToggle!==null&&!(
+$defaultToggle instanceof $)){return;}var $containers=null;if(action=='collapse'){if($collapsible.is('table')){$containers=$collapsible.find('>tbody>tr');if($defaultToggle){$containers.not($defaultToggle.closest('tr')).stop(true,true).fadeOut();}else{if(instantHide){$containers.hide();}else{$containers.stop(true,true).fadeOut();}}}else if($collapsible.is('ul')||$collapsible.is('ol')){$containers=$collapsible.find('> li');if($defaultToggle){$containers.not($defaultToggle.parent()).stop(true,true).slideUp();}else{if(instantHide){$containers.hide();}else{$containers.stop(true,true).slideUp();}}}else{var $collapsibleContent=$collapsible.find('> .mw-collapsible-content');if($collapsibleContent.length){if(instantHide){$collapsibleContent.hide();}else{$collapsibleContent.slideUp();}}else{if($collapsible.is('tr')||$collapsible.is('td')||$collapsible.is('th')){$collapsible.fadeOut();}else{$collapsible.slideUp();}}}}else{if($collapsible.is('table')){$containers=$collapsible.find('>tbody>tr');if(
+$defaultToggle){$containers.not($defaultToggle.parent().parent()).stop(true,true).fadeIn();}else{$containers.stop(true,true).fadeIn();}}else if($collapsible.is('ul')||$collapsible.is('ol')){$containers=$collapsible.find('> li');if($defaultToggle){$containers.not($defaultToggle.parent()).stop(true,true).slideDown();}else{$containers.stop(true,true).slideDown();}}else{var $collapsibleContent=$collapsible.find('> .mw-collapsible-content');if($collapsibleContent.length){$collapsibleContent.slideDown();}else{if($collapsible.is('tr')||$collapsible.is('td')||$collapsible.is('th')){$collapsible.fadeIn();}else{$collapsible.slideDown();}}}}},toggleLinkDefault=function(that,e){var $that=$(that),$collapsible=$that.closest('.mw-collapsible.mw-made-collapsible').toggleClass('mw-collapsed');e.preventDefault();e.stopPropagation();if(!$that.hasClass('mw-collapsible-toggle-collapsed')){$that.removeClass('mw-collapsible-toggle-expanded').addClass('mw-collapsible-toggle-collapsed');if($that.find('> a').
+length){$that.find('> a').text(expandtext);}else{$that.text(expandtext);}toggleElement($collapsible,'collapse',$that);}else{$that.removeClass('mw-collapsible-toggle-collapsed').addClass('mw-collapsible-toggle-expanded');if($that.find('> a').length){$that.find('> a').text(collapsetext);}else{$that.text(collapsetext);}toggleElement($collapsible,'expand',$that);}return;},toggleLinkPremade=function($that,e){var $collapsible=$that.eq(0).closest('.mw-collapsible.mw-made-collapsible').toggleClass('mw-collapsed');if($(e.target).is('a')){return true;}e.preventDefault();e.stopPropagation();if(!$that.hasClass('mw-collapsible-toggle-collapsed')){$that.removeClass('mw-collapsible-toggle-expanded').addClass('mw-collapsible-toggle-collapsed');toggleElement($collapsible,'collapse',$that);}else{$that.removeClass('mw-collapsible-toggle-collapsed').addClass('mw-collapsible-toggle-expanded');toggleElement($collapsible,'expand',$that);}return;},toggleLinkCustom=function($that,e,$collapsible){if(e){e.
+preventDefault();e.stopPropagation();}var action=$collapsible.hasClass('mw-collapsed')?'expand':'collapse';$collapsible.toggleClass('mw-collapsed');toggleElement($collapsible,action,$that);};if(!collapsetext){collapsetext=mw.msg('collapsible-collapse');}if(!expandtext){expandtext=mw.msg('collapsible-expand');}var $toggleLink=$('<a href="#"></a>').text(collapsetext).wrap('<span class="mw-collapsible-toggle"></span>').parent().prepend('&nbsp;[').append(']&nbsp;').bind('click.mw-collapse',function(e){toggleLinkDefault(this,e);});if($that.hasClass('mw-made-collapsible')){return;}else{$that.addClass('mw-made-collapsible');}if(($that.attr('id')||'').indexOf('mw-customcollapsible-')===0){var thatId=$that.attr('id'),$customTogglers=$('.'+thatId.replace('mw-customcollapsible','mw-customtoggle'));mw.log(_fn+'Found custom collapsible: #'+thatId);if($customTogglers.length){$customTogglers.bind('click.mw-collapse',function(e){toggleLinkCustom($(this),e,$that);});}else{mw.log(_fn+'#'+thatId+
+': Missing toggler!');}if($that.hasClass('mw-collapsed')){$that.removeClass('mw-collapsed');toggleLinkCustom($customTogglers,null,$that);}}else{if($that.is('table')){var $firstRowCells=$('tr:first th, tr:first td',that),$toggle=$firstRowCells.find('> .mw-collapsible-toggle');if(!$toggle.length){$firstRowCells.eq(-1).prepend($toggleLink);}else{$toggleLink=$toggle.unbind('click.mw-collapse').bind('click.mw-collapse',function(e){toggleLinkPremade($toggle,e);});}}else if($that.is('ul')||$that.is('ol')){var $firstItem=$('li:first',$that),$toggle=$firstItem.find('> .mw-collapsible-toggle');if(!$toggle.length){var firstval=$firstItem.attr('value');if(firstval===undefined||!firstval||firstval=='-1'){$firstItem.attr('value','1');}$that.prepend($toggleLink.wrap('<li class="mw-collapsible-toggle-li"></li>').parent());}else{$toggleLink=$toggle.unbind('click.mw-collapse').bind('click.mw-collapse',function(e){toggleLinkPremade($toggle,e);});}}else{var $toggle=$that.find('> .mw-collapsible-toggle');
+if(!$that.find('> .mw-collapsible-content').length){$that.wrapInner('<div class="mw-collapsible-content"></div>');}if(!$toggle.length){$that.prepend($toggleLink);}else{$toggleLink=$toggle.unbind('click.mw-collapse').bind('click.mw-collapse',function(e){toggleLinkPremade($toggle,e);});}}}if($that.hasClass('mw-collapsed')&&($that.attr('id')||'').indexOf('mw-customcollapsible-')!==0){$that.removeClass('mw-collapsed');toggleElement($that,'collapse',$toggleLink.eq(0),true);$toggleLink.eq(0).click();}});};})(jQuery,mediaWiki);;},{"all":".mw-collapsible-toggle{float:right} li .mw-collapsible-toggle{float:none} .mw-collapsible-toggle-li{list-style:none}\n\n/* cache key: oni_wiki:resourceloader:filter:minify-css:7:4250852ed2349a0d4d0fc6509a3e7d4c */\n"},{"collapsible-expand":"Expand","collapsible-collapse":"Collapse"});mw.loader.implement("jquery.mw-jump",function($){jQuery(function($){$('.mw-jump').delegate('a','focus blur',function(e){if(e.type==="blur"||e.type==="focusout"){$(this).closest(
+'.mw-jump').css({height:'0'});}else{$(this).closest('.mw-jump').css({height:'auto'});}});});;},{},{});mw.loader.implement("jquery.placeholder",function($){(function($){$.fn.placeholder=function(){return this.each(function(){if(this.placeholder&&'placeholder'in document.createElement(this.tagName)){return;}var placeholder=this.getAttribute('placeholder');var $input=$(this);if(this.value===''||this.value===placeholder){$input.addClass('placeholder').val(placeholder);}$input.blur(function(){if(this.value===''){this.value=placeholder;$input.addClass('placeholder');}}).bind('focus drop keydown paste',function(e){if($input.hasClass('placeholder')){if(e.type=='drop'&&e.originalEvent.dataTransfer){try{this.value=e.originalEvent.dataTransfer.getData('text/plain');}catch(exception){this.value=e.originalEvent.dataTransfer.getData('text');}e.preventDefault();}else{this.value='';}$input.removeClass('placeholder');}});if(this.form){$(this.form).submit(function(){if($input.hasClass('placeholder')){
+$input.val('').removeClass('placeholder');}});}});};})(jQuery);;},{},{});mw.loader.implement("mediawiki.legacy.mwsuggest",function($){if(!mw.config.exists('wgMWSuggestTemplate')){mw.config.set('wgMWSuggestTemplate',mw.config.get('wgServer')+mw.config.get('wgScriptPath')+"/api.php?action=opensearch\x26search={searchTerms}\x26namespace={namespaces}\x26suggest");}window.os_map={};window.os_cache={};window.os_cur_keypressed=0;window.os_keypressed_count=0;window.os_timer=null;window.os_mouse_pressed=false;window.os_mouse_num=-1;window.os_mouse_moved=false;window.os_search_timeout=250;window.os_autoload_inputs=['searchInput','searchInput2','powerSearchText','searchText'];window.os_autoload_forms=['searchform','searchform2','powersearch','search'];window.os_is_stopped=false;window.os_max_lines_per_suggest=7;window.os_animation_steps=6;window.os_animation_min_step=2;window.os_animation_delay=30;window.os_container_max_width=2;window.os_animation_timer=null;window.os_enabled=true;window.
+os_use_datalist=false;window.os_Timer=function(id,r,query){this.id=id;this.r=r;this.query=query;};window.os_Results=function(name,formname){this.searchform=formname;this.searchbox=name;this.container=name+'Suggest';this.resultTable=name+'Result';this.resultText=name+'ResultText';this.toggle=name+'Toggle';this.query=null;this.results=null;this.resultCount=0;this.original=null;this.selected=-1;this.containerCount=0;this.containerRow=0;this.containerTotal=0;this.visible=false;this.stayHidden=false;};window.os_AnimationTimer=function(r,target){this.r=r;var current=document.getElementById(r.container).offsetWidth;this.inc=Math.round((target-current)/os_animation_steps);if(this.inc<os_animation_min_step&&this.inc>=0){this.inc=os_animation_min_step;}if(this.inc>-os_animation_min_step&&this.inc<0){this.inc=-os_animation_min_step;}this.target=target;};window.os_MWSuggestInit=function(){if(!window.os_enabled){return;}for(var i=0;i<os_autoload_inputs.length;i++){var id=os_autoload_inputs[i];var
+form=os_autoload_forms[i];element=document.getElementById(id);if(element!=null){os_initHandlers(id,form,element);}}};window.os_MWSuggestTeardown=function(){for(var i=0;i<os_autoload_inputs.length;i++){var id=os_autoload_inputs[i];var form=os_autoload_forms[i];element=document.getElementById(id);if(element!=null){os_teardownHandlers(id,form,element);}}};window.os_MWSuggestDisable=function(){window.os_MWSuggestTeardown();window.os_enabled=false;}
+window.os_initHandlers=function(name,formname,element){var r=new os_Results(name,formname);var formElement=document.getElementById(formname);if(!formElement){return;}os_hookEvent(element,'keyup',os_eventKeyup);os_hookEvent(element,'keydown',os_eventKeydown);os_hookEvent(element,'keypress',os_eventKeypress);if(!os_use_datalist){os_hookEvent(element,'blur',os_eventBlur);os_hookEvent(element,'focus',os_eventFocus);element.setAttribute('autocomplete','off');}os_hookEvent(formElement,'submit',os_eventOnsubmit);os_map[name]=r;if(document.getElementById(r.toggle)==null){}};window.os_teardownHandlers=function(name,formname,element){var formElement=document.getElementById(formname);if(!formElement){return;}os_unhookEvent(element,'keyup',os_eventKeyup);os_unhookEvent(element,'keydown',os_eventKeydown);os_unhookEvent(element,'keypress',os_eventKeypress);if(!os_use_datalist){os_unhookEvent(element,'blur',os_eventBlur);os_unhookEvent(element,'focus',os_eventFocus);element.removeAttribute(
+'autocomplete');}os_unhookEvent(formElement,'submit',os_eventOnsubmit);};window.os_hookEvent=function(element,hookName,hookFunct){if(element.addEventListener){element.addEventListener(hookName,hookFunct,false);}else if(window.attachEvent){element.attachEvent('on'+hookName,hookFunct);}};window.os_unhookEvent=function(element,hookName,hookFunct){if(element.removeEventListener){element.removeEventListener(hookName,hookFunct,false);}else if(element.detachEvent){element.detachEvent('on'+hookName,hookFunct);}}
+window.os_eventKeyup=function(e){var targ=os_getTarget(e);var r=os_map[targ.id];if(r==null){return;}if(os_keypressed_count==0){os_processKey(r,os_cur_keypressed,targ);}var query=targ.value;os_fetchResults(r,query,os_search_timeout);};window.os_processKey=function(r,keypressed,targ){if(keypressed==40&&!r.visible&&os_timer==null){r.query='';os_fetchResults(r,targ.value,0);}if(os_use_datalist){return;}if(keypressed==40){if(r.visible){os_changeHighlight(r,r.selected,r.selected+1,true);}}else if(keypressed==38){if(r.visible){os_changeHighlight(r,r.selected,r.selected-1,true);}}else if(keypressed==27){document.getElementById(r.searchbox).value=r.original;r.query=r.original;os_hideResults(r);}else if(r.query!=document.getElementById(r.searchbox).value){}};window.os_eventKeypress=function(e){var targ=os_getTarget(e);var r=os_map[targ.id];if(r==null){return;}var keypressed=os_cur_keypressed;os_keypressed_count++;os_processKey(r,keypressed,targ);};window.os_eventKeydown=function(e){if(!e){e=
+window.event;}var targ=os_getTarget(e);var r=os_map[targ.id];if(r==null){return;}os_mouse_moved=false;os_cur_keypressed=(e.keyCode==undefined)?e.which:e.keyCode;os_keypressed_count=0;};window.os_eventOnsubmit=function(e){var targ=os_getTarget(e);os_is_stopped=true;if(os_timer!=null&&os_timer.id!=null){clearTimeout(os_timer.id);os_timer=null;}for(i=0;i<os_autoload_inputs.length;i++){var r=os_map[os_autoload_inputs[i]];if(r!=null){var b=document.getElementById(r.searchform);if(b!=null&&b==targ){r.query=document.getElementById(r.searchbox).value;}os_hideResults(r);}}return true;};window.os_hideResults=function(r){if(os_use_datalist){document.getElementById(r.searchbox).setAttribute('list','');}else{var c=document.getElementById(r.container);if(c!=null){c.style.visibility='hidden';}}r.visible=false;r.selected=-1;};window.os_decodeValue=function(value){if(decodeURIComponent){return decodeURIComponent(value);}if(unescape){return unescape(value);}return null;};window.os_encodeQuery=function(
+value){if(encodeURIComponent){return encodeURIComponent(value);}if(escape){return escape(value);}return null;};window.os_updateResults=function(r,query,text,cacheKey){os_cache[cacheKey]=text;r.query=query;r.original=query;if(text==''){r.results=null;r.resultCount=0;os_hideResults(r);}else{try{var p=eval('('+text+')');if(p.length<2||p[1].length==0){r.results=null;r.resultCount=0;os_hideResults(r);return;}if(os_use_datalist){os_setupDatalist(r,p[1]);}else{os_setupDiv(r,p[1]);}}catch(e){os_hideResults(r);os_cache[cacheKey]=null;}}};window.os_setupDatalist=function(r,results){var s=document.getElementById(r.searchbox);var c=document.getElementById(r.container);if(c==null){c=document.createElement('datalist');c.setAttribute('id',r.container);document.body.appendChild(c);}else{c.innerHTML='';}s.setAttribute('list',r.container);r.results=[];r.resultCount=results.length;r.visible=true;for(i=0;i<results.length;i++){var title=os_decodeValue(results[i]);var opt=document.createElement('option');
+opt.value=title;r.results[i]=title;c.appendChild(opt);}};window.os_getNamespaces=function(r){var namespaces='';var elements=document.forms[r.searchform].elements;for(i=0;i<elements.length;i++){var name=elements[i].name;if(typeof name!='undefined'&&name.length>2&&name[0]=='n'&&name[1]=='s'&&((elements[i].type=='checkbox'&&elements[i].checked)||(elements[i].type=='hidden'&&elements[i].value=='1'))){if(namespaces!=''){namespaces+='|';}namespaces+=name.substring(2);}}if(namespaces==''){namespaces=mw.config.get('wgSearchNamespaces').join('|');}return namespaces;};window.os_updateIfRelevant=function(r,query,text,cacheKey){var t=document.getElementById(r.searchbox);if(t!=null&&t.value==query){os_updateResults(r,query,text,cacheKey);}r.query=query;};window.os_delayedFetch=function(){if(os_timer==null){return;}var r=os_timer.r;var query=os_timer.query;os_timer=null;var path=mw.config.get('wgMWSuggestTemplate').replace("{namespaces}",os_getNamespaces(r)).replace("{dbname}",mw.config.get(
+'wgDBname')).replace("{searchTerms}",os_encodeQuery(query));var cached=os_cache[path];if(cached!=null&&cached!=undefined){os_updateIfRelevant(r,query,cached,path);}else{var xmlhttp=sajax_init_object();if(xmlhttp){try{xmlhttp.open('GET',path,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&typeof os_updateIfRelevant=='function'){os_updateIfRelevant(r,query,xmlhttp.responseText,path);}};xmlhttp.send(null);}catch(e){if(window.location.hostname=='localhost'){alert("Your browser blocks XMLHttpRequest to 'localhost', try using a real hostname for development/testing.");}throw e;}}}};window.os_fetchResults=function(r,query,timeout){if(query==''){r.query='';os_hideResults(r);return;}else if(query==r.query){return;}os_is_stopped=false;if(os_timer!=null&&os_timer.id!=null){clearTimeout(os_timer.id);}if(timeout!=0){os_timer=new os_Timer(setTimeout("os_delayedFetch()",timeout),r,query);}else{os_timer=new os_Timer(null,r,query);os_delayedFetch();}};window.os_getTarget=function(
+e){if(!e){e=window.event;}if(e.target){return e.target;}else if(e.srcElement){return e.srcElement;}else{return null;}};window.os_isNumber=function(x){if(x==''||isNaN(x)){return false;}for(var i=0;i<x.length;i++){var c=x.charAt(i);if(!(c>='0'&&c<='9')){return false;}}return true;};window.os_enableSuggestionsOn=function(inputId,formName){os_initHandlers(inputId,formName,document.getElementById(inputId));};window.os_disableSuggestionsOn=function(inputId){r=os_map[inputId];if(r!=null){os_timer=null;os_hideResults(r);document.getElementById(inputId).setAttribute('autocomplete','on');os_map[inputId]=null;}var index=os_autoload_inputs.indexOf(inputId);if(index>=0){os_autoload_inputs[index]=os_autoload_forms[index]='';}};window.os_eventBlur=function(e){var targ=os_getTarget(e);var r=os_map[targ.id];if(r==null){return;}if(!os_mouse_pressed){os_hideResults(r);r.stayHidden=true;if(os_timer!=null&&os_timer.id!=null){clearTimeout(os_timer.id);}os_timer=null;}};window.os_eventFocus=function(e){var
+targ=os_getTarget(e);var r=os_map[targ.id];if(r==null){return;}r.stayHidden=false;};window.os_setupDiv=function(r,results){var c=document.getElementById(r.container);if(c==null){c=os_createContainer(r);}c.innerHTML=os_createResultTable(r,results);var t=document.getElementById(r.resultTable);r.containerTotal=t.offsetHeight;r.containerRow=t.offsetHeight/r.resultCount;os_fitContainer(r);os_trimResultText(r);os_showResults(r);};window.os_createResultTable=function(r,results){var c=document.getElementById(r.container);var width=c.offsetWidth-os_operaWidthFix(c.offsetWidth);var html='<table class="os-suggest-results" id="'+r.resultTable+'" style="width: '+width+'px;">';r.results=[];r.resultCount=results.length;for(i=0;i<results.length;i++){var title=os_decodeValue(results[i]);r.results[i]=title;html+='<tr><td class="os-suggest-result" id="'+r.resultTable+i+'"><span id="'+r.resultText+i+'">'+title+'</span></td></tr>';}html+='</table>';return html;};window.os_showResults=function(r){if(
+os_is_stopped){return;}if(r.stayHidden){return;}os_fitContainer(r);var c=document.getElementById(r.container);r.selected=-1;if(c!=null){c.scrollTop=0;c.style.visibility='visible';r.visible=true;}};window.os_operaWidthFix=function(x){if(typeof document.body.style.overflowX!='string'){return 30;}return 0;};window.f_clientWidth=function(){return f_filterResults(window.innerWidth?window.innerWidth:0,document.documentElement?document.documentElement.clientWidth:0,document.body?document.body.clientWidth:0);};window.f_clientHeight=function(){return f_filterResults(window.innerHeight?window.innerHeight:0,document.documentElement?document.documentElement.clientHeight:0,document.body?document.body.clientHeight:0);};window.f_scrollLeft=function(){return f_filterResults(window.pageXOffset?window.pageXOffset:0,document.documentElement?document.documentElement.scrollLeft:0,document.body?document.body.scrollLeft:0);};window.f_scrollTop=function(){return f_filterResults(window.pageYOffset?window.
+pageYOffset:0,document.documentElement?document.documentElement.scrollTop:0,document.body?document.body.scrollTop:0);};window.f_filterResults=function(n_win,n_docel,n_body){var n_result=n_win?n_win:0;if(n_docel&&(!n_result||(n_result>n_docel))){n_result=n_docel;}return n_body&&(!n_result||(n_result>n_body))?n_body:n_result;};window.os_availableHeight=function(r){var absTop=document.getElementById(r.container).style.top;var px=absTop.lastIndexOf('px');if(px>0){absTop=absTop.substring(0,px);}return f_clientHeight()-(absTop-f_scrollTop());};window.os_getElementPosition=function(elemID){var offsetTrail=document.getElementById(elemID);var offsetLeft=0;var offsetTop=0;while(offsetTrail){offsetLeft+=offsetTrail.offsetLeft;offsetTop+=offsetTrail.offsetTop;offsetTrail=offsetTrail.offsetParent;}if(navigator.userAgent.indexOf('Mac')!=-1&&typeof document.body.leftMargin!='undefined'){offsetLeft+=document.body.leftMargin;offsetTop+=document.body.topMargin;}return{left:offsetLeft,top:offsetTop};};
+window.os_createContainer=function(r){var c=document.createElement('div');var s=document.getElementById(r.searchbox);var pos=os_getElementPosition(r.searchbox);var left=pos.left;var top=pos.top+s.offsetHeight;c.className='os-suggest';c.setAttribute('id',r.container);document.body.appendChild(c);c=document.getElementById(r.container);c.style.top=top+'px';c.style.left=left+'px';c.style.width=s.offsetWidth+'px';c.onmouseover=function(event){os_eventMouseover(r.searchbox,event);};c.onmousemove=function(event){os_eventMousemove(r.searchbox,event);};c.onmousedown=function(event){return os_eventMousedown(r.searchbox,event);};c.onmouseup=function(event){os_eventMouseup(r.searchbox,event);};return c;};window.os_fitContainer=function(r){var c=document.getElementById(r.container);var h=os_availableHeight(r)-20;var inc=r.containerRow;h=parseInt(h/inc)*inc;if(h<(2*inc)&&r.resultCount>1){h=2*inc;}if((h/inc)>os_max_lines_per_suggest){h=inc*os_max_lines_per_suggest;}if(h<r.containerTotal){c.style.
+height=h+'px';r.containerCount=parseInt(Math.round(h/inc));}else{c.style.height=r.containerTotal+'px';r.containerCount=r.resultCount;}};window.os_trimResultText=function(r){var maxW=0;for(var i=0;i<r.resultCount;i++){var e=document.getElementById(r.resultText+i);if(e.offsetWidth>maxW){maxW=e.offsetWidth;}}var w=document.getElementById(r.container).offsetWidth;var fix=0;if(r.containerCount<r.resultCount){fix=20;}else{fix=os_operaWidthFix(w);}if(fix<4){fix=4;}maxW+=fix;var normW=document.getElementById(r.searchbox).offsetWidth;var prop=maxW/normW;if(prop>os_container_max_width){prop=os_container_max_width;}else if(prop<1){prop=1;}var newW=Math.round(normW*prop);if(w!=newW){w=newW;if(os_animation_timer!=null){clearInterval(os_animation_timer.id);}os_animation_timer=new os_AnimationTimer(r,w);os_animation_timer.id=setInterval("os_animateChangeWidth()",os_animation_delay);w-=fix;}if(w<10){return;}for(var i=0;i<r.resultCount;i++){var e=document.getElementById(r.resultText+i);var replace=1;
+var lastW=e.offsetWidth+1;var iteration=0;var changedText=false;while(e.offsetWidth>w&&(e.offsetWidth<lastW||iteration<2)){changedText=true;lastW=e.offsetWidth;var l=e.innerHTML;e.innerHTML=l.substring(0,l.length-replace)+'...';iteration++;replace=4;}if(changedText){document.getElementById(r.resultTable+i).setAttribute('title',r.results[i]);}}};window.os_animateChangeWidth=function(){var r=os_animation_timer.r;var c=document.getElementById(r.container);var w=c.offsetWidth;var normW=document.getElementById(r.searchbox).offsetWidth;var normL=os_getElementPosition(r.searchbox).left;var inc=os_animation_timer.inc;var target=os_animation_timer.target;var nw=w+inc;if((inc>0&&nw>=target)||(inc<=0&&nw<=target)){c.style.width=target+'px';clearInterval(os_animation_timer.id);os_animation_timer=null;}else{c.style.width=nw+'px';if(document.documentElement.dir=='rtl'){c.style.left=(normL+normW+(target-nw)-os_animation_timer.target-1)+'px';}}};window.os_changeHighlight=function(r,cur,next,
+updateSearchBox){if(next>=r.resultCount){next=r.resultCount-1;}if(next<-1){next=-1;}r.selected=next;if(cur==next){return;}if(cur>=0){var curRow=document.getElementById(r.resultTable+cur);if(curRow!=null){curRow.className='os-suggest-result';}}var newText;if(next>=0){var nextRow=document.getElementById(r.resultTable+next);if(nextRow!=null){nextRow.className=os_HighlightClass();}newText=r.results[next];}else{newText=r.original;}if(r.containerCount<r.resultCount){var c=document.getElementById(r.container);var vStart=c.scrollTop/r.containerRow;var vEnd=vStart+r.containerCount;if(next<vStart){c.scrollTop=next*r.containerRow;}else if(next>=vEnd){c.scrollTop=(next-r.containerCount+1)*r.containerRow;}}if(updateSearchBox){os_updateSearchQuery(r,newText);}};window.os_HighlightClass=function(){var match=navigator.userAgent.match(/AppleWebKit\/(\d+)/);if(match){var webKitVersion=parseInt(match[1]);if(webKitVersion<523){return'os-suggest-result-hl-webkit';}}return'os-suggest-result-hl';};window.
+os_updateSearchQuery=function(r,newText){document.getElementById(r.searchbox).value=newText;r.query=newText;};window.os_eventMouseover=function(srcId,e){var targ=os_getTarget(e);var r=os_map[srcId];if(r==null||!os_mouse_moved){return;}var num=os_getNumberSuffix(targ.id);if(num>=0){os_changeHighlight(r,r.selected,num,false);}};window.os_getNumberSuffix=function(id){var num=id.substring(id.length-2);if(!(num.charAt(0)>='0'&&num.charAt(0)<='9')){num=num.substring(1);}if(os_isNumber(num)){return parseInt(num);}else{return-1;}};window.os_eventMousemove=function(srcId,e){os_mouse_moved=true;};window.os_eventMousedown=function(srcId,e){var targ=os_getTarget(e);var r=os_map[srcId];if(r==null){return;}var num=os_getNumberSuffix(targ.id);os_mouse_pressed=true;if(num>=0){os_mouse_num=num;}document.getElementById(r.searchbox).focus();return false;};window.os_eventMouseup=function(srcId,e){var targ=os_getTarget(e);var r=os_map[srcId];if(r==null){return;}var num=os_getNumberSuffix(targ.id);if(num>=0
+&&os_mouse_num==num){os_updateSearchQuery(r,r.results[num]);os_hideResults(r);document.getElementById(r.searchform).submit();}os_mouse_pressed=false;document.getElementById(r.searchbox).focus();};window.os_createToggle=function(r,className){var t=document.createElement('span');t.className=className;t.setAttribute('id',r.toggle);var link=document.createElement('a');link.setAttribute('href','javascript:void(0);');link.onclick=function(){os_toggle(r.searchbox,r.searchform);};var msg=document.createTextNode(wgMWSuggestMessages[0]);link.appendChild(msg);t.appendChild(link);return t;};window.os_toggle=function(inputId,formName){r=os_map[inputId];var msg='';if(r==null){os_enableSuggestionsOn(inputId,formName);r=os_map[inputId];msg=wgMWSuggestMessages[0];}else{os_disableSuggestionsOn(inputId,formName);msg=wgMWSuggestMessages[1];}var link=document.getElementById(r.toggle).firstChild;link.replaceChild(document.createTextNode(msg),link.firstChild);};hookEvent('load',os_MWSuggestInit);;},{},{
+"search-mwsuggest-enabled":"with suggestions","search-mwsuggest-disabled":"no suggestions"});mw.loader.implement("mediawiki.page.ready",function($){jQuery(document).ready(function($){if(!('placeholder'in document.createElement('input'))){$('input[placeholder]').placeholder();}$('.mw-collapsible').makeCollapsible();if($('table.sortable').length){mw.loader.using('jquery.tablesorter',function(){$('table.sortable').tablesorter();});}$('input[type=checkbox]:not(.noshiftselect)').checkboxShiftClick();mw.util.updateTooltipAccessKeys();});;},{},{});mw.loader.implement("mediawiki.user",function($){(function($){function User(options,tokens){var that=this;this.options=options||new mw.Map();this.tokens=tokens||new mw.Map();function generateId(){var id='';var seed='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';for(var i=0,r;i<32;i++){r=Math.floor(Math.random()*seed.length);id+=seed.substring(r,r+1);}return id;}this.name=function(){return mw.config.get('wgUserName');};this.
+anonymous=function(){return that.name()?false:true;};this.sessionId=function(){var sessionId=$.cookie('mediaWiki.user.sessionId');if(typeof sessionId=='undefined'||sessionId===null){sessionId=generateId();$.cookie('mediaWiki.user.sessionId',sessionId,{'expires':null,'path':'/'});}return sessionId;};this.id=function(){var name=that.name();if(name){return name;}var id=$.cookie('mediaWiki.user.id');if(typeof id=='undefined'||id===null){id=generateId();}$.cookie('mediaWiki.user.id',id,{'expires':365,'path':'/'});return id;};this.bucket=function(key,options){options=$.extend({'buckets':{},'version':0,'tracked':false,'expires':30},options||{});var cookie=$.cookie('mediaWiki.user.bucket:'+key);var bucket=null;var version=0;if(typeof cookie==='string'&&cookie.length>2&&cookie.indexOf(':')>0){var parts=cookie.split(':');if(parts.length>1&&parts[0]==options.version){version=Number(parts[0]);bucket=String(parts[1]);}}if(bucket===null){if(!$.isPlainObject(options.buckets)){throw'Invalid buckets error. Object expected for options.buckets.'
+;}version=Number(options.version);var range=0,k;for(k in options.buckets){range+=options.buckets[k];}var rand=Math.random()*range;var total=0;for(k in options.buckets){bucket=k;total+=options.buckets[k];if(total>=rand){break;}}if(options.tracked){mw.loader.using('jquery.clickTracking',function(){$.trackAction('mediaWiki.user.bucket:'+key+'@'+version+':'+bucket);});}$.cookie('mediaWiki.user.bucket:'+key,version+':'+bucket,{'path':'/','expires':Number(options.expires)});}return bucket;};}mw.user=new User(mw.user.options,mw.user.tokens);})(jQuery);;},{},{});
+
+/* cache key: oni_wiki:resourceloader:filter:minify-js:7:d3fb03f9b61ada0e0e6ae2e20c3f4edc */
Index: /Vago/trunk/Vago/help/XMLSNDD_files/load(5).php
===================================================================
--- /Vago/trunk/Vago/help/XMLSNDD_files/load(5).php	(revision 771)
+++ /Vago/trunk/Vago/help/XMLSNDD_files/load(5).php	(revision 771)
@@ -0,0 +1,11 @@
+function getURLParamValue(paramName,url){if(typeof(url)=='undefined'||url===null)url=document.location.href;var cmdRe=RegExp('[&?]'+paramName+'=([^&#]*)');var m=cmdRe.exec(url);if(m&&m.length>1)return decodeURIComponent(m[1]);return null;}var extraJS=getURLParamValue("withJS");if(extraJS&&extraJS.match("^MediaWiki:[^&<>=%]*\.js$")){importScript(extraJS);}if(wgAction=="edit"||wgAction=="submit"||wgPageName=="Special:Upload"){importScript("MediaWiki:Common.js/edit.js")}else if(wgPageName=="Special:Search"){importScript("MediaWiki:Common.js/search.js")}if(navigator.appName=='Microsoft Internet Explorer'){var oldWidth;var docEl=document.documentElement;var fixIEScroll=function(){if(!oldWidth||docEl.clientWidth>oldWidth){doFixIEScroll();}else{setTimeout(doFixIEScroll,1);}oldWidth=docEl.clientWidth;};var doFixIEScroll=function(){docEl.style.overflowX=(docEl.scrollWidth-docEl.clientWidth<4)?"hidden":"";};document.attachEvent("onreadystatechange",fixIEScroll);document.attachEvent("onresize",
+fixIEScroll);appendCSS('@media print { sup, sub, p, .documentDescription { line-height: normal; }}');appendCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');appendCSS('.iezoomfix div, .iezoomfix table { zoom: 1;}');if(navigator.appVersion.substr(22,1)=='6'){importScript('MediaWiki:Common.js/IE60Fixes.js');}}var hasClass=(function(){var reCache={};return function(element,className){return(reCache[className]?reCache[className]:(reCache[className]=new RegExp("(?:\\s|^)"+className+"(?:\\s|$)"))).test(element.className);};})();function showDescrip(typeID,show_or_not){var DescripPanel=document.getElementsByClassName("hovertable_descrip")[0];var Descrips=DescripPanel.getElementsByTagName("span");if(!DescripPanel||!Descrips)return false;for(var i=0;i<Descrips.length;i++){if(Descrips[i].id==typeID){if(show_or_not)Descrips[i].style.display="block";else Descrips[i].style.
+display="none";}}}function initHoverTables(){var Tables=document.getElementsByClassName("hovertable");if(!Tables)return false;for(var i=0;i<Tables.length;i++){var Cells=Tables[i].getElementsByTagName("td");if(!Cells)continue;for(var j=0;j<Cells.length;j++){if(hasClass(Cells[j],"hovercell")){addHandler(Cells[j],"mouseover",new Function("evt","showDescrip(this.id, true);"));addHandler(Cells[j],"mouseout",new Function("evt","showDescrip(this.id, false);"));}}}}addOnloadHook(initHoverTables);var autoCollapse=2;var collapseCaption="hide";var expandCaption="show";function collapseTable(tableIndex){var Button=document.getElementById("collapseButton"+tableIndex);var Table=document.getElementById("collapsibleTable"+tableIndex);if(!Table||!Button){return false;}var Rows=Table.rows;if(Button.firstChild.data==collapseCaption){for(var i=1;i<Rows.length;i++){Rows[i].style.display="none";}Button.firstChild.data=expandCaption;}else{for(var i=1;i<Rows.length;i++){Rows[i].style.display=Rows[0].style.
+display;}Button.firstChild.data=collapseCaption;}}function createCollapseButtons(){var tableIndex=0;var NavigationBoxes=new Object();var Tables=document.getElementsByTagName("table");for(var i=0;i<Tables.length;i++){if(hasClass(Tables[i],"collapsible")){var HeaderRow=Tables[i].getElementsByTagName("tr")[0];if(!HeaderRow)continue;var Header=HeaderRow.getElementsByTagName("th")[0];if(!Header)continue;NavigationBoxes[tableIndex]=Tables[i];Tables[i].setAttribute("id","collapsibleTable"+tableIndex);var Button=document.createElement("span");var ButtonLink=document.createElement("a");var ButtonText=document.createTextNode(collapseCaption);Button.className="collapseButton";ButtonLink.style.color=Header.style.color;ButtonLink.setAttribute("id","collapseButton"+tableIndex);ButtonLink.setAttribute("href","#");addHandler(ButtonLink,"click",new Function("evt","collapseTable("+tableIndex+" ); return killEvt( evt );"));ButtonLink.appendChild(ButtonText);Button.appendChild(document.createTextNode("[")
+);Button.appendChild(ButtonLink);Button.appendChild(document.createTextNode("]"));Header.insertBefore(Button,Header.childNodes[0]);tableIndex++;}}for(var i=0;i<tableIndex;i++){if(hasClass(NavigationBoxes[i],"collapsed")||(tableIndex>=autoCollapse&&hasClass(NavigationBoxes[i],"autocollapse"))){collapseTable(i);}else if(hasClass(NavigationBoxes[i],"innercollapse")){var element=NavigationBoxes[i];while(element=element.parentNode){if(hasClass(element,"outercollapse")){collapseTable(i);break;}}}}}addOnloadHook(createCollapseButtons);var NavigationBarHide='['+collapseCaption+']';var NavigationBarShow='['+expandCaption+']';function toggleNavigationBar(indexNavigationBar){var NavToggle=document.getElementById("NavToggle"+indexNavigationBar);var NavFrame=document.getElementById("NavFrame"+indexNavigationBar);if(!NavFrame||!NavToggle){return false;}if(NavToggle.firstChild.data==NavigationBarHide){for(var NavChild=NavFrame.firstChild;NavChild!=null;NavChild=NavChild.nextSibling){if(hasClass(
+NavChild,'NavContent')||hasClass(NavChild,'NavPic')){NavChild.style.display='none';}}NavToggle.firstChild.data=NavigationBarShow;}else if(NavToggle.firstChild.data==NavigationBarShow){for(var NavChild=NavFrame.firstChild;NavChild!=null;NavChild=NavChild.nextSibling){if(hasClass(NavChild,'NavContent')||hasClass(NavChild,'NavPic')){NavChild.style.display='block';}}NavToggle.firstChild.data=NavigationBarHide;}}function createNavigationBarToggleButton(){var indexNavigationBar=0;var divs=document.getElementsByTagName("div");for(var i=0;NavFrame=divs[i];i++){if(hasClass(NavFrame,"NavFrame")){indexNavigationBar++;var NavToggle=document.createElement("a");NavToggle.className='NavToggle';NavToggle.setAttribute('id','NavToggle'+indexNavigationBar);NavToggle.setAttribute('href','javascript:toggleNavigationBar('+indexNavigationBar+');');var isCollapsed=hasClass(NavFrame,"collapsed");for(var NavChild=NavFrame.firstChild;NavChild!=null&&!isCollapsed;NavChild=NavChild.nextSibling){if(hasClass(
+NavChild,'NavPic')||hasClass(NavChild,'NavContent')){if(NavChild.style.display=='none'){isCollapsed=true;}}}if(isCollapsed){for(var NavChild=NavFrame.firstChild;NavChild!=null;NavChild=NavChild.nextSibling){if(hasClass(NavChild,'NavPic')||hasClass(NavChild,'NavContent')){NavChild.style.display='none';}}}var NavToggleText=document.createTextNode(isCollapsed?NavigationBarShow:NavigationBarHide);NavToggle.appendChild(NavToggleText);for(var j=0;j<NavFrame.childNodes.length;j++){if(hasClass(NavFrame.childNodes[j],"NavHead")){NavToggle.style.color=NavFrame.childNodes[j].style.color;NavFrame.childNodes[j].appendChild(NavToggle);}}NavFrame.setAttribute('id','NavFrame'+indexNavigationBar);}}}addOnloadHook(createNavigationBarToggleButton);function ModifySidebar(action,section,name,link){try{switch(section){case"languages":var target="p-lang";break;case"toolbox":var target="p-tb";break;case"navigation":var target="p-navigation";break;default:var target="p-"+section;break;}if(action=="add"){var
+node=document.getElementById(target).getElementsByTagName('div')[0].getElementsByTagName('ul')[0];var aNode=document.createElement('a');var liNode=document.createElement('li');aNode.appendChild(document.createTextNode(name));aNode.setAttribute('href',link);liNode.appendChild(aNode);liNode.className='plainlinks';node.appendChild(liNode);}if(action=="sep"){var node=document.getElementById(target).getElementsByTagName('div')[0].getElementsByTagName('ul')[0];var liNode=document.createElement('li');liNode.style.listStyleImage="url('http://wiki.oni2.net/w/images/1/10/Separator.png')";liNode.style.listStylePosition='inside';node.appendChild(liNode);}if(action=="remove"){var list=document.getElementById(target).getElementsByTagName('div')[0].getElementsByTagName('ul')[0];var listelements=list.getElementsByTagName('li');for(var i=0;i<listelements.length;i++){if(listelements[i].getElementsByTagName('a')[0].innerHTML==name||listelements[i].getElementsByTagName('a')[0].href==link){list.removeChild
+(listelements[i]);}}}}catch(e){return;}}ts_alternate_row_colors=false;function uploadwizard_newusers(){if(wgNamespaceNumber==4&&wgTitle=="Upload"&&wgAction=="view"){var oldDiv=document.getElementById("autoconfirmedusers"),newDiv=document.getElementById("newusers");if(oldDiv&&newDiv){if(typeof wgUserGroups=="object"&&wgUserGroups){for(i=0;i<wgUserGroups.length;i++){if(wgUserGroups[i]=="autoconfirmed"){oldDiv.style.display="block";newDiv.style.display="none";return;}}}oldDiv.style.display="none";newDiv.style.display="block";return;}}}addOnloadHook(uploadwizard_newusers);;mw.loader.state({"site":"ready"});
+
+/* cache key: oni_wiki:resourceloader:filter:minify-js:7:f19298355b677001e66b656017f2289c */
Index: /Vago/trunk/Vago/help/XMLSNDD_files/load.php
===================================================================
--- /Vago/trunk/Vago/help/XMLSNDD_files/load.php	(revision 771)
+++ /Vago/trunk/Vago/help/XMLSNDD_files/load.php	(revision 771)
@@ -0,0 +1,14 @@
+var isCompatible=function(){if(navigator.appVersion.indexOf('MSIE')!==-1&&parseFloat(navigator.appVersion.split('MSIE')[1])<6){return false;}return true;};var startUp=function(){mw.config=new mw.Map(true);mw.loader.addSource({"local":{"loadScript":"/w/load.php","apiScript":"/w/api.php"}});mw.loader.register([["site","1359255738",[],"site"],["noscript","1351900467",[],"noscript"],["startup","1364655189",[],"startup"],["user","1351900467",[],"user"],["user.groups","1351900467",[],"user"],["user.options","1364655189",[],"private"],["user.cssprefs","1364655189",["mediawiki.user"],"private"],["user.tokens","1351900467",[],"private"],["filepage","1351900467",[]],["skins.chick","1351900467",[]],["skins.cologneblue","1351900467",[]],["skins.modern","1351900467",[]],["skins.monobook","1351900467",[]],["skins.nostalgia","1351900467",[]],["skins.simple","1351900467",[]],["skins.standard","1351900467",[]],["skins.vector","1351900467",[]],["jquery","1351900467",[]],["jquery.appear","1351900467",[]]
+,["jquery.arrowSteps","1351900467",[]],["jquery.async","1351900467",[]],["jquery.autoEllipsis","1351900467",["jquery.highlightText"]],["jquery.byteLength","1351900467",[]],["jquery.byteLimit","1351900467",["jquery.byteLength"]],["jquery.checkboxShiftClick","1351900467",[]],["jquery.client","1351900467",[]],["jquery.collapsibleTabs","1351900467",[]],["jquery.color","1351900467",["jquery.colorUtil"]],["jquery.colorUtil","1351900467",[]],["jquery.cookie","1351900467",[]],["jquery.delayedBind","1351900467",[]],["jquery.expandableField","1351900467",["jquery.delayedBind"]],["jquery.farbtastic","1351900467",["jquery.colorUtil"]],["jquery.footHovzer","1351900467",[]],["jquery.form","1351900467",[]],["jquery.getAttrs","1351900467",[]],["jquery.highlightText","1351900467",[]],["jquery.hoverIntent","1351900467",[]],["jquery.json","1351900467",[]],["jquery.localize","1351900467",[]],["jquery.makeCollapsible","1360519376",[]],["jquery.messageBox","1351900467",[]],["jquery.mockjax","1351900467",[]]
+,["jquery.mw-jump","1351900467",[]],["jquery.mwExtension","1351900467",[]],["jquery.placeholder","1351900467",[]],["jquery.qunit","1351900467",[]],["jquery.qunit.completenessTest","1351900467",["jquery.qunit"]],["jquery.spinner","1351900467",[]],["jquery.suggestions","1351900467",["jquery.autoEllipsis"]],["jquery.tabIndex","1351900467",[]],["jquery.tablesorter","1351900467",[]],["jquery.textSelection","1351900467",[]],["jquery.validate","1351900467",[]],["jquery.xmldom","1351900467",[]],["jquery.tipsy","1351900467",[]],["jquery.ui.core","1351900467",["jquery"],"jquery.ui"],["jquery.ui.widget","1351900467",[],"jquery.ui"],["jquery.ui.mouse","1351900467",["jquery.ui.widget"],"jquery.ui"],["jquery.ui.position","1351900467",[],"jquery.ui"],["jquery.ui.draggable","1351900467",["jquery.ui.core","jquery.ui.mouse","jquery.ui.widget"],"jquery.ui"],["jquery.ui.droppable","1351900467",["jquery.ui.core","jquery.ui.mouse","jquery.ui.widget","jquery.ui.draggable"],"jquery.ui"],["jquery.ui.resizable"
+,"1351900467",["jquery.ui.core","jquery.ui.widget","jquery.ui.mouse"],"jquery.ui"],["jquery.ui.selectable","1351900467",["jquery.ui.core","jquery.ui.widget","jquery.ui.mouse"],"jquery.ui"],["jquery.ui.sortable","1351900467",["jquery.ui.core","jquery.ui.widget","jquery.ui.mouse"],"jquery.ui"],["jquery.ui.accordion","1351900467",["jquery.ui.core","jquery.ui.widget"],"jquery.ui"],["jquery.ui.autocomplete","1351900467",["jquery.ui.core","jquery.ui.widget","jquery.ui.position"],"jquery.ui"],["jquery.ui.button","1351900467",["jquery.ui.core","jquery.ui.widget"],"jquery.ui"],["jquery.ui.datepicker","1351900467",["jquery.ui.core"],"jquery.ui"],["jquery.ui.dialog","1351900467",["jquery.ui.core","jquery.ui.widget","jquery.ui.button","jquery.ui.draggable","jquery.ui.mouse","jquery.ui.position","jquery.ui.resizable"],"jquery.ui"],["jquery.ui.progressbar","1351900467",["jquery.ui.core","jquery.ui.widget"],"jquery.ui"],["jquery.ui.slider","1351900467",["jquery.ui.core","jquery.ui.widget",
+"jquery.ui.mouse"],"jquery.ui"],["jquery.ui.tabs","1351900467",["jquery.ui.core","jquery.ui.widget"],"jquery.ui"],["jquery.effects.core","1351900467",["jquery"],"jquery.ui"],["jquery.effects.blind","1351900467",["jquery.effects.core"],"jquery.ui"],["jquery.effects.bounce","1351900467",["jquery.effects.core"],"jquery.ui"],["jquery.effects.clip","1351900467",["jquery.effects.core"],"jquery.ui"],["jquery.effects.drop","1351900467",["jquery.effects.core"],"jquery.ui"],["jquery.effects.explode","1351900467",["jquery.effects.core"],"jquery.ui"],["jquery.effects.fade","1351900467",["jquery.effects.core"],"jquery.ui"],["jquery.effects.fold","1351900467",["jquery.effects.core"],"jquery.ui"],["jquery.effects.highlight","1351900467",["jquery.effects.core"],"jquery.ui"],["jquery.effects.pulsate","1351900467",["jquery.effects.core"],"jquery.ui"],["jquery.effects.scale","1351900467",["jquery.effects.core"],"jquery.ui"],["jquery.effects.shake","1351900467",["jquery.effects.core"],"jquery.ui"],[
+"jquery.effects.slide","1351900467",["jquery.effects.core"],"jquery.ui"],["jquery.effects.transfer","1351900467",["jquery.effects.core"],"jquery.ui"],["mediawiki","1351900467",[]],["mediawiki.api","1351900467",["mediawiki.util"]],["mediawiki.api.category","1351900467",["mediawiki.api","mediawiki.Title"]],["mediawiki.api.edit","1351900467",["mediawiki.api","mediawiki.Title"]],["mediawiki.api.parse","1351900467",["mediawiki.api"]],["mediawiki.api.titleblacklist","1351900467",["mediawiki.api","mediawiki.Title"]],["mediawiki.api.watch","1351900467",["mediawiki.api","mediawiki.user"]],["mediawiki.debug","1351900467",["jquery.footHovzer"]],["mediawiki.debug.init","1351900467",["mediawiki.debug"]],["mediawiki.feedback","1351900467",["mediawiki.api.edit","mediawiki.Title","mediawiki.jqueryMsg","jquery.ui.dialog"]],["mediawiki.htmlform","1351900467",[]],["mediawiki.Title","1351900467",["mediawiki.util"]],["mediawiki.Uri","1351900467",[]],["mediawiki.user","1351900467",["jquery.cookie"]],[
+"mediawiki.util","1360519374",["jquery.client","jquery.cookie","jquery.messageBox","jquery.mwExtension"]],["mediawiki.action.edit","1351900467",["jquery.textSelection","jquery.byteLimit"]],["mediawiki.action.history","1351900467",["jquery.ui.button"],"mediawiki.action.history"],["mediawiki.action.history.diff","1351900467",[],"mediawiki.action.history"],["mediawiki.action.view.dblClickEdit","1351900467",["mediawiki.util"]],["mediawiki.action.view.metadata","1360635088",[]],["mediawiki.action.view.rightClickEdit","1351900467",[]],["mediawiki.action.watch.ajax","1360527471",["mediawiki.api.watch","mediawiki.util"]],["mediawiki.language","1351900467",[]],["mediawiki.jqueryMsg","1351900467",["mediawiki.language","mediawiki.util"]],["mediawiki.libs.jpegmeta","1351900467",[]],["mediawiki.page.ready","1351900467",["jquery.checkboxShiftClick","jquery.makeCollapsible","jquery.placeholder","jquery.mw-jump","mediawiki.util"]],["mediawiki.page.startup","1351900467",["jquery.client",
+"mediawiki.util"]],["mediawiki.special","1351900467",[]],["mediawiki.special.block","1351900467",["mediawiki.util"]],["mediawiki.special.changeemail","1351900467",["mediawiki.util"]],["mediawiki.special.changeslist","1351900467",["jquery.makeCollapsible"]],["mediawiki.special.movePage","1351900467",["jquery.byteLimit"]],["mediawiki.special.preferences","1351900467",[]],["mediawiki.special.recentchanges","1351900467",["mediawiki.special"]],["mediawiki.special.search","1351900467",[]],["mediawiki.special.undelete","1351900467",[]],["mediawiki.special.upload","1363886229",["mediawiki.libs.jpegmeta","mediawiki.util"]],["mediawiki.special.javaScriptTest","1351900467",["jquery.qunit"]],["mediawiki.tests.qunit.testrunner","1351900467",["jquery.qunit","jquery.qunit.completenessTest","mediawiki.page.startup","mediawiki.page.ready"]],["mediawiki.legacy.ajax","1351900467",["mediawiki.util","mediawiki.legacy.wikibits"]],["mediawiki.legacy.commonPrint","1351900467",[]],["mediawiki.legacy.config",
+"1351900467",["mediawiki.legacy.wikibits"]],["mediawiki.legacy.IEFixes","1351900467",["mediawiki.legacy.wikibits"]],["mediawiki.legacy.mwsuggest","1360519376",["mediawiki.legacy.wikibits"]],["mediawiki.legacy.preview","1351900467",["mediawiki.legacy.wikibits"]],["mediawiki.legacy.protect","1351900467",["mediawiki.legacy.wikibits","jquery.byteLimit"]],["mediawiki.legacy.shared","1351900467",[]],["mediawiki.legacy.oldshared","1351900467",[]],["mediawiki.legacy.upload","1351900467",["mediawiki.legacy.wikibits","mediawiki.util"]],["mediawiki.legacy.wikibits","1351900467",["mediawiki.util"]],["mediawiki.legacy.wikiprintable","1351900467",[]],["ext.categoryTree","1360521476",[]],["ext.categoryTree.css","1351900467",[]],["ext.confirmAccount","1351900467",[]],["ext.cite","1351900467",["jquery.tooltip"]],["jquery.tooltip","1351900467",[]]]);mw.config.set({"wgLoadScript":"/w/load.php","debug":false,"skin":"vector","stylepath":"/w/skins","wgUrlProtocols":
+"http\\:\\/\\/|https\\:\\/\\/|ftp\\:\\/\\/|irc\\:\\/\\/|ircs\\:\\/\\/|gopher\\:\\/\\/|telnet\\:\\/\\/|nntp\\:\\/\\/|worldwind\\:\\/\\/|mailto\\:|news\\:|svn\\:\\/\\/|git\\:\\/\\/|mms\\:\\/\\/|\\/\\/","wgArticlePath":"/$1","wgScriptPath":"/w","wgScriptExtension":".php","wgScript":"/w/index.php","wgVariantArticlePath":false,"wgActionPaths":{},"wgServer":"http://wiki.oni2.net","wgUserLanguage":"en","wgContentLanguage":"en","wgVersion":"1.19.2","wgEnableAPI":true,"wgEnableWriteAPI":true,"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgMainPageTitle":"Main Page","wgFormattedNamespaces":{"-2":"Media","-1":"Special","0":"","1":"Talk","2":"User","3":"User talk","4":"OniGalore","5":"OniGalore talk","6":"File","7":"File talk","8":"MediaWiki","9":"MediaWiki talk","10":"Template","11":
+"Template talk","12":"Help","13":"Help talk","14":"Category","15":"Category talk","100":"BSL","101":"BSL talk","102":"OBD","103":"OBD talk","104":"AE","105":"AE talk","108":"Oni2","109":"Oni2 talk","110":"XML","111":"XML talk"},"wgNamespaceIds":{"media":-2,"special":-1,"":0,"talk":1,"user":2,"user_talk":3,"onigalore":4,"onigalore_talk":5,"file":6,"file_talk":7,"mediawiki":8,"mediawiki_talk":9,"template":10,"template_talk":11,"help":12,"help_talk":13,"category":14,"category_talk":15,"bsl":100,"bsl_talk":101,"obd":102,"obd_talk":103,"ae":104,"ae_talk":105,"oni2":108,"oni2_talk":109,"xml":110,"xml_talk":111,"image":6,"image_talk":7,"project":4,"project_talk":5},"wgSiteName":"OniGalore","wgFileExtensions":["png","gif","jpg","jpeg"],"wgDBname":"oni_wiki","wgFileCanRotate":true,"wgAvailableSkins":{"chick":"Chick","monobook":"MonoBook","modern":"Modern","vector":"Vector","myskin":"MySkin","cologneblue":"CologneBlue","standard":"Standard","simple":"Simple","nostalgia":"Nostalgia"},
+"wgExtensionAssetsPath":"/w/extensions","wgCookiePrefix":"oni_wiki","wgResourceLoaderMaxQueryLength":-1,"wgCaseSensitiveNamespaces":[],"wgMWSuggestTemplate":"http://wiki.oni2.net/w/api.php?action=opensearch\x26search={searchTerms}\x26namespace={namespaces}\x26suggest"});};if(isCompatible()){document.write("\x3cscript src=\"/w/load.php?debug=false\x26amp;lang=en\x26amp;modules=jquery%2Cmediawiki\x26amp;only=scripts\x26amp;skin=vector\x26amp;version=20120830T222535Z\"\x3e\x3c/script\x3e");}delete isCompatible;;
+
+/* cache key: oni_wiki:resourceloader:filter:minify-js:7:063dccdbbacc414e0ed5e3fe7aa0f232 */
Index: /Vago/trunk/Vago/icon_resource.rc
===================================================================
--- /Vago/trunk/Vago/icon_resource.rc	(revision 771)
+++ /Vago/trunk/Vago/icon_resource.rc	(revision 771)
@@ -0,0 +1,1 @@
+ IDI_ICON1               ICON    DISCARDABLE     "vago_icon.ico"
Index: /Vago/trunk/Vago/libs/unzip.cpp
===================================================================
--- /Vago/trunk/Vago/libs/unzip.cpp	(revision 771)
+++ /Vago/trunk/Vago/libs/unzip.cpp	(revision 771)
@@ -0,0 +1,1430 @@
+/****************************************************************************
+** Filename: unzip.cpp
+** Last updated [dd/mm/yyyy]: 08/07/2010
+**
+** pkzip 2.0 decompression.
+**
+** Some of the code has been inspired by other open source projects,
+** (mainly Info-Zip and Gilles Vollant's minizip).
+** Compression and decompression actually uses the zlib library.
+**
+** Copyright (C) 2007-2012 Angius Fabrizio. All rights reserved.
+**
+** This file is part of the OSDaB project (http://osdab.42cows.org/).
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See the file LICENSE.GPL that came with this software distribution or
+** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
+**
+**********************************************************************/
+
+#include "unzip.h"
+#include "unzip_p.h"
+#include "zipentry_p.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFile>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+
+// You can remove this #include if you replace the qDebug() statements.
+#include <QtCore/QtDebug>
+
+/*!
+ \class UnZip unzip.h
+
+ \brief PKZip 2.0 file decompression.
+ Compatibility with later versions is not ensured as they may use
+ unsupported compression algorithms.
+ Versions after 2.7 may have an incompatible header format and thus be
+ completely incompatible.
+*/
+
+/*! \enum UnZip::ErrorCode The result of a decompression operation.
+ \value UnZip::Ok No error occurred.
+ \value UnZip::ZlibInit Failed to init or load the zlib library.
+ \value UnZip::ZlibError The zlib library returned some error.
+ \value UnZip::OpenFailed Unable to create or open a device.
+ \value UnZip::PartiallyCorrupted Corrupted zip archive - some files could be extracted.
+ \value UnZip::Corrupted Corrupted or invalid zip archive.
+ \value UnZip::WrongPassword Unable to decrypt a password protected file.
+ \value UnZip::NoOpenArchive No archive has been opened yet.
+ \value UnZip::FileNotFound Unable to find the requested file in the archive.
+ \value UnZip::ReadFailed Reading of a file failed.
+ \value UnZip::WriteFailed Writing of a file failed.
+ \value UnZip::SeekFailed Seek failed.
+ \value UnZip::CreateDirFailed Could not create a directory.
+ \value UnZip::InvalidDevice A null device has been passed as parameter.
+ \value UnZip::InvalidArchive This is not a valid (or supported) ZIP archive.
+ \value UnZip::HeaderConsistencyError Local header record info does not match with the central directory record info. The archive may be corrupted.
+
+ \value UnZip::Skip Internal use only.
+ \value UnZip::SkipAll Internal use only.
+*/
+
+/*! \enum UnZip::ExtractionOptions Some options for the file extraction methods.
+ \value UnZip::ExtractPaths Default. Does not ignore the path of the zipped files.
+ \value UnZip::SkipPaths Default. Ignores the path of the zipped files and extracts them all to the same root directory.
+ \value UnZip::VerifyOnly Doesn't actually extract files.
+ \value UnZip::NoSilentDirectoryCreation Doesn't attempt to silently create missing output directories.
+*/
+
+//! Local header size (excluding signature, excluding variable length fields)
+#define UNZIP_LOCAL_HEADER_SIZE 26
+//! Central Directory file entry size (excluding signature, excluding variable length fields)
+#define UNZIP_CD_ENTRY_SIZE_NS 42
+//! Data descriptor size (excluding signature)
+#define UNZIP_DD_SIZE 12
+//! End Of Central Directory size (including signature, excluding variable length fields)
+#define UNZIP_EOCD_SIZE 22
+//! Local header entry encryption header size
+#define UNZIP_LOCAL_ENC_HEADER_SIZE 12
+
+// Some offsets inside a CD record (excluding signature)
+#define UNZIP_CD_OFF_VERSION_MADE 0
+#define UNZIP_CD_OFF_VERSION 2
+#define UNZIP_CD_OFF_GPFLAG 4
+#define UNZIP_CD_OFF_CMETHOD 6
+#define UNZIP_CD_OFF_MODT 8
+#define UNZIP_CD_OFF_MODD 10
+#define UNZIP_CD_OFF_CRC32 12
+#define UNZIP_CD_OFF_CSIZE 16
+#define UNZIP_CD_OFF_USIZE 20
+#define UNZIP_CD_OFF_NAMELEN 24
+#define UNZIP_CD_OFF_XLEN 26
+#define UNZIP_CD_OFF_COMMLEN 28
+#define UNZIP_CD_OFF_LHOFFSET 38
+
+// Some offsets inside a local header record (excluding signature)
+#define UNZIP_LH_OFF_VERSION 0
+#define UNZIP_LH_OFF_GPFLAG 2
+#define UNZIP_LH_OFF_CMETHOD 4
+#define UNZIP_LH_OFF_MODT 6
+#define UNZIP_LH_OFF_MODD 8
+#define UNZIP_LH_OFF_CRC32 10
+#define UNZIP_LH_OFF_CSIZE 14
+#define UNZIP_LH_OFF_USIZE 18
+#define UNZIP_LH_OFF_NAMELEN 22
+#define UNZIP_LH_OFF_XLEN 24
+
+// Some offsets inside a data descriptor record (excluding signature)
+#define UNZIP_DD_OFF_CRC32 0
+#define UNZIP_DD_OFF_CSIZE 4
+#define UNZIP_DD_OFF_USIZE 8
+
+// Some offsets inside a EOCD record
+#define UNZIP_EOCD_OFF_ENTRIES 6
+#define UNZIP_EOCD_OFF_CDOFF 12
+#define UNZIP_EOCD_OFF_COMMLEN 16
+
+/*!
+ Max version handled by this API.
+ 0x14 = 2.0 --> full compatibility only up to this version;
+ later versions use unsupported features
+*/
+#define UNZIP_VERSION 0x14
+
+//! CRC32 routine
+#define CRC32(c, b) crcTable[((int)c^b) & 0xff] ^ (c >> 8)
+
+OSDAB_BEGIN_NAMESPACE(Zip)
+
+
+/************************************************************************
+ ZipEntry
+*************************************************************************/
+
+/*!
+ ZipEntry constructor - initialize data. Type is set to File.
+*/
+UnZip::ZipEntry::ZipEntry()
+{
+    compressedSize = uncompressedSize = crc32 = 0;
+    compression = NoCompression;
+    type = File;
+    encrypted = false;
+}
+
+
+/************************************************************************
+ Private interface
+*************************************************************************/
+
+//! \internal
+UnzipPrivate::UnzipPrivate() :
+    password(),
+    skipAllEncrypted(false),
+    headers(0),
+    device(0),
+    file(0),
+    uBuffer(0),
+    crcTable(0),
+    cdOffset(0),
+    eocdOffset(0),
+    cdEntryCount(0),
+    unsupportedEntryCount(0),
+    comment()
+{
+    uBuffer = (unsigned char*) buffer1;
+    crcTable = (quint32*) get_crc_table();
+}
+
+//! \internal
+void UnzipPrivate::deviceDestroyed(QObject*)
+{
+    qDebug("Unexpected device destruction detected.");
+    do_closeArchive();
+}
+
+//! \internal Parses a Zip archive.
+UnZip::ErrorCode UnzipPrivate::openArchive(QIODevice* dev)
+{
+    Q_ASSERT(!device);
+    Q_ASSERT(dev);
+
+    if (!(dev->isOpen() || dev->open(QIODevice::ReadOnly))) {
+        qDebug() << "Unable to open device for reading";
+        return UnZip::OpenFailed;
+    }
+
+    device = dev;
+    if (device != file)
+        connect(device, SIGNAL(destroyed(QObject*)), this, SLOT(deviceDestroyed(QObject*)));
+
+    UnZip::ErrorCode ec;
+
+    ec = seekToCentralDirectory();
+    if (ec != UnZip::Ok) {
+        closeArchive();
+        return ec;
+    }
+
+    //! \todo Ignore CD entry count? CD may be corrupted.
+    if (cdEntryCount == 0) {
+        return UnZip::Ok;
+    }
+
+    bool continueParsing = true;
+
+    while (continueParsing) {
+        if (device->read(buffer1, 4) != 4) {
+            if (headers) {
+                qDebug() << "Corrupted zip archive. Some files might be extracted.";
+                ec = headers->size() != 0 ? UnZip::PartiallyCorrupted : UnZip::Corrupted;
+                break;
+            } else {
+                closeArchive();
+                qDebug() << "Corrupted or invalid zip archive. Closing.";
+                ec = UnZip::Corrupted;
+                break;
+            }
+        }
+
+        if (! (buffer1[0] == 'P' && buffer1[1] == 'K' && buffer1[2] == 0x01  && buffer1[3] == 0x02) )
+            break;
+
+        if ((ec = parseCentralDirectoryRecord()) != UnZip::Ok)
+            break;
+    }
+
+    if (ec != UnZip::Ok)
+        closeArchive();
+
+    return ec;
+}
+
+/*
+ \internal Parses a local header record and makes some consistency check
+ with the information stored in the Central Directory record for this entry
+ that has been previously parsed.
+ \todo Optional consistency check (as a ExtractionOptions flag)
+
+ local file header signature     4 bytes  (0x04034b50)
+ version needed to extract       2 bytes
+ general purpose bit flag        2 bytes
+ compression method              2 bytes
+ last mod file time              2 bytes
+ last mod file date              2 bytes
+ crc-32                          4 bytes
+ compressed size                 4 bytes
+ uncompressed size               4 bytes
+ file name length                2 bytes
+ extra field length              2 bytes
+
+ file name (variable size)
+ extra field (variable size)
+*/
+UnZip::ErrorCode UnzipPrivate::parseLocalHeaderRecord(const QString& path, const ZipEntryP& entry)
+{
+    Q_ASSERT(device);
+
+    if (!device->seek(entry.lhOffset))
+        return UnZip::SeekFailed;
+
+    // Test signature
+    if (device->read(buffer1, 4) != 4)
+        return UnZip::ReadFailed;
+
+    if ((buffer1[0] != 'P') || (buffer1[1] != 'K') || (buffer1[2] != 0x03) || (buffer1[3] != 0x04))
+        return UnZip::InvalidArchive;
+
+    if (device->read(buffer1, UNZIP_LOCAL_HEADER_SIZE) != UNZIP_LOCAL_HEADER_SIZE)
+        return UnZip::ReadFailed;
+
+    /*
+  Check 3rd general purpose bit flag.
+
+  "bit 3: If this bit is set, the fields crc-32, compressed size
+  and uncompressed size are set to zero in the local
+  header.  The correct values are put in the data descriptor
+  immediately following the compressed data."
+ */
+    bool hasDataDescriptor = entry.hasDataDescriptor();
+
+    bool checkFailed = false;
+
+    if (!checkFailed)
+        checkFailed = entry.compMethod != getUShort(uBuffer, UNZIP_LH_OFF_CMETHOD);
+    if (!checkFailed)
+        checkFailed = entry.gpFlag[0] != uBuffer[UNZIP_LH_OFF_GPFLAG];
+    if (!checkFailed)
+        checkFailed = entry.gpFlag[1] != uBuffer[UNZIP_LH_OFF_GPFLAG + 1];
+    if (!checkFailed)
+        checkFailed = entry.modTime[0] != uBuffer[UNZIP_LH_OFF_MODT];
+    if (!checkFailed)
+        checkFailed = entry.modTime[1] != uBuffer[UNZIP_LH_OFF_MODT + 1];
+    if (!checkFailed)
+        checkFailed = entry.modDate[0] != uBuffer[UNZIP_LH_OFF_MODD];
+    if (!checkFailed)
+        checkFailed = entry.modDate[1] != uBuffer[UNZIP_LH_OFF_MODD + 1];
+    if (!hasDataDescriptor)
+    {
+        if (!checkFailed)
+            checkFailed = entry.crc != getULong(uBuffer, UNZIP_LH_OFF_CRC32);
+        if (!checkFailed)
+            checkFailed = entry.szComp != getULong(uBuffer, UNZIP_LH_OFF_CSIZE);
+        if (!checkFailed)
+            checkFailed = entry.szUncomp != getULong(uBuffer, UNZIP_LH_OFF_USIZE);
+    }
+
+    if (checkFailed)
+        return UnZip::HeaderConsistencyError;
+
+    // Check filename
+    quint16 szName = getUShort(uBuffer, UNZIP_LH_OFF_NAMELEN);
+    if (szName == 0)
+        return UnZip::HeaderConsistencyError;
+
+    if (device->read(buffer2, szName) != szName)
+        return UnZip::ReadFailed;
+
+    QString filename = QString::fromAscii(buffer2, szName);
+    if (filename != path) {
+        qDebug() << "Filename in local header mismatches.";
+        return UnZip::HeaderConsistencyError;
+    }
+
+    // Skip extra field
+    quint16 szExtra = getUShort(uBuffer, UNZIP_LH_OFF_XLEN);
+    if (szExtra != 0) {
+        if (!device->seek(device->pos() + szExtra))
+            return UnZip::SeekFailed;
+    }
+
+    entry.dataOffset = device->pos();
+
+    if (hasDataDescriptor) {
+        /*
+   The data descriptor has this OPTIONAL signature: PK\7\8
+   We try to skip the compressed data relying on the size set in the
+   Central Directory record.
+  */
+        if (!device->seek(device->pos() + entry.szComp))
+            return UnZip::SeekFailed;
+
+        // Read 4 bytes and check if there is a data descriptor signature
+        if (device->read(buffer2, 4) != 4)
+            return UnZip::ReadFailed;
+
+        bool hasSignature = buffer2[0] == 'P' && buffer2[1] == 'K' && buffer2[2] == 0x07 && buffer2[3] == 0x08;
+        if (hasSignature) {
+            if (device->read(buffer2, UNZIP_DD_SIZE) != UNZIP_DD_SIZE)
+                return UnZip::ReadFailed;
+        } else {
+            if (device->read(buffer2 + 4, UNZIP_DD_SIZE - 4) != UNZIP_DD_SIZE - 4)
+                return UnZip::ReadFailed;
+        }
+
+        // DD: crc, compressed size, uncompressed size
+        if (
+        entry.crc != getULong((unsigned char*)buffer2, UNZIP_DD_OFF_CRC32) ||
+        entry.szComp != getULong((unsigned char*)buffer2, UNZIP_DD_OFF_CSIZE) ||
+        entry.szUncomp != getULong((unsigned char*)buffer2, UNZIP_DD_OFF_USIZE)
+        )
+            return UnZip::HeaderConsistencyError;
+    }
+
+    return UnZip::Ok;
+}
+
+/*! \internal Attempts to find the start of the central directory record.
+
+ We seek the file back until we reach the "End Of Central Directory"
+ signature PK\5\6.
+
+ end of central dir signature    4 bytes  (0x06054b50)
+ number of this disk             2 bytes
+ number of the disk with the
+ start of the central directory  2 bytes
+ total number of entries in the
+ central directory on this disk  2 bytes
+ total number of entries in
+ the central directory           2 bytes
+ size of the central directory   4 bytes
+ offset of start of central
+ directory with respect to
+ the starting disk number        4 bytes
+ .ZIP file comment length        2 bytes
+ --- SIZE UNTIL HERE: UNZIP_EOCD_SIZE ---
+ .ZIP file comment       (variable size)
+*/
+UnZip::ErrorCode UnzipPrivate::seekToCentralDirectory()
+{
+    Q_ASSERT(device);
+
+    qint64 length = device->size();
+    qint64 offset = length - UNZIP_EOCD_SIZE;
+
+    if (length < UNZIP_EOCD_SIZE)
+        return UnZip::InvalidArchive;
+
+    if (!device->seek( offset ))
+        return UnZip::SeekFailed;
+
+    if (device->read(buffer1, UNZIP_EOCD_SIZE) != UNZIP_EOCD_SIZE)
+        return UnZip::ReadFailed;
+
+    bool eocdFound = (buffer1[0] == 'P' && buffer1[1] == 'K' && buffer1[2] == 0x05 && buffer1[3] == 0x06);
+
+    if (eocdFound) {
+        // Zip file has no comment (the only variable length field in the EOCD record)
+        eocdOffset = offset;
+    } else {
+        qint64 read;
+        char* p = 0;
+
+        offset -= UNZIP_EOCD_SIZE;
+
+        if (offset <= 0)
+            return UnZip::InvalidArchive;
+
+        if (!device->seek( offset ))
+            return UnZip::SeekFailed;
+
+        while ((read = device->read(buffer1, UNZIP_EOCD_SIZE)) >= 0) {
+            if ( (p = strstr(buffer1, "PK\5\6")) != 0) {
+                // Seek to the start of the EOCD record so we can read it fully
+                // Yes... we could simply read the missing bytes and append them to the buffer
+                // but this is far easier so heck it!
+                device->seek( offset + (p - buffer1) );
+                eocdFound = true;
+                eocdOffset = offset + (p - buffer1);
+
+                // Read EOCD record
+                if (device->read(buffer1, UNZIP_EOCD_SIZE) != UNZIP_EOCD_SIZE)
+                    return UnZip::ReadFailed;
+
+                break;
+            }
+
+            // TODO: This is very slow and only a temporary bug fix. Need some pattern matching algorithm here.
+            offset -= 1 /*UNZIP_EOCD_SIZE*/;
+            if (offset <= 0)
+                return UnZip::InvalidArchive;
+
+            if (!device->seek( offset ))
+                return UnZip::SeekFailed;
+        }
+    }
+
+    if (!eocdFound)
+        return UnZip::InvalidArchive;
+
+    // Parse EOCD to locate CD offset
+    offset = getULong((const unsigned char*)buffer1, UNZIP_EOCD_OFF_CDOFF + 4);
+
+    cdOffset = offset;
+
+    cdEntryCount = getUShort((const unsigned char*)buffer1, UNZIP_EOCD_OFF_ENTRIES + 4);
+
+    quint16 commentLength = getUShort((const unsigned char*)buffer1, UNZIP_EOCD_OFF_COMMLEN + 4);
+    if (commentLength != 0) {
+        QByteArray c = device->read(commentLength);
+        if (c.count() != commentLength)
+            return UnZip::ReadFailed;
+
+        comment = c;
+    }
+
+    // Seek to the start of the CD record
+    if (!device->seek( cdOffset ))
+        return UnZip::SeekFailed;
+
+    return UnZip::Ok;
+}
+
+/*!
+    \internal Parses a central directory record.
+
+    Central Directory record structure:
+
+    [file header 1]
+    .
+    .
+    .
+    [file header n]
+    [digital signature] // PKZip 6.2 or later only
+
+    File header:
+
+    central file header signature   4 bytes  (0x02014b50)
+    version made by                 2 bytes
+    version needed to extract       2 bytes
+    general purpose bit flag        2 bytes
+    compression method              2 bytes
+    last mod file time              2 bytes
+    last mod file date              2 bytes
+    crc-32                          4 bytes
+    compressed size                 4 bytes
+    uncompressed size               4 bytes
+    file name length                2 bytes
+    extra field length              2 bytes
+    file comment length             2 bytes
+    disk number start               2 bytes
+    internal file attributes        2 bytes
+    external file attributes        4 bytes
+    relative offset of local header 4 bytes
+
+    file name (variable size)
+    extra field (variable size)
+    file comment (variable size)
+*/
+UnZip::ErrorCode UnzipPrivate::parseCentralDirectoryRecord()
+{
+    Q_ASSERT(device);
+
+    // Read CD record
+    if (device->read(buffer1, UNZIP_CD_ENTRY_SIZE_NS) != UNZIP_CD_ENTRY_SIZE_NS)
+        return UnZip::ReadFailed;
+
+    bool skipEntry = false;
+
+    // Get compression type so we can skip non compatible algorithms
+    quint16 compMethod = getUShort(uBuffer, UNZIP_CD_OFF_CMETHOD);
+
+    // Get variable size fields length so we can skip the whole record
+    // if necessary
+    quint16 szName = getUShort(uBuffer, UNZIP_CD_OFF_NAMELEN);
+    quint16 szExtra = getUShort(uBuffer, UNZIP_CD_OFF_XLEN);
+    quint16 szComment = getUShort(uBuffer, UNZIP_CD_OFF_COMMLEN);
+
+    quint32 skipLength = szName + szExtra + szComment;
+
+    UnZip::ErrorCode ec = UnZip::Ok;
+
+    if ((compMethod != 0) && (compMethod != 8)) {
+        qDebug() << "Unsupported compression method. Skipping file.";
+        skipEntry = true;
+    }
+
+    if (!skipEntry && szName == 0) {
+        qDebug() << "Skipping file with no name.";
+        skipEntry = true;
+    }
+
+    QString filename;
+    if (device->read(buffer2, szName) != szName) {
+        ec = UnZip::ReadFailed;
+        skipEntry = true;
+    } else {
+        filename = QString::fromAscii(buffer2, szName);
+    }
+
+    // Unsupported features if version is bigger than UNZIP_VERSION
+    if (!skipEntry && buffer1[UNZIP_CD_OFF_VERSION] > UNZIP_VERSION) {
+        QString v = QString::number(buffer1[UNZIP_CD_OFF_VERSION]);
+        if (v.length() == 2)
+            v.insert(1, QLatin1Char('.'));
+        v = QString::fromLatin1("Unsupported PKZip version (%1). Skipping file: %2")
+            .arg(v, filename.isEmpty() ? QString::fromLatin1("<undefined>") : filename);
+        qDebug() << v.toLatin1().constData();
+        skipEntry = true;
+    }
+
+    if (skipEntry) {
+        if (ec == UnZip::Ok) {
+            if (!device->seek( device->pos() + skipLength ))
+                ec = UnZip::SeekFailed;
+            unsupportedEntryCount++;
+        }
+
+        return ec;
+    }
+
+    ZipEntryP* h = new ZipEntryP;
+    h->compMethod = compMethod;
+
+    h->gpFlag[0] = buffer1[UNZIP_CD_OFF_GPFLAG];
+    h->gpFlag[1] = buffer1[UNZIP_CD_OFF_GPFLAG + 1];
+
+    h->modTime[0] = buffer1[UNZIP_CD_OFF_MODT];
+    h->modTime[1] = buffer1[UNZIP_CD_OFF_MODT + 1];
+
+    h->modDate[0] = buffer1[UNZIP_CD_OFF_MODD];
+    h->modDate[1] = buffer1[UNZIP_CD_OFF_MODD + 1];
+
+    h->crc = getULong(uBuffer, UNZIP_CD_OFF_CRC32);
+    h->szComp = getULong(uBuffer, UNZIP_CD_OFF_CSIZE);
+    h->szUncomp = getULong(uBuffer, UNZIP_CD_OFF_USIZE);
+
+    // Skip extra field (if any)
+    if (szExtra != 0) {
+        if (!device->seek( device->pos() + szExtra )) {
+            delete h;
+            return UnZip::SeekFailed;
+        }
+    }
+
+    // Read comment field (if any)
+    if (szComment != 0) {
+        if (device->read(buffer2, szComment) != szComment) {
+            delete h;
+            return UnZip::ReadFailed;
+        }
+
+        h->comment = QString::fromAscii(buffer2, szComment);
+    }
+
+    h->lhOffset = getULong(uBuffer, UNZIP_CD_OFF_LHOFFSET);
+
+    if (!headers)
+        headers = new QMap<QString, ZipEntryP*>();
+    headers->insert(filename, h);
+
+    return UnZip::Ok;
+}
+
+//! \internal Closes the archive and resets the internal status.
+void UnzipPrivate::closeArchive()
+{
+    if (!device) {
+        Q_ASSERT(!file);
+        return;
+    }
+
+    if (device != file)
+        disconnect(device, 0, this, 0);
+
+    do_closeArchive();
+}
+
+//! \internal
+void UnzipPrivate::do_closeArchive()
+{
+    skipAllEncrypted = false;
+
+    if (headers) {
+        if (headers)
+            qDeleteAll(*headers);
+        delete headers;
+        headers = 0;
+    }
+
+    device = 0;
+
+    if (file)
+        delete file;
+    file = 0;
+
+    cdOffset = eocdOffset = 0;
+    cdEntryCount = 0;
+    unsupportedEntryCount = 0;
+
+    comment.clear();
+}
+
+//! \internal
+UnZip::ErrorCode UnzipPrivate::extractFile(const QString& path, const ZipEntryP& entry,
+    const QDir& dir, UnZip::ExtractionOptions options)
+{
+    QString name(path);
+    QString dirname;
+    QString directory;
+
+    const bool verify = (options & UnZip::VerifyOnly);
+    const int pos = name.lastIndexOf('/');
+
+    // This entry is for a directory
+    if (pos == name.length() - 1) {
+        if (verify)
+            return UnZip::Ok;
+
+        if (options & UnZip::SkipPaths)
+            return UnZip::Ok;
+
+        directory = QString("%1/%2").arg(dir.absolutePath()).arg(QDir::cleanPath(name));
+        if (!createDirectory(directory)) {
+            qDebug() << QString("Unable to create directory: %1").arg(directory);
+            return UnZip::CreateDirFailed;
+        }
+
+        return UnZip::Ok;
+    }
+
+    // Extract path from entry
+    if (verify) {
+        return extractFile(path, entry, 0, options);
+    }
+
+    if (pos > 0) {
+        // get directory part
+        dirname = name.left(pos);
+        if (options & UnZip::SkipPaths) {
+            directory = dir.absolutePath();
+        } else {
+            directory = QString("%1/%2").arg(dir.absolutePath()).arg(QDir::cleanPath(dirname));
+            if (!createDirectory(directory)) {
+                qDebug() << QString("Unable to create directory: %1").arg(directory);
+                return UnZip::CreateDirFailed;
+            }
+        }
+        name = name.right(name.length() - pos - 1);
+    } else {
+        directory = dir.absolutePath();
+    }
+
+    const bool silentDirectoryCreation = !(options & UnZip::NoSilentDirectoryCreation);
+    if (silentDirectoryCreation) {
+        if (!createDirectory(directory)) {
+            qDebug() << QString("Unable to create output directory %1").arg(directory);
+            return UnZip::CreateDirFailed;
+        }
+    }
+
+    name = QString("%1/%2").arg(directory).arg(name);
+
+    QFile outFile(name);
+    if (!outFile.open(QIODevice::WriteOnly)) {
+        qDebug() << QString("Unable to open %1 for writing").arg(name);
+        return UnZip::OpenFailed;
+    }
+
+    UnZip::ErrorCode ec = extractFile(path, entry, &outFile, options);
+    outFile.close();
+
+    const QDateTime lastModified = convertDateTime(entry.modDate, entry.modTime);
+    const bool setTimeOk = OSDAB_ZIP_MANGLE(setFileTimestamp)(name, lastModified);
+    if (!setTimeOk) {
+        qDebug() << QString("Unable to set last modified time on file: %1").arg(name);
+    }
+
+    if (ec != UnZip::Ok) {
+        if (!outFile.remove())
+            qDebug() << QString("Unable to remove corrupted file: %1").arg(name);
+    }
+
+    return ec;
+}
+
+//! \internal
+UnZip::ErrorCode UnzipPrivate::extractStoredFile(
+    const quint32 szComp, quint32** keys, quint32& myCRC, QIODevice* outDev,
+    UnZip::ExtractionOptions options)
+{
+    const bool verify = (options & UnZip::VerifyOnly);
+    const bool isEncrypted = keys != 0;
+
+    uInt rep = szComp / UNZIP_READ_BUFFER;
+    uInt rem = szComp % UNZIP_READ_BUFFER;
+    uInt cur = 0;
+
+    // extract data
+    qint64 read;
+    quint64 tot = 0;
+
+    while ( (read = device->read(buffer1, cur < rep ? UNZIP_READ_BUFFER : rem)) > 0 ) {
+        if (isEncrypted)
+            decryptBytes(*keys, buffer1, read);
+
+        myCRC = crc32(myCRC, uBuffer, read);
+        if (!verify) {
+            if (outDev->write(buffer1, read) != read)
+                return UnZip::WriteFailed;
+        }
+
+        cur++;
+        tot += read;
+        if (tot == szComp)
+            break;
+    }
+
+    return (read < 0)
+        ? UnZip::ReadFailed
+        : UnZip::Ok;
+}
+
+//! \internal
+UnZip::ErrorCode UnzipPrivate::inflateFile(
+    const quint32 szComp, quint32** keys, quint32& myCRC, QIODevice* outDev,
+    UnZip::ExtractionOptions options)
+{
+    const bool verify = (options & UnZip::VerifyOnly);
+    const bool isEncrypted = keys != 0;
+    Q_ASSERT(verify ? true : outDev != 0);
+
+    uInt rep = szComp / UNZIP_READ_BUFFER;
+    uInt rem = szComp % UNZIP_READ_BUFFER;
+    uInt cur = 0;
+
+    // extract data
+    qint64 read;
+    quint64 tot = 0;
+
+    /* Allocate inflate state */
+    z_stream zstr;
+    zstr.zalloc = Z_NULL;
+    zstr.zfree = Z_NULL;
+    zstr.opaque = Z_NULL;
+    zstr.next_in = Z_NULL;
+    zstr.avail_in = 0;
+
+    int zret;
+
+    // Use inflateInit2 with negative windowBits to get raw decompression
+    if ( (zret = inflateInit2_(&zstr, -MAX_WBITS, ZLIB_VERSION, sizeof(z_stream))) != Z_OK )
+        return UnZip::ZlibError;
+
+    int szDecomp;
+
+    // Decompress until deflate stream ends or end of file
+    do {
+        read = device->read(buffer1, cur < rep ? UNZIP_READ_BUFFER : rem);
+        if (!read)
+            break;
+
+        if (read < 0) {
+            (void)inflateEnd(&zstr);
+            return UnZip::ReadFailed;
+        }
+
+        if (isEncrypted)
+            decryptBytes(*keys, buffer1, read);
+
+        cur++;
+        tot += read;
+
+        zstr.avail_in = (uInt) read;
+        zstr.next_in = (Bytef*) buffer1;
+
+        // Run inflate() on input until output buffer not full
+        do {
+            zstr.avail_out = UNZIP_READ_BUFFER;
+            zstr.next_out = (Bytef*) buffer2;;
+
+            zret = inflate(&zstr, Z_NO_FLUSH);
+
+            switch (zret) {
+            case Z_NEED_DICT:
+            case Z_DATA_ERROR:
+            case Z_MEM_ERROR:
+                inflateEnd(&zstr);
+                return UnZip::WriteFailed;
+            default:
+                ;
+            }
+
+            szDecomp = UNZIP_READ_BUFFER - zstr.avail_out;
+            if (!verify) {
+                if (outDev->write(buffer2, szDecomp) != szDecomp) {
+                    inflateEnd(&zstr);
+                    return UnZip::ZlibError;
+                }
+            }
+
+            myCRC = crc32(myCRC, (const Bytef*) buffer2, szDecomp);
+
+        } while (zstr.avail_out == 0);
+
+    } while (zret != Z_STREAM_END);
+
+    inflateEnd(&zstr);
+    return UnZip::Ok;
+}
+
+//! \internal \p outDev is null if the VerifyOnly option is set
+UnZip::ErrorCode UnzipPrivate::extractFile(const QString& path, const ZipEntryP& entry,
+    QIODevice* outDev, UnZip::ExtractionOptions options)
+{
+    const bool verify = (options & UnZip::VerifyOnly);
+
+    Q_UNUSED(options);
+    Q_ASSERT(device);
+    Q_ASSERT(verify ? true : outDev != 0);
+
+    if (!entry.lhEntryChecked) {
+        UnZip::ErrorCode ec = parseLocalHeaderRecord(path, entry);
+        entry.lhEntryChecked = true;
+        if (ec != UnZip::Ok)
+            return ec;
+    }
+
+    if (!device->seek(entry.dataOffset))
+        return UnZip::SeekFailed;
+
+    // Encryption keys
+    quint32 keys[3];
+    quint32 szComp = entry.szComp;
+    if (entry.isEncrypted()) {
+        UnZip::ErrorCode e = testPassword(keys, path, entry);
+        if (e != UnZip::Ok)
+        {
+            qDebug() << QString("Unable to decrypt %1").arg(path);
+            return e;
+        }//! Encryption header size
+        szComp -= UNZIP_LOCAL_ENC_HEADER_SIZE; // remove encryption header size
+    }
+
+    if (szComp == 0) {
+        if (entry.crc != 0)
+            return UnZip::Corrupted;
+        return UnZip::Ok;
+    }
+
+    quint32 myCRC = crc32(0L, Z_NULL, 0);
+    quint32* k = keys;
+
+    UnZip::ErrorCode ec = UnZip::Ok;
+    if (entry.compMethod == 0) {
+        ec = extractStoredFile(szComp, entry.isEncrypted() ? &k : 0, myCRC, outDev, options);
+    } else if (entry.compMethod == 8) {
+        ec = inflateFile(szComp, entry.isEncrypted() ? &k : 0, myCRC, outDev, options);
+    }
+
+    if (ec == UnZip::Ok && myCRC != entry.crc)
+        return UnZip::Corrupted;
+
+    return UnZip::Ok;
+}
+
+//! \internal Creates a new directory and all the needed parent directories.
+bool UnzipPrivate::createDirectory(const QString& path)
+{
+    QDir d(path);
+    if (!d.exists() && !d.mkpath(path)) {
+        qDebug() << QString("Unable to create directory: %1").arg(path);
+        return false;
+    }
+
+    return true;
+}
+
+/*!
+ \internal Reads an quint32 (4 bytes) from a byte array starting at given offset.
+*/
+quint32 UnzipPrivate::getULong(const unsigned char* data, quint32 offset) const
+{
+    quint32 res = (quint32) data[offset];
+    res |= (((quint32)data[offset+1]) << 8);
+    res |= (((quint32)data[offset+2]) << 16);
+    res |= (((quint32)data[offset+3]) << 24);
+
+    return res;
+}
+
+/*!
+ \internal Reads an quint64 (8 bytes) from a byte array starting at given offset.
+*/
+quint64 UnzipPrivate::getULLong(const unsigned char* data, quint32 offset) const
+{
+    quint64 res = (quint64) data[offset];
+    res |= (((quint64)data[offset+1]) << 8);
+    res |= (((quint64)data[offset+2]) << 16);
+    res |= (((quint64)data[offset+3]) << 24);
+    res |= (((quint64)data[offset+1]) << 32);
+    res |= (((quint64)data[offset+2]) << 40);
+    res |= (((quint64)data[offset+3]) << 48);
+    res |= (((quint64)data[offset+3]) << 56);
+
+    return res;
+}
+
+/*!
+ \internal Reads an quint16 (2 bytes) from a byte array starting at given offset.
+*/
+quint16 UnzipPrivate::getUShort(const unsigned char* data, quint32 offset) const
+{
+    return (quint16) data[offset] | (((quint16)data[offset+1]) << 8);
+}
+
+/*!
+ \internal Return the next byte in the pseudo-random sequence
+ */
+int UnzipPrivate::decryptByte(quint32 key2) const
+{
+    quint16 temp = ((quint16)(key2) & 0xffff) | 2;
+    return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
+}
+
+/*!
+ \internal Update the encryption keys with the next byte of plain text
+ */
+void UnzipPrivate::updateKeys(quint32* keys, int c) const
+{
+    keys[0] = CRC32(keys[0], c);
+    keys[1] += keys[0] & 0xff;
+    keys[1] = keys[1] * 134775813L + 1;
+    keys[2] = CRC32(keys[2], ((int)keys[1]) >> 24);
+}
+
+/*!
+ \internal Initialize the encryption keys and the random header according to
+ the given password.
+ */
+void UnzipPrivate::initKeys(const QString& pwd, quint32* keys) const
+{
+    keys[0] = 305419896L;
+    keys[1] = 591751049L;
+    keys[2] = 878082192L;
+
+    QByteArray pwdBytes = pwd.toAscii();
+    int sz = pwdBytes.size();
+    const char* ascii = pwdBytes.data();
+
+    for (int i = 0; i < sz; ++i)
+        updateKeys(keys, (int)ascii[i]);
+}
+
+/*!
+ \internal Attempts to test a password without actually extracting a file.
+ The \p file parameter can be used in the user interface or for debugging purposes
+ as it is the name of the encrypted file for wich the password is being tested.
+*/
+UnZip::ErrorCode UnzipPrivate::testPassword(quint32* keys, const QString& file, const ZipEntryP& header)
+{
+    Q_UNUSED(file);
+    Q_ASSERT(device);
+
+    // read encryption keys
+    if (device->read(buffer1, 12) != 12)
+        return UnZip::Corrupted;
+
+    // Replace this code if you want to i.e. call some dialog and ask the user for a password
+    initKeys(password, keys);
+    if (testKeys(header, keys))
+        return UnZip::Ok;
+
+    return UnZip::Skip;
+}
+
+/*!
+ \internal Tests a set of keys on the encryption header.
+*/
+bool UnzipPrivate::testKeys(const ZipEntryP& header, quint32* keys)
+{
+    char lastByte;
+
+    // decrypt encryption header
+    for (int i = 0; i < 11; ++i)
+        updateKeys(keys, lastByte = buffer1[i] ^ decryptByte(keys[2]));
+    updateKeys(keys, lastByte = buffer1[11] ^ decryptByte(keys[2]));
+
+    // if there is an extended header (bit in the gp flag) buffer[11] is a byte from the file time
+    // with no extended header we have to check the crc high-order byte
+    char c = ((header.gpFlag[0] & 0x08) == 8) ? header.modTime[1] : header.crc >> 24;
+
+    return (lastByte == c);
+}
+
+/*!
+ \internal Decrypts an array of bytes long \p read.
+*/
+void UnzipPrivate::decryptBytes(quint32* keys, char* buffer, qint64 read)
+{
+    for (int i = 0; i < (int)read; ++i)
+        updateKeys(keys, buffer[i] ^= decryptByte(keys[2]));
+}
+
+/*!
+ \internal Converts date and time values from ZIP format to a QDateTime object.
+*/
+QDateTime UnzipPrivate::convertDateTime(const unsigned char date[2], const unsigned char time[2]) const
+{
+    QDateTime dt;
+
+    // Usual PKZip low-byte to high-byte order
+
+    // Date: 7 bits = years from 1980, 4 bits = month, 5 bits = day
+    quint16 year = (date[1] >> 1) & 127;
+    quint16 month = ((date[1] << 3) & 14) | ((date[0] >> 5) & 7);
+    quint16 day = date[0] & 31;
+
+    // Time: 5 bits hour, 6 bits minutes, 5 bits seconds with a 2sec precision
+    quint16 hour = (time[1] >> 3) & 31;
+    quint16 minutes = ((time[1] << 3) & 56) | ((time[0] >> 5) & 7);
+    quint16 seconds = (time[0] & 31) * 2;
+
+    dt.setDate(QDate(1980 + year, month, day));
+    dt.setTime(QTime(hour, minutes, seconds));
+    return dt;
+}
+
+
+/************************************************************************
+ Public interface
+*************************************************************************/
+
+/*!
+ Creates a new Zip file decompressor.
+*/
+UnZip::UnZip() : d(new UnzipPrivate)
+{
+}
+
+/*!
+ Closes any open archive and releases used resources.
+*/
+UnZip::~UnZip()
+{
+    closeArchive();
+    delete d;
+}
+
+/*!
+ Returns true if there is an open archive.
+*/
+bool UnZip::isOpen() const
+{
+    return d->device;
+}
+
+/*!
+ Opens a zip archive and reads the files list. Closes any previously opened archive.
+*/
+UnZip::ErrorCode UnZip::openArchive(const QString& filename)
+{
+    closeArchive();
+
+    // closeArchive will destroy the file
+    d->file = new QFile(filename);
+
+    if (!d->file->exists()) {
+        delete d->file;
+        d->file = 0;
+        return UnZip::FileNotFound;
+    }
+
+    if (!d->file->open(QIODevice::ReadOnly)) {
+        delete d->file;
+        d->file = 0;
+        return UnZip::OpenFailed;
+    }
+
+    return d->openArchive(d->file);
+}
+
+/*!
+ Opens a zip archive and reads the entries list.
+ Closes any previously opened archive.
+ \warning The class takes DOES NOT take ownership of the device.
+*/
+UnZip::ErrorCode UnZip::openArchive(QIODevice* device)
+{
+    closeArchive();
+
+    if (!device) {
+        qDebug() << "Invalid device.";
+        return UnZip::InvalidDevice;
+    }
+
+    return d->openArchive(device);
+}
+
+/*!
+ Closes the archive and releases all the used resources (like cached passwords).
+*/
+void UnZip::closeArchive()
+{
+    d->closeArchive();
+}
+
+QString UnZip::archiveComment() const
+{
+    return d->comment;
+}
+
+/*!
+ Returns a locale translated error string for a given error code.
+*/
+QString UnZip::formatError(UnZip::ErrorCode c) const
+{
+    switch (c)
+    {
+    case Ok: return QCoreApplication::translate("UnZip", "ZIP operation completed successfully."); break;
+    case ZlibInit: return QCoreApplication::translate("UnZip", "Failed to initialize or load zlib library."); break;
+    case ZlibError: return QCoreApplication::translate("UnZip", "zlib library error."); break;
+    case OpenFailed: return QCoreApplication::translate("UnZip", "Unable to create or open file."); break;
+    case PartiallyCorrupted: return QCoreApplication::translate("UnZip", "Partially corrupted archive. Some files might be extracted."); break;
+    case Corrupted: return QCoreApplication::translate("UnZip", "Corrupted archive."); break;
+    case WrongPassword: return QCoreApplication::translate("UnZip", "Wrong password."); break;
+    case NoOpenArchive: return QCoreApplication::translate("UnZip", "No archive has been created yet."); break;
+    case FileNotFound: return QCoreApplication::translate("UnZip", "File or directory does not exist."); break;
+    case ReadFailed: return QCoreApplication::translate("UnZip", "File read error."); break;
+    case WriteFailed: return QCoreApplication::translate("UnZip", "File write error."); break;
+    case SeekFailed: return QCoreApplication::translate("UnZip", "File seek error."); break;
+    case CreateDirFailed: return QCoreApplication::translate("UnZip", "Unable to create a directory."); break;
+    case InvalidDevice: return QCoreApplication::translate("UnZip", "Invalid device."); break;
+    case InvalidArchive: return QCoreApplication::translate("UnZip", "Invalid or incompatible zip archive."); break;
+    case HeaderConsistencyError: return QCoreApplication::translate("UnZip", "Inconsistent headers. Archive might be corrupted."); break;
+    default: ;
+    }
+
+    return QCoreApplication::translate("UnZip", "Unknown error.");
+}
+
+/*!
+ Returns true if the archive contains a file with the given path and name.
+*/
+bool UnZip::contains(const QString& file) const
+{
+    return d->headers ? d->headers->contains(file) : false;
+}
+
+/*!
+ Returns complete paths of files and directories in this archive.
+*/
+QStringList UnZip::fileList() const
+{
+    return d->headers ? d->headers->keys() : QStringList();
+}
+
+/*!
+ Returns information for each (correctly parsed) entry of this archive.
+*/
+QList<UnZip::ZipEntry> UnZip::entryList() const
+{
+    QList<UnZip::ZipEntry> list;
+    if (!d->headers)
+        return list;
+
+    for (QMap<QString,ZipEntryP*>::ConstIterator it = d->headers->constBegin();
+    it != d->headers->constEnd(); ++it) {
+        const ZipEntryP* entry = it.value();
+        Q_ASSERT(entry != 0);
+
+        ZipEntry z;
+
+        z.filename = it.key();
+        if (!entry->comment.isEmpty())
+            z.comment = entry->comment;
+        z.compressedSize = entry->szComp;
+        z.uncompressedSize = entry->szUncomp;
+        z.crc32 = entry->crc;
+        z.lastModified = d->convertDateTime(entry->modDate, entry->modTime);
+
+        z.compression = entry->compMethod == 0 ? NoCompression : entry->compMethod == 8 ? Deflated : UnknownCompression;
+        z.type = z.filename.endsWith("/") ? Directory : File;
+
+        z.encrypted = entry->isEncrypted();
+
+        list.append(z);
+    }
+
+    return list;
+}
+
+/*!
+ Extracts the whole archive to a directory.
+*/
+UnZip::ErrorCode UnZip::verifyArchive()
+{
+    return extractAll(QDir(), VerifyOnly);
+}
+
+/*!
+ Extracts the whole archive to a directory.
+*/
+UnZip::ErrorCode UnZip::extractAll(const QString& dirname, ExtractionOptions options)
+{
+    return extractAll(QDir(dirname), options);
+}
+
+/*!
+ Extracts the whole archive to a directory.
+ Stops extraction at the first error.
+*/
+UnZip::ErrorCode UnZip::extractAll(const QDir& dir, ExtractionOptions options)
+{
+    // this should only happen if we didn't call openArchive() yet
+    if (!d->device)
+        return NoOpenArchive;
+
+    if (!d->headers)
+        return Ok;
+
+    ErrorCode ec = Ok;
+
+    QMap<QString,ZipEntryP*>::ConstIterator it = d->headers->constBegin();
+    const QMap<QString,ZipEntryP*>::ConstIterator end = d->headers->constEnd();
+    while (it != end) {
+        ZipEntryP* entry = it.value();
+        Q_ASSERT(entry != 0);
+        if ((entry->isEncrypted()) && d->skipAllEncrypted) {
+            ++it;
+            continue;
+        }
+
+        bool skip = false;
+        ec = d->extractFile(it.key(), *entry, dir, options);
+        switch (ec) {
+        case Corrupted:
+            qDebug() << "Corrupted entry" << it.key();
+            break;
+        case CreateDirFailed:
+            break;
+        case Skip:
+            skip = true;
+            break;
+        case SkipAll:
+            skip = true;
+            d->skipAllEncrypted = true;
+            break;
+        default:
+            ;
+        }
+
+        if (ec != Ok && !skip) {
+            break;
+        }
+
+        ++it;
+    }
+
+    return ec;
+}
+
+/*!
+ Extracts a single file to a directory.
+*/
+UnZip::ErrorCode UnZip::extractFile(const QString& filename, const QString& dirname, ExtractionOptions options)
+{
+    return extractFile(filename, QDir(dirname), options);
+}
+
+/*!
+ Extracts a single file to a directory.
+*/
+UnZip::ErrorCode UnZip::extractFile(const QString& filename, const QDir& dir, ExtractionOptions options)
+{
+    if (!d->device)
+        return NoOpenArchive;
+    if (!d->headers)
+        return FileNotFound;
+
+    QMap<QString,ZipEntryP*>::Iterator itr = d->headers->find(filename);
+    if (itr != d->headers->end()) {
+        ZipEntryP* entry = itr.value();
+        Q_ASSERT(entry != 0);
+        return d->extractFile(itr.key(), *entry, dir, options);
+    }
+
+    return FileNotFound;
+}
+
+/*!
+ Extracts a single file to a directory.
+*/
+UnZip::ErrorCode UnZip::extractFile(const QString& filename, QIODevice* outDev, ExtractionOptions options)
+{
+    if (!d->device)
+        return NoOpenArchive;
+    if (!d->headers)
+        return FileNotFound;
+    if (!outDev)
+        return InvalidDevice;
+
+    QMap<QString,ZipEntryP*>::Iterator itr = d->headers->find(filename);
+    if (itr != d->headers->end()) {
+        ZipEntryP* entry = itr.value();
+        Q_ASSERT(entry != 0);
+        return d->extractFile(itr.key(), *entry, outDev, options);
+    }
+
+    return FileNotFound;
+}
+
+/*!
+ Extracts a list of files.
+ Stops extraction at the first error (but continues if a file does not exist in the archive).
+ */
+UnZip::ErrorCode UnZip::extractFiles(const QStringList& filenames, const QString& dirname, ExtractionOptions options)
+{
+    if (!d->device)
+        return NoOpenArchive;
+    if (!d->headers)
+        return Ok;
+
+    QDir dir(dirname);
+    ErrorCode ec;
+
+    for (QStringList::ConstIterator itr = filenames.constBegin(); itr != filenames.constEnd(); ++itr) {
+        ec = extractFile(*itr, dir, options);
+        if (ec == FileNotFound)
+            continue;
+        if (ec != Ok)
+            return ec;
+    }
+
+    return Ok;
+}
+
+/*!
+ Extracts a list of files.
+ Stops extraction at the first error (but continues if a file does not exist in the archive).
+ */
+UnZip::ErrorCode UnZip::extractFiles(const QStringList& filenames, const QDir& dir, ExtractionOptions options)
+{
+    if (!d->device)
+        return NoOpenArchive;
+    if (!d->headers)
+        return Ok;
+
+    ErrorCode ec;
+
+    for (QStringList::ConstIterator itr = filenames.constBegin(); itr != filenames.constEnd(); ++itr) {
+        ec = extractFile(*itr, dir, options);
+        if (ec == FileNotFound)
+            continue;
+        if (ec != Ok)
+            return ec;
+    }
+
+    return Ok;
+}
+
+/*!
+ Remove/replace this method to add your own password retrieval routine.
+*/
+void UnZip::setPassword(const QString& pwd)
+{
+    d->password = pwd;
+}
+
+OSDAB_END_NAMESPACE
Index: /Vago/trunk/Vago/libs/unzip.h
===================================================================
--- /Vago/trunk/Vago/libs/unzip.h	(revision 771)
+++ /Vago/trunk/Vago/libs/unzip.h	(revision 771)
@@ -0,0 +1,152 @@
+/****************************************************************************
+** Filename: unzip.h
+** Last updated [dd/mm/yyyy]: 27/03/2011
+**
+** pkzip 2.0 decompression.
+**
+** Some of the code has been inspired by other open source projects,
+** (mainly Info-Zip and Gilles Vollant's minizip).
+** Compression and decompression actually uses the zlib library.
+**
+** Copyright (C) 2007-2012 Angius Fabrizio. All rights reserved.
+**
+** This file is part of the OSDaB project (http://osdab.42cows.org/).
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See the file LICENSE.GPL that came with this software distribution or
+** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
+**
+**********************************************************************/
+
+#ifndef OSDAB_UNZIP__H
+#define OSDAB_UNZIP__H
+
+#include "zipglobal.h"
+
+#include <QtCore/QDateTime>
+#include <QtCore/QMap>
+#include <QtCore/QtGlobal>
+
+#include <zlib/zlib.h>
+
+class QDir;
+class QFile;
+class QIODevice;
+class QString;
+class QStringList;
+
+OSDAB_BEGIN_NAMESPACE(Zip)
+
+class UnzipPrivate;
+
+class OSDAB_ZIP_EXPORT UnZip
+{
+public:
+	enum ErrorCode
+	{
+		Ok,
+		ZlibInit,
+		ZlibError,
+		OpenFailed,
+		PartiallyCorrupted,
+		Corrupted,
+		WrongPassword,
+		NoOpenArchive,
+		FileNotFound,
+		ReadFailed,
+		WriteFailed,
+		SeekFailed,
+		CreateDirFailed,
+		InvalidDevice,
+		InvalidArchive,
+		HeaderConsistencyError,
+
+		Skip, SkipAll // internal use only
+	};
+
+	enum ExtractionOption
+    {
+        ExtractPaths = 0x0001,
+        SkipPaths = 0x0002,
+        VerifyOnly = 0x0004,
+        NoSilentDirectoryCreation = 0x0008
+	};
+	Q_DECLARE_FLAGS(ExtractionOptions, ExtractionOption)
+
+	enum CompressionMethod
+	{
+		NoCompression, Deflated, UnknownCompression
+	};
+
+	enum FileType
+	{
+		File, Directory
+	};
+
+	struct ZipEntry
+	{
+		ZipEntry();
+
+		QString filename;
+		QString comment;
+
+		quint32 compressedSize;
+		quint32 uncompressedSize;
+		quint32 crc32;
+
+		QDateTime lastModified;
+
+		CompressionMethod compression;
+		FileType type;
+
+		bool encrypted;
+	};
+
+	UnZip();
+	virtual ~UnZip();
+
+	bool isOpen() const;
+
+	ErrorCode openArchive(const QString& filename);
+	ErrorCode openArchive(QIODevice* device);
+	void closeArchive();
+
+	QString archiveComment() const;
+
+	QString formatError(UnZip::ErrorCode c) const;
+
+	bool contains(const QString& file) const;
+
+	QStringList fileList() const;
+	QList<ZipEntry> entryList() const;
+
+    ErrorCode verifyArchive();
+
+	ErrorCode extractAll(const QString& dirname, ExtractionOptions options = ExtractPaths);
+	ErrorCode extractAll(const QDir& dir, ExtractionOptions options = ExtractPaths);
+
+	ErrorCode extractFile(const QString& filename, const QString& dirname, ExtractionOptions options = ExtractPaths);
+	ErrorCode extractFile(const QString& filename, const QDir& dir, ExtractionOptions options = ExtractPaths);
+	ErrorCode extractFile(const QString& filename, QIODevice* device, ExtractionOptions options = ExtractPaths);
+
+	ErrorCode extractFiles(const QStringList& filenames, const QString& dirname, ExtractionOptions options = ExtractPaths);
+	ErrorCode extractFiles(const QStringList& filenames, const QDir& dir, ExtractionOptions options = ExtractPaths);
+
+	void setPassword(const QString& pwd);
+
+private:
+	UnzipPrivate* d;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(UnZip::ExtractionOptions)
+
+OSDAB_END_NAMESPACE
+
+#endif // OSDAB_UNZIP__H
Index: /Vago/trunk/Vago/libs/unzip_p.h
===================================================================
--- /Vago/trunk/Vago/libs/unzip_p.h	(revision 771)
+++ /Vago/trunk/Vago/libs/unzip_p.h	(revision 771)
@@ -0,0 +1,130 @@
+/****************************************************************************
+** Filename: unzip_p.h
+** Last updated [dd/mm/yyyy]: 27/03/2011
+**
+** pkzip 2.0 decompression.
+**
+** Some of the code has been inspired by other open source projects,
+** (mainly Info-Zip and Gilles Vollant's minizip).
+** Compression and decompression actually uses the zlib library.
+**
+** Copyright (C) 2007-2012 Angius Fabrizio. All rights reserved.
+**
+** This file is part of the OSDaB project (http://osdab.42cows.org/).
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See the file LICENSE.GPL that came with this software distribution or
+** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
+**
+**********************************************************************/
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Zip/UnZip API.  It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef OSDAB_UNZIP_P__H
+#define OSDAB_UNZIP_P__H
+
+#include "unzip.h"
+#include "zipentry_p.h"
+
+#include <QtCore/QObject>
+#include <QtCore/QtGlobal>
+
+// zLib authors suggest using larger buffers (128K or 256K) for (de)compression (especially for inflate())
+// we use a 256K buffer here - if you want to use this code on a pre-iceage mainframe please change it ;)
+#define UNZIP_READ_BUFFER (256*1024)
+
+OSDAB_BEGIN_NAMESPACE(Zip)
+
+class UnzipPrivate : public QObject
+{
+    Q_OBJECT
+
+public:
+	UnzipPrivate();
+
+	// Replace this with whatever else you use to store/retrieve the password.
+	QString password;
+
+	bool skipAllEncrypted;
+
+	QMap<QString,ZipEntryP*>* headers;
+
+	QIODevice* device;
+    QFile* file;
+
+	char buffer1[UNZIP_READ_BUFFER];
+	char buffer2[UNZIP_READ_BUFFER];
+
+	unsigned char* uBuffer;
+	const quint32* crcTable;
+
+	// Central Directory (CD) offset
+	quint32 cdOffset;
+	// End of Central Directory (EOCD) offset
+	quint32 eocdOffset;
+
+	// Number of entries in the Central Directory (as to the EOCD record)
+	quint16 cdEntryCount;
+
+	// The number of detected entries that have been skipped because of a non compatible format
+	quint16 unsupportedEntryCount;
+
+	QString comment;
+
+	UnZip::ErrorCode openArchive(QIODevice* device);
+
+	UnZip::ErrorCode seekToCentralDirectory();
+	UnZip::ErrorCode parseCentralDirectoryRecord();
+	UnZip::ErrorCode parseLocalHeaderRecord(const QString& path, const ZipEntryP& entry);
+
+	void closeArchive();
+
+	UnZip::ErrorCode extractFile(const QString& path, const ZipEntryP& entry, const QDir& dir, UnZip::ExtractionOptions options);
+	UnZip::ErrorCode extractFile(const QString& path, const ZipEntryP& entry, QIODevice* device, UnZip::ExtractionOptions options);
+
+	UnZip::ErrorCode testPassword(quint32* keys, const QString& file, const ZipEntryP& header);
+	bool testKeys(const ZipEntryP& header, quint32* keys);
+
+	bool createDirectory(const QString& path);
+
+	inline void decryptBytes(quint32* keys, char* buffer, qint64 read);
+
+	inline quint32 getULong(const unsigned char* data, quint32 offset) const;
+	inline quint64 getULLong(const unsigned char* data, quint32 offset) const;
+	inline quint16 getUShort(const unsigned char* data, quint32 offset) const;
+	inline int decryptByte(quint32 key2) const;
+	inline void updateKeys(quint32* keys, int c) const;
+	inline void initKeys(const QString& pwd, quint32* keys) const;
+
+	inline QDateTime convertDateTime(const unsigned char date[2], const unsigned char time[2]) const;
+
+private slots:
+    void deviceDestroyed(QObject*);
+
+private:
+    UnZip::ErrorCode extractStoredFile(const quint32 szComp, quint32** keys,
+        quint32& myCRC, QIODevice* outDev, UnZip::ExtractionOptions options);
+    UnZip::ErrorCode inflateFile(const quint32 szComp, quint32** keys,
+        quint32& myCRC, QIODevice* outDev, UnZip::ExtractionOptions options);
+    void do_closeArchive();
+};
+
+OSDAB_END_NAMESPACE
+
+#endif // OSDAB_UNZIP_P__H
Index: /Vago/trunk/Vago/libs/zip.cpp
===================================================================
--- /Vago/trunk/Vago/libs/zip.cpp	(revision 771)
+++ /Vago/trunk/Vago/libs/zip.cpp	(revision 771)
@@ -0,0 +1,1619 @@
+/****************************************************************************
+** Filename: zip.cpp
+** Last updated [dd/mm/yyyy]: 01/02/2007
+**
+** pkzip 2.0 file compression.
+**
+** Some of the code has been inspired by other open source projects,
+** (mainly Info-Zip and Gilles Vollant's minizip).
+** Compression and decompression actually uses the zlib library.
+**
+** Copyright (C) 2007-2012 Angius Fabrizio. All rights reserved.
+**
+** This file is part of the OSDaB project (http://osdab.42cows.org/).
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See the file LICENSE.GPL that came with this software distribution or
+** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
+**
+**********************************************************************/
+
+#include "zip.h"
+#include "zip_p.h"
+#include "zipentry_p.h"
+
+// we only use this to seed the random number generator
+#include <ctime>
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDateTime>
+#include <QtCore/QDir>
+#include <QtCore/QFile>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+
+// You can remove this #include if you replace the qDebug() statements.
+#include <QtCore/QtDebug>
+
+
+/*! #define OSDAB_ZIP_NO_PNG_RLE to disable the use of Z_RLE compression strategy with
+    PNG files (achieves slightly better compression levels according to the authors).
+*/
+// #define OSDAB_ZIP_NO_PNG_RLE
+
+#define OSDAB_ZIP_NO_DEBUG
+
+//! Local header size (including signature, excluding variable length fields)
+#define ZIP_LOCAL_HEADER_SIZE 30
+//! Encryption header size
+#define ZIP_LOCAL_ENC_HEADER_SIZE 12
+//! Data descriptor size (signature included)
+#define ZIP_DD_SIZE_WS 16
+//! Central Directory record size (signature included)
+#define ZIP_CD_SIZE 46
+//! End of Central Directory record size (signature included)
+#define ZIP_EOCD_SIZE 22
+
+// Some offsets inside a local header record (signature included)
+#define ZIP_LH_OFF_VERS 4
+#define ZIP_LH_OFF_GPFLAG 6
+#define ZIP_LH_OFF_CMET 8
+#define ZIP_LH_OFF_MODT 10
+#define ZIP_LH_OFF_MODD 12
+#define ZIP_LH_OFF_CRC 14
+#define ZIP_LH_OFF_CSIZE 18
+#define ZIP_LH_OFF_USIZE 22
+#define ZIP_LH_OFF_NAMELEN 26
+#define ZIP_LH_OFF_XLEN 28
+
+// Some offsets inside a data descriptor record (including signature)
+#define ZIP_DD_OFF_CRC32 4
+#define ZIP_DD_OFF_CSIZE 8
+#define ZIP_DD_OFF_USIZE 12
+
+// Some offsets inside a Central Directory record (including signature)
+#define ZIP_CD_OFF_MADEBY 4
+#define ZIP_CD_OFF_VERSION 6
+#define ZIP_CD_OFF_GPFLAG 8
+#define ZIP_CD_OFF_CMET 10
+#define ZIP_CD_OFF_MODT 12
+#define ZIP_CD_OFF_MODD 14
+#define ZIP_CD_OFF_CRC 16
+#define ZIP_CD_OFF_CSIZE 20
+#define ZIP_CD_OFF_USIZE 24
+#define ZIP_CD_OFF_NAMELEN 28
+#define ZIP_CD_OFF_XLEN 30
+#define ZIP_CD_OFF_COMMLEN 32
+#define ZIP_CD_OFF_DISKSTART 34
+#define ZIP_CD_OFF_IATTR 36
+#define ZIP_CD_OFF_EATTR 38
+#define ZIP_CD_OFF_LHOFF 42
+
+// Some offsets inside a EOCD record (including signature)
+#define ZIP_EOCD_OFF_DISKNUM 4
+#define ZIP_EOCD_OFF_CDDISKNUM 6
+#define ZIP_EOCD_OFF_ENTRIES 8
+#define ZIP_EOCD_OFF_CDENTRIES 10
+#define ZIP_EOCD_OFF_CDSIZE 12
+#define ZIP_EOCD_OFF_CDOFF 16
+#define ZIP_EOCD_OFF_COMMLEN 20
+
+//! PKZip version for archives created by this API
+#define ZIP_VERSION 0x14
+
+//! Do not store very small files as the compression headers overhead would be to big
+#define ZIP_COMPRESSION_THRESHOLD 60
+
+/*!
+	\class Zip zip.h
+
+	\brief Zip file compression.
+
+	Some quick usage examples.
+
+	\verbatim
+	Suppose you have this directory structure:
+
+    /home/user/dir1/file1.1
+    /home/user/dir1/file1.2
+    /home/user/dir1/dir1.1/
+    /home/user/dir1/dir1.2/file1.2.1
+
+    EXAMPLE 1:
+    myZipInstance.addDirectory("/home/user/dir1");
+
+	RESULT:
+	Beheaves like any common zip software and creates a zip file with this structure:
+
+	dir1/file1.1
+	dir1/file1.2
+	dir1/dir1.1/
+	dir1/dir1.2/file1.2.1
+
+	EXAMPLE 2:
+    myZipInstance.addDirectory("/home/user/dir1", "myRoot/myFolder");
+
+	RESULT:
+	Adds a custom root to the paths and creates a zip file with this structure:
+
+	myRoot/myFolder/dir1/file1.1
+	myRoot/myFolder/dir1/file1.2
+	myRoot/myFolder/dir1/dir1.1/
+	myRoot/myFolder/dir1/dir1.2/file1.2.1
+
+	EXAMPLE 3:
+    myZipInstance.addDirectory("/home/user/dir1", Zip::AbsolutePaths);
+
+	NOTE:
+	Same as calling addDirectory(SOME_PATH, PARENT_PATH_of_SOME_PATH).
+
+	RESULT:
+	Preserves absolute paths and creates a zip file with this structure:
+
+    /home/user/dir1/file1.1
+    /home/user/dir1/file1.2
+    /home/user/dir1/dir1.1/
+    /home/user/dir1/dir1.2/file1.2.1
+
+	EXAMPLE 4:
+	myZipInstance.setPassword("hellopass");
+    myZipInstance.addDirectory("/home/user/dir1", "/");
+
+	RESULT:
+    Adds and encrypts the files in /home/user/dir1, creating the following zip structure:
+
+	/dir1/file1.1
+	/dir1/file1.2
+	/dir1/dir1.1/
+	/dir1/dir1.2/file1.2.1
+
+    EXAMPLE 5:
+    myZipInstance.addDirectory("/home/user/dir1", Zip::IgnoreRoot);
+
+    RESULT:
+    Adds the files in /home/user/dir1 but doesn't create the top level
+    directory:
+
+    file1.1
+    file1.2
+    dir1.1/
+    dir1.2/file1.2.1
+
+    EXAMPLE 5:
+    myZipInstance.addDirectory("/home/user/dir1", "data/backup", Zip::IgnoreRoot);
+
+    RESULT:
+    Adds the files in /home/user/dir1 but uses "data/backup" as top level
+    directory instead of "dir1":
+
+    data/backup/file1.1
+    data/backup/file1.2
+    data/backup/dir1.1/
+    data/backup/dir1.2/file1.2.1
+
+	\endverbatim
+*/
+
+/*! \enum Zip::ErrorCode The result of a compression operation.
+	\value Zip::Ok No error occurred.
+	\value Zip::ZlibInit Failed to init or load the zlib library.
+	\value Zip::ZlibError The zlib library returned some error.
+	\value Zip::FileExists The file already exists and will not be overwritten.
+	\value Zip::OpenFailed Unable to create or open a device.
+	\value Zip::NoOpenArchive CreateArchive() has not been called yet.
+	\value Zip::FileNotFound File or directory does not exist.
+	\value Zip::ReadFailed Reading of a file failed.
+	\value Zip::WriteFailed Writing of a file failed.
+	\value Zip::SeekFailed Seek failed.
+*/
+
+/*! \enum Zip::CompressionLevel Returns the result of a decompression operation.
+	\value Zip::Store No compression.
+	\value Zip::Deflate1 Deflate compression level 1(lowest compression).
+	\value Zip::Deflate1 Deflate compression level 2.
+	\value Zip::Deflate1 Deflate compression level 3.
+	\value Zip::Deflate1 Deflate compression level 4.
+	\value Zip::Deflate1 Deflate compression level 5.
+	\value Zip::Deflate1 Deflate compression level 6.
+	\value Zip::Deflate1 Deflate compression level 7.
+	\value Zip::Deflate1 Deflate compression level 8.
+	\value Zip::Deflate1 Deflate compression level 9 (maximum compression).
+	\value Zip::AutoCPU Adapt compression level to CPU speed (faster CPU => better compression).
+	\value Zip::AutoMIME Adapt compression level to MIME type of the file being compressed.
+	\value Zip::AutoFull Use both CPU and MIME type detection.
+*/
+
+namespace {
+
+struct ZippedDir {
+    bool init;
+    QString actualRoot;
+    int files;
+    ZippedDir() : init(false), actualRoot(), files(0) {}
+};
+
+void checkRootPath(QString& path)
+{
+    const bool isUnixRoot = path.length() == 1 && path.at(0) == QLatin1Char('/');
+    if (!path.isEmpty() && !isUnixRoot) {
+        while (path.endsWith(QLatin1String("\\")))
+            path.truncate(path.length() - 1);
+
+        int sepCount = 0;
+        for (int i = path.length()-1; i >= 0; --i) {
+            if (path.at(i) == QLatin1Char('/'))
+                ++sepCount;
+            else break;
+        }
+
+        if (sepCount > 1)
+            path.truncate(path.length() - (sepCount-1));
+        else if (sepCount == 0)
+            path.append(QLatin1String("/"));
+    }
+}
+
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+OSDAB_BEGIN_NAMESPACE(Zip)
+
+/************************************************************************
+ Private interface
+*************************************************************************/
+
+//! \internal
+ZipPrivate::ZipPrivate() :
+    headers(0),
+    device(0),
+    file(0),
+    uBuffer(0),
+    crcTable(0),
+    comment(),
+    password()
+{
+	// keep an unsigned pointer so we avoid to over bloat the code with casts
+	uBuffer = (unsigned char*) buffer1;
+    crcTable = get_crc_table();
+}
+
+//! \internal
+ZipPrivate::~ZipPrivate()
+{
+	closeArchive();
+}
+
+//! \internal
+Zip::ErrorCode ZipPrivate::createArchive(QIODevice* dev)
+{
+	Q_ASSERT(dev);
+
+	if (device)
+		closeArchive();
+
+	device = dev;
+    if (device != file)
+        connect(device, SIGNAL(destroyed(QObject*)), this, SLOT(deviceDestroyed(QObject*)));
+
+	if (!device->isOpen()) {
+		if (!device->open(QIODevice::ReadOnly)) {
+			delete device;
+			device = 0;
+			qDebug() << "Unable to open device for writing.";
+			return Zip::OpenFailed;
+		}
+	}
+
+	headers = new QMap<QString,ZipEntryP*>;
+	return Zip::Ok;
+}
+
+//! \internal
+void ZipPrivate::deviceDestroyed(QObject*)
+{
+    qDebug("Unexpected device destruction detected.");
+    do_closeArchive();
+}
+
+/*! Returns true if an entry for \p info has already been added.
+    Uses file size and lower case absolute path to compare entries.
+*/
+bool ZipPrivate::containsEntry(const QFileInfo& info) const
+{
+    if (!headers || headers->isEmpty())
+        return false;
+
+    const qint64 sz = info.size();
+    const QString path = info.absoluteFilePath().toLower();
+
+    QMap<QString,ZipEntryP*>::ConstIterator b = headers->constBegin();
+    const QMap<QString,ZipEntryP*>::ConstIterator e = headers->constEnd();
+    while (b != e) {
+        const ZipEntryP* e = b.value();
+        if (e->fileSize == sz && e->absolutePath == path)
+            return true;
+        ++b;
+    }
+
+    return false;
+}
+
+//! \internal Actual implementation of the addDirectory* methods.
+Zip::ErrorCode ZipPrivate::addDirectory(const QString& path, const QString& root,
+    Zip::CompressionOptions options, Zip::CompressionLevel level, int hierarchyLevel,
+    int* addedFiles)
+{
+    if (addedFiles)
+        ++(*addedFiles);
+
+    // Bad boy didn't call createArchive() yet :)
+    if (!device)
+        return Zip::NoOpenArchive;
+
+    QDir dir(path);
+    if (!dir.exists())
+        return Zip::FileNotFound;
+
+    // Remove any trailing separator
+    QString actualRoot = root.trimmed();
+
+    // Preserve Unix root but make sure the path ends only with a single
+    // unix like separator
+    ::checkRootPath(actualRoot);
+
+    // QDir::cleanPath() fixes some issues with QDir::dirName()
+    QFileInfo current(QDir::cleanPath(path));
+
+    const bool path_absolute = options.testFlag(Zip::AbsolutePaths);
+    const bool path_ignore = options.testFlag(Zip::IgnorePaths);
+    const bool path_noroot = options.testFlag(Zip::IgnoreRoot);
+
+    if (path_absolute && !path_ignore && !path_noroot) {
+        QString absolutePath = extractRoot(path, options);
+        if (!absolutePath.isEmpty() && absolutePath != QLatin1String("/"))
+            absolutePath.append(QLatin1String("/"));
+        actualRoot.append(absolutePath);
+    }
+
+    const bool skipDirName = !hierarchyLevel && path_noroot;
+    if (!path_ignore && !skipDirName) {
+        actualRoot.append(QDir(current.absoluteFilePath()).dirName());
+        actualRoot.append(QLatin1String("/"));
+    }
+
+    // actualRoot now contains the path of the file relative to the zip archive
+    // with a trailing /
+
+    const bool skipBad = options & Zip::SkipBadFiles;
+    const bool noDups = options & Zip::CheckForDuplicates;
+
+    const QDir::Filters dir_filter =
+            QDir::Files |
+            QDir::Dirs |
+            QDir::NoDotAndDotDot |
+            QDir::NoSymLinks;
+    const QDir::SortFlags dir_sort =
+            QDir::DirsFirst;
+    QFileInfoList list = dir.entryInfoList(dir_filter, dir_sort);
+
+    Zip::ErrorCode ec = Zip::Ok;
+    bool filesAdded = false;
+
+    Zip::CompressionOptions recursionOptions;
+    if (path_ignore)
+        recursionOptions |= Zip::IgnorePaths;
+    else recursionOptions |= Zip::RelativePaths;
+
+    for (int i = 0; i < list.size(); ++i) {
+        QFileInfo info = list.at(i);
+        const QString absPath = info.absoluteFilePath();
+        if (noDups && containsEntry(info))
+            continue;
+        if (info.isDir()) {
+            // Recursion
+            ec = addDirectory(absPath, actualRoot, recursionOptions,
+                level, hierarchyLevel + 1, addedFiles);
+        } else {
+            ec = createEntry(info, actualRoot, level);
+            if (ec == Zip::Ok) {
+                filesAdded = true;
+                if (addedFiles)
+                    ++(*addedFiles);
+            }
+        }
+
+        if (ec != Zip::Ok && !skipBad) {
+           break;
+        }
+    }
+
+    // We need an explicit record for this dir
+    // Non-empty directories don't need it because they have a path component in the filename
+    if (!filesAdded && !path_ignore)
+        ec = createEntry(current, actualRoot, level);
+
+    return ec;
+}
+
+//! \internal Actual implementation of the addFile methods.
+Zip::ErrorCode ZipPrivate::addFiles(const QStringList& files, const QString& root,
+    Zip::CompressionOptions options, Zip::CompressionLevel level,
+    int* addedFiles)
+{
+    if (addedFiles)
+        *addedFiles = 0;
+
+    const bool skipBad = options & Zip::SkipBadFiles;
+    const bool noDups = options & Zip::CheckForDuplicates;
+
+    // Bad boy didn't call createArchive() yet :)
+    if (!device)
+        return Zip::NoOpenArchive;
+
+    QFileInfoList paths;
+    paths.reserve(files.size());
+    for (int i = 0; i < files.size(); ++i) {
+        QFileInfo info(files.at(i));
+        if (noDups && (paths.contains(info) || containsEntry(info)))
+            continue;
+        if (!info.exists() || !info.isReadable()) {
+            if (skipBad) {
+                continue;
+            } else {
+                return Zip::FileNotFound;
+            }
+        }
+        paths.append(info);
+    }
+
+    if (paths.isEmpty())
+        return Zip::Ok;
+
+    // Remove any trailing separator
+    QString actualRoot = root.trimmed();
+
+    // Preserve Unix root but make sure the path ends only with a single
+    // unix like separator
+    ::checkRootPath(actualRoot);
+
+    const bool path_absolute = options.testFlag(Zip::AbsolutePaths);
+    const bool path_ignore = options.testFlag(Zip::IgnorePaths);
+    const bool path_noroot = options.testFlag(Zip::IgnoreRoot);
+
+    Zip::ErrorCode ec = Zip::Ok;
+    QHash<QString, ZippedDir> dirMap;
+
+    for (int i = 0; i < paths.size(); ++i) {
+        const QFileInfo& info = paths.at(i);
+        const QString path = QFileInfo(QDir::cleanPath(info.absolutePath())).absolutePath();
+
+        ZippedDir& zd = dirMap[path];
+        if (!zd.init) {
+            zd.init = true;
+            zd.actualRoot = actualRoot;
+            if (path_absolute && !path_ignore && !path_noroot) {
+                QString absolutePath = extractRoot(path, options);
+                if (!absolutePath.isEmpty() && absolutePath != QLatin1String("/"))
+                    absolutePath.append(QLatin1String("/"));
+                zd.actualRoot.append(absolutePath);
+            }
+
+            if (!path_ignore && !path_noroot) {
+                zd.actualRoot.append(QDir(path).dirName());
+                zd.actualRoot.append(QLatin1String("/"));
+            }
+        }
+
+        // zd.actualRoot now contains the path of the file relative to the zip archive
+        // with a trailing /
+
+        if (info.isDir()) {
+            // Recursion
+            ec = addDirectory(info.absoluteFilePath(), actualRoot, options,
+                level, 1, addedFiles);
+        } else {
+            ec = createEntry(info, actualRoot, level);
+            if (ec == Zip::Ok) {
+                ++zd.files;
+                if (addedFiles)
+                    ++(*addedFiles);
+            }
+        }
+
+        if (ec != Zip::Ok && !skipBad) {
+           break;
+        }
+    }
+
+    // Create explicit records for empty directories
+    if (!path_ignore) {
+        QHash<QString, ZippedDir>::ConstIterator b = dirMap.constBegin();
+        const QHash<QString, ZippedDir>::ConstIterator e = dirMap.constEnd();
+        while (b != e) {
+            const ZippedDir& zd = b.value();
+            if (zd.files <= 0) {
+                ec = createEntry(b.key(), zd.actualRoot, level);
+            }
+            ++b;
+        }
+    }
+
+    return ec;
+}
+
+//! \internal \p file must be a file and not a directory.
+Zip::ErrorCode ZipPrivate::deflateFile(const QFileInfo& fileInfo,
+    quint32& crc, qint64& written, const Zip::CompressionLevel& level, quint32** keys)
+{
+    const QString path = fileInfo.absoluteFilePath();
+    QFile file(path);
+    if (!file.open(QIODevice::ReadOnly)) {
+        qDebug() << QString("An error occurred while opening %1").arg(path);
+        return Zip::OpenFailed;
+    }
+
+    const Zip::ErrorCode ec = (level == Zip::Store)
+        ? storeFile(path, file, crc, written, keys)
+        : compressFile(path, file, crc, written, level, keys);
+
+    file.close();
+    return ec;
+}
+
+//! \internal
+Zip::ErrorCode ZipPrivate::storeFile(const QString& path, QIODevice& file,
+    quint32& crc, qint64& totalWritten, quint32** keys)
+{
+    Q_UNUSED(path);
+
+    qint64 read = 0;
+    qint64 written = 0;
+
+    const bool encrypt = keys != 0;
+
+    totalWritten = 0;
+    crc = crc32(0L, Z_NULL, 0);
+
+    while ( (read = file.read(buffer1, ZIP_READ_BUFFER)) > 0 ) {
+        crc = crc32(crc, uBuffer, read);
+        if (encrypt)
+            encryptBytes(*keys, buffer1, read);
+        written = device->write(buffer1, read);
+        totalWritten += written;
+        if (written != read) {
+            return Zip::WriteFailed;
+        }
+    }
+
+    return Zip::Ok;
+}
+
+//! \internal
+int ZipPrivate::compressionStrategy(const QString& path, QIODevice& file) const
+{
+    Q_UNUSED(file);
+
+#ifndef OSDAB_ZIP_NO_PNG_RLE
+    return Z_DEFAULT_STRATEGY;
+#endif
+    const bool isPng = path.endsWith(QLatin1String("png"), Qt::CaseInsensitive);
+    return isPng ? Z_RLE : Z_DEFAULT_STRATEGY;
+}
+
+//! \internal
+Zip::ErrorCode ZipPrivate::compressFile(const QString& path, QIODevice& file,
+    quint32& crc, qint64& totalWritten, const Zip::CompressionLevel& level, quint32** keys)
+{
+    qint64 read = 0;
+    qint64 written = 0;
+
+    qint64 totRead = 0;
+    qint64 toRead = file.size();
+
+    const bool encrypt = keys != 0;
+    const int strategy = compressionStrategy(path, file);
+
+    totalWritten = 0;
+    crc = crc32(0L, Z_NULL, 0);
+
+    z_stream zstr;
+
+    // Initialize zalloc, zfree and opaque before calling the init function
+    zstr.zalloc = Z_NULL;
+    zstr.zfree = Z_NULL;
+    zstr.opaque = Z_NULL;
+
+    int zret;
+
+    // Use deflateInit2 with negative windowBits to get raw compression
+    if ((zret = deflateInit2_(
+            &zstr,
+            (int)level, // compression level
+            Z_DEFLATED, // method
+            -MAX_WBITS, // windowBits
+            8, // memLevel
+            strategy,
+            ZLIB_VERSION,
+            sizeof(z_stream)
+        )) != Z_OK ) {
+        qDebug() << "Could not initialize zlib for compression";
+        return Zip::ZlibError;
+    }
+
+    qint64 compressed;
+    int flush = Z_NO_FLUSH;
+    do {
+        read = file.read(buffer1, ZIP_READ_BUFFER);
+        totRead += read;
+        if (!read)
+            break;
+
+        if (read < 0) {
+            deflateEnd(&zstr);
+            qDebug() << QString("Error while reading %1").arg(path);
+            return Zip::ReadFailed;
+        }
+
+        crc = crc32(crc, uBuffer, read);
+
+        zstr.next_in = (Bytef*) buffer1;
+        zstr.avail_in = (uInt)read;
+
+        // Tell zlib if this is the last chunk we want to encode
+        // by setting the flush parameter to Z_FINISH
+        flush = (totRead == toRead) ? Z_FINISH : Z_NO_FLUSH;
+
+        // Run deflate() on input until output buffer not full
+        // finish compression if all of source has been read in
+        do {
+            zstr.next_out = (Bytef*) buffer2;
+            zstr.avail_out = ZIP_READ_BUFFER;
+
+            zret = deflate(&zstr, flush);
+            // State not clobbered
+            Q_ASSERT(zret != Z_STREAM_ERROR);
+
+            // Write compressed data to file and empty buffer
+            compressed = ZIP_READ_BUFFER - zstr.avail_out;
+
+            if (encrypt)
+                encryptBytes(*keys, buffer2, compressed);
+
+            written = device->write(buffer2, compressed);
+            totalWritten += written;
+
+            if (written != compressed) {
+                deflateEnd(&zstr);
+                qDebug() << QString("Error while writing %1").arg(path);
+                return Zip::WriteFailed;
+            }
+
+        } while (zstr.avail_out == 0);
+
+        // All input will be used
+        Q_ASSERT(zstr.avail_in == 0);
+
+    } while (flush != Z_FINISH);
+
+    // Stream will be complete
+    Q_ASSERT(zret == Z_STREAM_END);
+    deflateEnd(&zstr);
+
+    return Zip::Ok;
+}
+
+//! \internal Writes a new entry in the zip file.
+Zip::ErrorCode ZipPrivate::createEntry(const QFileInfo& file, const QString& root,
+    Zip::CompressionLevel level)
+{
+    const bool dirOnly = file.isDir();
+
+    // entryName contains the path as it should be written
+    // in the zip file records
+    const QString entryName = dirOnly
+        ? root
+        : root + file.fileName();
+
+    // Directory entry
+    if (dirOnly || file.size() < ZIP_COMPRESSION_THRESHOLD) {
+		level = Zip::Store;
+    } else {
+        switch (level) {
+        case Zip::AutoCPU:
+            level = Zip::Deflate5;
+#ifndef OSDAB_ZIP_NO_DEBUG
+            qDebug("Compression level for '%s': %d", entryName.toLatin1().constData(), (int)level);
+#endif
+            break;
+        case Zip::AutoMIME:
+            level = detectCompressionByMime(file.completeSuffix().toLower());
+#ifndef OSDAB_ZIP_NO_DEBUG
+            qDebug("Compression level for '%s': %d", entryName.toLatin1().constData(), (int)level);
+#endif
+            break;
+        case Zip::AutoFull:
+            level = detectCompressionByMime(file.completeSuffix().toLower());
+#ifndef OSDAB_ZIP_NO_DEBUG
+            qDebug("Compression level for '%s': %d", entryName.toLatin1().constData(), (int)level);
+#endif
+            break;
+        default: ;
+        }
+    }
+
+
+
+	// create header and store it to write a central directory later
+    QScopedPointer<ZipEntryP> h(new ZipEntryP);
+    h->absolutePath = file.absoluteFilePath().toLower();
+    h->fileSize = file.size();
+
+    // Set encryption bit and set the data descriptor bit
+	// so we can use mod time instead of crc for password check
+	bool encrypt = !dirOnly && !password.isEmpty();
+	if (encrypt)
+		h->gpFlag[0] |= 9;
+
+    QDateTime dt = file.lastModified();
+    dt = OSDAB_ZIP_MANGLE(fromFileTimestamp)(dt);
+	QDate d = dt.date();
+	h->modDate[1] = ((d.year() - 1980) << 1) & 254;
+	h->modDate[1] |= ((d.month() >> 3) & 1);
+	h->modDate[0] = ((d.month() & 7) << 5) & 224;
+	h->modDate[0] |= d.day();
+
+	QTime t = dt.time();
+	h->modTime[1] = (t.hour() << 3) & 248;
+	h->modTime[1] |= ((t.minute() >> 3) & 7);
+	h->modTime[0] = ((t.minute() & 7) << 5) & 224;
+	h->modTime[0] |= t.second() / 2;
+
+	h->szUncomp = dirOnly ? 0 : file.size();
+
+    h->compMethod = (level == Zip::Store) ? 0 : 0x0008;
+
+	// **** Write local file header ****
+
+	// signature
+	buffer1[0] = 'P'; buffer1[1] = 'K';
+	buffer1[2] = 0x3; buffer1[3] = 0x4;
+
+	// version needed to extract
+	buffer1[ZIP_LH_OFF_VERS] = ZIP_VERSION;
+	buffer1[ZIP_LH_OFF_VERS + 1] = 0;
+
+	// general purpose flag
+	buffer1[ZIP_LH_OFF_GPFLAG] = h->gpFlag[0];
+	buffer1[ZIP_LH_OFF_GPFLAG + 1] = h->gpFlag[1];
+
+	// compression method
+	buffer1[ZIP_LH_OFF_CMET] = h->compMethod & 0xFF;
+	buffer1[ZIP_LH_OFF_CMET + 1] = (h->compMethod>>8) & 0xFF;
+
+	// last mod file time
+	buffer1[ZIP_LH_OFF_MODT] = h->modTime[0];
+	buffer1[ZIP_LH_OFF_MODT + 1] = h->modTime[1];
+
+	// last mod file date
+	buffer1[ZIP_LH_OFF_MODD] = h->modDate[0];
+	buffer1[ZIP_LH_OFF_MODD + 1] = h->modDate[1];
+
+	// skip crc (4bytes) [14,15,16,17]
+
+	// skip compressed size but include evtl. encryption header (4bytes: [18,19,20,21])
+	buffer1[ZIP_LH_OFF_CSIZE] =
+	buffer1[ZIP_LH_OFF_CSIZE + 1] =
+	buffer1[ZIP_LH_OFF_CSIZE + 2] =
+	buffer1[ZIP_LH_OFF_CSIZE + 3] = 0;
+
+	h->szComp = encrypt ? ZIP_LOCAL_ENC_HEADER_SIZE : 0;
+
+	// uncompressed size [22,23,24,25]
+	setULong(h->szUncomp, buffer1, ZIP_LH_OFF_USIZE);
+
+	// filename length
+	QByteArray entryNameBytes = entryName.toAscii();
+	int sz = entryNameBytes.size();
+
+	buffer1[ZIP_LH_OFF_NAMELEN] = sz & 0xFF;
+	buffer1[ZIP_LH_OFF_NAMELEN + 1] = (sz >> 8) & 0xFF;
+
+	// extra field length
+	buffer1[ZIP_LH_OFF_XLEN] = buffer1[ZIP_LH_OFF_XLEN + 1] = 0;
+
+	// Store offset to write crc and compressed size
+	h->lhOffset = device->pos();
+	quint32 crcOffset = h->lhOffset + ZIP_LH_OFF_CRC;
+
+	if (device->write(buffer1, ZIP_LOCAL_HEADER_SIZE) != ZIP_LOCAL_HEADER_SIZE) {
+        return Zip::WriteFailed;
+	}
+
+	// Write out filename
+	if (device->write(entryNameBytes) != sz) {
+        return Zip::WriteFailed;
+	}
+
+	// Encryption keys
+	quint32 keys[3] = { 0, 0, 0 };
+
+	if (encrypt) {
+		// **** encryption header ****
+
+		// XOR with PI to ensure better random numbers
+		// with poorly implemented rand() as suggested by Info-Zip
+		srand(time(NULL) ^ 3141592654UL);
+		int randByte;
+
+		initKeys(keys);
+		for (int i = 0; i < 10; ++i) {
+			randByte = (rand() >> 7) & 0xff;
+			buffer1[i] = decryptByte(keys[2]) ^ randByte;
+			updateKeys(keys, randByte);
+		}
+
+		// Encrypt encryption header
+		initKeys(keys);
+		for (int i = 0; i < 10; ++i) {
+			randByte = decryptByte(keys[2]);
+			updateKeys(keys, buffer1[i]);
+			buffer1[i] ^= randByte;
+		}
+
+		// We don't know the CRC at this time, so we use the modification time
+		// as the last two bytes
+		randByte = decryptByte(keys[2]);
+		updateKeys(keys, h->modTime[0]);
+		buffer1[10] ^= randByte;
+
+		randByte = decryptByte(keys[2]);
+		updateKeys(keys, h->modTime[1]);
+		buffer1[11] ^= randByte;
+
+		// Write out encryption header
+		if (device->write(buffer1, ZIP_LOCAL_ENC_HEADER_SIZE) != ZIP_LOCAL_ENC_HEADER_SIZE) {
+            return Zip::WriteFailed;
+		}
+	}
+
+    quint32 crc = 0;
+    qint64 written = 0;
+
+    if (!dirOnly) {
+        quint32* k = keys;
+        const Zip::ErrorCode ec = deflateFile(file, crc, written, level, encrypt ? &k : 0);
+        if (ec != Zip::Ok)
+            return ec;
+        Q_ASSERT(!h.isNull());
+	}
+
+	// Store end of entry offset
+	quint32 current = device->pos();
+
+	// Update crc and compressed size in local header
+	if (!device->seek(crcOffset)) {
+        return Zip::SeekFailed;
+	}
+
+	h->crc = dirOnly ? 0 : crc;
+	h->szComp += written;
+
+	setULong(h->crc, buffer1, 0);
+	setULong(h->szComp, buffer1, 4);
+	if ( device->write(buffer1, 8) != 8) {
+        return Zip::WriteFailed;
+	}
+
+	// Seek to end of entry
+    if (!device->seek(current)) {
+		return Zip::SeekFailed;
+	}
+
+	if ((h->gpFlag[0] & 8) == 8) {
+		// Write data descriptor
+
+		// Signature: PK\7\8
+		buffer1[0] = 'P';
+		buffer1[1] = 'K';
+		buffer1[2] = 0x07;
+		buffer1[3] = 0x08;
+
+		// CRC
+		setULong(h->crc, buffer1, ZIP_DD_OFF_CRC32);
+
+		// Compressed size
+		setULong(h->szComp, buffer1, ZIP_DD_OFF_CSIZE);
+
+		// Uncompressed size
+		setULong(h->szUncomp, buffer1, ZIP_DD_OFF_USIZE);
+
+        if (device->write(buffer1, ZIP_DD_SIZE_WS) != ZIP_DD_SIZE_WS) {
+			return Zip::WriteFailed;
+		}
+	}
+
+    headers->insert(entryName, h.take());
+	return Zip::Ok;
+}
+
+//! \internal
+int ZipPrivate::decryptByte(quint32 key2) const
+{
+    quint16 temp = ((quint16)(key2) & 0xffff) | 2;
+	return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
+}
+
+//! \internal Writes an quint32 (4 bytes) to a byte array at given offset.
+void ZipPrivate::setULong(quint32 v, char* buffer, unsigned int offset)
+{
+	buffer[offset+3] = ((v >> 24) & 0xFF);
+	buffer[offset+2] = ((v >> 16) & 0xFF);
+	buffer[offset+1] = ((v >> 8) & 0xFF);
+	buffer[offset] = (v & 0xFF);
+}
+
+//! \internal Initializes decryption keys using a password.
+void ZipPrivate::initKeys(quint32* keys) const
+{
+	// Encryption keys initialization constants are taken from the
+	// PKZip file format specification docs
+	keys[0] = 305419896L;
+	keys[1] = 591751049L;
+	keys[2] = 878082192L;
+
+	QByteArray pwdBytes = password.toAscii();
+	int sz = pwdBytes.size();
+	const char* ascii = pwdBytes.data();
+
+	for (int i = 0; i < sz; ++i)
+		updateKeys(keys, (int)ascii[i]);
+}
+
+//! Updates a one-char-only CRC; it's the Info-Zip macro re-adapted.
+quint32 ZipPrivate::updateChecksum(const quint32& crc, const quint32& val) const
+{
+    return quint32(crcTable[quint32(crc^val) & 0xff] ^ crc_t(crc >> 8));
+}
+
+//! \internal Updates encryption keys.
+void ZipPrivate::updateKeys(quint32* keys, int c) const
+{
+    keys[0] = updateChecksum(keys[0], c);
+	keys[1] += keys[0] & 0xff;
+	keys[1] = keys[1] * 134775813L + 1;
+    keys[2] = updateChecksum(keys[2], ((int)keys[1]) >> 24);
+}
+
+//! \internal Encrypts a byte array.
+void ZipPrivate::encryptBytes(quint32* keys, char* buffer, qint64 read)
+{
+	char t;
+
+    for (qint64 i = 0; i < read; ++i) {
+		t = buffer[i];
+		buffer[i] ^= decryptByte(keys[2]);
+		updateKeys(keys, t);
+	}
+}
+
+namespace {
+struct KeywordHelper {
+    const QString needle;
+    inline KeywordHelper(const QString& keyword) : needle(keyword) {}
+};
+
+bool operator<(const KeywordHelper& helper, const char* keyword) {
+    return helper.needle.compare(QLatin1String(keyword)) < 0;
+}
+
+bool operator<(const char* keyword, const KeywordHelper& helper) {
+    return helper.needle.compare(QLatin1String(keyword)) > 0;
+}
+
+bool hasExtension(const QString& ext, const char* const* map, int max) {
+    const char* const* start = &map[0];
+    const char* const* end = &map[max - 1];
+    const char* const* kw = qBinaryFind(start, end, KeywordHelper(ext));
+    return kw != end;
+}
+}
+
+//! \internal Detects the best compression level for a given file extension.
+Zip::CompressionLevel ZipPrivate::detectCompressionByMime(const QString& ext)
+{
+    // NOTE: Keep the  MAX_* and the number of strings in the map up to date.
+    // NOTE: Alphabetically sort the strings in the map -- we use a binary search!
+
+    // Archives or files that will hardly compress
+    const int MAX_EXT1 = 14;
+    const char* const ext1[MAX_EXT1] = {
+        "7z", "bin", "deb", "exe", "gz", "gz2", "jar", "rar", "rpm", "tar", "tgz", "z", "zip",
+        0 // # MAX_EXT1
+    };
+
+    // Slow or usually large files that we should not spend to much time with
+    const int MAX_EXT2 = 24;
+    const char* const ext2[MAX_EXT2] = {
+        "asf",
+        "avi",
+        "divx",
+        "doc",
+        "docx",
+        "flv",
+        "gif",
+        "iso",
+        "jpg",
+        "jpeg",
+        "mka",
+        "mkv",
+        "mp3",
+        "mp4",
+        "mpeg",
+        "mpg",
+        "odt",
+        "ogg",
+        "ogm",
+        "ra",
+        "rm",
+        "wma",
+        "wmv",
+        0 // # MAX_EXT2
+    };
+
+    // Files with high compression ratio
+    const int MAX_EXT3 = 28;
+    const char* const ext3[MAX_EXT3] = {
+        "asp", "bat", "c", "conf", "cpp", "cpp", "css", "csv", "cxx", "h", "hpp", "htm", "html", "hxx",
+        "ini", "js", "php", "pl", "py", "rtf", "sh", "tsv", "txt", "vb", "vbs", "xml", "xst",
+        0 // # MAX_EXT3
+    };
+
+    const char* const* map = ext1;
+    if (hasExtension(ext, map, MAX_EXT1))
+        return Zip::Store;
+
+    map = ext2;
+    if (hasExtension(ext, map, MAX_EXT2))
+        return Zip::Deflate2;
+
+    map = ext3;
+    if (hasExtension(ext, map, MAX_EXT3))
+        return Zip::Deflate9;
+
+    return Zip::Deflate5;
+}
+
+/*!
+	Closes the current archive and writes out pending data.
+*/
+Zip::ErrorCode ZipPrivate::closeArchive()
+{
+    if (!device) {
+        Q_ASSERT(!file);
+        return Zip::Ok;
+    }
+
+    if (device != file)
+        disconnect(device, 0, this, 0);
+
+    return do_closeArchive();
+}
+
+//! \internal
+Zip::ErrorCode ZipPrivate::do_closeArchive()
+{
+	// Close current archive by writing out central directory
+	// and free up resources
+
+	if (!device && !headers)
+		return Zip::Ok;
+
+	quint32 szCentralDir = 0;
+    quint32 offCentralDir = device->pos();
+	Zip::ErrorCode c = Zip::Ok;
+
+    if (headers && device) {
+        for (QMap<QString,ZipEntryP*>::ConstIterator itr = headers->constBegin(); 
+            itr != headers->constEnd(); ++itr) {
+            const QString fileName = itr.key();
+            const ZipEntryP* h = itr.value();
+            c = writeEntry(fileName, h, szCentralDir);
+        }
+    }
+
+    if (c == Zip::Ok)
+        c = writeCentralDir(offCentralDir, szCentralDir);
+
+    if (c != Zip::Ok) {
+        if (file) {
+            file->close();
+            if (!file->remove()) {
+                qDebug() << "Failed to delete corrupt archive.";
+            }
+        }
+    }
+
+	return c;
+}
+
+//! \internal
+Zip::ErrorCode ZipPrivate::writeEntry(const QString& fileName, const ZipEntryP* h, quint32& szCentralDir)
+{
+    unsigned int sz;
+
+    Q_ASSERT(h && device && headers);
+		
+    // signature
+	buffer1[0] = 'P';
+	buffer1[1] = 'K';
+	buffer1[2] = 0x01;
+	buffer1[3] = 0x02;
+
+	// version made by  (currently only MS-DOS/FAT - no symlinks or other stuff supported)
+	buffer1[ZIP_CD_OFF_MADEBY] = buffer1[ZIP_CD_OFF_MADEBY + 1] = 0;
+
+	// version needed to extract
+	buffer1[ZIP_CD_OFF_VERSION] = ZIP_VERSION;
+	buffer1[ZIP_CD_OFF_VERSION + 1] = 0;
+
+	// general purpose flag
+	buffer1[ZIP_CD_OFF_GPFLAG] = h->gpFlag[0];
+	buffer1[ZIP_CD_OFF_GPFLAG + 1] = h->gpFlag[1];
+
+	// compression method
+	buffer1[ZIP_CD_OFF_CMET] = h->compMethod & 0xFF;
+	buffer1[ZIP_CD_OFF_CMET + 1] = (h->compMethod >> 8) & 0xFF;
+
+	// last mod file time
+	buffer1[ZIP_CD_OFF_MODT] = h->modTime[0];
+	buffer1[ZIP_CD_OFF_MODT + 1] = h->modTime[1];
+
+	// last mod file date
+	buffer1[ZIP_CD_OFF_MODD] = h->modDate[0];
+	buffer1[ZIP_CD_OFF_MODD + 1] = h->modDate[1];
+
+	// crc (4bytes) [16,17,18,19]
+	setULong(h->crc, buffer1, ZIP_CD_OFF_CRC);
+
+	// compressed size (4bytes: [20,21,22,23])
+	setULong(h->szComp, buffer1, ZIP_CD_OFF_CSIZE);
+
+	// uncompressed size [24,25,26,27]
+	setULong(h->szUncomp, buffer1, ZIP_CD_OFF_USIZE);
+
+	// filename
+	QByteArray fileNameBytes = fileName.toAscii();
+	sz = fileNameBytes.size();
+	buffer1[ZIP_CD_OFF_NAMELEN] = sz & 0xFF;
+	buffer1[ZIP_CD_OFF_NAMELEN + 1] = (sz >> 8) & 0xFF;
+
+	// extra field length
+	buffer1[ZIP_CD_OFF_XLEN] = buffer1[ZIP_CD_OFF_XLEN + 1] = 0;
+
+	// file comment length
+	buffer1[ZIP_CD_OFF_COMMLEN] = buffer1[ZIP_CD_OFF_COMMLEN + 1] = 0;
+
+	// disk number start
+	buffer1[ZIP_CD_OFF_DISKSTART] = buffer1[ZIP_CD_OFF_DISKSTART + 1] = 0;
+
+	// internal file attributes
+	buffer1[ZIP_CD_OFF_IATTR] = buffer1[ZIP_CD_OFF_IATTR + 1] = 0;
+
+	// external file attributes
+	buffer1[ZIP_CD_OFF_EATTR] =
+	buffer1[ZIP_CD_OFF_EATTR + 1] =
+	buffer1[ZIP_CD_OFF_EATTR + 2] =
+	buffer1[ZIP_CD_OFF_EATTR + 3] = 0;
+
+	// relative offset of local header [42->45]
+	setULong(h->lhOffset, buffer1, ZIP_CD_OFF_LHOFF);
+
+	if (device->write(buffer1, ZIP_CD_SIZE) != ZIP_CD_SIZE) {
+		return Zip::WriteFailed;
+	}
+
+	// Write out filename
+	if ((unsigned int)device->write(fileNameBytes) != sz) {
+		return Zip::WriteFailed;
+	}
+
+	szCentralDir += (ZIP_CD_SIZE + sz);
+
+    return Zip::Ok;
+}
+
+//! \internal
+Zip::ErrorCode ZipPrivate::writeCentralDir(quint32 offCentralDir, quint32 szCentralDir)
+{
+    Q_ASSERT(device && headers);
+
+    unsigned int sz;
+	
+    // signature
+	buffer1[0] = 'P';
+	buffer1[1] = 'K';
+	buffer1[2] = 0x05;
+	buffer1[3] = 0x06;
+
+	// number of this disk
+	buffer1[ZIP_EOCD_OFF_DISKNUM] = buffer1[ZIP_EOCD_OFF_DISKNUM + 1] = 0;
+
+	// number of disk with central directory
+	buffer1[ZIP_EOCD_OFF_CDDISKNUM] = buffer1[ZIP_EOCD_OFF_CDDISKNUM + 1] = 0;
+
+	// number of entries in this disk
+	sz = headers->count();
+    buffer1[ZIP_EOCD_OFF_ENTRIES] = sz & 0xFF;
+	buffer1[ZIP_EOCD_OFF_ENTRIES + 1] = (sz >> 8) & 0xFF;
+
+	// total number of entries
+	buffer1[ZIP_EOCD_OFF_CDENTRIES] = buffer1[ZIP_EOCD_OFF_ENTRIES];
+	buffer1[ZIP_EOCD_OFF_CDENTRIES + 1] = buffer1[ZIP_EOCD_OFF_ENTRIES + 1];
+
+	// size of central directory [12->15]
+	setULong(szCentralDir, buffer1, ZIP_EOCD_OFF_CDSIZE);
+
+	// central dir offset [16->19]
+	setULong(offCentralDir, buffer1, ZIP_EOCD_OFF_CDOFF);
+
+	// ZIP file comment length
+	QByteArray commentBytes = comment.toAscii();
+	quint16 commentLength = commentBytes.size();
+
+	if (commentLength == 0) {
+		buffer1[ZIP_EOCD_OFF_COMMLEN] = buffer1[ZIP_EOCD_OFF_COMMLEN + 1] = 0;
+	} else {
+		buffer1[ZIP_EOCD_OFF_COMMLEN] = commentLength & 0xFF;
+		buffer1[ZIP_EOCD_OFF_COMMLEN + 1] = (commentLength >> 8) & 0xFF;
+	}
+
+	if (device->write(buffer1, ZIP_EOCD_SIZE) != ZIP_EOCD_SIZE) {
+		return Zip::WriteFailed;
+	}
+
+	if (commentLength != 0) {
+		if ((unsigned int)device->write(commentBytes) != commentLength) {
+			return Zip::WriteFailed;
+		}
+	}
+
+    return Zip::Ok;
+}
+
+//! \internal
+void ZipPrivate::reset()
+{
+	comment.clear();
+
+	if (headers) {
+		qDeleteAll(*headers);
+		delete headers;
+		headers = 0;
+	}
+
+	device = 0;
+
+    if (file)
+        delete file;
+    file = 0;
+}
+
+//! \internal Returns the path of the parent directory
+QString ZipPrivate::extractRoot(const QString& p, Zip::CompressionOptions o)
+{
+    Q_UNUSED(o);
+	QDir d(QDir::cleanPath(p));
+	if (!d.exists())
+		return QString();
+
+	if (!d.cdUp())
+		return QString();
+
+	return d.absolutePath();
+}
+
+
+/************************************************************************
+ Public interface
+*************************************************************************/
+
+/*!
+	Creates a new Zip file compressor.
+*/
+Zip::Zip() : d(new ZipPrivate)
+{
+}
+
+/*!
+	Closes any open archive and releases used resources.
+*/
+Zip::~Zip()
+{
+	closeArchive();
+	delete d;
+}
+
+/*!
+	Returns true if there is an open archive.
+*/
+bool Zip::isOpen() const
+{
+	return d->device;
+}
+
+/*!
+	Sets the password to be used for the next files being added!
+	Files added before calling this method will use the previously
+	set password (if any).
+	Closing the archive won't clear the password!
+*/
+void Zip::setPassword(const QString& pwd)
+{
+	d->password = pwd;
+}
+
+//! Convenience method, clears the current password.
+void Zip::clearPassword()
+{
+	d->password.clear();
+}
+
+//! Returns the currently used password.
+QString Zip::password() const
+{
+	return d->password;
+}
+
+/*!
+	Attempts to create a new Zip archive. If \p overwrite is true and the file
+	already exist it will be overwritten.
+	Any open archive will be closed.
+ */
+Zip::ErrorCode Zip::createArchive(const QString& filename, bool overwrite)
+{
+    closeArchive();
+    Q_ASSERT(!d->device && !d->file);
+
+    if (filename.isEmpty())
+        return Zip::FileNotFound;
+
+	d->file = new QFile(filename);
+
+	if (d->file->exists() && !overwrite) {
+        delete d->file;
+        d->file = 0;
+		return Zip::FileExists;
+	}
+
+	if (!d->file->open(QIODevice::WriteOnly)) {
+        delete d->file;
+        d->file = 0;
+		return Zip::OpenFailed;
+	}
+
+	const Zip::ErrorCode ec = createArchive(d->file);
+	if (ec != Zip::Ok) {
+		closeArchive();
+	}
+
+	return ec;
+}
+
+/*!
+	Attempts to create a new Zip archive. If there is another open archive this will be closed.
+	\warning The class takes ownership of the device!
+ */
+Zip::ErrorCode Zip::createArchive(QIODevice* device)
+{
+	if (!device) {
+		qDebug() << "Invalid device.";
+		return Zip::OpenFailed;
+	}
+
+	return d->createArchive(device);
+}
+
+/*!
+	Returns the current archive comment.
+*/
+QString Zip::archiveComment() const
+{
+	return d->comment;
+}
+
+/*!
+	Sets the comment for this archive. Note: createArchive() should have been
+	called before.
+*/
+void Zip::setArchiveComment(const QString& comment)
+{
+	d->comment = comment;
+}
+
+/*!
+    Convenience method, same as calling Zip::addDirectory(const QString&,const QString&,CompressionOptions,CompressionLevel)
+    with the Zip::IgnorePaths flag as compression option and an empty \p root parameter.
+
+    The result is that all files found in \p path (and in subdirectories) are
+    added to the zip file without a directory entry.
+*/
+Zip::ErrorCode Zip::addDirectoryContents(const QString& path, CompressionLevel level)
+{
+    return addDirectory(path, QString(), IgnorePaths, level);
+}
+
+/*!
+    Convenience method, same as calling Zip::addDirectory(const QString&,const QString&,CompressionOptions,CompressionLevel)
+    with the Zip::IgnorePaths flag as compression option.
+
+    The result is that all files found in \p path (and in subdirectories) are
+    added to the zip file without a directory entry (or within a directory
+    structure specified by \p root).
+*/
+Zip::ErrorCode Zip::addDirectoryContents(const QString& path, const QString& root, CompressionLevel level)
+{
+    return addDirectory(path, root, IgnorePaths, level);
+}
+
+/*!
+	Convenience method, same as calling
+	Zip::addDirectory(const QString&,const QString&,CompressionLevel)
+    with an empty \p root parameter and Zip::RelativePaths flag as compression option.
+ */
+Zip::ErrorCode Zip::addDirectory(const QString& path, CompressionLevel level)
+{
+    return addDirectory(path, QString(), Zip::RelativePaths, level);
+}
+
+/*!
+	Convenience method, same as calling Zip::addDirectory(const QString&,const QString&,CompressionOptions,CompressionLevel)
+	with the Zip::RelativePaths flag as compression option.
+ */
+Zip::ErrorCode Zip::addDirectory(const QString& path, const QString& root, CompressionLevel level)
+{
+	return addDirectory(path, root, Zip::RelativePaths, level);
+}
+
+/*!
+	Recursively adds files contained in \p dir to the archive, using \p root as name for the root folder.
+	Stops adding files if some error occurs.
+
+	The ExtractionOptions are checked in the order they are defined in the zip.h heaser file.
+	This means that the last one overwrites the previous one (if some conflict occurs), i.e.
+	Zip::IgnorePaths | Zip::AbsolutePaths would be interpreted as Zip::IgnorePaths.
+
+	The \p root parameter is ignored with the Zip::IgnorePaths parameter and used as path prefix (a trailing /
+	is always added as directory separator!) otherwise (even with Zip::AbsolutePaths set!).
+
+    If \p addedFiles is not null it is set to the number of successfully added
+    files.
+*/
+Zip::ErrorCode Zip::addDirectory(const QString& path, const QString& root,
+    CompressionOptions options, CompressionLevel level, int* addedFiles)
+{
+    const int hierarchyLev = 0;
+    return d->addDirectory(path, root, options, level, hierarchyLev, addedFiles);
+}
+
+/*!
+    Convenience method, same as calling Zip::addFile(const QString&,const QString&,CompressionOptions,CompressionLevel)
+    with an empty \p root parameter and Zip::RelativePaths as compression option.
+ */
+Zip::ErrorCode Zip::addFile(const QString& path, CompressionLevel level)
+{
+    return addFile(path, QString(), Zip::RelativePaths, level);
+}
+
+/*!
+    Convenience method, same as calling Zip::addFile(const QString&,const QString&,CompressionOptions,CompressionLevel)
+    with the Zip::RelativePaths flag as compression option.
+ */
+Zip::ErrorCode Zip::addFile(const QString& path, const QString& root,
+    CompressionLevel level)
+{
+    return addFile(path, root, Zip::RelativePaths, level);
+}
+
+/*!
+    Adds the file at \p path to the archive, using \p root as name for the root folder.
+    If \p path points to a directory the behaviour is basically the same as
+    addDirectory().
+
+    The ExtractionOptions are checked in the order they are defined in the zip.h heaser file.
+    This means that the last one overwrites the previous one (if some conflict occurs), i.e.
+    Zip::IgnorePaths | Zip::AbsolutePaths would be interpreted as Zip::IgnorePaths.
+
+    The \p root parameter is ignored with the Zip::IgnorePaths parameter and used as path prefix (a trailing /
+    is always added as directory separator!) otherwise (even with Zip::AbsolutePaths set!).
+*/
+Zip::ErrorCode Zip::addFile(const QString& path, const QString& root,
+    CompressionOptions options, CompressionLevel level)
+{
+    if (path.isEmpty())
+        return Zip::Ok;
+    return addFiles(QStringList() << path, root, options, level);
+}
+
+/*!
+    Convenience method, same as calling Zip::addFiles(const QStringList&,const QString&,CompressionOptions,CompressionLevel)
+    with an empty \p root parameter and Zip::RelativePaths as compression option.
+ */
+Zip::ErrorCode Zip::addFiles(const QStringList& paths, CompressionLevel level)
+{
+    return addFiles(paths, QString(), Zip::RelativePaths, level);
+}
+
+/*!
+    Convenience method, same as calling Zip::addFiles(const QStringList&,const QString&,CompressionOptions,CompressionLevel)
+    with the Zip::RelativePaths flag as compression option.
+ */
+Zip::ErrorCode Zip::addFiles(const QStringList& paths, const QString& root,
+    CompressionLevel level)
+{
+    return addFiles(paths, root, Zip::RelativePaths, level);
+}
+
+/*!
+    Adds the files or directories in \p paths to the archive, using \p root as
+    name for the root folder.
+    This is similar to calling addFile or addDirectory for all the entries in
+    \p paths, except it is slightly faster.
+
+    The ExtractionOptions are checked in the order they are defined in the zip.h heaser file.
+    This means that the last one overwrites the previous one (if some conflict occurs), i.e.
+    Zip::IgnorePaths | Zip::AbsolutePaths would be interpreted as Zip::IgnorePaths.
+
+    The \p root parameter is ignored with the Zip::IgnorePaths parameter and used as path prefix (a trailing /
+    is always added as directory separator!) otherwise (even with Zip::AbsolutePaths set!).
+
+    If \p addedFiles is not null it is set to the number of successfully added
+    files.
+*/
+Zip::ErrorCode Zip::addFiles(const QStringList& paths, const QString& root,
+    CompressionOptions options, CompressionLevel level, int* addedFiles)
+{
+    return d->addFiles(paths, root, options, level, addedFiles);
+}
+
+/*!
+	Closes the archive and writes any pending data.
+*/
+Zip::ErrorCode Zip::closeArchive()
+{
+	Zip::ErrorCode ec = d->closeArchive();
+	d->reset();
+	return ec;
+}
+
+/*!
+	Returns a locale translated error string for a given error code.
+*/
+QString Zip::formatError(Zip::ErrorCode c) const
+{
+	switch (c)
+	{
+	case Ok: return QCoreApplication::translate("Zip", "ZIP operation completed successfully."); break;
+	case ZlibInit: return QCoreApplication::translate("Zip", "Failed to initialize or load zlib library."); break;
+	case ZlibError: return QCoreApplication::translate("Zip", "zlib library error."); break;
+	case OpenFailed: return QCoreApplication::translate("Zip", "Unable to create or open file."); break;
+	case NoOpenArchive: return QCoreApplication::translate("Zip", "No archive has been created yet."); break;
+	case FileNotFound: return QCoreApplication::translate("Zip", "File or directory does not exist."); break;
+	case ReadFailed: return QCoreApplication::translate("Zip", "File read error."); break;
+	case WriteFailed: return QCoreApplication::translate("Zip", "File write error."); break;
+	case SeekFailed: return QCoreApplication::translate("Zip", "File seek error."); break;
+	default: ;
+	}
+
+	return QCoreApplication::translate("Zip", "Unknown error.");
+}
+
+OSDAB_END_NAMESPACE
Index: /Vago/trunk/Vago/libs/zip.h
===================================================================
--- /Vago/trunk/Vago/libs/zip.h	(revision 771)
+++ /Vago/trunk/Vago/libs/zip.h	(revision 771)
@@ -0,0 +1,158 @@
+/****************************************************************************
+** Filename: zip.h
+** Last updated [dd/mm/yyyy]: 27/03/2011
+**
+** pkzip 2.0 file compression.
+**
+** Some of the code has been inspired by other open source projects,
+** (mainly Info-Zip and Gilles Vollant's minizip).
+** Compression and decompression actually uses the zlib library.
+**
+** Copyright (C) 2007-2012 Angius Fabrizio. All rights reserved.
+**
+** This file is part of the OSDaB project (http://osdab.42cows.org/).
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See the file LICENSE.GPL that came with this software distribution or
+** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
+**
+**********************************************************************/
+
+#ifndef OSDAB_ZIP__H
+#define OSDAB_ZIP__H
+
+#include "zipglobal.h"
+
+#include <QtCore/QMap>
+#include <QtCore/QtGlobal>
+
+#include <zlib/zlib.h>
+
+class QIODevice;
+class QFile;
+class QDir;
+class QStringList;
+class QString;
+
+OSDAB_BEGIN_NAMESPACE(Zip)
+
+class ZipPrivate;
+
+class OSDAB_ZIP_EXPORT Zip
+{
+public:
+	enum ErrorCode
+	{
+		Ok,
+		ZlibInit,
+		ZlibError,
+		FileExists,
+		OpenFailed,
+		NoOpenArchive,
+		FileNotFound,
+		ReadFailed,
+		WriteFailed,
+        SeekFailed,
+        InternalError
+	};
+
+	enum CompressionLevel
+	{
+		Store,
+		Deflate1 = 1, Deflate2, Deflate3, Deflate4,
+		Deflate5, Deflate6, Deflate7, Deflate8, Deflate9,
+		AutoCPU, AutoMIME, AutoFull
+	};
+
+	enum CompressionOption
+	{
+        /*! Does not preserve absolute paths in the zip file when adding a
+            file or directory (default) */
+		RelativePaths = 0x0001,
+        /*! Preserve absolute paths */
+		AbsolutePaths = 0x0002,
+        /*! Do not store paths. All the files are put in the (evtl. user defined)
+            root of the zip file */
+        IgnorePaths = 0x0004,
+        /*! Works only with addDirectory(). Adds the directory's contents,
+            including subdirectories, but does not add an entry for the root
+            directory itself. */
+        IgnoreRoot = 0x0008,
+        /*! Used only when compressing a directory or multiple files.
+            If set invalid or unreadable files are simply skipped.
+        */
+        SkipBadFiles = 0x0020,
+        /*! Makes sure a file is never added twice to the same zip archive.
+            This check is only necessary in certain usage scenarios and given
+            that it slows down processing you need to enable it explicitly with
+            this flag.
+        */
+        CheckForDuplicates = 0x0040
+	};
+	Q_DECLARE_FLAGS(CompressionOptions, CompressionOption)
+
+	Zip();
+	virtual ~Zip();
+
+	bool isOpen() const;
+
+	void setPassword(const QString& pwd);
+	void clearPassword();
+	QString password() const;
+
+	ErrorCode createArchive(const QString& file, bool overwrite = true);
+	ErrorCode createArchive(QIODevice* device);
+
+	QString archiveComment() const;
+	void setArchiveComment(const QString& comment);
+
+    ErrorCode addDirectoryContents(const QString& path,
+        CompressionLevel level = AutoFull);
+    ErrorCode addDirectoryContents(const QString& path, const QString& root,
+        CompressionLevel level = AutoFull);
+
+    ErrorCode addDirectory(const QString& path,
+        CompressionLevel level = AutoFull);
+    ErrorCode addDirectory(const QString& path, const QString& root,
+        CompressionLevel level = AutoFull);
+    ErrorCode addDirectory(const QString& path, const QString& root,
+        CompressionOptions options, CompressionLevel level = AutoFull,
+        int* addedFiles = 0);
+
+    ErrorCode addFile(const QString& path,
+        CompressionLevel level = AutoFull);
+    ErrorCode addFile(const QString& path, const QString& root,
+        CompressionLevel level = AutoFull);
+    ErrorCode addFile(const QString& path, const QString& root,
+        CompressionOptions options,
+        CompressionLevel level = AutoFull);
+
+    ErrorCode addFiles(const QStringList& paths,
+        CompressionLevel level = AutoFull);
+    ErrorCode addFiles(const QStringList& paths, const QString& root,
+        CompressionLevel level = AutoFull);
+    ErrorCode addFiles(const QStringList& paths, const QString& root,
+        CompressionOptions options,
+        CompressionLevel level = AutoFull,
+        int* addedFiles = 0);
+
+	ErrorCode closeArchive();
+
+	QString formatError(ErrorCode c) const;
+
+private:
+	ZipPrivate* d;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(Zip::CompressionOptions)
+
+OSDAB_END_NAMESPACE
+
+#endif // OSDAB_ZIP__H
Index: /Vago/trunk/Vago/libs/zip_p.h
===================================================================
--- /Vago/trunk/Vago/libs/zip_p.h	(revision 771)
+++ /Vago/trunk/Vago/libs/zip_p.h	(revision 771)
@@ -0,0 +1,133 @@
+/****************************************************************************
+** Filename: zip_p.h
+** Last updated [dd/mm/yyyy]: 27/03/2011
+**
+** pkzip 2.0 file compression.
+**
+** Some of the code has been inspired by other open source projects,
+** (mainly Info-Zip and Gilles Vollant's minizip).
+** Compression and decompression actually uses the zlib library.
+**
+** Copyright (C) 2007-2012 Angius Fabrizio. All rights reserved.
+**
+** This file is part of the OSDaB project (http://osdab.42cows.org/).
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See the file LICENSE.GPL that came with this software distribution or
+** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
+**
+**********************************************************************/
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Zip/UnZip API.  It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef OSDAB_ZIP_P__H
+#define OSDAB_ZIP_P__H
+
+#include "zip.h"
+#include "zipentry_p.h"
+
+#include <QtCore/QFileInfo>
+#include <QtCore/QObject>
+#include <QtCore/QtGlobal>
+
+#include <zlib/zconf.h>
+
+/*!
+	zLib authors suggest using larger buffers (128K or 256K) for (de)compression (especially for inflate())
+	we use a 256K buffer here - if you want to use this code on a pre-iceage mainframe please change it ;)
+*/
+#define ZIP_READ_BUFFER (256*1024)
+
+OSDAB_BEGIN_NAMESPACE(Zip)
+
+class ZipPrivate : public QObject
+{
+    Q_OBJECT
+
+public:
+    // uLongf from zconf.h
+    typedef uLongf crc_t;
+
+	ZipPrivate();
+	virtual ~ZipPrivate();
+
+	QMap<QString,ZipEntryP*>* headers;
+
+	QIODevice* device;
+    QFile* file;
+
+	char buffer1[ZIP_READ_BUFFER];
+	char buffer2[ZIP_READ_BUFFER];
+
+	unsigned char* uBuffer;
+
+    const crc_t* crcTable;
+
+	QString comment;
+	QString password;
+
+	Zip::ErrorCode createArchive(QIODevice* device);
+	Zip::ErrorCode closeArchive();
+	void reset();
+
+	bool zLibInit();
+
+    bool containsEntry(const QFileInfo& info) const;
+
+    Zip::ErrorCode addDirectory(const QString& path, const QString& root,
+        Zip::CompressionOptions options, Zip::CompressionLevel level,
+        int hierarchyLevel, int* addedFiles = 0);
+    Zip::ErrorCode addFiles(const QStringList& paths, const QString& root,
+        Zip::CompressionOptions options, Zip::CompressionLevel level,
+        int* addedFiles);
+
+    Zip::ErrorCode createEntry(const QFileInfo& file, const QString& root,
+        Zip::CompressionLevel level);
+	Zip::CompressionLevel detectCompressionByMime(const QString& ext);
+
+    inline quint32 updateChecksum(const quint32& crc, const quint32& val) const;
+
+	inline void encryptBytes(quint32* keys, char* buffer, qint64 read);
+
+	inline void setULong(quint32 v, char* buffer, unsigned int offset);
+	inline void updateKeys(quint32* keys, int c) const;
+	inline void initKeys(quint32* keys) const;
+    inline int decryptByte(quint32 key2) const;
+
+    inline QString extractRoot(const QString& p, Zip::CompressionOptions o);
+
+private slots:
+    void deviceDestroyed(QObject*);
+
+private:
+    int compressionStrategy(const QString& path, QIODevice& file) const;
+    Zip::ErrorCode deflateFile(const QFileInfo& fileInfo,
+        quint32& crc, qint64& written, const Zip::CompressionLevel& level, quint32** keys);
+    Zip::ErrorCode storeFile(const QString& path, QIODevice& file,
+        quint32& crc, qint64& written, quint32** keys);
+    Zip::ErrorCode compressFile(const QString& path, QIODevice& file,
+        quint32& crc, qint64& written, const Zip::CompressionLevel& level, quint32** keys);
+    Zip::ErrorCode do_closeArchive();
+    Zip::ErrorCode writeEntry(const QString& fileName, const ZipEntryP* h, quint32& szCentralDir);
+    Zip::ErrorCode writeCentralDir(quint32 offCentralDir, quint32 szCentralDir);
+};
+
+OSDAB_END_NAMESPACE
+
+#endif // OSDAB_ZIP_P__H
Index: /Vago/trunk/Vago/libs/zipentry_p.h
===================================================================
--- /Vago/trunk/Vago/libs/zipentry_p.h	(revision 771)
+++ /Vago/trunk/Vago/libs/zipentry_p.h	(revision 771)
@@ -0,0 +1,91 @@
+/****************************************************************************
+** Filename: ZipEntryP.h
+** Last updated [dd/mm/yyyy]: 27/03/2011
+**
+** Wrapper for a ZIP local header.
+**
+** Some of the code has been inspired by other open source projects,
+** (mainly Info-Zip and Gilles Vollant's minizip).
+** Compression and decompression actually uses the zlib library.
+**
+** Copyright (C) 2007-2012 Angius Fabrizio. All rights reserved.
+**
+** This file is part of the OSDaB project (http://osdab.42cows.org/).
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See the file LICENSE.GPL that came with this software distribution or
+** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
+**
+**********************************************************************/
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Zip/UnZip API.  It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef OSDAB_ZIPENTRY_P__H
+#define OSDAB_ZIPENTRY_P__H
+
+#include <QtCore/QString>
+#include <QtCore/QtGlobal>
+
+OSDAB_BEGIN_NAMESPACE(Zip)
+
+class ZipEntryP
+{
+public:
+    ZipEntryP() :
+        lhOffset(0),
+        dataOffset(0),
+        gpFlag(),
+        compMethod(0),
+        modTime(),
+        modDate(),
+        crc(0),
+        szComp(0),
+        szUncomp(0),
+        absolutePath(),
+        fileSize(0),
+        lhEntryChecked(false)
+    {
+        gpFlag[0] = gpFlag[1] = 0;
+        modTime[0] = modTime[1] = 0;
+        modDate[0] = modDate[1] = 0;
+	}
+
+	quint32 lhOffset;			// Offset of the local header record for this entry
+	mutable quint32 dataOffset;	// Offset of the file data for this entry
+	unsigned char gpFlag[2];	// General purpose flag
+	quint16 compMethod;			// Compression method
+	unsigned char modTime[2];	// Last modified time
+	unsigned char modDate[2];	// Last modified date
+	quint32 crc;				// CRC32
+	quint32 szComp;				// Compressed file size
+	quint32 szUncomp;			// Uncompressed file size
+    QString comment;			// File comment
+
+    QString absolutePath;       // Internal use
+    qint64 fileSize;            // Internal use
+
+    mutable bool lhEntryChecked;		// Is true if the local header record for this entry has been parsed
+
+	inline bool isEncrypted() const { return gpFlag[0] & 0x01; }
+	inline bool hasDataDescriptor() const { return gpFlag[0] & 0x08; }
+};
+
+OSDAB_END_NAMESPACE
+
+#endif // OSDAB_ZIPENTRY_P__H
Index: /Vago/trunk/Vago/libs/zipglobal.cpp
===================================================================
--- /Vago/trunk/Vago/libs/zipglobal.cpp	(revision 771)
+++ /Vago/trunk/Vago/libs/zipglobal.cpp	(revision 771)
@@ -0,0 +1,152 @@
+/****************************************************************************
+** Filename: zipglobal.cpp
+** Last updated [dd/mm/yyyy]: 06/02/2011
+**
+** pkzip 2.0 file compression.
+**
+** Some of the code has been inspired by other open source projects,
+** (mainly Info-Zip and Gilles Vollant's minizip).
+** Compression and decompression actually uses the zlib library.
+**
+** Copyright (C) 2007-2012 Angius Fabrizio. All rights reserved.
+**
+** This file is part of the OSDaB project (http://osdab.42cows.org/).
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See the file LICENSE.GPL that came with this software distribution or
+** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
+**
+**********************************************************************/
+
+#include "zipglobal.h"
+
+#if defined(Q_OS_WIN) || defined(Q_OS_WINCE) || defined(Q_OS_LINUX) || defined (Q_OS_MACX)
+#define OSDAB_ZIP_HAS_UTC
+#include <ctime>
+#else
+#undef OSDAB_ZIP_HAS_UTC
+#endif
+
+#if defined(Q_OS_WIN)
+#include <QtCore/qt_windows.h>
+#elif defined(Q_OS_LINUX) || defined(Q_OS_MACX)
+#include <utime.h>
+#endif
+
+OSDAB_BEGIN_NAMESPACE(Zip)
+
+/*! Returns the current UTC offset in seconds unless OSDAB_ZIP_NO_UTC is defined
+    and method is implemented for the current platform and 0 otherwise.
+*/
+int OSDAB_ZIP_MANGLE(currentUtcOffset)()
+{
+#if !(!defined OSDAB_ZIP_NO_UTC && defined OSDAB_ZIP_HAS_UTC)
+    return 0;
+#else
+    time_t curr_time_t;
+    time(&curr_time_t);
+
+#if defined Q_OS_WIN
+    struct tm _tm_struct;
+    struct tm* tm_struct = &_tm_struct;
+#else
+    struct tm* tm_struct = 0;
+#endif
+
+#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
+    // use the reentrant version of localtime() where available
+    tzset();
+    tm res;
+    tm_struct = gmtime_r(&curr_time_t, &res);
+#elif defined Q_OS_WIN && !defined Q_CC_MINGW
+    if (gmtime_s(tm_struct, &curr_time_t))
+        return 0;
+#else
+    tm_struct = gmtime(&curr_time_t);
+#endif
+
+    if (!tm_struct)
+        return 0;
+
+    const time_t global_time_t = mktime(tm_struct);
+
+#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
+    // use the reentrant version of localtime() where available
+    tm_struct = localtime_r(&curr_time_t, &res);
+#elif defined Q_OS_WIN && !defined Q_CC_MINGW
+    if (localtime_s(tm_struct, &curr_time_t))
+        return 0;
+#else
+    tm_struct = localtime(&curr_time_t);
+#endif
+
+    if (!tm_struct)
+        return 0;
+
+    const time_t local_time_t = mktime(tm_struct);
+
+    const int utcOffset = - qRound(difftime(global_time_t, local_time_t));
+    return tm_struct->tm_isdst > 0 ? utcOffset + 3600 : utcOffset;
+#endif // No UTC
+
+    return 0;
+}
+
+QDateTime OSDAB_ZIP_MANGLE(fromFileTimestamp)(const QDateTime& dateTime)
+{
+#if !defined OSDAB_ZIP_NO_UTC && defined OSDAB_ZIP_HAS_UTC
+    const int utc = OSDAB_ZIP_MANGLE(currentUtcOffset)();
+    return dateTime.toUTC().addSecs(utc);
+#else
+    return dateTime;
+#endif // OSDAB_ZIP_NO_UTC
+}
+
+bool OSDAB_ZIP_MANGLE(setFileTimestamp)(const QString& fileName, const QDateTime& dateTime)
+{
+    if (fileName.isEmpty())
+        return true;
+
+#ifdef Q_OS_WIN
+    HANDLE hFile = CreateFile(fileName.toStdWString().c_str(),
+        GENERIC_WRITE, FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
+    if (hFile == INVALID_HANDLE_VALUE) {
+        return false;
+    }
+
+    SYSTEMTIME st;
+    FILETIME ft, ftLastMod;
+    const QDate date = dateTime.date();
+    const QTime time = dateTime.time();
+    st.wYear = date.year();
+    st.wMonth = date.month();
+    st.wDay = date.day();
+    st.wHour = time.hour();
+    st.wMinute = time.minute();
+    st.wSecond = time.second();
+    st.wMilliseconds = time.msec();
+
+    SystemTimeToFileTime(&st, &ft);
+    LocalFileTimeToFileTime(&ft, &ftLastMod);
+
+    const bool success = SetFileTime(hFile, NULL, NULL, &ftLastMod);
+    CloseHandle(hFile);
+    return success;
+
+#elif defined(Q_OS_LINUX) || defined(Q_OS_MACX)
+
+    struct utimbuf t_buffer;
+    t_buffer.actime = t_buffer.modtime = dateTime.toTime_t();
+    return utime(fileName.toLocal8Bit().constData(), &t_buffer) == 0;
+#endif
+
+    return true;
+}
+OSDAB_END_NAMESPACE
Index: /Vago/trunk/Vago/libs/zipglobal.h
===================================================================
--- /Vago/trunk/Vago/libs/zipglobal.h	(revision 771)
+++ /Vago/trunk/Vago/libs/zipglobal.h	(revision 771)
@@ -0,0 +1,77 @@
+/****************************************************************************
+** Filename: zipglobal.h
+** Last updated [dd/mm/yyyy]: 27/03/2011
+**
+** pkzip 2.0 file compression.
+**
+** Some of the code has been inspired by other open source projects,
+** (mainly Info-Zip and Gilles Vollant's minizip).
+** Compression and decompression actually uses the zlib library.
+**
+** Copyright (C) 2007-2012 Angius Fabrizio. All rights reserved.
+**
+** This file is part of the OSDaB project (http://osdab.42cows.org/).
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See the file LICENSE.GPL that came with this software distribution or
+** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
+**
+**********************************************************************/
+
+#ifndef OSDAB_ZIPGLOBAL__H
+#define OSDAB_ZIPGLOBAL__H
+
+#include <QtCore/QDateTime>
+#include <QtCore/QtGlobal>
+
+/* If you want to build the OSDaB Zip code as
+   a library, define OSDAB_ZIP_LIB in the library's .pro file and
+   in the libraries using it OR remove the #ifndef OSDAB_ZIP_LIB
+   define below and leave the #else body. Also remember to define
+   OSDAB_ZIP_BUILD_LIB in the library's project).
+*/
+
+#ifndef OSDAB_ZIP_LIB
+# define OSDAB_ZIP_EXPORT
+#else
+# if defined(OSDAB_ZIP_BUILD_LIB)
+#   define OSDAB_ZIP_EXPORT Q_DECL_EXPORT
+# else
+#   define OSDAB_ZIP_EXPORT Q_DECL_IMPORT
+# endif
+#endif
+
+#ifdef OSDAB_NAMESPACE
+#define OSDAB_BEGIN_NAMESPACE(ModuleName) namespace Osdab { namespace ModuleName {
+#else
+#define OSDAB_BEGIN_NAMESPACE(ModuleName)
+#endif
+
+#ifdef OSDAB_NAMESPACE
+#define OSDAB_END_NAMESPACE } }
+#else
+#define OSDAB_END_NAMESPACE
+#endif
+
+#ifndef OSDAB_NAMESPACE
+#define OSDAB_ZIP_MANGLE(x) zip_##x
+#else
+#define OSDAB_ZIP_MANGLE(x) x
+#endif
+
+OSDAB_BEGIN_NAMESPACE(Zip)
+
+OSDAB_ZIP_EXPORT int OSDAB_ZIP_MANGLE(currentUtcOffset)();
+OSDAB_ZIP_EXPORT QDateTime OSDAB_ZIP_MANGLE(fromFileTimestamp)(const QDateTime& dateTime);
+OSDAB_ZIP_EXPORT bool OSDAB_ZIP_MANGLE(setFileTimestamp)(const QString& fileName, const QDateTime& dateTime);
+
+OSDAB_END_NAMESPACE
+
+#endif // OSDAB_ZIPGLOBAL__H
Index: /Vago/trunk/Vago/libs/zlib/zconf.h
===================================================================
--- /Vago/trunk/Vago/libs/zlib/zconf.h	(revision 771)
+++ /Vago/trunk/Vago/libs/zlib/zconf.h	(revision 771)
@@ -0,0 +1,428 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2010 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
+ * this permanently in zconf.h using "./configure --zprefix".
+ */
+#ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
+
+/* all linked symbols */
+#  define _dist_code            z__dist_code
+#  define _length_code          z__length_code
+#  define _tr_align             z__tr_align
+#  define _tr_flush_block       z__tr_flush_block
+#  define _tr_init              z__tr_init
+#  define _tr_stored_block      z__tr_stored_block
+#  define _tr_tally             z__tr_tally
+#  define adler32               z_adler32
+#  define adler32_combine       z_adler32_combine
+#  define adler32_combine64     z_adler32_combine64
+#  define compress              z_compress
+#  define compress2             z_compress2
+#  define compressBound         z_compressBound
+#  define crc32                 z_crc32
+#  define crc32_combine         z_crc32_combine
+#  define crc32_combine64       z_crc32_combine64
+#  define deflate               z_deflate
+#  define deflateBound          z_deflateBound
+#  define deflateCopy           z_deflateCopy
+#  define deflateEnd            z_deflateEnd
+#  define deflateInit2_         z_deflateInit2_
+#  define deflateInit_          z_deflateInit_
+#  define deflateParams         z_deflateParams
+#  define deflatePrime          z_deflatePrime
+#  define deflateReset          z_deflateReset
+#  define deflateSetDictionary  z_deflateSetDictionary
+#  define deflateSetHeader      z_deflateSetHeader
+#  define deflateTune           z_deflateTune
+#  define deflate_copyright     z_deflate_copyright
+#  define get_crc_table         z_get_crc_table
+#  define gz_error              z_gz_error
+#  define gz_intmax             z_gz_intmax
+#  define gz_strwinerror        z_gz_strwinerror
+#  define gzbuffer              z_gzbuffer
+#  define gzclearerr            z_gzclearerr
+#  define gzclose               z_gzclose
+#  define gzclose_r             z_gzclose_r
+#  define gzclose_w             z_gzclose_w
+#  define gzdirect              z_gzdirect
+#  define gzdopen               z_gzdopen
+#  define gzeof                 z_gzeof
+#  define gzerror               z_gzerror
+#  define gzflush               z_gzflush
+#  define gzgetc                z_gzgetc
+#  define gzgets                z_gzgets
+#  define gzoffset              z_gzoffset
+#  define gzoffset64            z_gzoffset64
+#  define gzopen                z_gzopen
+#  define gzopen64              z_gzopen64
+#  define gzprintf              z_gzprintf
+#  define gzputc                z_gzputc
+#  define gzputs                z_gzputs
+#  define gzread                z_gzread
+#  define gzrewind              z_gzrewind
+#  define gzseek                z_gzseek
+#  define gzseek64              z_gzseek64
+#  define gzsetparams           z_gzsetparams
+#  define gztell                z_gztell
+#  define gztell64              z_gztell64
+#  define gzungetc              z_gzungetc
+#  define gzwrite               z_gzwrite
+#  define inflate               z_inflate
+#  define inflateBack           z_inflateBack
+#  define inflateBackEnd        z_inflateBackEnd
+#  define inflateBackInit_      z_inflateBackInit_
+#  define inflateCopy           z_inflateCopy
+#  define inflateEnd            z_inflateEnd
+#  define inflateGetHeader      z_inflateGetHeader
+#  define inflateInit2_         z_inflateInit2_
+#  define inflateInit_          z_inflateInit_
+#  define inflateMark           z_inflateMark
+#  define inflatePrime          z_inflatePrime
+#  define inflateReset          z_inflateReset
+#  define inflateReset2         z_inflateReset2
+#  define inflateSetDictionary  z_inflateSetDictionary
+#  define inflateSync           z_inflateSync
+#  define inflateSyncPoint      z_inflateSyncPoint
+#  define inflateUndermine      z_inflateUndermine
+#  define inflate_copyright     z_inflate_copyright
+#  define inflate_fast          z_inflate_fast
+#  define inflate_table         z_inflate_table
+#  define uncompress            z_uncompress
+#  define zError                z_zError
+#  define zcalloc               z_zcalloc
+#  define zcfree                z_zcfree
+#  define zlibCompileFlags      z_zlibCompileFlags
+#  define zlibVersion           z_zlibVersion
+
+/* all zlib typedefs in zlib.h and zconf.h */
+#  define Byte                  z_Byte
+#  define Bytef                 z_Bytef
+#  define alloc_func            z_alloc_func
+#  define charf                 z_charf
+#  define free_func             z_free_func
+#  define gzFile                z_gzFile
+#  define gz_header             z_gz_header
+#  define gz_headerp            z_gz_headerp
+#  define in_func               z_in_func
+#  define intf                  z_intf
+#  define out_func              z_out_func
+#  define uInt                  z_uInt
+#  define uIntf                 z_uIntf
+#  define uLong                 z_uLong
+#  define uLongf                z_uLongf
+#  define voidp                 z_voidp
+#  define voidpc                z_voidpc
+#  define voidpf                z_voidpf
+
+/* all zlib structs in zlib.h and zconf.h */
+#  define gz_header_s           z_gz_header_s
+#  define internal_state        z_internal_state
+
+#endif
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+#  define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+#  define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+#  define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+#  ifndef WIN32
+#    define WIN32
+#  endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+#    ifndef SYS16BIT
+#      define SYS16BIT
+#    endif
+#  endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+#  define MAXSEG_64K
+#endif
+#ifdef MSDOS
+#  define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+#  ifndef STDC
+#    define STDC
+#  endif
+#  if __STDC_VERSION__ >= 199901L
+#    ifndef STDC99
+#      define STDC99
+#    endif
+#  endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+#  define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
+#  define STDC
+#endif
+
+#ifndef STDC
+#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+#    define const       /* note: need a more gentle solution here */
+#  endif
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+#  define NO_DUMMY_DECL
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+#  ifdef MAXSEG_64K
+#    define MAX_MEM_LEVEL 8
+#  else
+#    define MAX_MEM_LEVEL 9
+#  endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+#  define MAX_WBITS   15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+            (1 << (windowBits+2)) +  (1 << (memLevel+9))
+ that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+   The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+                        /* Type declarations */
+
+#ifndef OF /* function prototypes */
+#  ifdef STDC
+#    define OF(args)  args
+#  else
+#    define OF(args)  ()
+#  endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+#  if defined(M_I86SM) || defined(M_I86MM)
+     /* MSC small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef _MSC_VER
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#  if (defined(__SMALL__) || defined(__MEDIUM__))
+     /* Turbo C small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef __BORLANDC__
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+   /* If building or using zlib as a DLL, define ZLIB_DLL.
+    * This is not mandatory, but it offers a little performance increase.
+    */
+#  ifdef ZLIB_DLL
+#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+#      ifdef ZLIB_INTERNAL
+#        define ZEXTERN extern __declspec(dllexport)
+#      else
+#        define ZEXTERN extern __declspec(dllimport)
+#      endif
+#    endif
+#  endif  /* ZLIB_DLL */
+   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+    * define ZLIB_WINAPI.
+    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+    */
+#  ifdef ZLIB_WINAPI
+#    ifdef FAR
+#      undef FAR
+#    endif
+#    include <windows.h>
+     /* No need for _export, use ZLIB.DEF instead. */
+     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+#    define ZEXPORT WINAPI
+#    ifdef WIN32
+#      define ZEXPORTVA WINAPIV
+#    else
+#      define ZEXPORTVA FAR CDECL
+#    endif
+#  endif
+#endif
+
+#if defined (__BEOS__)
+#  ifdef ZLIB_DLL
+#    ifdef ZLIB_INTERNAL
+#      define ZEXPORT   __declspec(dllexport)
+#      define ZEXPORTVA __declspec(dllexport)
+#    else
+#      define ZEXPORT   __declspec(dllimport)
+#      define ZEXPORTVA __declspec(dllimport)
+#    endif
+#  endif
+#endif
+
+#ifndef ZEXTERN
+#  define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+#  define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+#  define ZEXPORTVA
+#endif
+
+#ifndef FAR
+#  define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char  Byte;  /* 8 bits */
+#endif
+typedef unsigned int   uInt;  /* 16 bits or more */
+typedef unsigned long  uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+#  define Bytef Byte FAR
+#else
+   typedef Byte  FAR Bytef;
+#endif
+typedef char  FAR charf;
+typedef int   FAR intf;
+typedef uInt  FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+   typedef void const *voidpc;
+   typedef void FAR   *voidpf;
+   typedef void       *voidp;
+#else
+   typedef Byte const *voidpc;
+   typedef Byte FAR   *voidpf;
+   typedef Byte       *voidp;
+#endif
+
+#if defined(HAVE_UNISTD_H) || !defined(WIN32)
+#  define Z_HAVE_UNISTD_H
+#endif
+
+#if defined(STDC) && !defined(_WIN32_WCE)
+#  include <sys/types.h>    /* for off_t */
+#endif
+
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if -_LARGEFILE64_SOURCE - -1 == 1
+#  undef _LARGEFILE64_SOURCE
+#endif
+
+#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+#  include <unistd.h>       /* for SEEK_* and off_t */
+#  ifdef VMS
+#    include <unixio.h>     /* for off_t */
+#  endif
+#  ifndef z_off_t
+#    define z_off_t off_t
+#  endif
+#endif
+
+#ifndef SEEK_SET
+#  define SEEK_SET        0       /* Seek from beginning of file.  */
+#  define SEEK_CUR        1       /* Seek from current position.  */
+#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
+#endif
+
+#ifndef z_off_t
+#  define z_off_t long
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+#  define z_off64_t off64_t
+#else
+#  define z_off64_t z_off_t
+#endif
+
+#if defined(__OS400__)
+#  define NO_vsnprintf
+#endif
+
+#if defined(__MVS__)
+#  define NO_vsnprintf
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+  #pragma map(deflateInit_,"DEIN")
+  #pragma map(deflateInit2_,"DEIN2")
+  #pragma map(deflateEnd,"DEEND")
+  #pragma map(deflateBound,"DEBND")
+  #pragma map(inflateInit_,"ININ")
+  #pragma map(inflateInit2_,"ININ2")
+  #pragma map(inflateEnd,"INEND")
+  #pragma map(inflateSync,"INSY")
+  #pragma map(inflateSetDictionary,"INSEDI")
+  #pragma map(compressBound,"CMBND")
+  #pragma map(inflate_table,"INTABL")
+  #pragma map(inflate_fast,"INFA")
+  #pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
Index: /Vago/trunk/Vago/libs/zlib/zlib.h
===================================================================
--- /Vago/trunk/Vago/libs/zlib/zlib.h	(revision 771)
+++ /Vago/trunk/Vago/libs/zlib/zlib.h	(revision 771)
@@ -0,0 +1,1622 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+  version 1.2.5, April 19th, 2010
+
+  Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  jloup@gzip.org          madler@alumni.caltech.edu
+
+
+  The data format used by the zlib library is described by RFCs (Request for
+  Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
+  (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+*/
+
+#ifndef ZLIB_H
+#define ZLIB_H
+
+#include "zconf.h"
+
+#include "qconfig.h"
+#if defined(QT_VISIBILITY_AVAILABLE)
+# undef ZEXTERN
+# define ZEXTERN __attribute__((visibility("default")))
+#elif defined(QT_MAKEDLL)
+# undef ZEXTERN
+# define ZEXTERN __declspec(dllexport)
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.2.5"
+#define ZLIB_VERNUM 0x1250
+#define ZLIB_VER_MAJOR 1
+#define ZLIB_VER_MINOR 2
+#define ZLIB_VER_REVISION 5
+#define ZLIB_VER_SUBREVISION 0
+
+/*
+    The 'zlib' compression library provides in-memory compression and
+  decompression functions, including integrity checks of the uncompressed data.
+  This version of the library supports only one compression method (deflation)
+  but other algorithms will be added later and will have the same stream
+  interface.
+
+    Compression can be done in a single step if the buffers are large enough,
+  or can be done by repeated calls of the compression function.  In the latter
+  case, the application must provide more input and/or consume the output
+  (providing more output space) before each call.
+
+    The compressed data format used by default by the in-memory functions is
+  the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
+  around a deflate stream, which is itself documented in RFC 1951.
+
+    The library also supports reading and writing files in gzip (.gz) format
+  with an interface similar to that of stdio using the functions that start
+  with "gz".  The gzip format is different from the zlib format.  gzip is a
+  gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
+
+    This library can optionally read and write gzip streams in memory as well.
+
+    The zlib format was designed to be compact and fast for use in memory
+  and on communications channels.  The gzip format was designed for single-
+  file compression on file systems, has a larger header than zlib to maintain
+  directory information, and uses a different, slower check method than zlib.
+
+    The library does not install any signal handler.  The decoder checks
+  the consistency of the compressed data, so the library should never crash
+  even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void   (*free_func)  OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+    Bytef    *next_in;  /* next input byte */
+    uInt     avail_in;  /* number of bytes available at next_in */
+    uLong    total_in;  /* total nb of input bytes read so far */
+
+    Bytef    *next_out; /* next output byte should be put there */
+    uInt     avail_out; /* remaining free space at next_out */
+    uLong    total_out; /* total nb of bytes output so far */
+
+    char     *msg;      /* last error message, NULL if no error */
+    struct internal_state FAR *state; /* not visible by applications */
+
+    alloc_func zalloc;  /* used to allocate the internal state */
+    free_func  zfree;   /* used to free the internal state */
+    voidpf     opaque;  /* private data object passed to zalloc and zfree */
+
+    int     data_type;  /* best guess about the data type: binary or text */
+    uLong   adler;      /* adler32 value of the uncompressed data */
+    uLong   reserved;   /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+     gzip header information passed to and from zlib routines.  See RFC 1952
+  for more details on the meanings of these fields.
+*/
+typedef struct gz_header_s {
+    int     text;       /* true if compressed data believed to be text */
+    uLong   time;       /* modification time */
+    int     xflags;     /* extra flags (not used when writing a gzip file) */
+    int     os;         /* operating system */
+    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */
+    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */
+    uInt    extra_max;  /* space at extra (only when reading header) */
+    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */
+    uInt    name_max;   /* space at name (only when reading header) */
+    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */
+    uInt    comm_max;   /* space at comment (only when reading header) */
+    int     hcrc;       /* true if there was or will be a header crc */
+    int     done;       /* true when done reading gzip header (not used
+                           when writing a gzip file) */
+} gz_header;
+
+typedef gz_header FAR *gz_headerp;
+
+/*
+     The application must update next_in and avail_in when avail_in has dropped
+   to zero.  It must update next_out and avail_out when avail_out has dropped
+   to zero.  The application must initialize zalloc, zfree and opaque before
+   calling the init function.  All other fields are set by the compression
+   library and must not be updated by the application.
+
+     The opaque value provided by the application will be passed as the first
+   parameter for calls of zalloc and zfree.  This can be useful for custom
+   memory management.  The compression library attaches no meaning to the
+   opaque value.
+
+     zalloc must return Z_NULL if there is not enough memory for the object.
+   If zlib is used in a multi-threaded application, zalloc and zfree must be
+   thread safe.
+
+     On 16-bit systems, the functions zalloc and zfree must be able to allocate
+   exactly 65536 bytes, but will not be required to allocate more than this if
+   the symbol MAXSEG_64K is defined (see zconf.h).  WARNING: On MSDOS, pointers
+   returned by zalloc for objects of exactly 65536 bytes *must* have their
+   offset normalized to zero.  The default allocation function provided by this
+   library ensures this (see zutil.c).  To reduce memory requirements and avoid
+   any allocation of 64K objects, at the expense of compression ratio, compile
+   the library with -DMAX_WBITS=14 (see zconf.h).
+
+     The fields total_in and total_out can be used for statistics or progress
+   reports.  After compression, total_in holds the total size of the
+   uncompressed data and may be saved for use in the decompressor (particularly
+   if the decompressor wants to decompress everything in a single step).
+*/
+
+                        /* constants */
+
+#define Z_NO_FLUSH      0
+#define Z_PARTIAL_FLUSH 1
+#define Z_SYNC_FLUSH    2
+#define Z_FULL_FLUSH    3
+#define Z_FINISH        4
+#define Z_BLOCK         5
+#define Z_TREES         6
+/* Allowed flush values; see deflate() and inflate() below for details */
+
+#define Z_OK            0
+#define Z_STREAM_END    1
+#define Z_NEED_DICT     2
+#define Z_ERRNO        (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR   (-3)
+#define Z_MEM_ERROR    (-4)
+#define Z_BUF_ERROR    (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative values
+ * are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION         0
+#define Z_BEST_SPEED             1
+#define Z_BEST_COMPRESSION       9
+#define Z_DEFAULT_COMPRESSION  (-1)
+/* compression levels */
+
+#define Z_FILTERED            1
+#define Z_HUFFMAN_ONLY        2
+#define Z_RLE                 3
+#define Z_FIXED               4
+#define Z_DEFAULT_STRATEGY    0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY   0
+#define Z_TEXT     1
+#define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */
+#define Z_UNKNOWN  2
+/* Possible values of the data_type field (though see inflate()) */
+
+#define Z_DEFLATED   8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+
+                        /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+   If the first character differs, the library code actually used is not
+   compatible with the zlib.h header file used by the application.  This check
+   is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+     Initializes the internal stream state for compression.  The fields
+   zalloc, zfree and opaque must be initialized before by the caller.  If
+   zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
+   allocation functions.
+
+     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+   1 gives best speed, 9 gives best compression, 0 gives no compression at all
+   (the input data is simply copied a block at a time).  Z_DEFAULT_COMPRESSION
+   requests a default compromise between speed and compression (currently
+   equivalent to level 6).
+
+     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if level is not a valid compression level, or
+   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+   with the version assumed by the caller (ZLIB_VERSION).  msg is set to null
+   if there is no error message.  deflateInit does not perform any compression:
+   this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+    deflate compresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full.  It may introduce
+  some output latency (reading input without producing any output) except when
+  forced to flush.
+
+    The detailed semantics are as follows.  deflate performs one or both of the
+  following actions:
+
+  - Compress more input starting at next_in and update next_in and avail_in
+    accordingly.  If not all input can be processed (because there is not
+    enough room in the output buffer), next_in and avail_in are updated and
+    processing will resume at this point for the next call of deflate().
+
+  - Provide more output starting at next_out and update next_out and avail_out
+    accordingly.  This action is forced if the parameter flush is non zero.
+    Forcing flush frequently degrades the compression ratio, so this parameter
+    should be set only when necessary (in interactive applications).  Some
+    output may be provided even if flush is not set.
+
+    Before the call of deflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming more
+  output, and updating avail_in or avail_out accordingly; avail_out should
+  never be zero before the call.  The application can consume the compressed
+  output when it wants, for example when the output buffer is full (avail_out
+  == 0), or after each call of deflate().  If deflate returns Z_OK and with
+  zero avail_out, it must be called again after making room in the output
+  buffer because there might be more output pending.
+
+    Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
+  decide how much data to accumulate before producing output, in order to
+  maximize compression.
+
+    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+  flushed to the output buffer and the output is aligned on a byte boundary, so
+  that the decompressor can get all input data available so far.  (In
+  particular avail_in is zero after the call if enough output space has been
+  provided before the call.) Flushing may degrade compression for some
+  compression algorithms and so it should be used only when necessary.  This
+  completes the current deflate block and follows it with an empty stored block
+  that is three bits plus filler bits to the next byte, followed by four bytes
+  (00 00 ff ff).
+
+    If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
+  output buffer, but the output is not aligned to a byte boundary.  All of the
+  input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
+  This completes the current deflate block and follows it with an empty fixed
+  codes block that is 10 bits long.  This assures that enough bytes are output
+  in order for the decompressor to finish the block before the empty fixed code
+  block.
+
+    If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
+  for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
+  seven bits of the current block are held to be written as the next byte after
+  the next deflate block is completed.  In this case, the decompressor may not
+  be provided enough bits at this point in order to complete decompression of
+  the data provided so far to the compressor.  It may need to wait for the next
+  block to be emitted.  This is for advanced applications that need to control
+  the emission of deflate blocks.
+
+    If flush is set to Z_FULL_FLUSH, all output is flushed as with
+  Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+  restart from this point if previous compressed data has been damaged or if
+  random access is desired.  Using Z_FULL_FLUSH too often can seriously degrade
+  compression.
+
+    If deflate returns with avail_out == 0, this function must be called again
+  with the same value of the flush parameter and more output space (updated
+  avail_out), until the flush is complete (deflate returns with non-zero
+  avail_out).  In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
+  avail_out is greater than six to avoid repeated flush markers due to
+  avail_out == 0 on return.
+
+    If the parameter flush is set to Z_FINISH, pending input is processed,
+  pending output is flushed and deflate returns with Z_STREAM_END if there was
+  enough output space; if deflate returns with Z_OK, this function must be
+  called again with Z_FINISH and more output space (updated avail_out) but no
+  more input data, until it returns with Z_STREAM_END or an error.  After
+  deflate has returned Z_STREAM_END, the only possible operations on the stream
+  are deflateReset or deflateEnd.
+
+    Z_FINISH can be used immediately after deflateInit if all the compression
+  is to be done in a single step.  In this case, avail_out must be at least the
+  value returned by deflateBound (see below).  If deflate does not return
+  Z_STREAM_END, then it must be called again as described above.
+
+    deflate() sets strm->adler to the adler32 checksum of all input read
+  so far (that is, total_in bytes).
+
+    deflate() may update strm->data_type if it can make a good guess about
+  the input data type (Z_BINARY or Z_TEXT).  In doubt, the data is considered
+  binary.  This field is only for information purposes and does not affect the
+  compression algorithm in any manner.
+
+    deflate() returns Z_OK if some progress has been made (more input
+  processed or more output produced), Z_STREAM_END if all input has been
+  consumed and all output has been produced (only when flush is set to
+  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+  if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
+  (for example avail_in or avail_out was zero).  Note that Z_BUF_ERROR is not
+  fatal, and deflate() can be called again with more input and more output
+  space to continue compressing.
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any pending
+   output.
+
+     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+   stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+   prematurely (some input or output was discarded).  In the error case, msg
+   may be set but then points to a static string (which must not be
+   deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+     Initializes the internal stream state for decompression.  The fields
+   next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+   the caller.  If next_in is not Z_NULL and avail_in is large enough (the
+   exact value depends on the compression method), inflateInit determines the
+   compression method from the zlib header and allocates all data structures
+   accordingly; otherwise the allocation will be deferred to the first call of
+   inflate.  If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+   use default allocation functions.
+
+     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+   invalid, such as a null pointer to the structure.  msg is set to null if
+   there is no error message.  inflateInit does not perform any decompression
+   apart from possibly reading the zlib header if present: actual decompression
+   will be done by inflate().  (So next_in and avail_in may be modified, but
+   next_out and avail_out are unused and unchanged.) The current implementation
+   of inflateInit() does not process any header information -- that is deferred
+   until inflate() is called.
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+    inflate decompresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full.  It may introduce
+  some output latency (reading input without producing any output) except when
+  forced to flush.
+
+  The detailed semantics are as follows.  inflate performs one or both of the
+  following actions:
+
+  - Decompress more input starting at next_in and update next_in and avail_in
+    accordingly.  If not all input can be processed (because there is not
+    enough room in the output buffer), next_in is updated and processing will
+    resume at this point for the next call of inflate().
+
+  - Provide more output starting at next_out and update next_out and avail_out
+    accordingly.  inflate() provides as much output as possible, until there is
+    no more input data or no more space in the output buffer (see below about
+    the flush parameter).
+
+    Before the call of inflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming more
+  output, and updating the next_* and avail_* values accordingly.  The
+  application can consume the uncompressed output when it wants, for example
+  when the output buffer is full (avail_out == 0), or after each call of
+  inflate().  If inflate returns Z_OK and with zero avail_out, it must be
+  called again after making room in the output buffer because there might be
+  more output pending.
+
+    The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
+  Z_BLOCK, or Z_TREES.  Z_SYNC_FLUSH requests that inflate() flush as much
+  output as possible to the output buffer.  Z_BLOCK requests that inflate()
+  stop if and when it gets to the next deflate block boundary.  When decoding
+  the zlib or gzip format, this will cause inflate() to return immediately
+  after the header and before the first block.  When doing a raw inflate,
+  inflate() will go ahead and process the first block, and will return when it
+  gets to the end of that block, or when it runs out of data.
+
+    The Z_BLOCK option assists in appending to or combining deflate streams.
+  Also to assist in this, on return inflate() will set strm->data_type to the
+  number of unused bits in the last byte taken from strm->next_in, plus 64 if
+  inflate() is currently decoding the last block in the deflate stream, plus
+  128 if inflate() returned immediately after decoding an end-of-block code or
+  decoding the complete header up to just before the first byte of the deflate
+  stream.  The end-of-block will not be indicated until all of the uncompressed
+  data from that block has been written to strm->next_out.  The number of
+  unused bits may in general be greater than seven, except when bit 7 of
+  data_type is set, in which case the number of unused bits will be less than
+  eight.  data_type is set as noted here every time inflate() returns for all
+  flush options, and so can be used to determine the amount of currently
+  consumed input in bits.
+
+    The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
+  end of each deflate block header is reached, before any actual data in that
+  block is decoded.  This allows the caller to determine the length of the
+  deflate block header for later use in random access within a deflate block.
+  256 is added to the value of strm->data_type when inflate() returns
+  immediately after reaching the end of the deflate block header.
+
+    inflate() should normally be called until it returns Z_STREAM_END or an
+  error.  However if all decompression is to be performed in a single step (a
+  single call of inflate), the parameter flush should be set to Z_FINISH.  In
+  this case all pending input is processed and all pending output is flushed;
+  avail_out must be large enough to hold all the uncompressed data.  (The size
+  of the uncompressed data may have been saved by the compressor for this
+  purpose.) The next operation on this stream must be inflateEnd to deallocate
+  the decompression state.  The use of Z_FINISH is never required, but can be
+  used to inform inflate that a faster approach may be used for the single
+  inflate() call.
+
+     In this implementation, inflate() always flushes as much output as
+  possible to the output buffer, and always uses the faster approach on the
+  first call.  So the only effect of the flush parameter in this implementation
+  is on the return value of inflate(), as noted below, or when it returns early
+  because Z_BLOCK or Z_TREES is used.
+
+     If a preset dictionary is needed after this call (see inflateSetDictionary
+  below), inflate sets strm->adler to the adler32 checksum of the dictionary
+  chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
+  strm->adler to the adler32 checksum of all output produced so far (that is,
+  total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
+  below.  At the end of the stream, inflate() checks that its computed adler32
+  checksum is equal to that saved by the compressor and returns Z_STREAM_END
+  only if the checksum is correct.
+
+    inflate() can decompress and check either zlib-wrapped or gzip-wrapped
+  deflate data.  The header type is detected automatically, if requested when
+  initializing with inflateInit2().  Any information contained in the gzip
+  header is not retained, so applications that need that information should
+  instead use raw inflate, see inflateInit2() below, or inflateBack() and
+  perform their own processing of the gzip header and trailer.
+
+    inflate() returns Z_OK if some progress has been made (more input processed
+  or more output produced), Z_STREAM_END if the end of the compressed data has
+  been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+  corrupted (input stream not conforming to the zlib format or incorrect check
+  value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
+  next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,
+  Z_BUF_ERROR if no progress is possible or if there was not enough room in the
+  output buffer when Z_FINISH is used.  Note that Z_BUF_ERROR is not fatal, and
+  inflate() can be called again with more input and more output space to
+  continue decompressing.  If Z_DATA_ERROR is returned, the application may
+  then call inflateSync() to look for a good compression block if a partial
+  recovery of the data is desired.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any pending
+   output.
+
+     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+   was inconsistent.  In the error case, msg may be set but then points to a
+   static string (which must not be deallocated).
+*/
+
+
+                        /* Advanced functions */
+
+/*
+    The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+                                     int  level,
+                                     int  method,
+                                     int  windowBits,
+                                     int  memLevel,
+                                     int  strategy));
+
+     This is another version of deflateInit with more compression options.  The
+   fields next_in, zalloc, zfree and opaque must be initialized before by the
+   caller.
+
+     The method parameter is the compression method.  It must be Z_DEFLATED in
+   this version of the library.
+
+     The windowBits parameter is the base two logarithm of the window size
+   (the size of the history buffer).  It should be in the range 8..15 for this
+   version of the library.  Larger values of this parameter result in better
+   compression at the expense of memory usage.  The default value is 15 if
+   deflateInit is used instead.
+
+     windowBits can also be -8..-15 for raw deflate.  In this case, -windowBits
+   determines the window size.  deflate() will then generate raw deflate data
+   with no zlib header or trailer, and will not compute an adler32 check value.
+
+     windowBits can also be greater than 15 for optional gzip encoding.  Add
+   16 to windowBits to write a simple gzip header and trailer around the
+   compressed data instead of a zlib wrapper.  The gzip header will have no
+   file name, no extra data, no comment, no modification time (set to zero), no
+   header crc, and the operating system will be set to 255 (unknown).  If a
+   gzip stream is being written, strm->adler is a crc32 instead of an adler32.
+
+     The memLevel parameter specifies how much memory should be allocated
+   for the internal compression state.  memLevel=1 uses minimum memory but is
+   slow and reduces compression ratio; memLevel=9 uses maximum memory for
+   optimal speed.  The default value is 8.  See zconf.h for total memory usage
+   as a function of windowBits and memLevel.
+
+     The strategy parameter is used to tune the compression algorithm.  Use the
+   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
+   string match), or Z_RLE to limit match distances to one (run-length
+   encoding).  Filtered data consists mostly of small values with a somewhat
+   random distribution.  In this case, the compression algorithm is tuned to
+   compress them better.  The effect of Z_FILTERED is to force more Huffman
+   coding and less string matching; it is somewhat intermediate between
+   Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY.  Z_RLE is designed to be almost as
+   fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data.  The
+   strategy parameter only affects the compression ratio but not the
+   correctness of the compressed output even if it is not set appropriately.
+   Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
+   decoder for special applications.
+
+     deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
+   method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
+   incompatible with the version assumed by the caller (ZLIB_VERSION).  msg is
+   set to null if there is no error message.  deflateInit2 does not perform any
+   compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the compression dictionary from the given byte sequence
+   without producing any compressed output.  This function must be called
+   immediately after deflateInit, deflateInit2 or deflateReset, before any call
+   of deflate.  The compressor and decompressor must use exactly the same
+   dictionary (see inflateSetDictionary).
+
+     The dictionary should consist of strings (byte sequences) that are likely
+   to be encountered later in the data to be compressed, with the most commonly
+   used strings preferably put towards the end of the dictionary.  Using a
+   dictionary is most useful when the data to be compressed is short and can be
+   predicted with good accuracy; the data can then be compressed better than
+   with the default empty dictionary.
+
+     Depending on the size of the compression data structures selected by
+   deflateInit or deflateInit2, a part of the dictionary may in effect be
+   discarded, for example if the dictionary is larger than the window size
+   provided in deflateInit or deflateInit2.  Thus the strings most likely to be
+   useful should be put at the end of the dictionary, not at the front.  In
+   addition, the current implementation of deflate will use at most the window
+   size minus 262 bytes of the provided dictionary.
+
+     Upon return of this function, strm->adler is set to the adler32 value
+   of the dictionary; the decompressor may later use this value to determine
+   which dictionary has been used by the compressor.  (The adler32 value
+   applies to the whole dictionary even if only a subset of the dictionary is
+   actually used by the compressor.) If a raw deflate was requested, then the
+   adler32 value is not computed and strm->adler is not set.
+
+     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
+   inconsistent (for example if deflate has already been called for this stream
+   or if the compression method is bsort).  deflateSetDictionary does not
+   perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when several compression strategies will be
+   tried, for example when there are several ways of pre-processing the input
+   data with a filter.  The streams that will be discarded should then be freed
+   by calling deflateEnd.  Note that deflateCopy duplicates the internal
+   compression state which can be quite large, so this strategy is slow and can
+   consume lots of memory.
+
+     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being Z_NULL).  msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to deflateEnd followed by deflateInit,
+   but does not free and reallocate all the internal compression state.  The
+   stream will keep the same compression level and any other attributes that
+   may have been set by deflateInit2.
+
+     deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+                                      int level,
+                                      int strategy));
+/*
+     Dynamically update the compression level and compression strategy.  The
+   interpretation of level and strategy is as in deflateInit2.  This can be
+   used to switch between compression and straight copy of the input data, or
+   to switch to a different kind of input data requiring a different strategy.
+   If the compression level is changed, the input available so far is
+   compressed with the old level (and may be flushed); the new level will take
+   effect only at the next call of deflate().
+
+     Before the call of deflateParams, the stream state must be set as for
+   a call of deflate(), since the currently available input may have to be
+   compressed and flushed.  In particular, strm->avail_out must be non-zero.
+
+     deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+   stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if
+   strm->avail_out was zero.
+*/
+
+ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
+                                    int good_length,
+                                    int max_lazy,
+                                    int nice_length,
+                                    int max_chain));
+/*
+     Fine tune deflate's internal compression parameters.  This should only be
+   used by someone who understands the algorithm used by zlib's deflate for
+   searching for the best matching string, and even then only by the most
+   fanatic optimizer trying to squeeze out the last compressed bit for their
+   specific input data.  Read the deflate.c source code for the meaning of the
+   max_lazy, good_length, nice_length, and max_chain parameters.
+
+     deflateTune() can be called after deflateInit() or deflateInit2(), and
+   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
+ */
+
+ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
+                                       uLong sourceLen));
+/*
+     deflateBound() returns an upper bound on the compressed size after
+   deflation of sourceLen bytes.  It must be called after deflateInit() or
+   deflateInit2(), and after deflateSetHeader(), if used.  This would be used
+   to allocate an output buffer for deflation in a single pass, and so would be
+   called before deflate().
+*/
+
+ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     deflatePrime() inserts bits in the deflate output stream.  The intent
+   is that this function is used to start off the deflate output with the bits
+   leftover from a previous deflate stream when appending to it.  As such, this
+   function can only be used for raw deflate, and must be used before the first
+   deflate() call after a deflateInit2() or deflateReset().  bits must be less
+   than or equal to 16, and that many of the least significant bits of value
+   will be inserted in the output.
+
+     deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+     deflateSetHeader() provides gzip header information for when a gzip
+   stream is requested by deflateInit2().  deflateSetHeader() may be called
+   after deflateInit2() or deflateReset() and before the first call of
+   deflate().  The text, time, os, extra field, name, and comment information
+   in the provided gz_header structure are written to the gzip header (xflag is
+   ignored -- the extra flags are set according to the compression level).  The
+   caller must assure that, if not Z_NULL, name and comment are terminated with
+   a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
+   available there.  If hcrc is true, a gzip header crc is included.  Note that
+   the current versions of the command-line version of gzip (up through version
+   1.3.x) do not support header crc's, and will report that it is a "multi-part
+   gzip file" and give up.
+
+     If deflateSetHeader is not used, the default gzip header has text false,
+   the time set to zero, and os set to 255, with no extra, name, or comment
+   fields.  The gzip header is returned to the default state by deflateReset().
+
+     deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+                                     int  windowBits));
+
+     This is another version of inflateInit with an extra parameter.  The
+   fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+   before by the caller.
+
+     The windowBits parameter is the base two logarithm of the maximum window
+   size (the size of the history buffer).  It should be in the range 8..15 for
+   this version of the library.  The default value is 15 if inflateInit is used
+   instead.  windowBits must be greater than or equal to the windowBits value
+   provided to deflateInit2() while compressing, or it must be equal to 15 if
+   deflateInit2() was not used.  If a compressed stream with a larger window
+   size is given as input, inflate() will return with the error code
+   Z_DATA_ERROR instead of trying to allocate a larger window.
+
+     windowBits can also be zero to request that inflate use the window size in
+   the zlib header of the compressed stream.
+
+     windowBits can also be -8..-15 for raw inflate.  In this case, -windowBits
+   determines the window size.  inflate() will then process raw deflate data,
+   not looking for a zlib or gzip header, not generating a check value, and not
+   looking for any check values for comparison at the end of the stream.  This
+   is for use with other formats that use the deflate compressed data format
+   such as zip.  Those formats provide their own check values.  If a custom
+   format is developed using the raw deflate format for compressed data, it is
+   recommended that a check value such as an adler32 or a crc32 be applied to
+   the uncompressed data as is done in the zlib, gzip, and zip formats.  For
+   most applications, the zlib format should be used as is.  Note that comments
+   above on the use in deflateInit2() applies to the magnitude of windowBits.
+
+     windowBits can also be greater than 15 for optional gzip decoding.  Add
+   32 to windowBits to enable zlib and gzip decoding with automatic header
+   detection, or add 16 to decode only the gzip format (the zlib format will
+   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is a
+   crc32 instead of an adler32.
+
+     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+   invalid, such as a null pointer to the structure.  msg is set to null if
+   there is no error message.  inflateInit2 does not perform any decompression
+   apart from possibly reading the zlib header if present: actual decompression
+   will be done by inflate().  (So next_in and avail_in may be modified, but
+   next_out and avail_out are unused and unchanged.) The current implementation
+   of inflateInit2() does not process any header information -- that is
+   deferred until inflate() is called.
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the decompression dictionary from the given uncompressed byte
+   sequence.  This function must be called immediately after a call of inflate,
+   if that call returned Z_NEED_DICT.  The dictionary chosen by the compressor
+   can be determined from the adler32 value returned by that call of inflate.
+   The compressor and decompressor must use exactly the same dictionary (see
+   deflateSetDictionary).  For raw inflate, this function can be called
+   immediately after inflateInit2() or inflateReset() and before any call of
+   inflate() to set the dictionary.  The application must insure that the
+   dictionary that was used for compression is provided.
+
+     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
+   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+   expected one (incorrect adler32 value).  inflateSetDictionary does not
+   perform any decompression: this will be done by subsequent calls of
+   inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+     Skips invalid compressed data until a full flush point (see above the
+   description of deflate with Z_FULL_FLUSH) can be found, or until all
+   available input is skipped.  No output is provided.
+
+     inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+   if no more input was provided, Z_DATA_ERROR if no flush point has been
+   found, or Z_STREAM_ERROR if the stream structure was inconsistent.  In the
+   success case, the application may save the current current value of total_in
+   which indicates where valid compressed data was found.  In the error case,
+   the application may repeatedly call inflateSync, providing more input each
+   time, until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when randomly accessing a large stream.  The
+   first pass through the stream can periodically record the inflate state,
+   allowing restarting inflate at those points when randomly accessing the
+   stream.
+
+     inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being Z_NULL).  msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to inflateEnd followed by inflateInit,
+   but does not free and reallocate all the internal decompression state.  The
+   stream will keep attributes that may have been set by inflateInit2.
+
+     inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
+                                      int windowBits));
+/*
+     This function is the same as inflateReset, but it also permits changing
+   the wrap and window size requests.  The windowBits parameter is interpreted
+   the same as it is for inflateInit2.
+
+     inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being Z_NULL), or if
+   the windowBits parameter is invalid.
+*/
+
+ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     This function inserts bits in the inflate input stream.  The intent is
+   that this function is used to start inflating at a bit position in the
+   middle of a byte.  The provided bits will be used before any bytes are used
+   from next_in.  This function should only be used with raw inflate, and
+   should be used before the first inflate() call after inflateInit2() or
+   inflateReset().  bits must be less than or equal to 16, and that many of the
+   least significant bits of value will be inserted in the input.
+
+     If bits is negative, then the input stream bit buffer is emptied.  Then
+   inflatePrime() can be called again to put bits in the buffer.  This is used
+   to clear out bits leftover after feeding inflate a block description prior
+   to feeding inflate codes.
+
+     inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
+/*
+     This function returns two values, one in the lower 16 bits of the return
+   value, and the other in the remaining upper bits, obtained by shifting the
+   return value down 16 bits.  If the upper value is -1 and the lower value is
+   zero, then inflate() is currently decoding information outside of a block.
+   If the upper value is -1 and the lower value is non-zero, then inflate is in
+   the middle of a stored block, with the lower value equaling the number of
+   bytes from the input remaining to copy.  If the upper value is not -1, then
+   it is the number of bits back from the current bit position in the input of
+   the code (literal or length/distance pair) currently being processed.  In
+   that case the lower value is the number of bytes already emitted for that
+   code.
+
+     A code is being processed if inflate is waiting for more input to complete
+   decoding of the code, or if it has completed decoding but is waiting for
+   more output space to write the literal or match data.
+
+     inflateMark() is used to mark locations in the input data for random
+   access, which may be at bit positions, and to note those cases where the
+   output of a code may span boundaries of random access blocks.  The current
+   location in the input stream can be determined from avail_in and data_type
+   as noted in the description for the Z_BLOCK flush parameter for inflate.
+
+     inflateMark returns the value noted above or -1 << 16 if the provided
+   source stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+     inflateGetHeader() requests that gzip header information be stored in the
+   provided gz_header structure.  inflateGetHeader() may be called after
+   inflateInit2() or inflateReset(), and before the first call of inflate().
+   As inflate() processes the gzip stream, head->done is zero until the header
+   is completed, at which time head->done is set to one.  If a zlib stream is
+   being decoded, then head->done is set to -1 to indicate that there will be
+   no gzip header information forthcoming.  Note that Z_BLOCK or Z_TREES can be
+   used to force inflate() to return immediately after header processing is
+   complete and before any actual data is decompressed.
+
+     The text, time, xflags, and os fields are filled in with the gzip header
+   contents.  hcrc is set to true if there is a header CRC.  (The header CRC
+   was valid if done is set to one.) If extra is not Z_NULL, then extra_max
+   contains the maximum number of bytes to write to extra.  Once done is true,
+   extra_len contains the actual extra field length, and extra contains the
+   extra field, or that field truncated if extra_max is less than extra_len.
+   If name is not Z_NULL, then up to name_max characters are written there,
+   terminated with a zero unless the length is greater than name_max.  If
+   comment is not Z_NULL, then up to comm_max characters are written there,
+   terminated with a zero unless the length is greater than comm_max.  When any
+   of extra, name, or comment are not Z_NULL and the respective field is not
+   present in the header, then that field is set to Z_NULL to signal its
+   absence.  This allows the use of deflateSetHeader() with the returned
+   structure to duplicate the header.  However if those fields are set to
+   allocated memory, then the application will need to save those pointers
+   elsewhere so that they can be eventually freed.
+
+     If inflateGetHeader is not used, then the header information is simply
+   discarded.  The header is always checked for validity, including the header
+   CRC if present.  inflateReset() will reset the process to discard the header
+   information.  The application would need to call inflateGetHeader() again to
+   retrieve the header from the next gzip stream.
+
+     inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
+                                        unsigned char FAR *window));
+
+     Initialize the internal stream state for decompression using inflateBack()
+   calls.  The fields zalloc, zfree and opaque in strm must be initialized
+   before the call.  If zalloc and zfree are Z_NULL, then the default library-
+   derived memory allocation routines are used.  windowBits is the base two
+   logarithm of the window size, in the range 8..15.  window is a caller
+   supplied buffer of that size.  Except for special applications where it is
+   assured that deflate was used with small window sizes, windowBits must be 15
+   and a 32K byte window must be supplied to be able to decompress general
+   deflate streams.
+
+     See inflateBack() for the usage of these routines.
+
+     inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
+   the paramaters are invalid, Z_MEM_ERROR if the internal state could not be
+   allocated, or Z_VERSION_ERROR if the version of the library does not match
+   the version of the header file.
+*/
+
+typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
+typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
+
+ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
+                                    in_func in, void FAR *in_desc,
+                                    out_func out, void FAR *out_desc));
+/*
+     inflateBack() does a raw inflate with a single call using a call-back
+   interface for input and output.  This is more efficient than inflate() for
+   file i/o applications in that it avoids copying between the output and the
+   sliding window by simply making the window itself the output buffer.  This
+   function trusts the application to not change the output buffer passed by
+   the output function, at least until inflateBack() returns.
+
+     inflateBackInit() must be called first to allocate the internal state
+   and to initialize the state with the user-provided window buffer.
+   inflateBack() may then be used multiple times to inflate a complete, raw
+   deflate stream with each call.  inflateBackEnd() is then called to free the
+   allocated state.
+
+     A raw deflate stream is one with no zlib or gzip header or trailer.
+   This routine would normally be used in a utility that reads zip or gzip
+   files and writes out uncompressed files.  The utility would decode the
+   header and process the trailer on its own, hence this routine expects only
+   the raw deflate stream to decompress.  This is different from the normal
+   behavior of inflate(), which expects either a zlib or gzip header and
+   trailer around the deflate stream.
+
+     inflateBack() uses two subroutines supplied by the caller that are then
+   called by inflateBack() for input and output.  inflateBack() calls those
+   routines until it reads a complete deflate stream and writes out all of the
+   uncompressed data, or until it encounters an error.  The function's
+   parameters and return types are defined above in the in_func and out_func
+   typedefs.  inflateBack() will call in(in_desc, &buf) which should return the
+   number of bytes of provided input, and a pointer to that input in buf.  If
+   there is no input available, in() must return zero--buf is ignored in that
+   case--and inflateBack() will return a buffer error.  inflateBack() will call
+   out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].  out()
+   should return zero on success, or non-zero on failure.  If out() returns
+   non-zero, inflateBack() will return with an error.  Neither in() nor out()
+   are permitted to change the contents of the window provided to
+   inflateBackInit(), which is also the buffer that out() uses to write from.
+   The length written by out() will be at most the window size.  Any non-zero
+   amount of input may be provided by in().
+
+     For convenience, inflateBack() can be provided input on the first call by
+   setting strm->next_in and strm->avail_in.  If that input is exhausted, then
+   in() will be called.  Therefore strm->next_in must be initialized before
+   calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called
+   immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in
+   must also be initialized, and then if strm->avail_in is not zero, input will
+   initially be taken from strm->next_in[0 ..  strm->avail_in - 1].
+
+     The in_desc and out_desc parameters of inflateBack() is passed as the
+   first parameter of in() and out() respectively when they are called.  These
+   descriptors can be optionally used to pass any information that the caller-
+   supplied in() and out() functions need to do their job.
+
+     On return, inflateBack() will set strm->next_in and strm->avail_in to
+   pass back any unused input that was provided by the last in() call.  The
+   return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
+   if in() or out() returned an error, Z_DATA_ERROR if there was a format error
+   in the deflate stream (in which case strm->msg is set to indicate the nature
+   of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
+   In the case of Z_BUF_ERROR, an input or output error can be distinguished
+   using strm->next_in which will be Z_NULL only if in() returned an error.  If
+   strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
+   non-zero.  (in() will always be called before out(), so strm->next_in is
+   assured to be defined if out() returns non-zero.) Note that inflateBack()
+   cannot return Z_OK.
+*/
+
+ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
+/*
+     All memory allocated by inflateBackInit() is freed.
+
+     inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
+   state was inconsistent.
+*/
+
+ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
+/* Return flags indicating compile-time options.
+
+    Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
+     1.0: size of uInt
+     3.2: size of uLong
+     5.4: size of voidpf (pointer)
+     7.6: size of z_off_t
+
+    Compiler, assembler, and debug options:
+     8: DEBUG
+     9: ASMV or ASMINF -- use ASM code
+     10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
+     11: 0 (reserved)
+
+    One-time table building (smaller code, but not thread-safe if true):
+     12: BUILDFIXED -- build static block decoding tables when needed
+     13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
+     14,15: 0 (reserved)
+
+    Library content (indicates missing functionality):
+     16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
+                          deflate code when not needed)
+     17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
+                    and decode gzip streams (to avoid linking crc code)
+     18-19: 0 (reserved)
+
+    Operation variations (changes in library functionality):
+     20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
+     21: FASTEST -- deflate algorithm with only one, lowest compression level
+     22,23: 0 (reserved)
+
+    The sprintf variant used by gzprintf (zero is best):
+     24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
+     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
+     26: 0 = returns value, 1 = void -- 1 means inferred string length returned
+
+    Remainder:
+     27-31: 0 (reserved)
+ */
+
+
+                        /* utility functions */
+
+/*
+     The following utility functions are implemented on top of the basic
+   stream-oriented functions.  To simplify the interface, some default options
+   are assumed (compression level and memory usage, standard memory allocation
+   functions).  The source code of these utility functions can be modified if
+   you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
+                                 const Bytef *source, uLong sourceLen));
+/*
+     Compresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer.  Upon entry, destLen is the total size
+   of the destination buffer, which must be at least the value returned by
+   compressBound(sourceLen).  Upon exit, destLen is the actual size of the
+   compressed buffer.
+
+     compress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
+                                  const Bytef *source, uLong sourceLen,
+                                  int level));
+/*
+     Compresses the source buffer into the destination buffer.  The level
+   parameter has the same meaning as in deflateInit.  sourceLen is the byte
+   length of the source buffer.  Upon entry, destLen is the total size of the
+   destination buffer, which must be at least the value returned by
+   compressBound(sourceLen).  Upon exit, destLen is the actual size of the
+   compressed buffer.
+
+     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+   Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
+/*
+     compressBound() returns an upper bound on the compressed size after
+   compress() or compress2() on sourceLen bytes.  It would be used before a
+   compress() or compress2() call to allocate the destination buffer.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
+                                   const Bytef *source, uLong sourceLen));
+/*
+     Decompresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer.  Upon entry, destLen is the total size
+   of the destination buffer, which must be large enough to hold the entire
+   uncompressed data.  (The size of the uncompressed data must have been saved
+   previously by the compressor and transmitted to the decompressor by some
+   mechanism outside the scope of this compression library.) Upon exit, destLen
+   is the actual size of the uncompressed buffer.
+
+     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
+*/
+
+
+                        /* gzip file access functions */
+
+/*
+     This library supports reading and writing files in gzip (.gz) format with
+   an interface similar to that of stdio, using the functions that start with
+   "gz".  The gzip format is different from the zlib format.  gzip is a gzip
+   wrapper, documented in RFC 1952, wrapped around a deflate stream.
+*/
+
+typedef voidp gzFile;       /* opaque gzip file descriptor */
+
+/*
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+
+     Opens a gzip (.gz) file for reading or writing.  The mode parameter is as
+   in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
+   a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
+   compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
+   for fixed code compression as in "wb9F".  (See the description of
+   deflateInit2 for more information about the strategy parameter.) Also "a"
+   can be used instead of "w" to request that the gzip stream that will be
+   written be appended to the file.  "+" will result in an error, since reading
+   and writing to the same gzip file is not supported.
+
+     gzopen can be used to read a file which is not in gzip format; in this
+   case gzread will directly read from the file without decompression.
+
+     gzopen returns NULL if the file could not be opened, if there was
+   insufficient memory to allocate the gzFile state, or if an invalid mode was
+   specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
+   errno can be checked to determine if the reason gzopen failed was that the
+   file could not be opened.
+*/
+
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+/*
+     gzdopen associates a gzFile with the file descriptor fd.  File descriptors
+   are obtained from calls like open, dup, creat, pipe or fileno (if the file
+   has been previously opened with fopen).  The mode parameter is as in gzopen.
+
+     The next call of gzclose on the returned gzFile will also close the file
+   descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
+   fd.  If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
+   mode);.  The duplicated descriptor should be saved to avoid a leak, since
+   gzdopen does not close fd if it fails.
+
+     gzdopen returns NULL if there was insufficient memory to allocate the
+   gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
+   provided, or '+' was provided), or if fd is -1.  The file descriptor is not
+   used until the next gz* read, write, seek, or close operation, so gzdopen
+   will not detect if fd is invalid (unless fd is -1).
+*/
+
+ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
+/*
+     Set the internal buffer size used by this library's functions.  The
+   default buffer size is 8192 bytes.  This function must be called after
+   gzopen() or gzdopen(), and before any other calls that read or write the
+   file.  The buffer memory allocation is always deferred to the first read or
+   write.  Two buffers are allocated, either both of the specified size when
+   writing, or one of the specified size and the other twice that size when
+   reading.  A larger buffer size of, for example, 64K or 128K bytes will
+   noticeably increase the speed of decompression (reading).
+
+     The new buffer size also affects the maximum length for gzprintf().
+
+     gzbuffer() returns 0 on success, or -1 on failure, such as being called
+   too late.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+     Dynamically update the compression level or strategy.  See the description
+   of deflateInit2 for the meaning of these parameters.
+
+     gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+   opened for writing.
+*/
+
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+/*
+     Reads the given number of uncompressed bytes from the compressed file.  If
+   the input file was not in gzip format, gzread copies the given number of
+   bytes into the buffer.
+
+     After reaching the end of a gzip stream in the input, gzread will continue
+   to read, looking for another gzip stream, or failing that, reading the rest
+   of the input file directly without decompression.  The entire input file
+   will be read if gzread is called until it returns less than the requested
+   len.
+
+     gzread returns the number of uncompressed bytes actually read, less than
+   len for end of file, or -1 for error.
+*/
+
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
+                                voidpc buf, unsigned len));
+/*
+     Writes the given number of uncompressed bytes into the compressed file.
+   gzwrite returns the number of uncompressed bytes written or 0 in case of
+   error.
+*/
+
+ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
+/*
+     Converts, formats, and writes the arguments to the compressed file under
+   control of the format string, as in fprintf.  gzprintf returns the number of
+   uncompressed bytes actually written, or 0 in case of error.  The number of
+   uncompressed bytes written is limited to 8191, or one less than the buffer
+   size given to gzbuffer().  The caller should assure that this limit is not
+   exceeded.  If it is exceeded, then gzprintf() will return an error (0) with
+   nothing written.  In this case, there may also be a buffer overflow with
+   unpredictable consequences, which is possible only if zlib was compiled with
+   the insecure functions sprintf() or vsprintf() because the secure snprintf()
+   or vsnprintf() functions were not available.  This can be determined using
+   zlibCompileFlags().
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+     Writes the given null-terminated string to the compressed file, excluding
+   the terminating null character.
+
+     gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+     Reads bytes from the compressed file until len-1 characters are read, or a
+   newline character is read and transferred to buf, or an end-of-file
+   condition is encountered.  If any characters are read or if len == 1, the
+   string is terminated with a null character.  If no characters are read due
+   to an end-of-file or len < 1, then the buffer is left untouched.
+
+     gzgets returns buf which is a null-terminated string, or it returns NULL
+   for end-of-file or in case of error.  If there was an error, the contents at
+   buf are indeterminate.
+*/
+
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+/*
+     Writes c, converted to an unsigned char, into the compressed file.  gzputc
+   returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+/*
+     Reads one byte from the compressed file.  gzgetc returns this byte or -1
+   in case of end of file or error.
+*/
+
+ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
+/*
+     Push one character back onto the stream to be read as the first character
+   on the next read.  At least one character of push-back is allowed.
+   gzungetc() returns the character pushed, or -1 on failure.  gzungetc() will
+   fail if c is -1, and may fail if a character has been pushed but not read
+   yet.  If gzungetc is used immediately after gzopen or gzdopen, at least the
+   output buffer size of pushed characters is allowed.  (See gzbuffer above.)
+   The pushed character will be discarded if the stream is repositioned with
+   gzseek() or gzrewind().
+*/
+
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+/*
+     Flushes all pending output into the compressed file.  The parameter flush
+   is as in the deflate() function.  The return value is the zlib error number
+   (see function gzerror below).  gzflush is only permitted when writing.
+
+     If the flush parameter is Z_FINISH, the remaining data is written and the
+   gzip stream is completed in the output.  If gzwrite() is called again, a new
+   gzip stream will be started in the output.  gzread() is able to read such
+   concatented gzip streams.
+
+     gzflush should be called only when strictly necessary because it will
+   degrade compression if called too often.
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+                                   z_off_t offset, int whence));
+
+     Sets the starting position for the next gzread or gzwrite on the given
+   compressed file.  The offset represents a number of bytes in the
+   uncompressed data stream.  The whence parameter is defined as in lseek(2);
+   the value SEEK_END is not supported.
+
+     If the file is opened for reading, this function is emulated but can be
+   extremely slow.  If the file is opened for writing, only forward seeks are
+   supported; gzseek then compresses a sequence of zeroes up to the new
+   starting position.
+
+     gzseek returns the resulting offset location as measured in bytes from
+   the beginning of the uncompressed stream, or -1 in case of error, in
+   particular if the file is opened for writing and the new starting position
+   would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
+/*
+     Rewinds the given file. This function is supported only for reading.
+
+     gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
+
+     Returns the starting position for the next gzread or gzwrite on the given
+   compressed file.  This position represents a number of bytes in the
+   uncompressed data stream, and is zero when starting, even if appending or
+   reading a gzip stream from the middle of a file using gzdopen().
+
+     gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
+
+     Returns the current offset in the file being read or written.  This offset
+   includes the count of bytes that precede the gzip stream, for example when
+   appending or when using gzdopen() for reading.  When reading, the offset
+   does not include as yet unused buffered input.  This information can be used
+   for a progress indicator.  On error, gzoffset() returns -1.
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+     Returns true (1) if the end-of-file indicator has been set while reading,
+   false (0) otherwise.  Note that the end-of-file indicator is set only if the
+   read tried to go past the end of the input, but came up short.  Therefore,
+   just like feof(), gzeof() may return false even if there is no more data to
+   read, in the event that the last read request was for the exact number of
+   bytes remaining in the input file.  This will happen if the input file size
+   is an exact multiple of the buffer size.
+
+     If gzeof() returns true, then the read functions will return no more data,
+   unless the end-of-file indicator is reset by gzclearerr() and the input file
+   has grown since the previous end of file was detected.
+*/
+
+ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
+/*
+     Returns true (1) if file is being copied directly while reading, or false
+   (0) if file is a gzip stream being decompressed.  This state can change from
+   false to true while reading the input file if the end of a gzip stream is
+   reached, but is followed by data that is not another gzip stream.
+
+     If the input file is empty, gzdirect() will return true, since the input
+   does not contain a gzip stream.
+
+     If gzdirect() is used immediately after gzopen() or gzdopen() it will
+   cause buffers to be allocated to allow reading the file to determine if it
+   is a gzip file.  Therefore if gzbuffer() is used, it should be called before
+   gzdirect().
+*/
+
+ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
+/*
+     Flushes all pending output if necessary, closes the compressed file and
+   deallocates the (de)compression state.  Note that once file is closed, you
+   cannot call gzerror with file, since its structures have been deallocated.
+   gzclose must not be called more than once on the same file, just as free
+   must not be called more than once on the same allocation.
+
+     gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
+   file operation error, or Z_OK on success.
+*/
+
+ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
+ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
+/*
+     Same as gzclose(), but gzclose_r() is only for use when reading, and
+   gzclose_w() is only for use when writing or appending.  The advantage to
+   using these instead of gzclose() is that they avoid linking in zlib
+   compression or decompression code that is not used when only reading or only
+   writing respectively.  If gzclose() is used, then both compression and
+   decompression code will be included the application when linking to a static
+   zlib library.
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+     Returns the error message for the last error which occurred on the given
+   compressed file.  errnum is set to zlib error number.  If an error occurred
+   in the file system and not in the compression library, errnum is set to
+   Z_ERRNO and the application may consult errno to get the exact error code.
+
+     The application must not modify the returned string.  Future calls to
+   this function may invalidate the previously returned string.  If file is
+   closed, then the string previously returned by gzerror will no longer be
+   available.
+
+     gzerror() should be used to distinguish errors from end-of-file for those
+   functions above that do not distinguish those cases in their return values.
+*/
+
+ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
+/*
+     Clears the error and end-of-file flags for file.  This is analogous to the
+   clearerr() function in stdio.  This is useful for continuing to read a gzip
+   file that is being written concurrently.
+*/
+
+
+                        /* checksum functions */
+
+/*
+     These functions are not related to compression but are exported
+   anyway because they might be useful in applications using the compression
+   library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+/*
+     Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+   return the updated checksum.  If buf is Z_NULL, this function returns the
+   required initial value for the checksum.
+
+     An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+   much faster.
+
+   Usage example:
+
+     uLong adler = adler32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       adler = adler32(adler, buffer, length);
+     }
+     if (adler != original_adler) error();
+*/
+
+/*
+ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
+                                          z_off_t len2));
+
+     Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1
+   and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
+   each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of
+   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
+*/
+
+ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
+/*
+     Update a running CRC-32 with the bytes buf[0..len-1] and return the
+   updated CRC-32.  If buf is Z_NULL, this function returns the required
+   initial value for the for the crc.  Pre- and post-conditioning (one's
+   complement) is performed within this function so it shouldn't be done by the
+   application.
+
+   Usage example:
+
+     uLong crc = crc32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       crc = crc32(crc, buffer, length);
+     }
+     if (crc != original_crc) error();
+*/
+
+/*
+ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
+
+     Combine two CRC-32 check values into one.  For two sequences of bytes,
+   seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
+   calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
+   check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
+   len2.
+*/
+
+
+                        /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,
+                                      int windowBits, int memLevel,
+                                      int strategy, const char *version,
+                                      int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,
+                                      const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
+                                         unsigned char FAR *window,
+                                         const char *version,
+                                         int stream_size));
+#define deflateInit(strm, level) \
+        deflateInit_((strm), (level),       ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit(strm) \
+        inflateInit_((strm),                ZLIB_VERSION, sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+        deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+                      (strategy),           ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+        inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+#define inflateBackInit(strm, windowBits, window) \
+        inflateBackInit_((strm), (windowBits), (window), \
+                                            ZLIB_VERSION, sizeof(z_stream))
+
+/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
+ * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
+ * both are true, the application gets the *64 functions, and the regular
+ * functions are changed to 64 bits) -- in case these are set on systems
+ * without large file support, _LFS64_LARGEFILE must also be true
+ */
+#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+   ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+   ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
+   ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
+   ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
+   ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
+   ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
+#endif
+
+#if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0
+#  define gzopen gzopen64
+#  define gzseek gzseek64
+#  define gztell gztell64
+#  define gzoffset gzoffset64
+#  define adler32_combine adler32_combine64
+#  define crc32_combine crc32_combine64
+#  ifdef _LARGEFILE64_SOURCE
+     ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+     ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
+     ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
+     ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
+     ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
+     ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+#  endif
+#else
+   ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
+   ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
+   ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
+   ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
+   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+#endif
+
+/* hack for buggy compilers */
+#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
+    struct internal_state {int dummy;};
+#endif
+
+/* undocumented functions */
+ZEXTERN const char   * ZEXPORT zError           OF((int));
+ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp));
+ZEXTERN const uLongf * ZEXPORT get_crc_table    OF((void));
+ZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZLIB_H */
Index: /Vago/trunk/Vago/logger.cpp
===================================================================
--- /Vago/trunk/Vago/logger.cpp	(revision 771)
+++ /Vago/trunk/Vago/logger.cpp	(revision 771)
@@ -0,0 +1,43 @@
+#include "logger.h"
+
+Logger::Logger()
+{
+     myLogFile = new QFile(GlobalVars::AppLogName);
+
+     if (!myLogFile->open(QIODevice::WriteOnly | QIODevice::Text)){ //open to write
+           return;
+     }
+
+    logStream = new QTextStream (myLogFile);
+    //logStream->setCodec("UTF-8");
+}
+
+ /**
+  ** Mutex makes it thread safe. (not sure if needed although)
+  **/
+void Logger::writeString(QString strToWrite){
+    mutex.lock();
+    *this->logStream << "--------------------------------------------";
+    *this->logStream << "\nEvent Start: " << QDateTime::currentDateTime().toString() << "\n" << strToWrite << "\nEvent End.\n";
+    *this->logStream << "--------------------------------------------\n";
+    this->logStream->flush();
+    mutex.unlock();
+}
+
+/**
+ ** Mutex makes it thread safe. (not sure if needed although)
+ **/
+void Logger::writeBytes(QByteArray arrToWrite){
+   mutex.lock();
+   *this->logStream << "--------------------------------------------";
+   *this->logStream << "\nEvent Start: " << QDateTime::currentDateTime().toString() << "\n" << arrToWrite << "\nEvent End.\n";
+   *this->logStream << "--------------------------------------------";
+   this->logStream->flush();
+   mutex.unlock();
+}
+
+//deconstructor, will close the file automatically and free the resources...
+Logger::~Logger(){
+    delete this->logStream;
+    delete this->myLogFile; //the deconstructor of the file will close it automatically
+}
Index: /Vago/trunk/Vago/logger.h
===================================================================
--- /Vago/trunk/Vago/logger.h	(revision 771)
+++ /Vago/trunk/Vago/logger.h	(revision 771)
@@ -0,0 +1,22 @@
+#ifndef LOGGER_H
+#define LOGGER_H
+#include <QFile>
+#include <QTextStream>
+#include <QMutex>
+#include <QDateTime>
+#include <util.h>
+
+class Logger
+{
+public:
+    Logger();
+    ~Logger();
+    void writeString(QString strToWrite);
+    void writeBytes(QByteArray arrToWrite);
+private:
+    QFile *myLogFile;
+    QTextStream *logStream;
+    QMutex mutex; //mutex for control writes to the logs
+};
+
+#endif // LOGGER_H
Index: /Vago/trunk/Vago/main.cpp
===================================================================
--- /Vago/trunk/Vago/main.cpp	(revision 771)
+++ /Vago/trunk/Vago/main.cpp	(revision 771)
@@ -0,0 +1,12 @@
+#include <QtGui/QApplication>
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    MainWindow w;
+    w.show();
+    a.setStyleSheet("QStatusBar::item { border: 0px; }"); //hide QLabels border in status bar //http://qt-project.org/forums/viewthread/18743
+    
+    return a.exec();
+}
Index: /Vago/trunk/Vago/mainwindow.cpp
===================================================================
--- /Vago/trunk/Vago/mainwindow.cpp	(revision 771)
+++ /Vago/trunk/Vago/mainwindow.cpp	(revision 771)
@@ -0,0 +1,1520 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+const QString MainWindow::VagoSettingsName = "settingsVago.ini";
+
+MainWindow::MainWindow(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::MainWindow)
+{
+    ui->setupUi(this);
+
+    this->setWindowTitle("Vago v"+GlobalVars::AppVersion);
+
+    // QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale ());
+
+    if(!QFile::exists(QDir::currentPath()+"/"+GlobalVars::OniSplitExeName)){
+        Util::showErrorPopUp("OniSplit not found. Please download it at "+GlobalVars::ModsDomain+" and put it in the same folder of Vago. \n\nProgram will now exit.");
+        exit(1);
+    }
+
+    if(!QFile::exists(QDir::currentPath()+"/"+GlobalVars::XmlToolsExeName)){
+        Util::showErrorPopUp("xmlTools not found. Please download it at "+GlobalVars::ModsDomain+" and put it in the same folder of Vago. \n\nProgram will now exit.");
+        exit(1);
+    }
+
+    this->vagoSettings = new QSettings(QDir::currentPath() + "/" + this->VagoSettingsName, QSettings::IniFormat);
+
+    //First Execution? Old configuration? Settings missed?
+    bool iniChanged=false;
+    if(!this->vagoSettings->contains("VagoVersion") || this->vagoSettings->value("VagoVersion")!=GlobalVars::AppVersion){
+        this->vagoSettings->setValue("VagoVersion", GlobalVars::AppVersion);
+        iniChanged=true;
+    }
+    if(!this->vagoSettings->contains("Workspace")){
+        this->vagoSettings->setValue("Workspace", QDir::currentPath()+"/VagoWorkspace");
+        iniChanged=true;
+    }
+    if(!this->vagoSettings->contains("AeFolder")){
+
+        Util::showPopUp("Seems it's the first time you are executing Vago. \n\nPlease input your Anniversary Edition (AE) Folder.");
+        QString aefolder=Util::normalizePath(QFileDialog::getExistingDirectory(this,"Choose Anniversary Edition (AE) folder..."));
+
+        if(aefolder.isEmpty()){
+            Util::showErrorPopUp("AE folder is mandatory. Application will exit.");
+            exit(1);
+        }
+
+        if(!aefolder.endsWith("AE")){
+            Util::showWarningPopUp("Seems the folder you selected isn't called 'AE'. \n\nIf you run in any problems you can always change it in Vago preferences window.");
+        }
+
+        this->vagoSettings->setValue("AeFolder", aefolder);
+        iniChanged=true;
+    }
+    if(!this->vagoSettings->contains("OniWindow")){
+        this->vagoSettings->setValue("OniWindow", true);
+        iniChanged=true;
+    }
+    if(!this->vagoSettings->contains("SeparateInWorkspace")){
+        this->vagoSettings->setValue("SeparateInWorkspace",true);
+        iniChanged=true;
+    }
+    if(!this->vagoSettings->contains("ConfirmExit")){
+        this->vagoSettings->setValue("ConfirmExit", false);
+        iniChanged=true;
+    }
+
+    if(iniChanged){
+        this->vagoSettings->sync();
+    }
+    ///
+
+    this->workspaceLocation=this->vagoSettings->value("Workspace").toString();
+    this->workspaceWizardsLocation=this->workspaceLocation+"/Wizards";
+    this->AeLocation=this->vagoSettings->value("AeFolder").toString();
+    this->outputFolder=this->workspaceLocation;
+
+    //Create our workspace if it doesn't exists yet
+    if(!QDir(this->workspaceLocation).exists()){
+        QDir().mkdir(this->workspaceLocation);
+    }
+    this->itemsLoaded=new QLabel(this);
+    ui->statusBar->addWidget(this->itemsLoaded);
+    this->myBar = new QProgressBar(this);
+    this->myBar->setTextVisible(false); //hides text
+
+    this->myBar->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Fixed);
+    this->myBar->setMinimumWidth(150);
+    this->myBar->hide(); //hide while not being used
+
+    ui->statusBar->addPermanentWidget(myBar); //this adds automatically in right
+
+    this->myLogger = new Logger(); //start logger
+
+    //Initialize list pointers
+    this->listToProccess = new QStringList;
+
+    //Create a thread for do the conversion in background
+    this->myConverter = new Converter(this->myLogger,this->listToProccess);
+
+    ui->mainToolBar->addWidget(ui->tbAE); //add ae installer launch button
+    ui->mainToolBar->addWidget(ui->emptySpacerLabel); //trick, we can't add directly a space so we add an empty
+    ui->mainToolBar->addWidget(ui->tbOni); //add oni launch buttonlabel
+    ui->mainToolBar->addWidget(ui->emptySpacerLabel2); //same as before
+    ui->mainToolBar->addWidget(ui->tbCommand); //add option to manual onisplit commands
+    ui->mainToolBar->addWidget(ui->emptySpacerLabel3); //same as before
+    ui->mainToolBar->addWidget(ui->tbOpenFolder); //add option to open folder with files converted etc
+
+    ui->mainToolBar->setLayoutDirection(Qt::RightToLeft);
+
+    connectSlots();
+
+    //Commands Mapping
+    this->commandMap = QHash<QString, QString>();
+    mapCommands();
+
+    updateItemsLoaded(ui->twSourcesGeneral);
+
+    this->myLogger->writeString("Application started.");
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+    this->myLogger->writeString("Application Exited.");
+}
+
+void MainWindow::on_actionExit_triggered()
+{
+    close();
+}
+
+void MainWindow::on_actionAbout_triggered()
+{
+    //Show preferences
+    About *aboutWindow = new About(this);
+    aboutWindow->show(); //it destroys itself when finished.
+}
+
+void MainWindow::on_actionAE_Package_Creator_triggered()
+{
+    PackageWizard myWizard = PackageWizard(this->workspaceWizardsLocation, this->vagoSettings, this->myLogger);
+    myWizard.exec();
+}
+
+void MainWindow::on_actionSound_Wizard_triggered()
+{
+    SoundWizard myWizard (this->workspaceWizardsLocation, this->myLogger, &this->commandMap);
+    myWizard.exec();
+}
+
+void MainWindow::on_tbOni_clicked()
+{
+    QStringList arguments;
+
+    if(this->vagoSettings->value("OniWindow").toBool()){ //Run in a window?
+        arguments << "-noswitch";
+    }
+    else{
+        arguments << "-switch";
+    }
+
+    arguments << " -debugfiles";
+
+    if(!QProcess::startDetached(this->AeLocation+"/Oni.exe",arguments,this->AeLocation)){
+        showErrStatusMessage("Oni could not be started!");
+    }
+}
+
+void MainWindow::on_tbAE_clicked()
+{
+    // If the app turn out someday to a native app use QProcess::startDetached instead...
+
+    if(!QDesktopServices::openUrl(this->AeLocation+"/AEInstaller/bin/AEInstaller2.jar")){
+        showErrStatusMessage("Could not start AE Installer!");
+    }
+}
+
+void MainWindow::on_tbOpenFolder_clicked()
+{
+    QDesktopServices::openUrl(QUrl("file:///"+this->outputFolder));
+}
+
+void MainWindow::on_cbEnvMap_toggled(bool checked)
+{
+    ui->leEnvMapTexture->setEnabled(checked);
+}
+
+void MainWindow::on_cbTexture_toggled(bool checked)
+{
+    ui->leTextureName->setEnabled(checked);
+}
+
+void MainWindow::on_cbWithAnimation_toggled(bool checked)
+{
+    ui->leAnimationName->setEnabled(checked);
+}
+
+void MainWindow::on_cbCamera_toggled(bool checked)
+{
+    if(checked){
+        ui->cbGeometry->setChecked(false);
+    }
+}
+
+void MainWindow::on_cbGeometry_toggled(bool checked)
+{
+    ui->leGeometryName->setEnabled(checked);
+    if(checked){
+        ui->cbCamera->setChecked(false);
+    }
+}
+
+void MainWindow::on_actionCheck_For_Updates_triggered()
+{
+
+    //let's check in the web if this version is the latest
+    QNetworkAccessManager *manager = new QNetworkAccessManager(this);
+    connect(manager, SIGNAL(finished(QNetworkReply*)),
+            this, SLOT(checkVagoLastVersion(QNetworkReply*)));
+
+    manager->get(QNetworkRequest(QUrl(GlobalVars::VagoCheckUpdatesUrl)));
+
+}
+
+void MainWindow::checkVagoLastVersion(QNetworkReply *result){
+
+    if(result->error()==QNetworkReply::NoError){
+        QScriptEngine engine;
+        QScriptValue sc = engine.evaluate("(" + QString(result->readAll()) + ")");
+
+        // "field_version":{"und":[{"value":"0.6a","format":null,"safe_value":"0.6a"}]} //Note the use of [{}] which means it's a array of 1 element with one object inside (so the use of [0] bellow
+
+        QString newVersion = sc.property("field_version").toObject().property("und").toObject().property("0").toObject().property("value").toString();
+
+        if(newVersion!=GlobalVars::AppVersion){
+            Util::showRichPopUp("There's a new version of Vago! (v"+newVersion+")<br/><br/>"+
+                                "You can download it <a href='"+GlobalVars::VagoWebUrl+"'>here</a>.");
+        }
+        else{
+            Util::showPopUp("You are using last version.");
+        }
+    }
+    else{
+        Util::showErrorPopUp("An error occurred checking last version:\n\n"+result->errorString());
+    }
+    result->deleteLater();
+}
+
+void MainWindow::on_pbAddSourceGeneral_clicked()
+{
+    if(QString::compare(ui->cbFromGeneral->currentText(),"ONI",Qt::CaseSensitive)==0 && QString::compare(ui->cbToGeneral->currentText(),"DAT",Qt::CaseSensitive)==0){ //CaseSensitive is faster)
+        addFilesSource(ui->twSourcesGeneral,Util::multipleDirDialog("Choose folders with ONIs..."));
+    }
+    else{
+        addFilesSource( ui->twSourcesGeneral,QFileDialog::getOpenFileNames(this,"Choose the files...","./" , "All Files (*.*)"));
+    }
+}
+
+void MainWindow::on_pbAddSourceTextures_clicked()
+{
+    addFilesSource( ui->twSourcesTextures, QFileDialog::getOpenFileNames(this,"Choose the files...","./" , "All Files (*.*)"));
+}
+
+void MainWindow::on_pbAddSourceModels_clicked()
+{
+    addFilesSource( ui->twSourcesModels,QFileDialog::getOpenFileNames(this,"Choose the files...","./" , "All Files (*.*)"));
+}
+
+void MainWindow::on_pbAddSourceAnimations_clicked()
+{
+    addFilesSource( ui->twSourcesAnimations,QFileDialog::getOpenFileNames(this,"Choose the files...","./" , "All Files (*.*)"));
+}
+
+void MainWindow::on_pbAddSourceLevels_clicked()
+{
+    addFilesSource( ui->twSourcesLevels,QFileDialog::getOpenFileNames(this,"Choose the files...","./" , "All Files (*.*)"));
+}
+
+void MainWindow::on_pbAddSourceMisc_clicked()
+{
+    addFilesSource( ui->twSourcesMisc,QFileDialog::getOpenFileNames(this,"Choose the files...","./" , "All Files (*.*)"));
+}
+
+QString MainWindow::getFileOutputFolder(QString fromTo, QString myOutputFolder){
+
+    if(myOutputFolder==""){ //We may want to change to a non standart location with context menu
+        myOutputFolder=this->outputFolder;
+    }
+
+    if(this->vagoSettings->value("SeparateInWorkspace").toBool() && myOutputFolder==this->workspaceLocation){
+        myOutputFolder+="/"+ui->tabWidget->tabText(ui->tabWidget->currentIndex());
+        myOutputFolder+="/"+QString(fromTo).replace(" / ","_").replace(" > "," - ");
+    }
+    return Util::insertQuotes(myOutputFolder+"/");
+}
+
+void MainWindow::addFilesSource(DropTableWidget *myTable, QStringList files){
+
+    //Get Conversion pretended
+    QString from,to;
+
+    QString fromTo = getTypeConversion(myTable);
+
+    from = QString(fromTo).remove(fromTo.indexOf(" >"),fromTo.size()-1); //parse the string to get the from, only 1 time parsed by each group of files = very fast
+    to = QString(fromTo).remove(0,fromTo.lastIndexOf("> ")+2); //+2 to start after "> "
+
+    //Pre-processing (check if the files/folders received are valid), e.g. check for ONI->DAT if are only given folders and not files
+    if(QString::compare(from,"ONI",Qt::CaseSensitive)==0 && QString::compare(to,"DAT",Qt::CaseSensitive)==0){
+        //check if it's a folder
+        foreach(QString myFile, files){
+            if(!QDir(myFile).exists()){
+                showErrStatusMessage("Only folders are allowed for this operation.");
+                return;
+            }
+        }
+
+    }
+    else{
+        foreach(QString myFile, files){
+            //check if it's a file
+            if(QDir(myFile).exists()){
+                showErrStatusMessage("Only files are allowed for this operation.");
+                return;
+            }
+        }
+    }
+
+    //Build command
+    QString command, lastFileName;
+
+    QString myOutputFolder=getFileOutputFolder(fromTo);
+
+    //if folder doesn't exist onisplit will create it for us :)
+    foreach(QString currentFile, files){
+
+        currentFile=Util::normalizeAndQuote(currentFile); //insert quotes ("") in file
+
+        if(lastFileName.isEmpty()){ //Optimization: all commands are the same for each file, just replace the filename
+
+            command=getCommand(myTable,myOutputFolder,from,to,currentFile);
+
+            if(command.isEmpty()){ //something wrong was happening (not inputted a texture name?)
+                return; //stop adding files
+            }
+            currentFile=Util::cutName(currentFile);
+        }else{ //one parsing was already made just replace the filename by the old one in the command
+
+            currentFile=Util::cutName(currentFile);
+
+            command.replace(lastFileName,currentFile,Qt::CaseSensitive); //case sentive is faster
+        }
+
+        lastFileName=currentFile;
+
+        addRowTable(myTable,lastFileName,fromTo,command);
+    }
+    updateItemsLoaded(myTable);
+}
+
+QString MainWindow::fileParsingGeneral(QString myOutputFolder, QString from, QString to , QString file){
+
+    QString command;
+
+    if(QString::compare(from,"ONI",Qt::CaseSensitive)==0 && QString::compare(to,"DAT",Qt::CaseSensitive)==0){ //CaseSensitive is faster
+
+        QString datName;
+
+        if(ui->cbDatGeneral->isChecked()){
+            if(ui->leTargetDatGeneral->text().isEmpty()){
+                showErrStatusMessage("Checkbox '"+ui->cbDatGeneral->text()+"' is selected. The name cannot be empty.");
+                return "";
+            }
+            datName+=QString(myOutputFolder).insert(myOutputFolder.size()-1,ui->leTargetDatGeneral->text()); //set name inputted by user
+            if(!ui->leTargetDatGeneral->text().toUpper().endsWith(".DAT")){
+                datName.insert(datName.size()-1,".dat"); //append extension if necessary (-1 to maintain final quote)
+            }
+        }
+        else{
+            datName=QString(myOutputFolder).insert(myOutputFolder.size()-1,Util::cutName(file).remove("/")+".dat"); //if none iputted set the same name of input file
+        }
+
+        if(ui->actionWindows->isChecked()){ //is target plataform select windows?
+            return command=this->commandMap.value("general->"+from+"->"+to+"(PC)")+" "+ file + " "+datName;
+        }
+        else{
+            return command=this->commandMap.value("general->"+from+"->"+to+"(demoPCMAC)")+" "+ file + " "+datName;
+        }
+    }
+    else if(QString::compare(from,"ONI",Qt::CaseSensitive)==0 && QString::compare(to,"XML",Qt::CaseSensitive)==0 && ui->cbTRAMGeneral->isChecked()){
+        if(ui->leTRAMGeneral->text().isEmpty()){
+            showErrStatusMessage("Checkbox '"+ui->cbTRAMGeneral->text()+"' is selected. The source cannot be empty.");
+            return "";
+        }
+        return command=this->commandMap.value("general->"+from+"->"+to)+" "+myOutputFolder+" "+this->commandMap.value("general->"+ui->cbTRAMGeneral->text())+file + " "+ Util::normalizeAndQuote(ui->leTRAMGeneral->text());
+    }
+    else{
+        return command=this->commandMap.value("general->"+from+"->"+to)+" "+myOutputFolder+" "+file;
+    }
+
+}
+
+QString MainWindow::fileParsingTextures(QString myOutputFolder, QString from, QString to , QString file){
+
+    QString command=this->commandMap.value("textures->"+from+"->"+to)+" "+myOutputFolder;
+
+    if(ui->gbTextures->isEnabled()){ //faster than compare strings (if is DAT/ONI)
+
+        if(ui->cbMipMapsTextures->isChecked()){
+            command+=" "+this->commandMap.value("textures->"+ui->cbMipMapsTextures->text());
+        }
+
+        if(ui->cbNoUwrap->isChecked()){
+            command+=" "+this->commandMap.value("textures->"+ui->cbNoUwrap->text());
+        }
+
+        if(ui->cbNoVwrap->isChecked()){
+            command+=" "+this->commandMap.value("textures->"+ui->cbNoVwrap->text());
+        }
+
+        if(ui->cbLarge->isChecked()){
+            command+=" "+this->commandMap.value("textures->"+ui->cbLarge->text());
+        }
+
+        if(ui->rbBGR32->isChecked()){
+            command+=" "+this->commandMap.value("textures->"+ui->rbBGR32->text());
+        }
+        else if(ui->rbBGRA32->isChecked()){
+            command+=" "+this->commandMap.value("textures->"+ui->rbBGRA32->text());
+        }
+        else if(ui->rbBGR555->isChecked()){
+            command+=" "+this->commandMap.value("textures->"+ui->rbBGR555->text());
+        }
+        else if(ui->rbBGRA5551->isChecked()){
+            command+=" "+this->commandMap.value("textures->"+ui->rbBGRA5551->text());
+        }
+        else if(ui->rbBGRA444->isChecked()){
+            command+=" "+this->commandMap.value("textures->"+ui->rbBGRA444->text());
+        }
+        else{ //dxt1 checked
+            command+=" "+this->commandMap.value("textures->"+ui->rbDxt1->text());
+        }
+
+        if(ui->cbEnvMap->isChecked()){
+            if(ui->leEnvMapTexture->text().isEmpty()){
+                showErrStatusMessage("Checkbox '"+ui->cbEnvMap->text()+"' is selected. The name texture name cannot be empty.");
+                return "";
+            }
+            command+=" "+this->commandMap.value("textures->"+ui->cbEnvMap->text()) + ui->leEnvMapTexture->text().remove(".oni",Qt::CaseInsensitive);
+        }
+    }
+
+    return command+=" "+file; //add source
+}
+
+QString MainWindow::fileParsingModels(QString myOutputFolder, QString from, QString to , QString file){
+
+    QString command=this->commandMap.value("models->"+from+"->"+to)+" "+myOutputFolder;
+
+    //TODO: This can be optimized. When some are not enable others are.
+    if(ui->cbTexture->isChecked()){
+        if(ui->leTextureName->text().isEmpty()){
+            showErrStatusMessage("Checkbox '"+ui->cbTexture->text()+"' is selected. The name cannot be empty.");
+            return "";
+        }
+        command+=" "+this->commandMap.value("models->"+ui->cbTexture->text()) + ui->leTextureName->text().remove(".oni",Qt::CaseInsensitive);
+    }
+
+    if(ui->cbCellShading->isChecked()){
+        command+=" "+this->commandMap.value("models->"+ui->cbCellShading->text());
+    }
+
+    if(ui->cbNormals->isChecked()){
+        command+=" "+this->commandMap.value("models->"+ui->cbNormals->text());
+    }
+
+    if(ui->cbWithAnimation->isEnabled()){
+        if(ui->cbWithAnimation->isChecked()){
+            command+=" "+this->commandMap.value("models->"+ui->cbWithAnimation->text())+ui->leAnimationName->text().remove(".oni",Qt::CaseInsensitive);
+        }
+        else{
+            command+=" "+this->commandMap.value("models->No Animation");
+        }
+    }
+
+
+    return command+=" "+file; //add source
+}
+
+QString MainWindow::fileParsingAnimations(QString myOutputFolder, QString from, QString to , QString file){
+
+    QString command=this->commandMap.value("animations->"+from+"->"+to)+" "+myOutputFolder + " " + file ;
+
+    if(ui->cbCamera->isChecked()){
+        command+=" "+this->commandMap.value("animations->"+ui->cbCamera->text());
+    }
+    else if(ui->cbGeometry->isChecked()){
+        if(ui->leGeometryName->text().isEmpty()){
+            showErrStatusMessage("Checkbox '"+ui->cbGeometry->text()+"' is selected. The geometry file path cannot be empty.");
+            return "";
+        }
+        command+=" "+this->commandMap.value("animations->"+ui->cbGeometry->text()) + (ui->leGeometryName->text().startsWith('"')?ui->leGeometryName->text():Util::insertQuotes(ui->leGeometryName->text()));
+    }
+
+    return command;
+}
+
+QString MainWindow::fileParsingLevels(QString myOutputFolder, QString from, QString to , QString file){
+
+    QString datName, command;
+
+    command=this->commandMap.value("levels->"+from+"->"+to)+" "+myOutputFolder+" "+file;
+
+    if(from=="MASTER XML" && to=="DAT"){
+        command+=GlobalVars::OniSplitProcSeparator; //insert mark so we know this action will take 2 commands
+
+        QString datName;
+        if(ui->cbDatLevels->isChecked()){
+            if(ui->leTargetDatLevels->text().isEmpty()){
+                showErrStatusMessage("Checkbox '"+ui->cbDatLevels->text()+"' is selected. The name cannot be empty.");
+                return "";
+            }
+            datName+=QString(myOutputFolder).insert(myOutputFolder.size()-1,ui->leTargetDatLevels->text()); //set name inputted by user
+            if(!ui->leTargetDatLevels->text().toUpper().endsWith(".DAT")){
+                datName.insert(datName.size()-1,".dat"); //append extension if necessary (-1 to maintain final quote)
+            }
+        }
+        else{
+            datName=QString(myOutputFolder).insert(myOutputFolder.size()-1,Util::cutName(file).remove("/").replace(".xml",".dat",Qt::CaseInsensitive)); //if none iputted set the same name of input file
+        }
+
+        if(ui->actionWindows->isChecked()){ //is target plataform select windows?
+            command+=this->commandMap.value("general->ONI->"+to+"(PC)")+" "+myOutputFolder+" "+datName; //add second command
+        }
+        else{
+            command+=this->commandMap.value("general->ONI->"+to+"(demoPCMAC)")+" "+myOutputFolder+" "+datName; //add second command
+        }
+    }
+
+    if(ui->cbBnvLevels->isChecked()){
+
+        if(ui->leBnvLevels->text().isEmpty()){
+            showErrStatusMessage("Checkbox '"+ui->cbBnvLevels->text()+"' is selected. The BNV file cannot be empty.");
+            return "";
+        }
+        command+=" "+Util::normalizeAndQuote(ui->leBnvLevels->text());
+    }
+
+    if(ui->cbAdditionalSourcesLevels->isChecked()){
+
+        if(ui->leAdditSourcesLevels->text().isEmpty()){
+            showErrStatusMessage("Checkbox '"+ui->cbAdditionalSourcesLevels->text()+"' is selected. The source files cannot be empty.");
+            return "";
+        }
+
+        QString additionalFiles=ui->leAdditSourcesLevels->text();
+
+        int currentIndex=0, nextIndex=0;
+
+        //parse all files (separated by spaces)
+        while(true){
+            nextIndex=additionalFiles.indexOf(" ",currentIndex+1);
+
+            command += " "+Util::normalizeAndQuote(additionalFiles.mid(currentIndex,(nextIndex-currentIndex)));
+
+            if(nextIndex==-1){ //we got to the end, stop parsing
+                break;
+            }
+            currentIndex=nextIndex+1; //update currentIndex +1 for start after the separator
+        }
+    }
+
+    if(ui->cbGridsLevels->isChecked()){
+        command+=GlobalVars::OniSplitProcSeparator+this->commandMap.value("levels->"+ui->cbGridsLevels->text())+" "+Util::normalizeAndQuote(ui->leBnvLevels->text())+" "+file+" -out:"+myOutputFolder;
+    }
+
+    return command;
+}
+
+QString MainWindow::fileParsingMisc(QString myOutputFolder, QString from, QString to , QString file){
+    return this->commandMap.value("misc->"+from+"->"+to)+" "+myOutputFolder+" "+file;
+}
+
+void MainWindow::addRowTable(DropTableWidget *myTable, QString fileName, QString fromTo, QString command){
+    //Get actual number rows
+    int twSize=myTable->rowCount();
+
+    //increase the rows for the new item
+    myTable->setRowCount(twSize+1);
+
+    //Add to table and list to
+    QTableWidgetItem *newFile = new QTableWidgetItem(fileName);
+    QTableWidgetItem *newConversion = new QTableWidgetItem(fromTo);
+    QTableWidgetItem *newCommand = new QTableWidgetItem(command);
+
+    myTable->setItem(twSize,0,newFile);
+    myTable->setItem(twSize,1,newConversion);
+    myTable->setItem(twSize,2,newCommand);
+
+    myTable->updateTableToolTips(twSize); //Update tool tips
+}
+
+void MainWindow::on_pbConvertGeneral_clicked()
+{
+    startConversion(ui->twSourcesGeneral);
+}
+
+void MainWindow::on_pbConvertTextures_clicked()
+{
+    startConversion(ui->twSourcesTextures);
+}
+
+void MainWindow::on_pbConvertModels_clicked()
+{
+    startConversion(ui->twSourcesModels);
+}
+
+void MainWindow::on_pbConvertAnimations_clicked()
+{
+    startConversion(ui->twSourcesAnimations);
+}
+
+void MainWindow::on_pbConvertLevels_clicked()
+{
+    startConversion(ui->twSourcesLevels);
+}
+
+void MainWindow::on_pbConvertMisc_clicked()
+{
+    startConversion(ui->twSourcesMisc);
+}
+
+void MainWindow::startConversion(DropTableWidget *myTable){
+
+    bool ready=false;
+    for(int i=0; i<myTable->rowCount(); i++){ //There are items to process?
+        if(myTable->item(i,2)->background()!=myTable->disabledBackStyle){
+            ready=true;
+            break;
+        }
+    }
+
+    if(!ready){
+        showErrStatusMessage("Please add sources to convert first.");
+        return;
+    }
+
+    if(myBar->isVisible()){
+        Util::showErrorPopUp("Another conversion is progress. Please wait until it finishes.");
+        return;
+    }
+
+    for(int i=0; i<myTable->rowCount(); i++){
+        //Only process enabled items
+        if(myTable->item(i,2)->background()!=myTable->disabledBackStyle){
+            this->listToProccess->append(myTable->item(i,2)->text());
+        }
+    }
+
+    this->myConverter->start();
+}
+
+void MainWindow::TsetupProgressBar(int max){
+    this->myBar->setValue(0);
+    this->myBar->show();
+    this->myBar->setMaximum(max);
+}
+
+void  MainWindow::TupdateProgressBar(){
+    this->myBar->setValue(this->myBar->value()+1); //more one task done
+}
+
+void MainWindow::TresultConversion(QString result, int numErrors){
+    QApplication::alert(this); //Show a notification if window is not active
+    this->myBar->hide();
+
+    if(numErrors!=0){
+        QString sNumErrors=QString::number(numErrors);
+        if(numErrors>1){
+            Util::showErrorLogPopUp(result+"\n This is the last of "+sNumErrors+" Errors.");
+            showErrStatusMessage("Something gone wrong. Check log file ("+sNumErrors+" Errors).");
+        }
+        else{
+            Util::showErrorLogPopUp(result);
+            showErrStatusMessage("Something gone wrong. Check log file.");
+        }
+
+    }
+    else{
+        showSuccessStatusMessage("Everything went well!");
+    }
+}
+
+void MainWindow::showErrStatusMessage(QString message){
+
+    QPalette myPalete = QPalette();
+    myPalete.setColor( QPalette::WindowText, QColor(255,0,0));
+    statusBar()->setPalette( myPalete );
+    ui->statusBar->showMessage(message,10000); //display by 10 seconds
+
+}
+
+void MainWindow::showSuccessStatusMessage(QString message){
+
+    QPalette myPalete = QPalette();
+    myPalete.setColor( QPalette::WindowText, QColor(0,150,0));
+    statusBar()->setPalette( myPalete );
+    ui->statusBar->showMessage(message,10000); //display by 10 seconds
+
+}
+
+void MainWindow::mapCommands(){
+    ////////////////////////////////////////////////////////////////////////General Commands
+    this->commandMap.insert("general->DAT->ONI","-export");
+    //this->commandMap.insert("general->ONI->DAT","-import"); //Not used.
+    this->commandMap.insert("general->ONI->DAT(PC)","-import:nosep");
+    this->commandMap.insert("general->ONI->DAT(demoPCMAC)","-import:sep");
+    this->commandMap.insert("general->ONI->XML","-extract:xml");
+    this->commandMap.insert("general->XML->ONI","-create");
+    //######################General Options
+    this->commandMap.insert("general->"+ui->cbTRAMGeneral->text(),"-anim-body:");
+    //Possible Combinations
+    this->commandMap.insertMulti("general->DAT","ONI");
+    this->commandMap.insertMulti("general->ONI","DAT");
+    this->commandMap.insertMulti("general->ONI","XML");
+    this->commandMap.insertMulti("general->XML","ONI");
+
+    ////////////////////////////////////////////////////////////////////////Textures Commands
+    this->commandMap.insert("textures->DAT / ONI->DDS","-extract:dds");
+    this->commandMap.insert("textures->DAT / ONI->TGA","-extract:tga");
+    this->commandMap.insert("textures->DAT / ONI->PNG","-extract:png");
+    this->commandMap.insert("textures->DAT / ONI->JPG","-extract:jpg");
+    this->commandMap.insert("textures->DDS / TGA / PNG / JPG->ONI","-create:txmp");
+    //######################Textures Options
+    this->commandMap.insert("textures->"+ui->rbBGR32->text(),"-format:bgr32");
+    this->commandMap.insert("textures->"+ui->rbBGRA32->text(),"-format:bgra32");
+    this->commandMap.insert("textures->"+ui->rbBGR555->text(),"-format:bgr555");
+    this->commandMap.insert("textures->"+ui->rbBGRA5551->text(),"-format:bgra5551");
+    this->commandMap.insert("textures->"+ui->rbBGRA444->text(),"-format:bgra4444");
+    this->commandMap.insert("textures->"+ui->rbDxt1->text(),"-format:dxt1");
+    this->commandMap.insert("textures->"+ui->cbMipMapsTextures->text(),"-genmipmaps");
+    this->commandMap.insert("textures->"+ui->cbNoUwrap->text(),"-nouwrap");
+    this->commandMap.insert("textures->"+ui->cbNoVwrap->text(),"-novwrap");
+    this->commandMap.insert("textures->"+ui->cbLarge->text(),"-large");
+    this->commandMap.insert("textures->"+ui->cbEnvMap->text(),"-envmap:");
+    //Possible Combinations
+    this->commandMap.insertMulti("textures->DAT / ONI","DDS");
+    this->commandMap.insertMulti("textures->DAT / ONI","TGA");
+    this->commandMap.insertMulti("textures->DAT / ONI","PNG");
+    this->commandMap.insertMulti("textures->DAT / ONI","JPG");
+    this->commandMap.insertMulti("textures->DDS / TGA / PNG / JPG","ONI");
+
+    ////////////////////////////////////////////////////////////////////////Models Commands
+    this->commandMap.insert("models->ONI->OBJ","-extract:obj");
+    this->commandMap.insert("models->ONI->DAE","-extract:dae -search "+Util::insertQuotes(this->AeLocation+"/GameDataFolder/level0_Final"));
+    this->commandMap.insert("models->OBJ->ONI","-create:m3gm");
+    this->commandMap.insert("models->DAE->ONI","-create:trbs");
+    //######################Models Options
+    this->commandMap.insert("models->"+ui->cbCellShading->text(),"-cel");
+    this->commandMap.insert("models->"+ui->cbNormals->text(),"-normals");
+    this->commandMap.insert("models->"+ui->cbTexture->text(),"-tex:");
+    this->commandMap.insert("models->"+ui->cbWithAnimation->text(),"-anim:");
+    this->commandMap.insert("models->No Animation","-noanim"); //No label with this name so can't be dynamic
+    //Possible Combinations
+    this->commandMap.insertMulti("models->ONI","OBJ");
+    this->commandMap.insertMulti("models->ONI","DAE");
+    this->commandMap.insertMulti("models->OBJ","ONI");
+    this->commandMap.insertMulti("models->DAE","ONI");
+
+    ////////////////////////////////////////////////////////////////////////Animations Commands
+    this->commandMap.insert("animations->ONI->DAE","-extract:dae");
+    this->commandMap.insert("animations->FILM DAT->XML","film2xml");
+    //######################Animations Options
+    this->commandMap.insert("animations->"+ui->cbCamera->text(),"-geom:camera");
+    this->commandMap.insert("animations->"+ui->cbGeometry->text(),"-geom:");
+    //Possible Combinations
+    this->commandMap.insertMulti("animations->ONI","DAE");
+    this->commandMap.insertMulti("animations->DAE","ONI");
+    this->commandMap.insertMulti("animations->FILM DAT","XML");
+
+    ////////////////////////////////////////////////////////////////////////Levels Commands
+    this->commandMap.insert("levels->ONI->DAE","-extract:dae -search "+Util::insertQuotes(this->AeLocation+"/GameDataFolder/level0_Final"));
+    this->commandMap.insert("levels->DAE->ONI","-create:akev");
+    this->commandMap.insert("levels->MASTER XML->DAT","-create:level");
+    this->commandMap.insert("levels->MASTER XML->ONI FILES","-create:level");
+    //######################Levels Options
+    this->commandMap.insert("levels->"+ui->cbGridsLevels->text(),"-grid:create");
+    //Possible Combinations
+    this->commandMap.insertMulti("levels->ONI","DAE");
+    this->commandMap.insertMulti("levels->DAE","ONI");
+    this->commandMap.insertMulti("levels->MASTER XML","DAT");
+    this->commandMap.insertMulti("levels->MASTER XML","ONI FILES");
+
+    ////////////////////////////////////////////////////////////////////////Misc Commands
+    this->commandMap.insert("misc->DAT / ONI->WAV","-extract:wav");
+    this->commandMap.insert("misc->DAT / ONI->AIF","-extract:aif");
+    this->commandMap.insert("misc->DAT / ONI->TXT","-extract:txt");
+    this->commandMap.insert("misc->WAV / AIF->ONI","-create");
+    this->commandMap.insert("misc->TXT->ONI","-create:subt");
+    //Possible Combinations
+    this->commandMap.insertMulti("misc->DAT / ONI","WAV");
+    this->commandMap.insertMulti("misc->DAT / ONI","AIF");
+    this->commandMap.insertMulti("misc->DAT / ONI","TXT");
+    this->commandMap.insertMulti("misc->WAV / AIF","ONI");
+    this->commandMap.insertMulti("misc->TXT","ONI");
+
+}
+
+void MainWindow::on_cbFromGeneral_currentIndexChanged(const QString &arg1)
+{
+    updateComboBox(arg1, ui->cbToGeneral, "general");
+}
+
+void MainWindow::on_cbFromTextures_currentIndexChanged(const QString &arg1)
+{
+    //Options are only used for DAT/ONI -> Image
+    if(QString::compare(arg1,"DAT / ONI",Qt::CaseSensitive)==0){ //case sensitive is faster
+        ui->gbTextures->setEnabled(false);
+    }
+    else{
+        ui->gbTextures->setEnabled(true);
+    }
+
+    updateComboBox(arg1, ui->cbToTextures, "textures");
+}
+
+void MainWindow::on_cbFromModels_currentIndexChanged(const QString &arg1)
+{
+
+    ui->cbCellShading->setEnabled(false);
+    ui->cbCellShading->setChecked(false);
+    ui->cbNormals->setEnabled(false);
+    ui->cbNormals->setChecked(false);
+    ui->cbTexture->setEnabled(false);
+    ui->cbTexture->setChecked(false);
+    ui->cbWithAnimation->setEnabled(false);
+    ui->cbWithAnimation->setChecked(false);
+
+    if(QString::compare(arg1,"OBJ",Qt::CaseSensitive)==0){ //case sensitive is faster
+        ui->cbTexture->setEnabled(true);
+    }
+    else if(QString::compare(arg1,"DAE",Qt::CaseSensitive)==0){
+        ui->cbCellShading->setEnabled(true);
+        ui->cbNormals->setEnabled(true);
+    }
+
+    updateComboBox(arg1, ui->cbToModels, "models");
+}
+
+void MainWindow::on_cbFromAnimations_currentIndexChanged(const QString &arg1)
+{
+    ui->cbCamera->setEnabled(false);
+    ui->cbCamera->setChecked(false);
+    ui->cbGeometry->setEnabled(false);
+    ui->cbGeometry->setChecked(false);
+
+    if(QString::compare(arg1,"ONI",Qt::CaseSensitive)==0){ //case sensitive is faster
+        ui->cbCamera->setEnabled(true);
+        ui->cbGeometry->setEnabled(true);
+    }
+
+    updateComboBox(arg1, ui->cbToAnimations, "animations");
+}
+
+void MainWindow::on_cbFromLevels_currentIndexChanged(const QString &arg1)
+{
+    updateComboBox(arg1, ui->cbToLevels, "levels");
+}
+
+void MainWindow::on_cbFromMisc_currentIndexChanged(const QString &arg1)
+{
+    updateComboBox(arg1, ui->cbToMisc, "misc");
+}
+
+void MainWindow::updateComboBox(const QString &arg1, QComboBox *comboBox, const QString &identifier){
+    comboBox->clear();
+
+    QStringList toUpdate=QStringList();
+
+    QStringList values=commandMap.values(identifier+"->"+arg1);
+
+    for (int i = values.size()-1; i >= 0; i--){ //By defaut MultiItems have the inversed order (http://qt-project.org/doc/qt-4.8/qhash.html#insertMulti)
+        toUpdate << values.at(i);
+    }
+
+    comboBox->addItems(toUpdate);
+}
+
+
+void MainWindow::on_actionWindows_triggered()
+{
+    ui->actionWindows->setChecked(true);
+    ui->actionMac_Windows_demo->setChecked(false);
+}
+
+void MainWindow::on_actionMac_Windows_demo_triggered()
+{
+    ui->actionMac_Windows_demo->setChecked(true);
+    ui->actionWindows->setChecked(false);
+}
+
+void MainWindow::on_pbRemoveSourceGeneral_clicked()
+{
+    removeTableContents( ui->twSourcesGeneral);
+}
+
+void MainWindow::on_pbRemoveSourceTextures_clicked()
+{
+    removeTableContents(ui->twSourcesTextures);
+}
+
+void MainWindow::on_pbRemoveSourceModels_clicked()
+{
+    removeTableContents(ui->twSourcesModels);
+}
+
+void MainWindow::on_pbRemoveSourceAnimations_clicked()
+{
+    removeTableContents(ui->twSourcesAnimations);
+}
+
+void MainWindow::on_pbRemoveSourceLevels_clicked()
+{
+    removeTableContents(ui->twSourcesLevels);
+}
+
+void MainWindow::on_pbRemoveSourceMisc_clicked()
+{
+    removeTableContents(ui->twSourcesMisc);
+}
+
+void MainWindow::on_pbClearSourcesGeneral_clicked()
+{
+    clearTableContents(ui->twSourcesGeneral);
+}
+
+void MainWindow::on_pbClearSourcesTextures_clicked()
+{
+    clearTableContents(ui->twSourcesTextures);
+}
+
+void MainWindow::on_pbClearSourcesModels_clicked()
+{
+    clearTableContents(ui->twSourcesModels);
+}
+
+void MainWindow::on_pbClearSourcesAnimations_clicked()
+{
+    clearTableContents(ui->twSourcesAnimations);
+}
+
+void MainWindow::on_pbClearSourcesLevels_clicked()
+{
+    clearTableContents(ui->twSourcesLevels);
+}
+
+void MainWindow::on_pbClearSourcesMisc_clicked()
+{
+    clearTableContents(ui->twSourcesMisc);
+}
+
+void MainWindow::removeTableContents(DropTableWidget *myTable){
+    int size = myTable->selectionModel()->selectedRows().size();
+
+    if(size==0){
+        Util::showPopUp("Select a row first.");
+        return;
+    }
+
+    if(Util::showQuestionPopUp(this,"Are you sure you want to delete the selected rows?")){
+        for(int i=0; i<size; i++){
+            //myTable->removeRow(myTable->selectedItems().at(size-i-1)->row());
+            myTable->removeRow(myTable->selectionModel()->selectedRows().at(size-i-1).row());
+        }
+        updateItemsLoaded(myTable);
+    }
+}
+
+void MainWindow::clearTableContents(DropTableWidget *myTable){
+    if(myTable->rowCount()==0){
+        Util::showPopUp("Nothing to clear.");
+        return;
+    }
+
+    if(Util::showQuestionPopUp(this,"Are you sure you want to clear the content?")){
+        myTable->clearContents();
+        myTable->setRowCount(0);
+    }
+    updateItemsLoaded(myTable);
+}
+
+
+void MainWindow::on_actionPreferences_triggered()
+{
+    //Show preferences
+    Preferences *preferencesWindow = new Preferences(this,this->vagoSettings);
+    preferencesWindow->exec(); //it destroys itself when finished.
+}
+
+
+void MainWindow::closeEvent(QCloseEvent *event){
+    if(this->vagoSettings->value("ConfirmExit").toBool()){
+        if(!Util::showQuestionPopUp(this,"Exit Vago?")){
+            event->ignore();
+        }
+    }
+}
+
+void MainWindow::on_cbToGeneral_currentIndexChanged(const QString &arg1)
+{
+
+    ui->cbDatGeneral->setEnabled(false);
+    ui->cbDatGeneral->setChecked(false);
+    ui->cbTRAMGeneral->setEnabled(false);
+    ui->cbTRAMGeneral->setChecked(false);
+
+    if(QString::compare(ui->cbFromGeneral->currentText(),"ONI",Qt::CaseSensitive)==0){
+        if(QString::compare(arg1,"DAT",Qt::CaseSensitive)==0){
+            ui->cbDatGeneral->setEnabled(true);
+        }
+        else{
+            ui->cbTRAMGeneral->setEnabled(true);
+        }
+    }
+
+}
+
+void MainWindow::on_cbToModels_currentIndexChanged(const QString &arg1)
+{
+    ui->cbWithAnimation->setEnabled(false);
+    ui->cbWithAnimation->setChecked(false);
+
+    if(arg1=="DAE"){
+        ui->cbWithAnimation->setEnabled(true);
+    }
+}
+
+void MainWindow::on_cbToLevels_currentIndexChanged(const QString &arg1)
+{
+
+    ui->cbDatLevels->setEnabled(false);
+    ui->cbDatLevels->setChecked(false);
+    ui->cbBnvLevels->setEnabled(false);
+    ui->cbBnvLevels->setChecked(false);
+    ui->cbAdditionalSourcesLevels->setEnabled(false);
+    ui->cbAdditionalSourcesLevels->setChecked(false);
+    ui->cbGridsLevels->setEnabled(false);
+    ui->cbGridsLevels->setChecked(false);
+
+    if(ui->cbFromLevels->currentText()=="MASTER XML" && arg1=="DAT"){
+        ui->cbDatLevels->setEnabled(true);
+    }
+    else if(ui->cbFromLevels->currentText()=="DAE" && arg1=="ONI"){
+        ui->cbBnvLevels->setEnabled(true);
+        ui->cbAdditionalSourcesLevels->setEnabled(true);
+    }
+}
+
+void MainWindow::on_cbDatGeneral_toggled(bool checked)
+{
+    ui->leTargetDatGeneral->setEnabled(checked);
+}
+
+void MainWindow::on_cbTRAMGeneral_toggled(bool checked)
+{
+    ui->leTRAMGeneral->setEnabled(checked);
+    if(checked){
+        QString file=QFileDialog::getOpenFileName(this,"Choose the TRAM.oni file...","./" , "All Files (*.*)");
+        if(!file.isEmpty()){
+            ui->leTRAMGeneral->setText(file);
+        }
+    }
+}
+
+void MainWindow::on_cbDatLevels_toggled(bool checked)
+{
+    ui->leTargetDatLevels->setEnabled(checked);
+}
+
+void MainWindow::on_cbBnvLevels_toggled(bool checked)
+{
+    ui->leBnvLevels->setEnabled(checked);
+    ui->cbGridsLevels->setEnabled(checked);
+    ui->cbGridsLevels->setChecked(checked);
+    if(checked){
+        QString file=QFileDialog::getOpenFileName(this,"Choose the BNV.dae file...","./" , "All Files (*.*)");
+        if(!file.isEmpty()){
+            ui->leBnvLevels->setText(file);
+        }
+    }
+}
+
+void MainWindow::on_cbAdditionalSourcesLevels_toggled(bool checked)
+{
+    ui->leAdditSourcesLevels->setEnabled(checked);
+
+    if(checked){
+        QStringList filesSelected=QFileDialog::getOpenFileNames(this,"Choose the additional .dae files...","./" , "All Files (*.*)");
+        QString filesJoined;
+        int size=filesSelected.size();
+
+        if(!filesSelected.isEmpty()){
+            for(int i=0; i<size-1; i++){
+                filesJoined+=filesSelected.at(i)+" ";
+            }
+            filesJoined+=filesSelected.at(size-1); //last doesn't have space after
+            ui->leAdditSourcesLevels->setText(filesJoined);
+        }
+
+    }
+}
+
+void MainWindow::on_actionCheck_OniSplit_version_triggered()
+{
+    QProcess *myProcess = new QProcess();
+    myProcess->start(GlobalVars::OniSplitExeName+" -version");
+    myProcess->waitForFinished(-1);
+    QString result=myProcess->readAllStandardOutput();
+    delete myProcess;
+    Util::showPopUp("This Vago version was built with base in OniSplit version "+GlobalVars::BuiltOniSplitVersion+"\n\nActual version is:\n"+result);
+}
+
+void MainWindow::on_actionCheck_xmlTools_version_triggered()
+{
+    QProcess *myProcess = new QProcess();
+    myProcess->start(GlobalVars::XmlToolsExeName+" version");
+    myProcess->waitForFinished(-1);
+    QString result=myProcess->readLine();
+    delete myProcess;
+    Util::showPopUp("This Vago version was built with base in xmlTools version "+GlobalVars::BuiltXmlToolsVersion+"\n\nActual version is:\n"+result);
+}
+
+/**
+  Update items loaded
+  **/
+void MainWindow::on_tabWidget_selected(const QString &arg1)
+{
+    if(arg1.compare("General",Qt::CaseSensitive)==0){ //case sentive is faster
+        updateItemsLoaded(ui->twSourcesGeneral);
+    }
+    else if(arg1.compare("Textures",Qt::CaseSensitive)==0){
+        updateItemsLoaded(ui->twSourcesTextures);
+    }
+    else if(arg1.compare("Models",Qt::CaseSensitive)==0){
+        updateItemsLoaded(ui->twSourcesModels);
+    }
+    else if(arg1.compare("Levels",Qt::CaseSensitive)==0){
+        updateItemsLoaded(ui->twSourcesLevels);
+    }
+    else{
+        updateItemsLoaded(ui->twSourcesMisc);
+    }
+}
+
+void MainWindow::updateItemsLoaded(DropTableWidget *currentTable){
+
+    int numItems=currentTable->rowCount();
+
+    this->itemsLoaded->setText(QString().setNum(numItems)+ (numItems==1?" item ":" items ") +"loaded");
+}
+
+void MainWindow::on_tbCommand_clicked()
+{
+    //Show preferences
+    ManualCommands *commandsWindow = new ManualCommands(this);
+    commandsWindow->show(); //it destroys itself when finished.
+}
+
+void MainWindow::on_actionWorkspace_triggered()
+{
+    ui->actionWorkspace->setChecked(true);
+    ui->actionOther->setChecked(false);
+    this->outputFolder=this->workspaceLocation;
+    ui->tbOpenFolder->setToolTip("Open Vago workspace");
+    showSuccessStatusMessage("Vago is now outputting the NEW items for Vago workspace.");
+}
+
+void MainWindow::on_actionOther_triggered()
+{
+    QString newDir=QFileDialog::getExistingDirectory(this,"Choose the folder for output NEW files directly...",this->AeLocation+"/GameDataFolder");
+    newDir=Util::normalizePath(newDir);
+
+    if(newDir.isEmpty()){
+        ui->actionOther->setChecked(false);
+        return; //do nothing
+    }
+
+    if(newDir==this->workspaceLocation){
+        on_actionWorkspace_triggered(); //set it to vago workspace
+        return;
+    }
+
+    ui->actionOther->setChecked(true);
+    ui->actionWorkspace->setChecked(false);
+
+    this->outputFolder=newDir;
+
+    QString newDirName=Util::cutName(newDir);
+    ui->tbOpenFolder->setToolTip("Open "+newDirName+" output folder");
+    showSuccessStatusMessage("Vago is now outputting the NEW items for "+newDirName+".");
+}
+
+void MainWindow::on_actionView_log_triggered()
+{
+    Util::openLogFile();
+}
+
+QString MainWindow::getTypeConversion(DropTableWidget *myTable){
+    QString from,to;
+
+    if(myTable==ui->twSourcesGeneral){
+        from=ui->cbFromGeneral->currentText();
+        to=ui->cbToGeneral->currentText();
+    }
+    else if(myTable==ui->twSourcesTextures){
+        from=ui->cbFromTextures->currentText();
+        to=ui->cbToTextures->currentText();
+    }
+    else if(myTable==ui->twSourcesModels){
+        from=ui->cbFromModels->currentText();
+        to=ui->cbToModels->currentText();
+    }
+    else if(myTable==ui->twSourcesAnimations){
+        from=ui->cbFromAnimations->currentText();
+        to=ui->cbToAnimations->currentText();
+    }
+    else if(myTable==ui->twSourcesLevels){
+        from=ui->cbFromLevels->currentText();
+        to=ui->cbToLevels->currentText();
+    }
+    else{
+        from=ui->cbFromMisc->currentText();
+        to=ui->cbToMisc->currentText();
+    }
+
+    return from + " > " + to;
+}
+
+//Drop table widget context menu
+void MainWindow::dtContextMenu(DropTableWidget* myTable, QContextMenuEvent *event){
+    QModelIndex index = myTable->indexAt(event->pos());
+
+    //item exists?
+    if(!index.isValid())
+        return;
+
+    if(myTable->selectionModel()->selectedRows().size()==0){ //No multiple rows selected
+        myTable->selectRow(myTable->itemAt(event->pos())->row()); //select all the row of the item clicked
+    }
+
+    QList<int> selectedRows = QList<int>();
+
+    foreach(QModelIndex rowItem, myTable->selectionModel()->selectedRows()){
+        selectedRows << rowItem.row();
+    }
+
+    QMenu *menu = new QMenu();
+    QAction *copy = new QAction("Copy",myTable);
+    QAction *moveUp = new QAction("Move Up",myTable);
+    QAction *moveDown = new QAction("Move Down",myTable);
+    QAction *changeOptions = new QAction("Change To Current Options",myTable);
+    QMenu *changeOutput = new QMenu("Change Output for:");
+    QAction *outWorkspace = new QAction("Workspace",myTable);
+    QAction *outCurrOutput = new QAction("Current Output Folder",myTable);
+    QAction *outOther = new QAction("Other...",myTable);
+    QAction *edisable = new QAction("Enable/Disable",myTable);
+
+    menu->addAction(copy);
+    menu->addSeparator();
+    menu->addAction(moveUp);
+    menu->addAction(moveDown);
+    menu->addSeparator();
+    menu->addAction(changeOptions);
+    menu->addMenu(changeOutput);
+    changeOutput->addActions(QList<QAction*>() << outWorkspace << outCurrOutput << outOther);
+    menu->addAction(edisable);
+
+
+    //if it's in the first row it can't be setted up
+    if(selectedRows.at(0)==0){
+        moveUp->setEnabled(false);
+    }
+
+    //if we are at bottom we can't go down
+    if(selectedRows.at(selectedRows.size()-1)==myTable->rowCount()-1){
+        moveDown->setEnabled(false);
+    }
+
+    //Can we change the settings? (the conversion must be the same)
+    QString currentSettings = (getTypeConversion(myTable)); //call function at the mainWindow with a signal (different threads?)
+    foreach(int row, selectedRows){
+        if( myTable->item(row,1)->text() != currentSettings){ //If we find out any of the selected items can't be convert disable operation
+            changeOptions->setEnabled(false);
+            break;
+        }
+    }
+
+    QAction* selectedOption = menu->exec(event->globalPos());
+
+    if(selectedOption==copy){
+        //Let's copy the contents to the clipboard
+
+        QString toCopy;
+
+        int size=selectedRows.size();
+
+        //Let's format it a bit...
+        for(int i=0; i<size; i++){
+            for(int j=0; j<myTable->columnCount(); j++){
+                toCopy+=myTable->item(selectedRows.at(i),j)->text();
+                if(j!=myTable->columnCount()-1){
+                    toCopy+="\t";
+                }
+            }
+            if(i!=size-1){
+                toCopy+="\n";
+            }
+        }
+
+        QApplication::clipboard()->setText(toCopy);
+        showSuccessStatusMessage(QString::number(size) + (size==1?" item ":" items ")+ "copied to the clipboard");
+    }
+    else if(selectedOption==moveUp){
+        qSort(selectedRows); //let's order the selections by the row number, so we know exactly how to swap it
+        myTable->swapPositions(selectedRows,-1);
+    }
+    else if(selectedOption==moveDown){
+        qSort(selectedRows);
+        myTable->swapPositions(selectedRows,+1);
+    }
+    else if(selectedOption==changeOptions){
+        changeToCurrentSettings(selectedRows,myTable);
+    }
+    else if(selectedOption==outWorkspace){
+        changeItemsOutput(myTable,selectedRows,this->workspaceLocation);
+    }
+    else if(selectedOption==outCurrOutput){
+        changeItemsOutput(myTable,selectedRows,this->outputFolder);
+    }
+    else if(selectedOption==outOther){
+
+        QString newDir=QFileDialog::getExistingDirectory(this,"Choose the folder for the output of the files selected...",this->AeLocation+"/GameDataFolder");
+        newDir=Util::normalizePath(newDir);
+
+        if(newDir.isEmpty()){
+            return; //do nothing
+        }
+
+        changeItemsOutput(myTable,selectedRows,newDir);
+
+    }
+    else if(selectedOption==edisable){
+
+        int enabledCount=0, disabledCount=0;
+
+        for(int i=0; i<selectedRows.size(); i++){
+
+            for(int j=0; j<myTable->columnCount(); j++){
+                QTableWidgetItem *currentItem=myTable->item(selectedRows.at(i),j);
+
+                if(currentItem->background()!=myTable->disabledBackStyle){
+                    myTable->setDisableStyleWidgetItem(currentItem);
+                    if(j==0){ //Only count the row, not the columns
+                        disabledCount++;
+                    }
+                }
+                else{ //reset to initial state (enable)
+                    myTable->resetStyleWidgetItem(currentItem);
+                    if(j==0){
+                        enabledCount++;
+                    }
+                }
+            }
+        }
+
+        QString result;
+
+        if(enabledCount!=0){
+            result+=QString::number(enabledCount) + (enabledCount==1?" item ":" items ") + "Enabled";
+        }
+        if(enabledCount!=0 && disabledCount!=0){
+            result+=" and ";
+        }
+        if(disabledCount!=0){
+            result+=QString::number(disabledCount) + (disabledCount==1?" item ":" items ") + "Disabled";
+        }
+
+        showSuccessStatusMessage(result);
+    }
+
+    delete copy;
+    delete moveUp;
+    delete moveDown;
+    delete changeOptions;
+    delete outWorkspace;
+    delete outCurrOutput;
+    delete outOther;
+    delete changeOutput;
+    delete edisable;
+    delete menu;
+}
+
+void MainWindow::changeToCurrentSettings(QList<int> rows, DropTableWidget* myTable){
+    //construct a command for each one
+    //Output a status message saying the number of changed files
+    QString fromTo=getTypeConversion(myTable);
+    QString from = QString(fromTo).remove(fromTo.indexOf(" >"),fromTo.size()-1); //parse the string to get the from, only 1 time parsed by each group of files = very fast
+    QString to = QString(fromTo).remove(0,fromTo.lastIndexOf("> ")+2); //+2 to start after "> "
+
+    QString command;
+
+    foreach(int row, rows){
+
+        command=getCommand(myTable,getFileOutputFolder(fromTo,myTable->getOutputAbsolute(row)),from,to,myTable->getFileAbsolute(row));
+
+        if(command.isEmpty()){ //something wrong was happening (not inputted a texture name?)
+            return; //stop changing settings
+        }
+
+        myTable->item(row,2)->setText(command); //update settings to the current row
+        myTable->updateTableToolTips(row);
+    }
+
+    showSuccessStatusMessage(QString::number(rows.size()) + (rows.size()==1?" item ":" items ")+ "changed to the current settings");
+}
+
+void MainWindow::changeItemsOutput(DropTableWidget* myTable, QList<int> rows, QString newOutput){
+
+    QString command, currentAbsoluteFile, fromTo, from, to;
+
+    foreach(int row, rows){ //No optimization possible here, commands may be different
+        fromTo=myTable->item(row,1)->text();
+        from = QString(fromTo).remove(fromTo.indexOf(" >"),fromTo.size()-1); //parse the string to get the from
+        to = QString(fromTo).remove(0,fromTo.lastIndexOf("> ")+2); //+2 to start after "> "
+
+        currentAbsoluteFile=myTable->getFileAbsolute(row);
+        command=getCommand(myTable,getFileOutputFolder(fromTo,newOutput),from,to,currentAbsoluteFile);
+
+        if(command.isEmpty()){ //something wrong was happening (not inputted a texture name?)
+            return; //stop changing output
+        }
+
+        myTable->item(row,2)->setText(command); //update command to the current row
+        myTable->updateTableToolTips(row);
+    }
+
+    showSuccessStatusMessage(QString::number(rows.size()) + (rows.size()==1?" item ":" items ")+ "changed the output to "+(newOutput!=this->workspaceLocation?Util::cutName(newOutput):"Vago workspace"));
+}
+
+QString MainWindow::getCommand(DropTableWidget* myTable, QString myOutputFolder, QString from, QString to , QString file){
+    if(myTable==ui->twSourcesGeneral){ //So we only need to parse one command.
+        return fileParsingGeneral(myOutputFolder,from,to,file);
+    }
+    else if(myTable==ui->twSourcesTextures){
+        return fileParsingTextures(myOutputFolder,from,to,file);
+    }
+    else if(myTable==ui->twSourcesModels){
+        return fileParsingModels(myOutputFolder,from,to,file);
+    }
+    else if(myTable==ui->twSourcesAnimations){
+        return fileParsingAnimations(myOutputFolder,from,to,file);
+    }
+    else if(myTable==ui->twSourcesLevels){
+        return fileParsingLevels(myOutputFolder,from,to,file);
+    }
+    else{
+        return fileParsingMisc(myOutputFolder,from,to,file);
+    }
+
+}
+
+void MainWindow::connectSlots(){
+
+    //This signal is for thread that is working setup the progress bar (make it visible and set it's min-max)
+    connect(myConverter, SIGNAL(setupPB(int)), this, SLOT(TsetupProgressBar(int)), Qt::BlockingQueuedConnection);
+
+    //This signal is for thread that is working can update the progress bar of the gui
+    connect(myConverter, SIGNAL(taskDone()), this, SLOT(TupdateProgressBar()),Qt::BlockingQueuedConnection);
+
+    //This signal is for thread that is working can show the result of a conversion
+    connect(myConverter, SIGNAL(resultConversion(QString,int)), this, SLOT(TresultConversion(QString,int)));
+
+    //Drop signal for General table
+    connect(ui->twSourcesGeneral, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addFilesSource(DropTableWidget*,QStringList)));
+
+    //Drop signal for Textures table
+    connect(ui->twSourcesTextures, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addFilesSource(DropTableWidget*,QStringList)));
+
+    //Drop signal for Models table
+    connect(ui->twSourcesModels, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addFilesSource(DropTableWidget*,QStringList)));
+
+    //Drop signal for Animations table
+    connect(ui->twSourcesAnimations, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addFilesSource(DropTableWidget*,QStringList)));
+
+    //Drop signal for Levels table
+    connect(ui->twSourcesLevels, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addFilesSource(DropTableWidget*,QStringList)));
+
+    //Drop signal for Misc table
+    connect(ui->twSourcesMisc, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addFilesSource(DropTableWidget*,QStringList)));
+
+    //Context menu for General table
+    connect(ui->twSourcesGeneral, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*)));
+
+    //Context menu for Textures table
+    connect(ui->twSourcesTextures, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*)));
+
+    //Context menu for Models table
+    connect(ui->twSourcesModels, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*)));
+
+    //Context menu for Animations table
+    connect(ui->twSourcesAnimations, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*)));
+
+    //Context menu for Levels table
+    connect(ui->twSourcesLevels, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*)));
+
+    //Context menu for Misc table
+    connect(ui->twSourcesMisc, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*)));
+}
+
+
Index: /Vago/trunk/Vago/mainwindow.h
===================================================================
--- /Vago/trunk/Vago/mainwindow.h	(revision 771)
+++ /Vago/trunk/Vago/mainwindow.h	(revision 771)
@@ -0,0 +1,223 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include "util.h"
+#include "preferences.h"
+#include "manualcommands.h"
+#include "about.h"
+#include "packagewizard.h"
+#include "soundwizard.h"
+
+#include <QMainWindow>
+#include <QSettings>
+#include <QMessageBox>
+#include <QProcess>
+#include <QColor>
+#include <QPalette>
+#include <QFileDialog>
+#include <QUrl>
+#include <QDesktopServices>
+#include <QErrorMessage>
+#include <QTextCodec>
+#include <converter.h>
+#include <QProgressBar>
+#include <droptablewidget.h>
+#include <QComboBox>
+#include <QtNetwork/QNetworkAccessManager>
+#include <QtNetwork/QNetworkRequest>
+#include <QtNetwork/QNetworkReply>
+#include <QDebug>
+#include <QCloseEvent>
+#include <QScriptEngine>
+#include <QScriptValueIterator>
+
+namespace Ui {
+class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+    
+public:
+    explicit MainWindow(QWidget *parent = 0);
+
+    ~MainWindow();
+
+protected:
+     void closeEvent(QCloseEvent *event);
+    
+private slots:
+    void on_actionExit_triggered();
+
+    void on_actionAbout_triggered();
+
+    void on_tbOni_clicked();
+
+    void on_tbAE_clicked();
+
+    void on_tbOpenFolder_clicked();
+
+    void on_cbEnvMap_toggled(bool checked);
+
+    void on_cbTexture_toggled(bool checked);
+
+    void on_actionCheck_For_Updates_triggered();
+
+    void on_pbAddSourceGeneral_clicked();
+
+    void on_pbConvertGeneral_clicked();
+
+    void TsetupProgressBar(int max);
+
+    void TupdateProgressBar();
+
+    void TresultConversion(QString result, int numErrors);
+
+    void on_cbFromGeneral_currentIndexChanged(const QString &arg1);
+
+    void on_actionWindows_triggered();
+
+    void on_actionMac_Windows_demo_triggered();
+
+    void on_pbClearSourcesGeneral_clicked();
+
+    void on_pbRemoveSourceGeneral_clicked();
+
+    void on_pbAddSourceTextures_clicked();
+
+    void on_pbRemoveSourceTextures_clicked();
+
+    void on_pbClearSourcesTextures_clicked();
+
+    void on_cbFromTextures_currentIndexChanged(const QString &arg1);
+
+    void on_cbFromModels_currentIndexChanged(const QString &arg1);
+
+    void on_cbFromLevels_currentIndexChanged(const QString &arg1);
+
+    void on_cbFromMisc_currentIndexChanged(const QString &arg1);
+
+    void on_pbAddSourceModels_clicked();
+
+    void on_pbAddSourceLevels_clicked();
+
+    void on_pbAddSourceMisc_clicked();
+
+    void on_pbConvertTextures_clicked();
+
+    void on_pbConvertModels_clicked();
+
+    void on_pbConvertLevels_clicked();
+
+    void on_pbConvertMisc_clicked();
+
+    void on_pbRemoveSourceModels_clicked();
+
+    void on_pbRemoveSourceLevels_clicked();
+
+    void on_pbRemoveSourceMisc_clicked();
+
+    void on_pbClearSourcesModels_clicked();
+
+    void on_pbClearSourcesLevels_clicked();
+
+    void on_pbClearSourcesMisc_clicked();
+
+    void on_actionPreferences_triggered();
+
+    void on_cbToGeneral_currentIndexChanged(const QString &arg1);
+
+    void on_cbToLevels_currentIndexChanged(const QString &arg1);
+
+    void on_cbDatGeneral_toggled(bool checked);
+
+    void on_cbDatLevels_toggled(bool checked);
+
+    void on_actionCheck_OniSplit_version_triggered();
+
+    void addFilesSource(DropTableWidget *myTable, QStringList files); //for drag 'n drop
+
+    void dtContextMenu(DropTableWidget* myTable, QContextMenuEvent *event); //Context menu options for table widgets
+
+    void on_cbTRAMGeneral_toggled(bool checked);
+
+    void on_tabWidget_selected(const QString &arg1);
+
+    void checkVagoLastVersion(QNetworkReply *result); //check vago last version
+
+    void on_cbBnvLevels_toggled(bool checked);
+
+    void on_cbAdditionalSourcesLevels_toggled(bool checked);
+
+    void on_tbCommand_clicked();
+
+    void on_actionWorkspace_triggered();
+
+    void on_actionOther_triggered();
+
+    void on_actionView_log_triggered();
+
+    void on_cbToModels_currentIndexChanged(const QString &arg1);
+
+    void on_cbWithAnimation_toggled(bool checked);
+
+    void on_actionAE_Package_Creator_triggered();
+
+    void on_cbFromAnimations_currentIndexChanged(const QString &arg1);
+
+    void on_cbCamera_toggled(bool checked);
+
+    void on_cbGeometry_toggled(bool checked);
+
+    void on_pbConvertAnimations_clicked();
+
+    void on_pbAddSourceAnimations_clicked();
+
+    void on_pbRemoveSourceAnimations_clicked();
+
+    void on_pbClearSourcesAnimations_clicked();
+
+    void on_actionSound_Wizard_triggered();
+
+    void on_actionCheck_xmlTools_version_triggered();
+
+private:
+    Ui::MainWindow *ui;
+    Logger *myLogger;
+    QString workspaceLocation; //Workspace location
+    QString workspaceWizardsLocation; //Workspace wizard location
+    QString outputFolder; //Output folder
+    QString AeLocation; //Workspace location
+    QLabel *itemsLoaded;
+    QProgressBar *myBar; //Progress Bar
+    QHash<QString, QString> commandMap; //Map the commands for fast retreive
+    QStringList *listToProccess; //items to proccess
+    Converter *myConverter;
+    QSettings *vagoSettings;
+    static const QString VagoSettingsName;
+
+    void connectSlots();
+    void showErrStatusMessage(QString message);
+    void showSuccessStatusMessage(QString message);
+    void mapCommands();
+    void addRowTable(DropTableWidget *myTable,QString file, QString fromTo, QString command);
+    void clearTableContents(DropTableWidget *myTable);
+    void removeTableContents(DropTableWidget *myTable);
+    void updateComboBox(const QString &arg1, QComboBox *comboBox, const QString &identifier);
+    void startConversion(DropTableWidget *myTable);
+    void updateItemsLoaded(DropTableWidget *currentTable);
+    void changeToCurrentSettings(QList<int> rows, DropTableWidget* myTable); //change some rows to the current settings
+    void changeItemsOutput(DropTableWidget* myTable, QList<int> rows, QString newOutput);
+    QString getFileOutputFolder(QString fromTo, QString myOutputFolder="");
+    QString fileParsingGeneral(QString myOutputFolder, QString from, QString to , QString file);
+    QString fileParsingTextures(QString myOutputFolder, QString from, QString to , QString file);
+    QString fileParsingModels(QString myOutputFolder, QString from, QString to , QString file);
+    QString fileParsingAnimations(QString myOutputFolder, QString from, QString to , QString file);
+    QString fileParsingLevels(QString myOutputFolder, QString from, QString to , QString file);
+    QString fileParsingMisc(QString myOutputFolder, QString from, QString to , QString file);
+    QString getCommand(DropTableWidget* myTable, QString myOutputFolder, QString from, QString to , QString file);
+    QString getTypeConversion(DropTableWidget *myTable); //get the current type for a table
+};
+
+#endif // MAINWINDOW_H
Index: /Vago/trunk/Vago/mainwindow.ui
===================================================================
--- /Vago/trunk/Vago/mainwindow.ui	(revision 771)
+++ /Vago/trunk/Vago/mainwindow.ui	(revision 771)
@@ -0,0 +1,1676 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>640</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Vago</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="resources.qrc">
+    <normaloff>:/new/icons/vago_icon.png</normaloff>:/new/icons/vago_icon.png</iconset>
+  </property>
+  <widget class="QWidget" name="centralWidget">
+   <layout class="QVBoxLayout" name="verticalLayout">
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout_10">
+      <item>
+       <widget class="QToolButton" name="tbOpenFolder">
+        <property name="toolTip">
+         <string>Open Vago workspace</string>
+        </property>
+        <property name="text">
+         <string>...</string>
+        </property>
+        <property name="icon">
+         <iconset resource="resources.qrc">
+          <normaloff>:/new/icons/folder_icon.png</normaloff>:/new/icons/folder_icon.png</iconset>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QLabel" name="emptySpacerLabel3">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>20</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="text">
+         <string/>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QToolButton" name="tbCommand">
+        <property name="toolTip">
+         <string>Manual OniSplit Commands</string>
+        </property>
+        <property name="text">
+         <string>...</string>
+        </property>
+        <property name="icon">
+         <iconset resource="resources.qrc">
+          <normaloff>:/new/icons/command_icon.png</normaloff>:/new/icons/command_icon.png</iconset>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QLabel" name="emptySpacerLabel2">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>20</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="baseSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="text">
+         <string/>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QToolButton" name="tbOni">
+        <property name="toolTip">
+         <string>Launch Oni</string>
+        </property>
+        <property name="text">
+         <string>...</string>
+        </property>
+        <property name="icon">
+         <iconset resource="resources.qrc">
+          <normaloff>:/new/icons/oni_icon.png</normaloff>:/new/icons/oni_icon.png</iconset>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QLabel" name="emptySpacerLabel">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>20</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="baseSize">
+         <size>
+          <width>0</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="text">
+         <string/>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QToolButton" name="tbAE">
+        <property name="toolTip">
+         <string>Launch AE installer</string>
+        </property>
+        <property name="text">
+         <string>...</string>
+        </property>
+        <property name="icon">
+         <iconset resource="resources.qrc">
+          <normaloff>:/new/icons/AE_icon.png</normaloff>:/new/icons/AE_icon.png</iconset>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </item>
+    <item>
+     <widget class="QTabWidget" name="tabWidget">
+      <property name="currentIndex">
+       <number>0</number>
+      </property>
+      <widget class="QWidget" name="tabGeneral">
+       <attribute name="title">
+        <string>General</string>
+       </attribute>
+       <layout class="QVBoxLayout" name="verticalLayout_18">
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_12">
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_8">
+            <item>
+             <widget class="QLabel" name="label_10">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="text">
+               <string>From</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="cbFromGeneral">
+              <item>
+               <property name="text">
+                <string>DAT</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>ONI</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>XML</string>
+               </property>
+              </item>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_9">
+            <item>
+             <widget class="QLabel" name="label_11">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="text">
+               <string>To</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="cbToGeneral">
+              <item>
+               <property name="text">
+                <string>ONI</string>
+               </property>
+              </item>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_11">
+          <item>
+           <widget class="QGroupBox" name="gbSourcesGeneral">
+            <property name="title">
+             <string>Sources</string>
+            </property>
+            <layout class="QHBoxLayout" name="horizontalLayout_13">
+             <item>
+              <widget class="DropTableWidget" name="twSourcesGeneral"/>
+             </item>
+             <item>
+              <layout class="QVBoxLayout" name="verticalLayout_10">
+               <item>
+                <widget class="QPushButton" name="pbAddSourceGeneral">
+                 <property name="minimumSize">
+                  <size>
+                   <width>0</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="text">
+                  <string>Add</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QPushButton" name="pbRemoveSourceGeneral">
+                 <property name="text">
+                  <string>Remove</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QPushButton" name="pbClearSourcesGeneral">
+                 <property name="text">
+                  <string>Clear</string>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </item>
+            </layout>
+           </widget>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <widget class="QGroupBox" name="gbGeneral">
+          <property name="enabled">
+           <bool>true</bool>
+          </property>
+          <property name="title">
+           <string>Options</string>
+          </property>
+          <layout class="QHBoxLayout" name="horizontalLayout_23">
+           <item>
+            <layout class="QVBoxLayout" name="verticalLayout_38">
+             <item>
+              <layout class="QHBoxLayout" name="horizontalLayout_29">
+               <item>
+                <widget class="QCheckBox" name="cbDatGeneral">
+                 <property name="enabled">
+                  <bool>false</bool>
+                 </property>
+                 <property name="text">
+                  <string>DAT Filename:</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QLineEdit" name="leTargetDatGeneral">
+                 <property name="enabled">
+                  <bool>false</bool>
+                 </property>
+                 <property name="placeholderText">
+                  <string>Custom .dat filename</string>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <widget class="QCheckBox" name="cbTRAMGeneral">
+             <property name="enabled">
+              <bool>false</bool>
+             </property>
+             <property name="toolTip">
+              <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Extract an ONCC with another character's TRAM&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;For example extract Konoko's ONCC with Muro's TRAM&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+             </property>
+             <property name="text">
+              <string>Another TRAM:</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="leTRAMGeneral">
+             <property name="enabled">
+              <bool>false</bool>
+             </property>
+             <property name="toolTip">
+              <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Extract an ONCC with another character's TRAM&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;For example extract Konoko's ONCC with Muro's TRAM&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+             </property>
+             <property name="placeholderText">
+              <string>TRAM.oni source file</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </widget>
+        </item>
+        <item>
+         <widget class="Line" name="line_3">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="pbConvertGeneral">
+          <property name="minimumSize">
+           <size>
+            <width>0</width>
+            <height>30</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Convert</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="tabTextures">
+       <attribute name="title">
+        <string>Textures</string>
+       </attribute>
+       <layout class="QVBoxLayout" name="verticalLayout_19">
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_15">
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_14">
+            <item>
+             <widget class="QLabel" name="label_13">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="text">
+               <string>From</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="cbFromTextures">
+              <item>
+               <property name="text">
+                <string>DAT / ONI</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>DDS / TGA / PNG / JPG</string>
+               </property>
+              </item>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_15">
+            <item>
+             <widget class="QLabel" name="label_14">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="text">
+               <string>To</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="cbToTextures">
+              <item>
+               <property name="text">
+                <string>DDS</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>TGA</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>PNG</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>JPG</string>
+               </property>
+              </item>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <widget class="QGroupBox" name="gbSourcesGeneralTextures">
+          <property name="title">
+           <string>Sources</string>
+          </property>
+          <layout class="QHBoxLayout" name="horizontalLayout_14">
+           <item>
+            <widget class="DropTableWidget" name="twSourcesTextures"/>
+           </item>
+           <item>
+            <layout class="QVBoxLayout" name="verticalLayout_17">
+             <item>
+              <widget class="QPushButton" name="pbAddSourceTextures">
+               <property name="minimumSize">
+                <size>
+                 <width>0</width>
+                 <height>0</height>
+                </size>
+               </property>
+               <property name="text">
+                <string>Add</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pbRemoveSourceTextures">
+               <property name="text">
+                <string>Remove</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pbClearSourcesTextures">
+               <property name="text">
+                <string>Clear</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+        </item>
+        <item>
+         <widget class="QGroupBox" name="gbTextures">
+          <property name="enabled">
+           <bool>false</bool>
+          </property>
+          <property name="title">
+           <string>Options</string>
+          </property>
+          <layout class="QVBoxLayout" name="verticalLayout_24">
+           <item>
+            <layout class="QVBoxLayout" name="verticalLayout_23">
+             <item>
+              <layout class="QHBoxLayout" name="horizontalLayout_21">
+               <item>
+                <widget class="QRadioButton" name="rbBGR32">
+                 <property name="text">
+                  <string>BGR32</string>
+                 </property>
+                 <property name="checked">
+                  <bool>true</bool>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QRadioButton" name="rbBGRA32">
+                 <property name="text">
+                  <string>BGRA32</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QRadioButton" name="rbBGR555">
+                 <property name="text">
+                  <string>BGR555</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QRadioButton" name="rbBGRA5551">
+                 <property name="text">
+                  <string>BGRA5551</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QRadioButton" name="rbBGRA444">
+                 <property name="text">
+                  <string>BGRA444</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QRadioButton" name="rbDxt1">
+                 <property name="text">
+                  <string>dxt1</string>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <layout class="QHBoxLayout" name="horizontalLayout_22">
+               <item>
+                <widget class="QCheckBox" name="cbMipMapsTextures">
+                 <property name="text">
+                  <string>GenMipMaps</string>
+                 </property>
+                 <property name="checked">
+                  <bool>true</bool>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QCheckBox" name="cbNoUwrap">
+                 <property name="text">
+                  <string>NoUwrap</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QCheckBox" name="cbNoVwrap">
+                 <property name="text">
+                  <string>NoVwrap</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QCheckBox" name="cbLarge">
+                 <property name="text">
+                  <string>Large</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QCheckBox" name="cbEnvMap">
+                 <property name="toolTip">
+                  <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Used for reflection in armors. The armor texture has an alpha channel which is transparent and the envmap texture is shown.&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;It's the name of a TXMP.oni file, don't include the extension.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+                 </property>
+                 <property name="text">
+                  <string>EnvMap:</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QLineEdit" name="leEnvMapTexture">
+                 <property name="enabled">
+                  <bool>false</bool>
+                 </property>
+                 <property name="toolTip">
+                  <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Used for reflection in armors. The armor texture has an alpha channel which is transparent and the envmap texture is shown.&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;It's the name of a TXMP.oni file, don't include the extension.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+                 </property>
+                 <property name="placeholderText">
+                  <string>EnvMap texture name</string>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+        </item>
+        <item>
+         <widget class="Line" name="line_8">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="pbConvertTextures">
+          <property name="minimumSize">
+           <size>
+            <width>0</width>
+            <height>30</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Convert</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="tabModels">
+       <attribute name="title">
+        <string>Models</string>
+       </attribute>
+       <layout class="QVBoxLayout" name="verticalLayout_25">
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_26">
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_28">
+            <item>
+             <widget class="QLabel" name="label_17">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="text">
+               <string>From</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="cbFromModels">
+              <item>
+               <property name="text">
+                <string>ONI</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>OBJ</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>DAE</string>
+               </property>
+              </item>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_29">
+            <item>
+             <widget class="QLabel" name="label_18">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="text">
+               <string>To</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="cbToModels">
+              <item>
+               <property name="text">
+                <string>OBJ</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>DAE</string>
+               </property>
+              </item>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <widget class="QGroupBox" name="gbSourcesModels">
+          <property name="title">
+           <string>Sources</string>
+          </property>
+          <layout class="QHBoxLayout" name="horizontalLayout_16">
+           <item>
+            <widget class="DropTableWidget" name="twSourcesModels"/>
+           </item>
+           <item>
+            <layout class="QVBoxLayout" name="verticalLayout_11">
+             <item>
+              <widget class="QPushButton" name="pbAddSourceModels">
+               <property name="minimumSize">
+                <size>
+                 <width>0</width>
+                 <height>0</height>
+                </size>
+               </property>
+               <property name="text">
+                <string>Add</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pbRemoveSourceModels">
+               <property name="text">
+                <string>Remove</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pbClearSourcesModels">
+               <property name="text">
+                <string>Clear</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+        </item>
+        <item>
+         <widget class="QGroupBox" name="gbModels">
+          <property name="title">
+           <string>Options</string>
+          </property>
+          <layout class="QVBoxLayout" name="verticalLayout_26">
+           <item>
+            <layout class="QVBoxLayout" name="verticalLayout_27">
+             <item>
+              <layout class="QHBoxLayout" name="horizontalLayout_24">
+               <item>
+                <widget class="QCheckBox" name="cbCellShading">
+                 <property name="enabled">
+                  <bool>false</bool>
+                 </property>
+                 <property name="text">
+                  <string>Cell Shading</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QCheckBox" name="cbNormals">
+                 <property name="enabled">
+                  <bool>false</bool>
+                 </property>
+                 <property name="text">
+                  <string>Normals</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QCheckBox" name="cbWithAnimation">
+                 <property name="enabled">
+                  <bool>false</bool>
+                 </property>
+                 <property name="toolTip">
+                  <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Extract the model with a specific animation.  &lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;If none inputted (and checkbox is selected) it will search for one at ONCC&amp;gt;TRAC.&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;It's the name of a TRAM.oni file, don't include the extension.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+                 </property>
+                 <property name="text">
+                  <string>With Animation:</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QLineEdit" name="leAnimationName">
+                 <property name="enabled">
+                  <bool>false</bool>
+                 </property>
+                 <property name="toolTip">
+                  <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Extract the model with a specific animation.  &lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;If none inputted (and checkbox is selected) it will search for one at &lt;/span&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;ONCC&amp;gt;TRAC.&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;It's the name of a TRAM.oni file, don't include the extension.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+                 </property>
+                 <property name="placeholderText">
+                  <string>Animation name</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QCheckBox" name="cbTexture">
+                 <property name="enabled">
+                  <bool>false</bool>
+                 </property>
+                 <property name="toolTip">
+                  <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Give model a texture.&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;It's the name of a TXMP.oni file, don't include the extension.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+                 </property>
+                 <property name="text">
+                  <string>Texture:</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QLineEdit" name="leTextureName">
+                 <property name="enabled">
+                  <bool>false</bool>
+                 </property>
+                 <property name="toolTip">
+                  <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Give model a texture. &lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;It's the name of a TXMP.oni file, don't include the extension.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+                 </property>
+                 <property name="placeholderText">
+                  <string>Texture name</string>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+        </item>
+        <item>
+         <widget class="Line" name="line_9">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="pbConvertModels">
+          <property name="minimumSize">
+           <size>
+            <width>0</width>
+            <height>30</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Convert</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="tab">
+       <attribute name="title">
+        <string>Animations</string>
+       </attribute>
+       <layout class="QVBoxLayout" name="verticalLayout_2">
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_49">
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_63">
+            <item>
+             <widget class="QLabel" name="label_30">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="text">
+               <string>From</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="cbFromAnimations">
+              <item>
+               <property name="text">
+                <string>ONI</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>FILM DAT</string>
+               </property>
+              </item>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_64">
+            <item>
+             <widget class="QLabel" name="label_31">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="text">
+               <string>To</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="cbToAnimations">
+              <item>
+               <property name="text">
+                <string>DAE</string>
+               </property>
+              </item>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <widget class="QGroupBox" name="gbSourcesAnimations">
+          <property name="title">
+           <string>Sources</string>
+          </property>
+          <layout class="QHBoxLayout" name="horizontalLayout_48">
+           <item>
+            <widget class="DropTableWidget" name="twSourcesAnimations"/>
+           </item>
+           <item>
+            <layout class="QVBoxLayout" name="verticalLayout_62">
+             <item>
+              <widget class="QPushButton" name="pbAddSourceAnimations">
+               <property name="minimumSize">
+                <size>
+                 <width>0</width>
+                 <height>0</height>
+                </size>
+               </property>
+               <property name="text">
+                <string>Add</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pbRemoveSourceAnimations">
+               <property name="text">
+                <string>Remove</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pbClearSourcesAnimations">
+               <property name="text">
+                <string>Clear</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+        </item>
+        <item>
+         <widget class="QGroupBox" name="gbAnimations">
+          <property name="title">
+           <string>Options</string>
+          </property>
+          <layout class="QVBoxLayout" name="verticalLayout_60">
+           <item>
+            <layout class="QVBoxLayout" name="verticalLayout_61">
+             <item>
+              <layout class="QHBoxLayout" name="horizontalLayout_47">
+               <item>
+                <widget class="QCheckBox" name="cbCamera">
+                 <property name="enabled">
+                  <bool>true</bool>
+                 </property>
+                 <property name="text">
+                  <string>Camera</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QCheckBox" name="cbGeometry">
+                 <property name="enabled">
+                  <bool>true</bool>
+                 </property>
+                 <property name="toolTip">
+                  <string/>
+                 </property>
+                 <property name="text">
+                  <string>Geometry:</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QLineEdit" name="leGeometryName">
+                 <property name="enabled">
+                  <bool>false</bool>
+                 </property>
+                 <property name="toolTip">
+                  <string/>
+                 </property>
+                 <property name="placeholderText">
+                  <string>Geometry file path</string>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+        </item>
+        <item>
+         <widget class="Line" name="line_15">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="pbConvertAnimations">
+          <property name="minimumSize">
+           <size>
+            <width>0</width>
+            <height>30</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Convert</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="tabLevels">
+       <attribute name="title">
+        <string>Levels</string>
+       </attribute>
+       <layout class="QVBoxLayout" name="verticalLayout_31">
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_28">
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_32">
+            <item>
+             <widget class="QLabel" name="label_19">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="text">
+               <string>From</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="cbFromLevels">
+              <item>
+               <property name="text">
+                <string>ONI</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>DAE</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>MASTER XML</string>
+               </property>
+              </item>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_33">
+            <item>
+             <widget class="QLabel" name="label_20">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="text">
+               <string>To</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="cbToLevels">
+              <item>
+               <property name="text">
+                <string>DAE</string>
+               </property>
+              </item>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <widget class="QGroupBox" name="gbSourcesLevels">
+          <property name="title">
+           <string>Sources</string>
+          </property>
+          <layout class="QHBoxLayout" name="horizontalLayout_17">
+           <item>
+            <widget class="DropTableWidget" name="twSourcesLevels"/>
+           </item>
+           <item>
+            <layout class="QVBoxLayout" name="verticalLayout_16">
+             <item>
+              <widget class="QPushButton" name="pbAddSourceLevels">
+               <property name="minimumSize">
+                <size>
+                 <width>0</width>
+                 <height>0</height>
+                </size>
+               </property>
+               <property name="text">
+                <string>Add</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pbRemoveSourceLevels">
+               <property name="text">
+                <string>Remove</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pbClearSourcesLevels">
+               <property name="text">
+                <string>Clear</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+        </item>
+        <item>
+         <widget class="QGroupBox" name="gbLevels">
+          <property name="enabled">
+           <bool>true</bool>
+          </property>
+          <property name="title">
+           <string>Options</string>
+          </property>
+          <layout class="QVBoxLayout" name="verticalLayout_30">
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_27">
+             <item>
+              <widget class="QCheckBox" name="cbDatLevels">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+               <property name="minimumSize">
+                <size>
+                 <width>115</width>
+                 <height>0</height>
+                </size>
+               </property>
+               <property name="text">
+                <string>DAT Filename:</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QLineEdit" name="leTargetDatLevels">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+               <property name="placeholderText">
+                <string>Custom .dat level filename</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QCheckBox" name="cbBnvLevels">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+               <property name="text">
+                <string>Bnv Source:</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QLineEdit" name="leBnvLevels">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+               <property name="placeholderText">
+                <string>Bnv .dae source file</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_31">
+             <item>
+              <widget class="QCheckBox" name="cbAdditionalSourcesLevels">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+               <property name="text">
+                <string>Additional Sources:</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QLineEdit" name="leAdditSourcesLevels">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+               <property name="toolTip">
+                <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Use &amp;quot;space&amp;quot; as separator for each file&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+               </property>
+               <property name="placeholderText">
+                <string>Additional .dae sources for akev (e.g. env_markers.dae)</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QCheckBox" name="cbGridsLevels">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+               <property name="toolTip">
+                <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Generate pathfinding grids (master xml generates them automatically). Needs Bnv source.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+               </property>
+               <property name="text">
+                <string>Generate Grids</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+        </item>
+        <item>
+         <widget class="Line" name="line_10">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="pbConvertLevels">
+          <property name="minimumSize">
+           <size>
+            <width>0</width>
+            <height>30</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Convert</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="tabMisc">
+       <attribute name="title">
+        <string>Misc</string>
+       </attribute>
+       <layout class="QVBoxLayout" name="verticalLayout_34">
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_19">
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_20">
+            <item>
+             <widget class="QLabel" name="label_22">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="text">
+               <string>From</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="cbFromMisc">
+              <item>
+               <property name="text">
+                <string>DAT / ONI</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>WAV / AIF</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>TXT</string>
+               </property>
+              </item>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_21">
+            <item>
+             <widget class="QLabel" name="label_23">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="text">
+               <string>To</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QComboBox" name="cbToMisc">
+              <item>
+               <property name="text">
+                <string>WAV</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>AIF</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>TXT</string>
+               </property>
+              </item>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <widget class="QGroupBox" name="gbSourcesMisc">
+          <property name="title">
+           <string>Sources</string>
+          </property>
+          <layout class="QHBoxLayout" name="horizontalLayout_18">
+           <item>
+            <widget class="DropTableWidget" name="twSourcesMisc"/>
+           </item>
+           <item>
+            <layout class="QVBoxLayout" name="verticalLayout_22">
+             <item>
+              <widget class="QPushButton" name="pbAddSourceMisc">
+               <property name="minimumSize">
+                <size>
+                 <width>0</width>
+                 <height>0</height>
+                </size>
+               </property>
+               <property name="text">
+                <string>Add</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pbRemoveSourceMisc">
+               <property name="text">
+                <string>Remove</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pbClearSourcesMisc">
+               <property name="text">
+                <string>Clear</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+        </item>
+        <item>
+         <widget class="Line" name="line_7">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="pbConvertMisc">
+          <property name="minimumSize">
+           <size>
+            <width>0</width>
+            <height>30</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Convert</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QMenuBar" name="menuBar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>640</width>
+     <height>21</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuFile">
+    <property name="title">
+     <string>File</string>
+    </property>
+    <addaction name="actionPreferences"/>
+    <addaction name="separator"/>
+    <addaction name="actionExit"/>
+   </widget>
+   <widget class="QMenu" name="menuHelp">
+    <property name="title">
+     <string>Help</string>
+    </property>
+    <addaction name="actionCheck_OniSplit_version"/>
+    <addaction name="actionCheck_xmlTools_version"/>
+    <addaction name="actionCheck_For_Updates"/>
+    <addaction name="actionAbout"/>
+   </widget>
+   <widget class="QMenu" name="menuTarget_Plataform">
+    <property name="title">
+     <string>Target Plataform</string>
+    </property>
+    <addaction name="actionWindows"/>
+    <addaction name="actionMac_Windows_demo"/>
+   </widget>
+   <widget class="QMenu" name="menuOptions">
+    <property name="title">
+     <string>Options</string>
+    </property>
+    <widget class="QMenu" name="menuOutput_directly_to">
+     <property name="title">
+      <string>Output directly to:</string>
+     </property>
+     <addaction name="actionWorkspace"/>
+     <addaction name="actionOther"/>
+    </widget>
+    <addaction name="menuOutput_directly_to"/>
+    <addaction name="separator"/>
+    <addaction name="actionView_log"/>
+   </widget>
+   <widget class="QMenu" name="menuTools">
+    <property name="title">
+     <string>Tools</string>
+    </property>
+    <addaction name="actionAE_Package_Creator"/>
+    <addaction name="actionSound_Wizard"/>
+   </widget>
+   <addaction name="menuFile"/>
+   <addaction name="menuTarget_Plataform"/>
+   <addaction name="menuOptions"/>
+   <addaction name="menuTools"/>
+   <addaction name="menuHelp"/>
+  </widget>
+  <widget class="QToolBar" name="mainToolBar">
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+  </widget>
+  <widget class="QStatusBar" name="statusBar">
+   <property name="layoutDirection">
+    <enum>Qt::LeftToRight</enum>
+   </property>
+  </widget>
+  <action name="actionExit">
+   <property name="text">
+    <string>Exit</string>
+   </property>
+  </action>
+  <action name="actionAbout">
+   <property name="text">
+    <string>About</string>
+   </property>
+  </action>
+  <action name="actionCheck_For_Updates">
+   <property name="text">
+    <string>Check for Vago updates</string>
+   </property>
+  </action>
+  <action name="actionWindows">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="checked">
+    <bool>true</bool>
+   </property>
+   <property name="text">
+    <string>Windows</string>
+   </property>
+  </action>
+  <action name="actionMac_Windows_demo">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="text">
+    <string>Mac / Windows demo</string>
+   </property>
+  </action>
+  <action name="actionPreferences">
+   <property name="text">
+    <string>Preferences</string>
+   </property>
+  </action>
+  <action name="actionCheck_OniSplit_version">
+   <property name="text">
+    <string>Check OniSplit version</string>
+   </property>
+  </action>
+  <action name="actionClean_Workspace">
+   <property name="text">
+    <string>Clean Workspace</string>
+   </property>
+  </action>
+  <action name="actionWorkspace">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="checked">
+    <bool>true</bool>
+   </property>
+   <property name="text">
+    <string>Workspace</string>
+   </property>
+   <property name="toolTip">
+    <string>Workspace</string>
+   </property>
+  </action>
+  <action name="actionOther">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="text">
+    <string>Other...</string>
+   </property>
+   <property name="toolTip">
+    <string>Other</string>
+   </property>
+  </action>
+  <action name="actionView_log">
+   <property name="icon">
+    <iconset resource="resources.qrc">
+     <normaloff>:/new/icons/log.png</normaloff>:/new/icons/log.png</iconset>
+   </property>
+   <property name="text">
+    <string>View log file</string>
+   </property>
+  </action>
+  <action name="actionAE_Package_Creator">
+   <property name="icon">
+    <iconset resource="resources.qrc">
+     <normaloff>:/new/icons/package.png</normaloff>:/new/icons/package.png</iconset>
+   </property>
+   <property name="text">
+    <string>AEI Mod Package Wizard</string>
+   </property>
+  </action>
+  <action name="actionSound_Wizard">
+   <property name="icon">
+    <iconset resource="resources.qrc">
+     <normaloff>:/new/icons/sound.png</normaloff>:/new/icons/sound.png</iconset>
+   </property>
+   <property name="text">
+    <string>Sound Wizard</string>
+   </property>
+  </action>
+  <action name="actionCheck_xmlTools_version">
+   <property name="text">
+    <string>Check XmlTools version</string>
+   </property>
+  </action>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <customwidgets>
+  <customwidget>
+   <class>DropTableWidget</class>
+   <extends>QTableWidget</extends>
+   <header>droptablewidget.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources>
+  <include location="resources.qrc"/>
+ </resources>
+ <connections/>
+</ui>
Index: /Vago/trunk/Vago/manualcommands.cpp
===================================================================
--- /Vago/trunk/Vago/manualcommands.cpp	(revision 771)
+++ /Vago/trunk/Vago/manualcommands.cpp	(revision 771)
@@ -0,0 +1,161 @@
+#include "manualcommands.h"
+#include "ui_manualcommands.h"
+
+ManualCommands::ManualCommands(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::ManualCommands)
+{
+    ui->setupUi(this);
+    this->setAttribute(Qt::WA_DeleteOnClose,true); //destroy itself once finished.
+    this->myProcess = new QProcess();
+    this->myProcess->setProcessChannelMode(QProcess::MergedChannels);
+    ui->leManualCommand->installEventFilter(this);
+
+    this->nextInsertHistoryIdx=0;
+    this->searchHistoryIdx=0;
+    for(int i=0; i<this->limHistory; i++){
+        this->history[i]=""; //clean array
+    }
+}
+
+ManualCommands::~ManualCommands()
+{
+    delete myProcess;
+    delete ui;
+}
+
+void ManualCommands::on_pbInput_clicked()
+{
+    executeCommand();
+}
+
+void ManualCommands::executeCommand(){
+
+    QString command=ui->leManualCommand->text().trimmed();
+
+    if(command.isEmpty()){
+        Util::showErrorPopUp("Please input a command first.");
+        return;
+    }
+
+    //Only add to the history if the last command is different
+    bool different=false;
+    if(this->nextInsertHistoryIdx==0){ //at the limit
+        if(this->history[this->limHistory-1]!=command){
+            different=true;
+        }
+    }
+    else{
+        if(this->history[this->nextInsertHistoryIdx-1]!=command){
+            different=true;
+        }
+    }
+
+    if(different){
+        this->history[this->nextInsertHistoryIdx++]=command; //assign and increment
+
+        if(this->nextInsertHistoryIdx==this->limHistory){ //if we are at the limit begin override
+            this->nextInsertHistoryIdx=0;
+        }
+    }
+
+    this->myProcess->start(GlobalVars::OniSplitExeName+" "+ui->leManualCommand->text());
+    this->myProcess->waitForFinished(120000); //wait 2 minutes at maximum
+    ui->ptOutput->appendPlainText("> "+command);
+    ui->ptOutput->appendPlainText(this->myProcess->readAll());
+    ui->ptOutput->ensureCursorVisible();
+    ui->ptOutput->verticalScrollBar()->setValue( ui->ptOutput->verticalScrollBar()->maximum() );
+    ui->leManualCommand->clear();
+}
+
+void ManualCommands::on_pcCopyClipboard_clicked()
+{
+    QApplication::clipboard()->setText(ui->ptOutput->toPlainText());
+}
+
+void ManualCommands::on_pbClear_clicked()
+{
+    if(Util::showQuestionPopUp(this,"Clear the output?")){
+        ui->ptOutput->clear();
+    }
+}
+
+//Allows detecting arrows press for history without subclassing lineedit.
+bool ManualCommands::eventFilter(QObject* obj, QEvent *event)
+{
+    if (obj == ui->leManualCommand)
+    {
+        if (event->type() == QEvent::KeyPress)
+        {
+            QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
+            if (keyEvent->key() == Qt::Key_Up) //UP ARROW
+            {
+
+                int oldValue=this->searchHistoryIdx;
+
+                //if it isn't the first member of history continue decrementing
+                if(this->searchHistoryIdx!=this->nextInsertHistoryIdx){ //for when it didn't the round
+                    this->searchHistoryIdx--;
+                }
+
+                //start with the last elemented inputted
+                if(ui->leManualCommand->text().trimmed().isEmpty()){
+                    this->searchHistoryIdx=this->nextInsertHistoryIdx-1;
+                }
+
+                //rotate
+                if(this->searchHistoryIdx < 0){
+                    this->searchHistoryIdx=this->limHistory-1; //start from behind (49)
+                }
+                else if(this->searchHistoryIdx == this->limHistory){
+                    this->searchHistoryIdx=0; //start from 0 again
+                }
+
+                //not filled yet value? Stop.
+                if(this->history[this->searchHistoryIdx].isEmpty()){
+                    this->searchHistoryIdx=oldValue;
+                    return true;
+                }
+
+                ui->leManualCommand->setText(this->history[this->searchHistoryIdx]);
+
+                return true;
+
+            }
+            else if(keyEvent->key() == Qt::Key_Down) //DOWN ARROW
+            {
+                if(ui->leManualCommand->text().trimmed().isEmpty()){
+                    return true;
+                }
+
+                int oldValue=this->searchHistoryIdx;
+
+                //Continue incrementing if it isnt the last member of history
+                if(this->searchHistoryIdx!=this->nextInsertHistoryIdx-1 && //for when it didn't the round
+                        !(this->nextInsertHistoryIdx==0 && this->searchHistoryIdx==this->limHistory-1)){ //for when it did the round
+                    this->searchHistoryIdx++;
+                 }
+
+                //rotate
+                if(this->searchHistoryIdx < 0){
+                    this->searchHistoryIdx=this->limHistory-1; //start from behind (49)
+                }
+                else if(this->searchHistoryIdx == this->limHistory){
+                    this->searchHistoryIdx=0; //start from 0 again
+                }
+
+                //not filled yet value? Stop.
+                if(this->history[this->searchHistoryIdx].isEmpty()){
+                    this->searchHistoryIdx=oldValue;
+                    return true;
+                }
+
+                ui->leManualCommand->setText(this->history[this->searchHistoryIdx]);
+
+                return true;
+            }
+        }
+        return false;
+    }
+    return QMainWindow::eventFilter(obj, event);
+}
Index: /Vago/trunk/Vago/manualcommands.h
===================================================================
--- /Vago/trunk/Vago/manualcommands.h	(revision 771)
+++ /Vago/trunk/Vago/manualcommands.h	(revision 771)
@@ -0,0 +1,43 @@
+#ifndef MANUALCOMMANDS_H
+#define MANUALCOMMANDS_H
+
+#include <QMainWindow>
+#include <QClipboard>
+#include <QProcess>
+#include <QScrollBar>
+#include <util.h>
+
+
+namespace Ui {
+class ManualCommands;
+}
+
+class ManualCommands : public QMainWindow
+{
+    Q_OBJECT
+    
+public:
+    explicit ManualCommands(QWidget *parent = 0);
+    ~ManualCommands();
+
+protected:
+    bool eventFilter(QObject* obj, QEvent *event);
+    
+private slots:
+    void on_pbInput_clicked();
+
+    void on_pcCopyClipboard_clicked();
+
+    void on_pbClear_clicked();
+
+private:
+    void executeCommand();
+    Ui::ManualCommands *ui;
+    static const int limHistory=50;
+    QString history[limHistory]; //this is kinda a circular buffer manual implementation (http://www.boost.org/doc/libs/1_36_0/libs/circular_buffer/doc/circular_buffer.html)
+    int nextInsertHistoryIdx; //next index where new commands will be inserted
+    int searchHistoryIdx; //current index when searching history with arrows
+    QProcess *myProcess;
+};
+
+#endif // MANUALCOMMANDS_H
Index: /Vago/trunk/Vago/manualcommands.ui
===================================================================
--- /Vago/trunk/Vago/manualcommands.ui	(revision 771)
+++ /Vago/trunk/Vago/manualcommands.ui	(revision 771)
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ManualCommands</class>
+ <widget class="QMainWindow" name="ManualCommands">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>460</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Manual OniSplit Commands</string>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <layout class="QVBoxLayout" name="verticalLayout">
+    <item>
+     <widget class="QGroupBox" name="groupBox">
+      <property name="title">
+       <string>Input</string>
+      </property>
+      <layout class="QHBoxLayout" name="horizontalLayout_2">
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout">
+         <item>
+          <widget class="QLabel" name="label">
+           <property name="text">
+            <string>Command:</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="leManualCommand">
+           <property name="placeholderText">
+            <string>Input the command directly (up arrow for last inputted)</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="pbInput">
+           <property name="minimumSize">
+            <size>
+             <width>0</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>Input</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+    </item>
+    <item>
+     <widget class="QGroupBox" name="groupBox_2">
+      <property name="title">
+       <string>Output</string>
+      </property>
+      <layout class="QHBoxLayout" name="horizontalLayout_3">
+       <item>
+        <widget class="QPlainTextEdit" name="ptOutput">
+         <property name="readOnly">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </item>
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout_4">
+      <item>
+       <spacer name="horizontalSpacer">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QPushButton" name="pcCopyClipboard">
+        <property name="minimumSize">
+         <size>
+          <width>100</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>Copy to clipboard</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer_2">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeType">
+         <enum>QSizePolicy::Fixed</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>20</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QPushButton" name="pbClear">
+        <property name="minimumSize">
+         <size>
+          <width>100</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>Clear</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </item>
+   </layout>
+  </widget>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>leManualCommand</sender>
+   <signal>returnPressed()</signal>
+   <receiver>pbInput</receiver>
+   <slot>click()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>95</x>
+     <y>42</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>404</x>
+     <y>50</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
Index: /Vago/trunk/Vago/packageWizard/packagepage2.cpp
===================================================================
--- /Vago/trunk/Vago/packageWizard/packagepage2.cpp	(revision 771)
+++ /Vago/trunk/Vago/packageWizard/packagepage2.cpp	(revision 771)
@@ -0,0 +1,209 @@
+#include "packagepage2.h"
+#include "ui_packagepage2.h"
+
+const QString PackagePage2::ZipCacheFile = "jsoncache.zip";
+const QString PackagePage2::PackagesCacheUrl = "http://mods.oni2.net/jsoncache/"+ZipCacheFile;
+const QString PackagePage2::CacheFile = "nodes.json";
+
+PackagePage2::PackagePage2(Logger *myLogger, QWidget *parent) :
+    QWizardPage(parent),
+    ui(new Ui::PackagePage2)
+{
+    ui->setupUi(this);
+    this->myLogger=myLogger;
+    this->setTitle("Mandatory Fields");
+
+    //Register fields to be accessible in another pages //Not using mandatory field, it would require empty verification too...
+    registerField("leModName", ui->leModName);
+    registerField("leAuthors", ui->leAuthors);
+    registerField("leVersion", ui->leVersion);
+    registerField("ptDescription", ui->ptDescription,"plainText");
+    registerField("lePackageNumber", ui->lePackageNumber);
+    registerField("rbReplace", ui->rbReplace);
+}
+
+bool PackagePage2::validatePage(){
+    QString modName=ui->leModName->text();
+    QString authors=ui->leAuthors->text();
+    QString version=ui->leVersion->text();
+    QString description=ui->ptDescription->toPlainText();
+    QString number=ui->lePackageNumber->text();
+
+    bool emptyContent=Util::checkEmptySpaces(QStringList()<<modName<<authors<<version<<description<<number);
+
+
+    if(emptyContent){
+        Util::showErrorPopUp("You need to fill all fields first!");
+        return false;
+    }
+
+    if(number.size()!=5){
+        Util::showErrorPopUp("Invalid number format. It should contain 5 numbers.");
+        return false;
+    }
+
+    if(!Util::isStringInteger(number)){
+        Util::showErrorPopUp("Number is not numeric.");
+        return false;
+    }
+
+    return true;
+}
+
+PackagePage2::~PackagePage2()
+{
+    delete ui;
+}
+
+void PackagePage2::on_pbCheck_clicked()
+{
+    QString number = ui->lePackageNumber->text();
+
+    if(Util::checkEmptySpaces(QStringList(number))){
+        Util::showErrorPopUp("Number is empty. Please fill it first.");
+        return;
+    }
+
+    if(number.size()!=5){
+        Util::showErrorPopUp("Invalid number format. It should contain 5 numbers.");
+        return;
+    }
+
+    if(Util::isStringInteger(number)){
+
+        bool necessaryToRedownload=false;
+
+        QFile *file = new QFile(GlobalVars::VagoTemporaryDir+"/"+this->ZipCacheFile);
+
+        if(!file->exists()){
+            necessaryToRedownload=true; //File doesn't exist yet, necessary to download
+        }
+        else if (QDateTime::currentDateTime().toTime_t()-QFileInfo(*file).lastModified().toTime_t() > 150){ //checks between 2 minutes (give more 30 seconds due to zip extraction)
+            necessaryToRedownload=true; //File already exists but already expired (+2 mins without update)
+        }
+        delete file;
+
+        if(necessaryToRedownload){
+            //let's start the search in the web, so we make sure it doesn't exists yet
+            QNetworkAccessManager *manager = new QNetworkAccessManager(this);
+            connect(manager, SIGNAL(finished(QNetworkReply*)),
+                    this, SLOT(downloadPackagesCache(QNetworkReply*)));
+
+            //This timestamp is to guarantee that the cache received is fresh even through proxys
+            QDateTime currTime = QDateTime::currentDateTime();
+            QString t_time =  QString::number(currTime.toTime_t());
+
+            manager->get(QNetworkRequest(QUrl(this->PackagesCacheUrl+"?ts="+t_time)));
+        }
+        else{ //Not needed to download! :) Let's use our local cache.
+            checkForPackagesInCache();
+        }
+    }
+    else{
+        Util::showErrorPopUp("Number is not numeric.");
+    }
+}
+
+void PackagePage2::downloadPackagesCache(QNetworkReply *result){
+
+    if(result->error()==QNetworkReply::NoError){
+
+        QFile *file = new QFile(GlobalVars::VagoTemporaryDir+"/"+this->ZipCacheFile);
+
+        // Create temp folder if it doesn't exist
+        if(!QDir(GlobalVars::VagoTemporaryDir).exists()){
+            QDir().mkdir(GlobalVars::VagoTemporaryDir);
+        }
+
+        if(!file->open(QIODevice::WriteOnly)){
+            const QString error="Error fetching package data: creating cache file.";
+            this->myLogger->writeString(error);
+            Util::showErrorPopUp(error);
+            return;
+        }
+        file->write(result->readAll());
+        file->close();
+
+        //Let's extract the cache data
+        UnZip uz;
+        UnZip::ErrorCode ec = uz.openArchive(GlobalVars::VagoTemporaryDir+"/"+this->ZipCacheFile);
+        checkForUnzipError(ec);
+
+        //Extract the cache files
+        ec = uz.extractAll(GlobalVars::VagoTemporaryDir);
+        checkForUnzipError(ec);
+
+        //Close zip archive
+        uz.closeArchive();
+
+        delete file;
+
+        checkForPackagesInCache();
+
+    }
+    else{
+        const QString error="An error occurred checking number availability:\n\n"+result->errorString();
+        this->myLogger->writeString(error);
+        Util::showErrorLogPopUp(error);
+    }
+
+    result->deleteLater();
+}
+
+void PackagePage2::checkForPackagesInCache(){
+    QString packageNumber=ui->lePackageNumber->text();
+
+    QFile *file = new QFile(GlobalVars::VagoTemporaryDir+"/"+this->CacheFile); //let's read the chache unzipped
+    if(!file->open(QIODevice::ReadOnly)){
+        const QString error="Error reading downloaded package cache data.";
+        this->myLogger->writeString(error);
+        Util::showErrorPopUp(error);
+        return;
+    }
+    //Read file cache to ram
+    QString data=file->readAll();
+
+
+    //Let's play with json engine
+    QScriptEngine engine;
+    QScriptValue sc = engine.evaluate("(" + data + ")");
+
+    QScriptValue currNumber;
+    QString existingModName,existingModUrl;
+
+    QScriptValueIterator it(sc);
+
+    while (it.hasNext()) {
+        it.next();
+        currNumber=it.value().toObject().property("field_package_number").toObject().property("und").toObject().property("0").toObject().property("value");
+        if(currNumber.isValid() && currNumber.toString() == packageNumber){
+            existingModName = it.value().toObject().property("title").toString();
+            existingModUrl = it.value().toObject().property("path").toString();
+            break;
+        }
+    }
+
+    if(!existingModName.isEmpty()){
+        Util::showRichErrorPopUp("Package "+packageNumber+" is already being used by the following mod:<br/><br/>"+
+                                 existingModName+"<br/><br/>"+
+                                 "More information <a href='"+existingModUrl+"'>here</a>.");
+    }
+    else{
+        Util::showPopUp("Package "+packageNumber+" seems it's not being used yet! :)");
+    }
+
+    delete file;
+}
+
+void PackagePage2::on_cbType_currentIndexChanged(int index)
+{
+    ui->lePackageNumber->setText(QString().setNum(index+1)+"000X");
+}
+
+void PackagePage2::checkForUnzipError(UnZip::ErrorCode ec){
+    if (ec != UnZip::Ok){
+        const QString error="Error found while unzipping the package data. Error number = "+QString::number(ec);
+        Util::showErrorPopUp(error);
+        this->myLogger->writeString(error);
+    }
+}
Index: /Vago/trunk/Vago/packageWizard/packagepage2.h
===================================================================
--- /Vago/trunk/Vago/packageWizard/packagepage2.h	(revision 771)
+++ /Vago/trunk/Vago/packageWizard/packagepage2.h	(revision 771)
@@ -0,0 +1,44 @@
+#ifndef PACKAGEPAGE2_H
+#define PACKAGEPAGE2_H
+
+#include "util.h"
+#include "logger.h"
+#include "unzip.h"
+#include <QWizardPage>
+#include <QtNetwork/QNetworkAccessManager>
+#include <QtNetwork/QNetworkRequest>
+#include <QtNetwork/QNetworkReply>
+#include <QScriptEngine>
+#include <QScriptValueIterator>
+
+namespace Ui {
+class PackagePage2;
+}
+
+class PackagePage2 : public QWizardPage
+{
+    Q_OBJECT
+    
+public:
+    explicit PackagePage2(Logger *myLogger, QWidget *parent = 0);
+
+    ~PackagePage2();
+    
+private slots:
+    void on_pbCheck_clicked();
+    void downloadPackagesCache(QNetworkReply *result);
+
+    void on_cbType_currentIndexChanged(int index);
+    bool validatePage();
+
+private:
+    Ui::PackagePage2 *ui;
+    Logger *myLogger;
+    static const QString ZipCacheFile;
+    static const QString CacheFile;
+    static const QString PackagesCacheUrl;
+    void checkForUnzipError(UnZip::ErrorCode ec);
+    void checkForPackagesInCache();
+};
+
+#endif // PACKAGEPAGE2_H
Index: /Vago/trunk/Vago/packageWizard/packagepage2.ui
===================================================================
--- /Vago/trunk/Vago/packageWizard/packagepage2.ui	(revision 771)
+++ /Vago/trunk/Vago/packageWizard/packagepage2.ui	(revision 771)
@@ -0,0 +1,336 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PackagePage2</class>
+ <widget class="QWizardPage" name="PackagePage2">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>353</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle">
+   <string>WizardPage</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QLabel" name="label">
+       <property name="minimumSize">
+        <size>
+         <width>84</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>Mod Name:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="leModName"/>
+     </item>
+     <item>
+      <widget class="QLabel" name="label_8">
+       <property name="text">
+        <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; color:#0000ff;&quot;&gt;*&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_2">
+     <item>
+      <widget class="QLabel" name="label_2">
+       <property name="minimumSize">
+        <size>
+         <width>84</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>Author(s):</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="leAuthors"/>
+     </item>
+     <item>
+      <widget class="QLabel" name="label_10">
+       <property name="text">
+        <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; color:#0000ff;&quot;&gt;*&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_3">
+     <item>
+      <widget class="QLabel" name="label_3">
+       <property name="minimumSize">
+        <size>
+         <width>84</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>Version:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="leVersion"/>
+     </item>
+     <item>
+      <widget class="QLabel" name="label_9">
+       <property name="text">
+        <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; color:#0000ff;&quot;&gt;*&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_7">
+     <item>
+      <widget class="QLabel" name="label_4">
+       <property name="minimumSize">
+        <size>
+         <width>84</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>Description:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPlainTextEdit" name="ptDescription">
+       <property name="maximumSize">
+        <size>
+         <width>16777215</width>
+         <height>100</height>
+        </size>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLabel" name="label_11">
+       <property name="text">
+        <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; color:#0000ff;&quot;&gt;*&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_4">
+     <item>
+      <widget class="QLabel" name="label_5">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>84</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>Type:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QComboBox" name="cbType">
+       <item>
+        <property name="text">
+         <string>Weapons</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>Characters</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>Particles</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>Animations (non-combat)</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>Animations (combat)</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>Sounds</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>User Interface</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>New Levels</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>Scenarios</string>
+        </property>
+       </item>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_5">
+     <item>
+      <widget class="QLabel" name="label_6">
+       <property name="text">
+        <string>Package Number:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="lePackageNumber"/>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pbCheck">
+       <property name="toolTip">
+        <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Check if the current number is available using a online database&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+       <property name="text">
+        <string>Check</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_6">
+     <item>
+      <widget class="QLabel" name="label_7">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>84</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>Scripts:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QRadioButton" name="rbReplace">
+       <property name="toolTip">
+        <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;The Installer considers your mod a scenario and takes steps to exclude other BSL scenario mods from being installed for the same level&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+       <property name="text">
+        <string>Replace</string>
+       </property>
+       <property name="checked">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QRadioButton" name="rbAdd">
+       <property name="toolTip">
+        <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;The Installer allows your mod to be installed to any level without restriction (allows multiple BSLs from different mods to co-exist in the same level)&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+       <property name="text">
+        <string>Add</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item>
+    <widget class="QLabel" name="label_12">
+     <property name="text">
+      <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; color:#0000ff;&quot;&gt;* Fields read &lt;/span&gt;&lt;span style=&quot; font-size:8pt; color:#0000ff;&quot;&gt;only&lt;/span&gt;&lt;span style=&quot; font-size:8pt; color:#0000ff;&quot;&gt; by AEI2 when the package isn't at the mod depot.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Index: /Vago/trunk/Vago/packageWizard/packagepage3.cpp
===================================================================
--- /Vago/trunk/Vago/packageWizard/packagepage3.cpp	(revision 771)
+++ /Vago/trunk/Vago/packageWizard/packagepage3.cpp	(revision 771)
@@ -0,0 +1,64 @@
+#include "packagepage3.h"
+#include "ui_packagepage3.h"
+
+PackagePage3::PackagePage3(QWidget *parent) :
+    QWizardPage(parent),
+    ui(new Ui::PackagePage3)
+{
+    ui->setupUi(this);
+    this->setTitle("Optional Fields");
+    this->setSubTitle("Separate multiple elements by commas.");
+
+    //Register fields
+    registerField("leDependentPackages", ui->leDependent);
+    registerField("leIncompatiblePackages", ui->leIncompatible);
+    registerField("leUnlockLevels", ui->leUnlockLevels);
+}
+
+bool PackagePage3::validatePage(){
+    QString dependentPackages=ui->leDependent->text().trimmed();
+    QString incompatiblePackages=ui->leIncompatible->text().trimmed();
+    QString unlockLevels=ui->leUnlockLevels->text().trimmed();
+
+    if(!validateField(dependentPackages) || !validateField(incompatiblePackages)
+            || !validateField(unlockLevels,true)){
+        return false;
+    }
+
+    return true;
+}
+
+bool PackagePage3::validateField(QString &field, bool isLevels){
+    //Check if the numbers are correct and correctly separated
+    if(!field.isEmpty()){
+
+        QStringList list =Util::substring(field,",");
+
+        for(int i=0; i<list.size(); i++){
+
+            if(list.at(i).isEmpty()){
+                Util::showErrorPopUp("There are commas without numbers in their sides.");
+                return false;
+            }
+
+            if(!Util::isStringInteger(list.at(i))){
+                Util::showErrorPopUp("Number is not numeric.");
+                return false;
+            }
+
+            if(!isLevels){
+                if(list.at(i).size()!=5){
+                    Util::showErrorPopUp("You have invalid packages numbers. Each number must have 5 digits.");
+                    return false;
+                }
+            }
+        }
+    }
+
+    return true;
+}
+
+PackagePage3::~PackagePage3()
+{
+    delete ui;
+}
Index: /Vago/trunk/Vago/packageWizard/packagepage3.h
===================================================================
--- /Vago/trunk/Vago/packageWizard/packagepage3.h	(revision 771)
+++ /Vago/trunk/Vago/packageWizard/packagepage3.h	(revision 771)
@@ -0,0 +1,25 @@
+#ifndef PACKAGEPAGE3_H
+#define PACKAGEPAGE3_H
+
+#include <QWizardPage>
+#include "util.h"
+
+namespace Ui {
+class PackagePage3;
+}
+
+class PackagePage3 : public QWizardPage
+{
+    Q_OBJECT
+    
+public:
+    explicit PackagePage3(QWidget *parent = 0);
+    ~PackagePage3();
+    
+private:
+    Ui::PackagePage3 *ui;
+    bool validateField(QString &field, bool isLevels=false);
+    bool validatePage();
+};
+
+#endif // PACKAGEPAGE3_H
Index: /Vago/trunk/Vago/packageWizard/packagepage3.ui
===================================================================
--- /Vago/trunk/Vago/packageWizard/packagepage3.ui	(revision 771)
+++ /Vago/trunk/Vago/packageWizard/packagepage3.ui	(revision 771)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PackagePage3</class>
+ <widget class="QWizardPage" name="PackagePage3">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>364</width>
+    <height>290</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>WizardPage</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_2">
+     <item>
+      <widget class="QLabel" name="label">
+       <property name="minimumSize">
+        <size>
+         <width>113</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="toolTip">
+        <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Fill with the packages number which this package will depend&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+       <property name="text">
+        <string>Dependent Packages:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="leDependent">
+       <property name="toolTip">
+        <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Fill with the packages number which this package will depend&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QLabel" name="label_2">
+       <property name="toolTip">
+        <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Fill with the packages number that will conflict with this package&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+       <property name="text">
+        <string>Incompatible Packages:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="leIncompatible">
+       <property name="toolTip">
+        <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Fill with the packages number that will conflict with this package&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_3">
+     <item>
+      <widget class="QLabel" name="label_3">
+       <property name="minimumSize">
+        <size>
+         <width>113</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="toolTip">
+        <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;If this package use new levels, specify its number to get them unlocked automatically&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+       <property name="text">
+        <string>Unlock Levels:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="leUnlockLevels">
+       <property name="toolTip">
+        <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;If this package use new levels, specify its number to get them unlocked automatically&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Index: /Vago/trunk/Vago/packageWizard/packagepage4.cpp
===================================================================
--- /Vago/trunk/Vago/packageWizard/packagepage4.cpp	(revision 771)
+++ /Vago/trunk/Vago/packageWizard/packagepage4.cpp	(revision 771)
@@ -0,0 +1,167 @@
+#include "packagepage4.h"
+#include "ui_packagepage4.h"
+
+PackagePage4::PackagePage4(QWidget *parent) :
+    QWizardPage(parent),
+    ui(new Ui::PackagePage4)
+{
+    ui->setupUi(this);
+    this->setTitle("Package Files");
+    this->setSubTitle("Add here the resources to the correspondent plataform for your package.");
+
+    commonTable=ui->twCommon;
+    windowsTable=ui->twWindows;
+    macTable=ui->twMac;
+
+    //Setup package resources tables
+    QStringList headers = QStringList()<<"Folder"<<"Type"<<"Full Path";
+    ui->twCommon->setHorizontalHeaderLabels(headers);
+    ui->twCommon->setColumnWidth(1,75); //set size for type
+    ui->twWindows->setHorizontalHeaderLabels(headers);
+    ui->twWindows->setColumnWidth(1,75);
+    ui->twMac->setHorizontalHeaderLabels(headers);
+    ui->twMac->setColumnWidth(1,75);
+    //
+
+    //Set +- tooltips
+    on_pbSwitchFiles_clicked();
+
+    ui->tbCommonMinus->setToolTip("Remove the selected common OS folders");
+    ui->tbWindowsMinus->setToolTip("Remove the selected Windows OS folders");
+    ui->tbMacMinus->setToolTip("Remove the selected Mac OS folders");
+
+    connectSlots();
+}
+
+PackagePage4::~PackagePage4()
+{
+    delete ui;
+}
+
+void PackagePage4::on_pbSwitchFiles_clicked()
+{
+    if(ui->pbSwitchFiles->text()==".oni files"){
+        ui->pbSwitchFiles->setText(".bsl files");
+        ui->pbSwitchFiles->setToolTip("Click to add folders with .oni-patch files instead");
+    }
+    else if(ui->pbSwitchFiles->text()==".bsl files"){
+        ui->pbSwitchFiles->setText(".oni-patch files");
+        ui->pbSwitchFiles->setToolTip("Click to add folders with .oni files instead");
+    }
+    else{
+        ui->pbSwitchFiles->setText(".oni files");
+        ui->pbSwitchFiles->setToolTip("Click to add folders with .bsl files files instead");
+    }
+
+    ui->tbCommonPlus->setToolTip("Add common OS folders with "+ui->pbSwitchFiles->text());
+    ui->tbWindowsPlus->setToolTip("Add Windows OS folders with "+ui->pbSwitchFiles->text());
+    ui->tbMacPlus->setToolTip("Add Mac OS folders with "+ui->pbSwitchFiles->text());
+}
+
+
+void PackagePage4::addResourcesPackage(DropTableWidget *myTable, QStringList resources){
+
+    //Pre-processing (check if received only folders)
+    foreach(QString myFile, resources){
+        if(!QDir(myFile).exists()){
+            Util::showErrorPopUp("Only folders are allowed for this operation.");
+            return;
+        }
+    }
+
+    QString type=ui->pbSwitchFiles->text().replace(" files","");
+
+    foreach(QString currentFolder, resources){
+
+        currentFolder=Util::normalizePath(currentFolder); //normalize path
+
+        //Get actual number rows
+        int twSize=myTable->rowCount();
+
+        //increase the rows for the new item
+        myTable->setRowCount(twSize+1);
+
+        //Add to table and list to
+        QTableWidgetItem *newFolder = new QTableWidgetItem(Util::cutName(currentFolder));
+        QTableWidgetItem *newType = new QTableWidgetItem(type);
+        QTableWidgetItem *newFullPath = new QTableWidgetItem(currentFolder);
+
+        myTable->setItem(twSize,0,newFolder);
+        myTable->setItem(twSize,1,newType);
+        myTable->setItem(twSize,2,newFullPath);
+        myTable->updateTableToolTips(twSize); //Update tool tips
+    }
+}
+
+void PackagePage4::connectSlots(){
+    //Drop signal for Packages table
+    connect(ui->twCommon, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addResourcesPackage(DropTableWidget*,QStringList)));
+    connect(ui->twWindows, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addResourcesPackage(DropTableWidget*,QStringList)));
+    connect(ui->twMac, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addResourcesPackage(DropTableWidget*,QStringList)));
+}
+
+void PackagePage4::on_tbCommonPlus_clicked()
+{
+   addTableContents(ui->twCommon);
+}
+
+void PackagePage4::on_tbCommonMinus_clicked()
+{
+    removeTableContents(ui->twCommon);
+}
+
+void PackagePage4::on_tbWindowsPlus_clicked()
+{
+     addTableContents(ui->twWindows);
+}
+
+void PackagePage4::on_tbWindowsMinus_clicked()
+{
+    removeTableContents(ui->twWindows);
+}
+
+void PackagePage4::on_tbMacPlus_clicked()
+{
+    addTableContents(ui->twMac);
+}
+
+void PackagePage4::on_tbMacMinus_clicked()
+{
+    removeTableContents(ui->twMac);
+}
+
+void PackagePage4::addTableContents(DropTableWidget *myTable){
+    if(ui->pbSwitchFiles->text()==".oni files"){
+        addResourcesPackage(myTable,Util::multipleDirDialog("Choose folders with .oni files..."));
+    }
+    else if(ui->pbSwitchFiles->text()==".bsl files"){
+        addResourcesPackage(myTable,Util::multipleDirDialog("Choose folders with .bsl files..."));
+    }
+    else{
+        addResourcesPackage(myTable,Util::multipleDirDialog("Choose folders with .oni-patch files..."));
+    }
+}
+
+void PackagePage4::removeTableContents(DropTableWidget *myTable){
+    int size = myTable->selectionModel()->selectedRows().size();
+
+    if(size==0){
+        Util::showPopUp("Select a row first.");
+        return;
+    }
+
+    if(Util::showQuestionPopUp(this,"Are you sure you want to delete the selected rows?")){
+        for(int i=0; i<size; i++){
+            myTable->removeRow(myTable->selectionModel()->selectedRows().at(size-i-1).row());
+        }
+    }
+}
+
+bool PackagePage4::validatePage(){
+    if(ui->twCommon->rowCount()==0 && ui->twWindows->rowCount()==0 && ui->twMac->rowCount()==0){
+        Util::showErrorPopUp("You need to add some folders with resources first!");
+        return false;
+    }
+
+    return true;
+}
Index: /Vago/trunk/Vago/packageWizard/packagepage4.h
===================================================================
--- /Vago/trunk/Vago/packageWizard/packagepage4.h	(revision 771)
+++ /Vago/trunk/Vago/packageWizard/packagepage4.h	(revision 771)
@@ -0,0 +1,47 @@
+#ifndef PACKAGEPAGE4_H
+#define PACKAGEPAGE4_H
+
+#include <QWizardPage>
+
+#include "droptablewidget.h"
+
+namespace Ui {
+class PackagePage4;
+}
+
+class PackagePage4 : public QWizardPage
+{
+    Q_OBJECT
+    
+public:
+    const DropTableWidget *commonTable;
+    const DropTableWidget *windowsTable;
+    const DropTableWidget *macTable;
+    explicit PackagePage4(QWidget *parent = 0);
+    ~PackagePage4();
+
+private slots:
+    void on_pbSwitchFiles_clicked();
+    void addResourcesPackage(DropTableWidget *myTable, QStringList resources); //for packages drop
+
+    void on_tbCommonPlus_clicked();
+
+    void on_tbCommonMinus_clicked();
+
+    void on_tbWindowsPlus_clicked();
+
+    void on_tbWindowsMinus_clicked();
+
+    void on_tbMacPlus_clicked();
+
+    void on_tbMacMinus_clicked();
+
+private:
+    Ui::PackagePage4 *ui;
+    void connectSlots();
+    void addTableContents(DropTableWidget *myTable);
+    void removeTableContents(DropTableWidget *myTable);
+    bool validatePage();
+};
+
+#endif // PACKAGEPAGE4_H
Index: /Vago/trunk/Vago/packageWizard/packagepage4.ui
===================================================================
--- /Vago/trunk/Vago/packageWizard/packagepage4.ui	(revision 771)
+++ /Vago/trunk/Vago/packageWizard/packagepage4.ui	(revision 771)
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PackagePage4</class>
+ <widget class="QWizardPage" name="PackagePage4">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>408</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>WizardPage</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_7">
+   <item>
+    <layout class="QVBoxLayout" name="verticalLayout_2">
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_5">
+       <item>
+        <widget class="QLabel" name="label">
+         <property name="minimumSize">
+          <size>
+           <width>250</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Common&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pbSwitchFiles">
+         <property name="toolTip">
+          <string>Click to add folders with .bsl files instead</string>
+         </property>
+         <property name="text">
+          <string>patch files</string>
+         </property>
+         <property name="icon">
+          <iconset resource="../resources.qrc">
+           <normaloff>:/new/icons/switch.png</normaloff>:/new/icons/switch.png</iconset>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout">
+       <item>
+        <widget class="DropTableWidget" name="twCommon"/>
+       </item>
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout">
+         <item>
+          <widget class="QToolButton" name="tbCommonPlus">
+           <property name="text">
+            <string>...</string>
+           </property>
+           <property name="icon">
+            <iconset resource="../resources.qrc">
+             <normaloff>:/new/icons/plus.png</normaloff>:/new/icons/plus.png</iconset>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="tbCommonMinus">
+           <property name="text">
+            <string>...</string>
+           </property>
+           <property name="icon">
+            <iconset resource="../resources.qrc">
+             <normaloff>:/new/icons/minus.png</normaloff>:/new/icons/minus.png</iconset>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_4">
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout_3">
+       <item>
+        <widget class="QLabel" name="label_2">
+         <property name="text">
+          <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Windows Only&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
+         <item>
+          <widget class="DropTableWidget" name="twWindows"/>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_4">
+           <item>
+            <widget class="QToolButton" name="tbWindowsPlus">
+             <property name="text">
+              <string>...</string>
+             </property>
+             <property name="icon">
+              <iconset resource="../resources.qrc">
+               <normaloff>:/new/icons/plus.png</normaloff>:/new/icons/plus.png</iconset>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QToolButton" name="tbWindowsMinus">
+             <property name="text">
+              <string>...</string>
+             </property>
+             <property name="icon">
+              <iconset resource="../resources.qrc">
+               <normaloff>:/new/icons/minus.png</normaloff>:/new/icons/minus.png</iconset>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout_5">
+       <item>
+        <widget class="QLabel" name="label_3">
+         <property name="text">
+          <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Mac OS Only&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_3">
+         <item>
+          <widget class="DropTableWidget" name="twMac"/>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_6">
+           <item>
+            <widget class="QToolButton" name="tbMacPlus">
+             <property name="text">
+              <string>...</string>
+             </property>
+             <property name="icon">
+              <iconset resource="../resources.qrc">
+               <normaloff>:/new/icons/plus.png</normaloff>:/new/icons/plus.png</iconset>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QToolButton" name="tbMacMinus">
+             <property name="text">
+              <string>...</string>
+             </property>
+             <property name="icon">
+              <iconset resource="../resources.qrc">
+               <normaloff>:/new/icons/minus.png</normaloff>:/new/icons/minus.png</iconset>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>DropTableWidget</class>
+   <extends>QTableWidget</extends>
+   <header>droptablewidget.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources>
+  <include location="../resources.qrc"/>
+ </resources>
+ <connections/>
+</ui>
Index: /Vago/trunk/Vago/packageWizard/packagepagefinal.cpp
===================================================================
--- /Vago/trunk/Vago/packageWizard/packagepagefinal.cpp	(revision 771)
+++ /Vago/trunk/Vago/packageWizard/packagepagefinal.cpp	(revision 771)
@@ -0,0 +1,34 @@
+#include "packagepagefinal.h"
+#include "ui_packagepagefinal.h"
+
+PackagePageFinal::PackagePageFinal(QSettings *vagoSettings, QWidget *parent) :
+    QWizardPage(parent),
+    ui(new Ui::PackagePageFinal)
+{
+    ui->setupUi(this);
+    this->setTitle("Finished");
+
+    //Use the global var for the depot domain so it's easier to change in the code if the domain changes
+    ui->lbComplete->setText(ui->lbComplete->text().replace("mods.oni2.net",GlobalVars::ModsDomain));
+
+    ui->lbComplete->setOpenExternalLinks(true); //allow navigate to mod depot
+
+    //Default checkboxes values
+    if(!vagoSettings->contains("PackageCreator/OpenFolder")){
+        vagoSettings->setValue("PackageCreator/OpenFolder", true);
+    }
+    if(!vagoSettings->contains("PackageCreator/CreateZip")){
+        vagoSettings->setValue("PackageCreator/CreateZip",true);
+    }
+
+    //remember them next time
+    ui->cbOpenFolder->setChecked(vagoSettings->value("PackageCreator/OpenFolder").toBool());
+    ui->cbCreateZip->setChecked(vagoSettings->value("PackageCreator/CreateZip").toBool());
+    registerField("cbOpenFolder", ui->cbOpenFolder);
+    registerField("cbCreateZip", ui->cbCreateZip);
+}
+
+PackagePageFinal::~PackagePageFinal()
+{
+    delete ui;
+}
Index: /Vago/trunk/Vago/packageWizard/packagepagefinal.h
===================================================================
--- /Vago/trunk/Vago/packageWizard/packagepagefinal.h	(revision 771)
+++ /Vago/trunk/Vago/packageWizard/packagepagefinal.h	(revision 771)
@@ -0,0 +1,26 @@
+#ifndef PACKAGEPAGEFINAL_H
+#define PACKAGEPAGEFINAL_H
+
+#include "util.h"
+#include "logger.h"
+
+#include <QWizardPage>
+#include <QSettings>
+
+namespace Ui {
+class PackagePageFinal;
+}
+
+class PackagePageFinal : public QWizardPage
+{
+    Q_OBJECT
+    
+public:
+    explicit PackagePageFinal(QSettings *vagoSettings, QWidget *parent=0);
+    ~PackagePageFinal();
+    
+private:
+    Ui::PackagePageFinal *ui;
+};
+
+#endif // PACKAGEPAGEFINAL_H
Index: /Vago/trunk/Vago/packageWizard/packagepagefinal.ui
===================================================================
--- /Vago/trunk/Vago/packageWizard/packagepagefinal.ui	(revision 771)
+++ /Vago/trunk/Vago/packageWizard/packagepagefinal.ui	(revision 771)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PackagePageFinal</class>
+ <widget class="QWizardPage" name="PackagePageFinal">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>WizardPage</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QLabel" name="lbComplete">
+     <property name="text">
+      <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;The wizard is now complete. The package will be created when you click in finish.&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;After that you can upload the package to &lt;/span&gt;&lt;a href=&quot;www.mods.oni2.net&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;mods.oni2.net&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt; to get your mod listed in the AEI.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>30</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>After the package creation</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_2">
+      <item>
+       <widget class="QCheckBox" name="cbOpenFolder">
+        <property name="text">
+         <string>Open the folder automatically where the package resides</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="cbCreateZip">
+        <property name="text">
+         <string>Automatically create a zip archive for the package</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Index: /Vago/trunk/Vago/packageWizard/packagewizard.cpp
===================================================================
--- /Vago/trunk/Vago/packageWizard/packagewizard.cpp	(revision 771)
+++ /Vago/trunk/Vago/packageWizard/packagewizard.cpp	(revision 771)
@@ -0,0 +1,220 @@
+#include "packagewizard.h"
+
+PackageWizard::PackageWizard(QString workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger)
+{
+    this->workspaceWizardLocation=workspaceWizardLocation;
+    this->vagoSettings=vagoSettings;
+    this->myLogger=myLogger;
+    this->packagesLocation=this->workspaceWizardLocation+"/Packages";
+}
+
+int PackageWizard::exec(){
+    QWizard myWizard;
+
+    myWizard.setWindowIcon(QIcon(":/new/icons/package.png"));
+
+    //Center and resize QWizard (http://www.thedazzlersinc.com/source/2012/06/04/qt-center-window-in-screen/)
+    myWizard.resize(640,480);
+    QRect position = myWizard.frameGeometry();
+    position.moveCenter(QDesktopWidget().availableGeometry().center());
+    myWizard.move(position.topLeft());
+    //
+
+    PackagePage2 *page2 = new PackagePage2(this->myLogger);
+    PackagePage3 *page3 = new PackagePage3();
+    PackagePage4 *page4 = new PackagePage4();
+    PackagePageFinal *pageFinal = new PackagePageFinal(this->vagoSettings);
+
+    myWizard.addPage(createIntroPage());
+    myWizard.addPage(page2);
+    myWizard.addPage(page3);
+    myWizard.addPage(page4);
+    myWizard.addPage(pageFinal);
+
+    myWizard.setWindowTitle("AIE2 Package Creator");
+
+    //If wizard finished with sucess
+    if(myWizard.exec()){ //modal and wait for finalization
+        createPackage(myWizard, page4);
+    }
+
+    return 0;
+}
+
+QWizardPage* PackageWizard::createIntroPage() {
+    QWizardPage *page = new QWizardPage;
+    page->setTitle("Introduction");
+
+    QLabel *label = new QLabel("Welcome to the Anniversary Edition Installer 2 (AIE2) package"
+                               " creator wizard.\n"
+                               "This wizard will allow you to create in a few and simple steps a package for AIE2.");
+    label->setWordWrap(true);
+
+    QVBoxLayout *layout = new QVBoxLayout;
+    layout->addWidget(label);
+    page->setLayout(layout);
+
+    return page;
+}
+
+void PackageWizard::createPackage(const QWizard &myWizard, PackagePage4 *page4){
+    const QString aeVersion="2.0";
+
+    //Get info page 2
+    QString modName=myWizard.field("leModName").toString();
+    QString authors=myWizard.field("leAuthors").toString();
+    QString version=myWizard.field("leVersion").toString();
+    QString description=myWizard.field("ptDescription").toString();
+    QString packageNumber=myWizard.field("lePackageNumber").toString();
+    bool bslReplace=myWizard.field("rbReplace").toBool();
+
+    //Get info page 3
+    QString dependentPackages=myWizard.field("leDependentPackages").toString();
+    QString incompatiblePackages=myWizard.field("leIncompatiblePackages").toString();
+    QString unlockLevels=myWizard.field("leUnlockLevels").toString();
+
+    //Get info page 4
+    const DropTableWidget *commonTable=page4->commonTable;
+    const DropTableWidget *windowsTable=page4->windowsTable;
+    const DropTableWidget *macTable=page4->macTable;
+
+    //Get info from final page
+    bool openFolder=myWizard.field("cbOpenFolder").toBool();
+    bool createZip=myWizard.field("cbCreateZip").toBool();
+    //Remember the final page choices to next time
+    this->vagoSettings->setValue("PackageCreator/OpenFolder",openFolder);
+    this->vagoSettings->setValue("PackageCreator/CreateZip",createZip);
+
+    const QString packageName=packageNumber+Util::fullTrim(modName);
+
+    // Start package creation...
+
+    // Create Packages folder if it doesn't exist
+    if(!QDir(this->packagesLocation).exists()){
+        QDir().mkpath(this->packagesLocation);
+    }
+
+    QString modDir=this->packagesLocation+"/"+packageName+"/";
+
+    QDir().mkdir(modDir);
+
+    bool bslExist=false;
+
+    if(commonTable->rowCount()>0){
+        copyPackageFolders(commonTable,"common",modDir,bslExist);
+    }
+
+    if(windowsTable->rowCount()>0){
+        copyPackageFolders(windowsTable,"win_only",modDir,bslExist);
+    }
+
+    if(macTable->rowCount()>0){
+        copyPackageFolders(macTable,"mac_only",modDir,bslExist);
+    }
+
+    QFile *modInfo = new QFile(modDir+"Mod_Info.cfg");
+
+    if (!modInfo->open(QIODevice::WriteOnly | QIODevice::Text)){ //open to write
+        Util::showErrorPopUp("Couldn't' create Mod_Info.cfg file.");
+        myLogger->writeString("Couldn't' create Mod_Info.cfg file when creating AE Package.");
+        return;
+    }
+
+    QTextStream *modWriteStream = new QTextStream (modInfo);
+    *modWriteStream << "AEInstallVersion -> "+aeVersion+"\n";
+    *modWriteStream << "NameOfMod -> "+modName+"\n";
+    *modWriteStream << "ModVersion -> "+version+"\n";
+    *modWriteStream << "Creator -> "+authors+"\n";
+    *modWriteStream << "Readme -> "+description.replace("\n"," \\n ")+"\n";
+    if(!incompatiblePackages.isEmpty()){
+        *modWriteStream << "IncompatibleWith -> "+incompatiblePackages+"\n";
+    }
+    if(!dependentPackages.isEmpty()){
+        *modWriteStream << "DependsOn -> "+dependentPackages+"\n";
+    }
+
+    if(bslExist){
+        if(bslReplace){
+            *modWriteStream << "HasBsl -> Yes\n";
+        }
+        else{
+            *modWriteStream << "HasBsl -> Addon\n";
+        }
+    }
+
+    if(!unlockLevels.isEmpty()){
+        *modWriteStream << "UnlockLevel -> "+unlockLevels+"\n";
+    }
+
+    *modWriteStream << "Vago -> "+GlobalVars::AppVersion;
+
+    delete modWriteStream; //it auto closes the files/streams
+    delete modInfo;
+
+    //Create zipped package using PKZIP 2.0 (http://osdab.42cows.org/snippets/zip.php?mode=advanced)
+    if(createZip){
+        Zip uz;
+
+        Zip::ErrorCode ec = uz.createArchive(this->packagesLocation+"/"+packageName+".zip");
+        checkForZipError(ec);
+
+        ec=uz.addDirectory(modDir);
+        checkForZipError(ec);
+
+        ec = uz.closeArchive();
+        checkForZipError(ec);
+    }
+
+    if(openFolder){
+        QDesktopServices::openUrl(QUrl("file:///"+this->packagesLocation));
+    }
+}
+
+void PackageWizard::copyPackageFolders(const DropTableWidget *myTable, QString tableDir, QString modDir, bool &bslExist){
+
+    QString sourceFolder;
+    bool onisExist=false;
+    QString path;
+
+    for(int i=0; i<myTable->rowCount(); i++){
+
+        sourceFolder=myTable->item(i,2)->text();
+
+        if(myTable->item(i,1)->text()==".oni"){
+            path=modDir+"oni/"+tableDir;
+            if(!onisExist){
+                onisExist=true;
+            }
+        }
+        else if(myTable->item(i,1)->text()==".bsl"){
+            path=modDir+"bsl/"+tableDir;
+            if(!bslExist){
+                bslExist=true;
+            }
+        }
+        else{
+            path=modDir+"patches/"+tableDir;
+            if(!bslExist){
+                bslExist=true;
+            }
+        }
+        QDir().mkpath(path); //create path if doesn't exist
+        if(!Util::cpDir(sourceFolder,path+Util::cutName(sourceFolder))){//copy contents (creates dest destination automatically if not exists yet)
+            QString errorString="An error occurred while copping the folder/files to the package folder: \n"
+                    "Copying from "+sourceFolder+"\n to "+path+Util::cutName(sourceFolder);
+            Util::showErrorLogPopUp(errorString);
+            this->myLogger->writeString(errorString);
+        }
+    }
+}
+
+/**
+  Convenience function for checking for zipping errors
+  */
+void PackageWizard::checkForZipError(Zip::ErrorCode ec){
+    if (ec != Zip::Ok){
+        const QString error="Error found while zipping the package. Error number = "+QString::number(ec);
+        Util::showErrorPopUp(error);
+        this->myLogger->writeString(error);
+    }
+}
Index: /Vago/trunk/Vago/packageWizard/packagewizard.h
===================================================================
--- /Vago/trunk/Vago/packageWizard/packagewizard.h	(revision 771)
+++ /Vago/trunk/Vago/packageWizard/packagewizard.h	(revision 771)
@@ -0,0 +1,35 @@
+#ifndef PACKAGEWIZARD_H
+#define PACKAGEWIZARD_H
+
+#include "logger.h"
+#include "packagepage2.h"
+#include "packagepage3.h"
+#include "packagepage4.h"
+#include "packagepagefinal.h"
+#include "zip.h"
+#include <QLabel>
+#include <QVBoxLayout>
+#include <QLineEdit>
+#include <QRect>
+#include <QDesktopWidget>
+#include <QTextStream>
+#include <QSettings>
+
+class PackageWizard
+{
+public:
+    PackageWizard(QString workspaceWizardLocation,QSettings *vagoSettings, Logger *myLogger);
+    int exec();
+private:
+    QWizardPage *createIntroPage();
+    void copyPackageFolders(const DropTableWidget *myTable, QString tableDir, QString modDir, bool &bslExist);
+    void createPackage(const QWizard &myWizard, PackagePage4 *page4);
+    void checkForZipError(Zip::ErrorCode ec);
+
+    Logger *myLogger;
+    QString workspaceWizardLocation;
+    QString packagesLocation;
+    QSettings *vagoSettings;
+};
+
+#endif // PACKAGEWIZARD_H
Index: /Vago/trunk/Vago/preferences.cpp
===================================================================
--- /Vago/trunk/Vago/preferences.cpp	(revision 771)
+++ /Vago/trunk/Vago/preferences.cpp	(revision 771)
@@ -0,0 +1,61 @@
+#include "preferences.h"
+#include "ui_preferences.h"
+
+Preferences::Preferences(QWidget *parent, QSettings *vagoSettings) :
+    QDialog(parent),
+    ui(new Ui::Preferences)
+{
+    ui->setupUi(this);
+    this->setAttribute(Qt::WA_DeleteOnClose,true ); //destroy itself once finished.
+
+    this->vagoSettings=vagoSettings;
+
+    ui->leAEfolder->setText(this->vagoSettings->value("AeFolder").toString());
+    ui->leWorkspace->setText(this->vagoSettings->value("Workspace").toString());
+    ui->cbOniWindow->setChecked(this->vagoSettings->value("OniWindow").toBool());
+    ui->cbSeparate->setChecked(this->vagoSettings->value("SeparateInWorkspace").toBool());
+    ui->cbVagoExit->setChecked(this->vagoSettings->value("ConfirmExit").toBool());
+
+}
+
+Preferences::~Preferences()
+{
+    delete ui;
+}
+
+void Preferences::on_buttonBox_accepted()
+{
+    this->vagoSettings->setValue("AeFolder",ui->leAEfolder->text());
+    this->vagoSettings->setValue("Workspace",ui->leWorkspace->text());
+    this->vagoSettings->setValue("OniWindow",ui->cbOniWindow->isChecked());
+    this->vagoSettings->setValue("SeparateInWorkspace",ui->cbSeparate->isChecked());
+    this->vagoSettings->setValue("ConfirmExit",ui->cbVagoExit->isChecked());
+
+    Util::showPopUp("You need to restart the application to all changes take effect.");
+}
+
+void Preferences::on_pbChooseWorkspace_clicked()
+{
+    QString newDir=QFileDialog::getExistingDirectory(this,"Choose workspace folder...");
+    newDir=Util::normalizePath(newDir);
+
+    if(!newDir.isEmpty()){
+        ui->leWorkspace->setText(newDir);
+    }
+}
+
+void Preferences::on_pbChooseAE_clicked()
+{
+    QString newDir=QFileDialog::getExistingDirectory(this,"Choose AE folder...");
+    newDir=Util::normalizePath(newDir);
+
+    if(!newDir.isEmpty()){
+        ui->leAEfolder->setText(newDir);
+    }
+}
+
+void Preferences::on_buttonBox_rejected()
+{
+    this->destroy(true,true);
+}
+
Index: /Vago/trunk/Vago/preferences.h
===================================================================
--- /Vago/trunk/Vago/preferences.h	(revision 771)
+++ /Vago/trunk/Vago/preferences.h	(revision 771)
@@ -0,0 +1,37 @@
+#ifndef PREFERENCES_H
+#define PREFERENCES_H
+
+#include <QDialog>
+#include <QFileDialog>
+#include <QSettings>
+#include <QMessageBox>
+#include <util.h>
+
+namespace Ui {
+class Preferences;
+}
+
+class Preferences : public QDialog
+{
+    Q_OBJECT
+    
+public:
+    Preferences(QWidget *parent, QSettings *vagoSettings);
+    ~Preferences();
+    
+private slots:
+
+    void on_buttonBox_accepted();
+
+    void on_pbChooseWorkspace_clicked();
+
+    void on_pbChooseAE_clicked();
+
+    void on_buttonBox_rejected();
+
+private:
+    Ui::Preferences *ui;
+    QSettings *vagoSettings;
+};
+
+#endif // PREFERENCES_H
Index: /Vago/trunk/Vago/preferences.ui
===================================================================
--- /Vago/trunk/Vago/preferences.ui	(revision 771)
+++ /Vago/trunk/Vago/preferences.ui	(revision 771)
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Preferences</class>
+ <widget class="QDialog" name="Preferences">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>493</width>
+    <height>258</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Vago Preferences</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>Preferences</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_2">
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout">
+        <item>
+         <widget class="QLabel" name="label">
+          <property name="minimumSize">
+           <size>
+            <width>130</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Vago Workspace Folder:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="leWorkspace"/>
+        </item>
+        <item>
+         <widget class="QPushButton" name="pbChooseWorkspace">
+          <property name="text">
+           <string>Choose</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_2">
+        <item>
+         <widget class="QLabel" name="label_2">
+          <property name="text">
+           <string>Anniversary Edition Folder:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="leAEfolder"/>
+        </item>
+        <item>
+         <widget class="QPushButton" name="pbChooseAE">
+          <property name="text">
+           <string>Choose</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="cbOniWindow">
+        <property name="text">
+         <string>Launch Oni in a window</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="cbSeparate">
+        <property name="toolTip">
+         <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Separate conversions by folders. For example: &amp;quot;Textures&amp;quot; -&amp;gt; &amp;quot;DAT_ONI - DDS&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+        </property>
+        <property name="text">
+         <string>Separate different conversions in workspace</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="cbVagoExit">
+        <property name="text">
+         <string>Always confirm Vago exit</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>Preferences</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>Preferences</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
Index: /Vago/trunk/Vago/readme.txt
===================================================================
--- /Vago/trunk/Vago/readme.txt	(revision 771)
+++ /Vago/trunk/Vago/readme.txt	(revision 771)
@@ -0,0 +1,128 @@
+Readme.txt
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Vago GUI v0.8
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+----------------------------------
+Description:
+----------------------------------
+
+An user interface application to use OniSplit in Windows.
+
+OniSplit:
+"OniSplit, written by Neo, is an integral part of the Anniversary Edition and an essential modding tool on its own. 
+It is able to import and export many kinds of Oni game data, such as textures, sound, 3D models, level geometry & 
+combat animations and is also able to split & recombine Oni's data files. It's functions supersede those of OUP & 
+OME and is currently the community's modding tool of choice."
+
+----------------------------------
+Installation (standalone version):
+----------------------------------
+
+Extract Vago folder to any place in your computer. At first run select your Anniversary Edition folder.
+
+----------------------------------
+Contacts:
+----------------------------------
+
+Script10k, "faob2@hotmail.com"
+
+Oni Central Forum:
+http://oni.bungie.org
+->Select forum
+
+Oni Wiki:
+http://wiki.oni2.net
+
+----------------------------------
+Change Log:
+----------------------------------
+0.8, 01-04-2012
+-Updated OniSplit to 0.9.86.0 version
+-Added Animations tab and options to export OBAN as dae, plus option to
+export "saved_films*.dat" as XML
+-Fixed AEI2 launch button
+-Added patch support in AEI2 package wizard
+-Added wizard to convert sounds to oni (thanks paradox, 
+have based in your excel macro)
+-Added xmlTools 0.8d as part of the framework (like onisplit)
+----------------------------------
+0.7, 10-02-2012
+-Updated to support the AEI2
+-Added wizard to create AEI2 packages
+-Added zip option to packages
+-Fixed check packages number (using new method, thanks Alloc!)
+-Fixed check for vago updates
+----------------------------------
+0.6a, 22-09-2012
+-Fixed the table tooltips disappearing when changing items order
+----------------------------------
+0.6, 11-09-2012
+-Added option to view log in option menu and also in error dialogs
+-Number of characters in oni split errors limited
+-When executing only one task, progess bar will be intermitent
+-Fixed About dialog image (didn't know that qt needed a plugin for jpg files)
+-Taskbar now flashes if a task is done and the Vago windows is not the window active
+-Added context menu with the following options: change items order, disable items
+processing, change items to the current settings, change specified items to output
+to a specified folder, copy items to clipboard
+-Added tooltips to every row and column to be processed (it's easier to check the
+command for each file for example)
+-Added wav/aif > oni conversion
+-Now .dat is added when a filename (to be exported as .dat) is inputted without 
+extension
+-Now the number of errors is showed
+-Added option to extract a dae with a specified animation
+----------------------------------
+0.5b, 28-07-2012
+-Fixed another small typo in the from/to description
+----------------------------------
+0.5a, 28-07-2012
+-Fixed two typos. EnvMap at Textures and at Texture Models were asking 
+for a .oni absolute file when it only needs the filename without the .oni
+extension
+----------------------------------
+0.5, 26-07-2012
+-Now every result of a conversion or package is separated in folders 
+in the workspace by default. This can be disabled in preferences
+-Added an icon
+-Changed About dialog
+-It now checks if every entry of ini exists at the begin
+-Added option to clear everything in packages
+-Added option to change output folder at anytime, this allows for example
+output a level directly to it's correct folder for easy testing. It is
+also simple to change between the workspace and another output folder
+-Fixed bug when selecting multiple dirs and the user cancelled which 
+still resulted in returning the files selected
+----------------------------------
+0.4, 25-07-2012
+-Fixed a typo in Packages creating making scripts installation fail
+-Added option to create AKEV from env.dae and bnv.dae, plus others resources 
+plus the ability to generate the path finding grids for AKEVs automatically
+-Added manual oni split commands input
+----------------------------------
+0.3, 22-07-2012
+-Implemented Packages tab functionality
+-Implemented check for Vago updates functionality
+-Fixed a bug in "extract an ONCC with another character's TRAM" 
+(command bad built)
+-Fixed an index out range bug when multiple selections in tables (when removing)
+----------------------------------
+0.2, 19-07-2012
+-It now checks for OniSplit at each run and exits if it's not found
+-Option to check onisplit version from gui
+-Optimized the code and made it more modular
+-Added -search ../GameDataFolder/level0_Final to AKEV (ONI) > DAE
+-Added JPG support for textures
+-Added -extract:xml  <target directory> -anim-body: ONCCsource  TRAMsource 
+(extract an ONCC with another character's TRAM)
+-Fixed a bug in ONI->DAT conversion (command bad built)
+-Added folder drag n' drop and checks if the current operation only work 
+with files or folders
+-Added items loaded at status bar
+----------------------------------
+0.1a, 15-07-2012
+-Fixed a bug with spaces in directories
+----------------------------------
+0.1, 15-07-2012
+-Initial Version
Index: /Vago/trunk/Vago/resources.qrc
===================================================================
--- /Vago/trunk/Vago/resources.qrc	(revision 771)
+++ /Vago/trunk/Vago/resources.qrc	(revision 771)
@@ -0,0 +1,23 @@
+<RCC>
+    <qresource prefix="/new/icons">
+        <file>oni_icon.png</file>
+        <file>AE_icon.png</file>
+        <file>command_icon.png</file>
+        <file>vago_icon.png</file>
+        <file>folder_icon.png</file>
+        <file>minus.png</file>
+        <file>plus.png</file>
+        <file>switch.png</file>
+        <file>package.png</file>
+        <file>log.png</file>
+        <file>toolPackage.png</file>
+        <file>sound.png</file>
+    </qresource>
+    <qresource prefix="/new/about">
+        <file>about.png</file>
+    </qresource>
+    <qresource prefix="/new">
+        <file>sampleFiles/OSBDsample_file.amb.xml</file>
+        <file>sampleFiles/OSBDsample_file.grp.xml</file>
+    </qresource>
+</RCC>
Index: /Vago/trunk/Vago/sampleFiles/OSBDsample_file.amb.xml
===================================================================
--- /Vago/trunk/Vago/sampleFiles/OSBDsample_file.amb.xml	(revision 771)
+++ /Vago/trunk/Vago/sampleFiles/OSBDsample_file.amb.xml	(revision 771)
@@ -0,0 +1,27 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Oni>
+    <AmbientSound>
+        <Priority>Normal</Priority>
+        <Flags></Flags>
+        <DetailTrackProperties>
+            <SphereRadius>10</SphereRadius>
+            <ElapsedTime>
+                <Min>1</Min>
+                <Max>1</Max>
+            </ElapsedTime>
+        </DetailTrackProperties>
+        <Volume>
+            <Distance>
+                <Min>10</Min>
+                <Max>50</Max>
+            </Distance>
+        </Volume>
+        <DetailTrack></DetailTrack>
+        <BaseTrack1>sample_file</BaseTrack1>
+        <BaseTrack2></BaseTrack2>
+        <InSound></InSound>
+        <OutSound></OutSound>
+        <Treshold>3</Treshold>
+        <MinOcclusion>0</MinOcclusion>
+    </AmbientSound>
+</Oni>
Index: /Vago/trunk/Vago/sampleFiles/OSBDsample_file.grp.xml
===================================================================
--- /Vago/trunk/Vago/sampleFiles/OSBDsample_file.grp.xml	(revision 771)
+++ /Vago/trunk/Vago/sampleFiles/OSBDsample_file.grp.xml	(revision 771)
@@ -0,0 +1,23 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Oni>
+    <SoundGroup>
+        <Volume>1</Volume>
+        <Pitch>1</Pitch>
+        <Flags>PreventRepeat</Flags>
+        <NumberOfChannels>2</NumberOfChannels>
+        <Permutations>
+            <Permutation>
+                <Weight>10</Weight>
+                <Volume>
+                    <Min>1</Min>
+                    <Max>1</Max>
+                </Volume>
+                <Pitch>
+                    <Min>1</Min>
+                    <Max>1</Max>
+                </Pitch>
+                <Sound>sample_file.wav</Sound>
+            </Permutation>
+        </Permutations>
+    </SoundGroup>
+</Oni>
Index: /Vago/trunk/Vago/soundWizard/soundpage2.cpp
===================================================================
--- /Vago/trunk/Vago/soundWizard/soundpage2.cpp	(revision 771)
+++ /Vago/trunk/Vago/soundWizard/soundpage2.cpp	(revision 771)
@@ -0,0 +1,141 @@
+#include "soundpage2.h"
+#include "ui_soundpage2.h"
+
+const QStringList SoundPage2::allowedFiles = QStringList() << "*.wav" <<  "*.aif" <<  "*.aifc" << "*.afc";
+const QString SoundPage2::codecLocalHelpFile=GlobalVars::HelpLocation + "/XMLSNDD.html#Source_file_creation";
+
+SoundPage2::SoundPage2(QWidget *parent) :
+    QWizardPage(parent),
+    ui(new Ui::soundpage2)
+{
+    ui->setupUi(this);
+    this->soundTable=ui->twSoundFiles;
+    ui->twSoundFiles->removeColumn(2); // Only two columns
+
+    // Drop signal for Packages table
+    connect(ui->twSoundFiles, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addResourcesSounds(DropTableWidget*,QStringList)));
+    // Signal for click in label (display local help)
+    connect(ui->label, SIGNAL(linkActivated(const QString & )), this, SLOT(openCodecLocalHelp()));
+
+    //Register fields to be accessible in another pages
+    registerField("rbOther", ui->rbOther);
+    registerField("leOtherLocation", ui->leOtherLocation);
+}
+
+SoundPage2::~SoundPage2()
+{
+    delete ui;
+}
+
+void SoundPage2::on_rbOther_toggled(bool checked)
+{
+    if(checked){
+        ui->leOtherLocation->setEnabled(true);
+        ui->pbBrowserOtherLocation->setEnabled(true);
+        return;
+    }
+
+    ui->leOtherLocation->setEnabled(false);
+    ui->pbBrowserOtherLocation->setEnabled(false);
+}
+
+void SoundPage2::on_tbAddFiles_clicked()
+{
+    addResourcesSounds(ui->twSoundFiles,QFileDialog::getOpenFileNames(this,"Choose the sound files...","./" , "Audio (" + this->allowedFiles.join(" ") + ")"));
+}
+
+void SoundPage2::on_tbRemoveFiles_clicked()
+{
+    int size = ui->twSoundFiles->selectionModel()->selectedRows().size();
+
+    if(size==0){
+        Util::showPopUp("Select a row first.");
+        return;
+    }
+
+    if(Util::showQuestionPopUp(this,"Are you sure you want to delete the selected rows?")){
+        for(int i=0; i<size; i++){
+            ui->twSoundFiles->removeRow(ui->twSoundFiles->selectionModel()->selectedRows().at(size-i-1).row());
+        }
+    }
+}
+
+void SoundPage2::addResourcesSounds(DropTableWidget *myTable, QStringList resources){
+
+    bool fileExtValid=false;
+
+    //Pre-processing (check if received only folders)
+    foreach(QString myFile, resources){
+        QString currFileExt=QFileInfo(myFile).completeSuffix();
+        if(QDir(myFile).exists()){
+            Util::showErrorPopUp("Only files are allowed for this operation.");
+            return;
+        }
+
+        foreach(QString vext, this->allowedFiles){
+            vext.remove("*.");
+            if(vext==currFileExt){
+                fileExtValid=true;
+                break;
+            }
+        }
+
+        if(!fileExtValid){
+            Util::showErrorPopUp("Files must be in the follow formats:\n" +
+                                 this->allowedFiles.join(" "));
+            return;
+        }
+    }
+
+    foreach(QString currentFile, resources){
+
+        //Get actual number rows
+        int twSize=myTable->rowCount();
+
+        //increase the rows for the new item
+        myTable->setRowCount(twSize+1);
+
+        //Add to table and list to
+        QTableWidgetItem *newName = new QTableWidgetItem(QFileInfo(currentFile).baseName());
+        QTableWidgetItem *newFileLocation = new QTableWidgetItem(Util::normalizePath(currentFile));
+
+        myTable->setItem(twSize,0,newName);
+        myTable->setItem(twSize,1,newFileLocation);
+        myTable->updateTableToolTips(twSize); //Update tool tips
+    }
+}
+
+void SoundPage2::on_pbBrowserOtherLocation_clicked()
+{
+    ui->leOtherLocation->setText(QFileDialog::getExistingDirectory(this,"Choose output folder..."));
+}
+
+void SoundPage2::openCodecLocalHelp(){
+    QDesktopServices::openUrl(QUrl("file:///"+this->codecLocalHelpFile));
+}
+
+bool SoundPage2::validatePage(){
+
+    QStringList namesList;
+
+    if(ui->twSoundFiles->rowCount()==0){
+        Util::showErrorPopUp("You need to add some sound files first!");
+        return false;
+    }
+
+    for(int i=0; i<ui->twSoundFiles->rowCount(); i++){
+        namesList << ui->twSoundFiles->item(i,0)->text();
+    }
+
+    if(ui->rbOther->isChecked() && Util::checkEmptySpaces(QStringList() << ui->leOtherLocation->text())){
+        Util::showErrorPopUp("Please input a directory to output the files.");
+        return false;
+    }
+
+    if(ui->rbOther->isChecked() && !QDir(ui->leOtherLocation->text()).exists()){
+        Util::showErrorPopUp("Invalid directory specified in other location. Please fix it.");
+        return false;
+    }
+
+    return true;
+}
Index: /Vago/trunk/Vago/soundWizard/soundpage2.h
===================================================================
--- /Vago/trunk/Vago/soundWizard/soundpage2.h	(revision 771)
+++ /Vago/trunk/Vago/soundWizard/soundpage2.h	(revision 771)
@@ -0,0 +1,44 @@
+#ifndef SOUNDPAGE2_H
+#define SOUNDPAGE2_H
+
+#include <QWizardPage>
+
+#include "util.h"
+#include "droptablewidget.h"
+
+namespace Ui {
+class soundpage2;
+}
+
+class SoundPage2 : public QWizardPage
+{
+    Q_OBJECT
+    
+public:
+    DropTableWidget *soundTable;
+
+    explicit SoundPage2(QWidget *parent = 0);
+    ~SoundPage2();
+    
+private slots:
+    void addResourcesSounds(DropTableWidget *myTable, QStringList resources);
+
+    void on_rbOther_toggled(bool checked);
+
+    void on_tbAddFiles_clicked();
+
+    void on_tbRemoveFiles_clicked();
+
+    void on_pbBrowserOtherLocation_clicked();
+
+    void openCodecLocalHelp();
+
+private:
+    Ui::soundpage2 *ui;
+    static const QStringList allowedFiles;
+    static const QString codecLocalHelpFile;
+
+    bool validatePage();
+};
+
+#endif // SOUNDPAGE2_H
Index: /Vago/trunk/Vago/soundWizard/soundpage2.ui
===================================================================
--- /Vago/trunk/Vago/soundWizard/soundpage2.ui	(revision 771)
+++ /Vago/trunk/Vago/soundWizard/soundpage2.ui	(revision 771)
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>soundpage2</class>
+ <widget class="QWizardPage" name="soundpage2">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>640</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>WizardPage</string>
+  </property>
+  <property name="title">
+   <string>Sound files to process</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_5">
+   <item>
+    <widget class="QLabel" name="label">
+     <property name="text">
+      <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Add here the files you want to convert. All the files will have the same properties applied. &lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Don't forget to first convert the files to an oni compatible codec&lt;/span&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;. More information &lt;/span&gt;&lt;a href=&quot; &quot;&gt;&lt;span style=&quot; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>57</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_2">
+     <property name="title">
+      <string>Files to convert</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_4">
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout">
+        <item>
+         <widget class="DropTableWidget" name="twSoundFiles">
+          <attribute name="horizontalHeaderStretchLastSection">
+           <bool>true</bool>
+          </attribute>
+          <column>
+           <property name="text">
+            <string>Name</string>
+           </property>
+          </column>
+          <column>
+           <property name="text">
+            <string>File Location</string>
+           </property>
+          </column>
+         </widget>
+        </item>
+        <item>
+         <layout class="QVBoxLayout" name="verticalLayout">
+          <item>
+           <widget class="QToolButton" name="tbAddFiles">
+            <property name="toolTip">
+             <string>Add sound files</string>
+            </property>
+            <property name="text">
+             <string>...</string>
+            </property>
+            <property name="icon">
+             <iconset resource="../resources.qrc">
+              <normaloff>:/new/icons/plus.png</normaloff>:/new/icons/plus.png</iconset>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QToolButton" name="tbRemoveFiles">
+            <property name="toolTip">
+             <string>Remove selected sound files</string>
+            </property>
+            <property name="text">
+             <string>...</string>
+            </property>
+            <property name="icon">
+             <iconset resource="../resources.qrc">
+              <normaloff>:/new/icons/minus.png</normaloff>:/new/icons/minus.png</iconset>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <spacer name="verticalSpacer_2">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>57</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>Output converted files to:</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_3">
+      <item>
+       <layout class="QVBoxLayout" name="verticalLayout_2">
+        <item>
+         <widget class="QRadioButton" name="rbWorkspace">
+          <property name="text">
+           <string>Workspace</string>
+          </property>
+          <property name="checked">
+           <bool>true</bool>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_2">
+          <item>
+           <widget class="QRadioButton" name="rbOther">
+            <property name="enabled">
+             <bool>true</bool>
+            </property>
+            <property name="text">
+             <string>Other</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLineEdit" name="leOtherLocation">
+            <property name="enabled">
+             <bool>false</bool>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QPushButton" name="pbBrowserOtherLocation">
+            <property name="enabled">
+             <bool>false</bool>
+            </property>
+            <property name="text">
+             <string>Browse...</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>DropTableWidget</class>
+   <extends>QTableWidget</extends>
+   <header>droptablewidget.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources>
+  <include location="../resources.qrc"/>
+ </resources>
+ <connections/>
+</ui>
Index: /Vago/trunk/Vago/soundWizard/soundpage3.cpp
===================================================================
--- /Vago/trunk/Vago/soundWizard/soundpage3.cpp	(revision 771)
+++ /Vago/trunk/Vago/soundWizard/soundpage3.cpp	(revision 771)
@@ -0,0 +1,52 @@
+#include "soundpage3.h"
+#include "ui_soundpage3.h"
+
+SoundPage3::SoundPage3(QWidget *parent) :
+    QWizardPage(parent),
+    ui(new Ui::soundpage3)
+{
+    ui->setupUi(this);
+
+    //Register fields to be accessible in another pages
+
+    registerField("rbPriorityLow", ui->rbPriorityLow);
+    registerField("rbPriorityNormal", ui->rbPriorityNormal);
+    registerField("rbPriorityHigh", ui->rbPriorityHigh);
+    registerField("rbPriorityHighest", ui->rbPriorityHighest);
+    registerField("cbInterruptOnStop", ui->cbInterruptOnStop);
+
+    registerField("cbPlayOnce", ui->cbPlayOnce);
+    registerField("cbCanPan", ui->cbCanPan);
+
+    registerField("leSphereRadious", ui->leSphereRadious);
+    registerField("leMinElapsedTime", ui->leMinElapsedTime);
+    registerField("leMaxElapsedTime", ui->leMaxElapsedTime);
+    registerField("leMinVolumeDistance", ui->leMinVolumeDistance);
+    registerField("leMaxVolumeDistance", ui->leMaxVolumeDistance);
+    registerField("leMinOcclusion", ui->leMinOcclusion);
+    registerField("leTreshold", ui->leTreshold);
+}
+
+bool SoundPage3::validatePage(){
+    QStringList leContents;
+    leContents << ui->leSphereRadious->text() << ui->leMinElapsedTime->text() << ui->leMaxElapsedTime->text()
+                       << ui->leMinVolumeDistance->text() << ui->leMaxVolumeDistance->text() << ui->leMinOcclusion->text()
+                       << ui->leTreshold->text();
+
+    if(Util::checkEmptySpaces(leContents)){
+        Util::showErrorPopUp("Please fill all fields first!");
+        return false;
+    }
+
+    if(Util::checkIfDoubles(leContents)){
+        Util::showErrorPopUp("All fields must contains numbers!");
+        return false;
+    }
+
+    return true;
+}
+
+SoundPage3::~SoundPage3()
+{
+    delete ui;
+}
Index: /Vago/trunk/Vago/soundWizard/soundpage3.h
===================================================================
--- /Vago/trunk/Vago/soundWizard/soundpage3.h	(revision 771)
+++ /Vago/trunk/Vago/soundWizard/soundpage3.h	(revision 771)
@@ -0,0 +1,26 @@
+#ifndef SOUNDPAGE3_H
+#define SOUNDPAGE3_H
+
+#include <QWizardPage>
+
+#include "util.h"
+
+namespace Ui {
+class soundpage3;
+}
+
+class SoundPage3 : public QWizardPage
+{
+    Q_OBJECT
+    
+public:
+    explicit SoundPage3(QWidget *parent = 0);
+    ~SoundPage3();
+    
+private:
+    Ui::soundpage3 *ui;
+
+    bool validatePage();
+};
+
+#endif // SOUNDPAGE3_H
Index: /Vago/trunk/Vago/soundWizard/soundpage3.ui
===================================================================
--- /Vago/trunk/Vago/soundWizard/soundpage3.ui	(revision 771)
+++ /Vago/trunk/Vago/soundWizard/soundpage3.ui	(revision 771)
@@ -0,0 +1,278 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>soundpage3</class>
+ <widget class="QWizardPage" name="soundpage3">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>680</width>
+    <height>460</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>WizardPage</string>
+  </property>
+  <property name="title">
+   <string>OSBD.amb file properties</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_4">
+   <item>
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>Sound priority</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_2">
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout">
+        <item>
+         <widget class="QRadioButton" name="rbPriorityLow">
+          <property name="text">
+           <string>Low</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QRadioButton" name="rbPriorityNormal">
+          <property name="text">
+           <string>Normal</string>
+          </property>
+          <property name="checked">
+           <bool>true</bool>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QRadioButton" name="rbPriorityHigh">
+          <property name="text">
+           <string>High</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QRadioButton" name="rbPriorityHighest">
+          <property name="text">
+           <string>Highest</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_2">
+     <property name="title">
+      <string>Options</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_9">
+      <item>
+       <widget class="QCheckBox" name="cbInterruptOnStop">
+        <property name="text">
+         <string>Interrupt track on stop</string>
+        </property>
+        <property name="checked">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="cbPlayOnce">
+        <property name="text">
+         <string>Play once</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="cbCanPan">
+        <property name="text">
+         <string>Can pan</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_3">
+     <property name="title">
+      <string>Properties</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_3">
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_2">
+        <item>
+         <widget class="QLabel" name="label">
+          <property name="minimumSize">
+           <size>
+            <width>115</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Sphere radious:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="leSphereRadious">
+          <property name="text">
+           <string>10</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_3">
+        <item>
+         <widget class="QLabel" name="label_2">
+          <property name="minimumSize">
+           <size>
+            <width>115</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Min elapsed time:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="leMinElapsedTime">
+          <property name="text">
+           <string>1</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_4">
+        <item>
+         <widget class="QLabel" name="label_3">
+          <property name="minimumSize">
+           <size>
+            <width>115</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Max elapsed time:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="leMaxElapsedTime">
+          <property name="text">
+           <string>1</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_5">
+        <item>
+         <widget class="QLabel" name="label_4">
+          <property name="minimumSize">
+           <size>
+            <width>115</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Min volume distance:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="leMinVolumeDistance">
+          <property name="text">
+           <string>10</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_6">
+        <item>
+         <widget class="QLabel" name="label_5">
+          <property name="minimumSize">
+           <size>
+            <width>115</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Max volume distance:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="leMaxVolumeDistance">
+          <property name="text">
+           <string>50</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_7">
+        <item>
+         <widget class="QLabel" name="label_6">
+          <property name="minimumSize">
+           <size>
+            <width>115</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Min occlusion:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="leMinOcclusion">
+          <property name="text">
+           <string>3</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_8">
+        <item>
+         <widget class="QLabel" name="label_7">
+          <property name="minimumSize">
+           <size>
+            <width>115</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Treshold:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="leTreshold">
+          <property name="text">
+           <string>0</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Index: /Vago/trunk/Vago/soundWizard/soundpage4.cpp
===================================================================
--- /Vago/trunk/Vago/soundWizard/soundpage4.cpp	(revision 771)
+++ /Vago/trunk/Vago/soundWizard/soundpage4.cpp	(revision 771)
@@ -0,0 +1,48 @@
+#include "soundpage4.h"
+#include "ui_soundpage4.h"
+
+SoundPage4::SoundPage4(QWidget *parent) :
+    QWizardPage(parent),
+    ui(new Ui::soundpage4)
+{
+    ui->setupUi(this);
+
+    //Register fields to be accessible in another pages
+    registerField("leVolume", ui->leVolume);
+    registerField("leMinVolume", ui->leMinVolume);
+    registerField("leMaxVolume", ui->leMaxVolume);
+    registerField("lePitch", ui->lePitch);
+    registerField("leMinPitch", ui->leMinPitch);
+    registerField("leMaxPitch", ui->leMaxPitch);
+    registerField("leWeight", ui->leWeight);
+
+    registerField("cbPreventRepeat", ui->cbPreventRepeat);
+
+    registerField("rbStereo22", ui->rbStereo22);
+    registerField("rbMono22", ui->rbMono22);
+    registerField("rbMono44Pc", ui->rbMono44Pc);
+}
+
+bool SoundPage4::validatePage(){
+    QStringList leContents;
+    leContents << ui->leVolume->text() << ui->leMinVolume->text() << ui->leMaxVolume->text()
+               << ui->lePitch->text() << ui->leMinPitch->text() << ui->leMaxPitch->text()
+               << ui->leWeight->text();
+
+    if(Util::checkEmptySpaces(leContents)){
+        Util::showErrorPopUp("Please fill all fields first!");
+        return false;
+    }
+
+    if(Util::checkIfDoubles(leContents)){
+        Util::showErrorPopUp("All fields must contains numbers!");
+        return false;
+    }
+
+    return true;
+}
+
+SoundPage4::~SoundPage4()
+{
+    delete ui;
+}
Index: /Vago/trunk/Vago/soundWizard/soundpage4.h
===================================================================
--- /Vago/trunk/Vago/soundWizard/soundpage4.h	(revision 771)
+++ /Vago/trunk/Vago/soundWizard/soundpage4.h	(revision 771)
@@ -0,0 +1,26 @@
+#ifndef SOUNDPAGE4_H
+#define SOUNDPAGE4_H
+
+#include <QWizardPage>
+
+#include "util.h"
+
+namespace Ui {
+class soundpage4;
+}
+
+class SoundPage4 : public QWizardPage
+{
+    Q_OBJECT
+    
+public:
+    explicit SoundPage4(QWidget *parent = 0);
+    ~SoundPage4();
+    
+private:
+    Ui::soundpage4 *ui;
+
+    bool validatePage();
+};
+
+#endif // SOUNDPAGE4_H
Index: /Vago/trunk/Vago/soundWizard/soundpage4.ui
===================================================================
--- /Vago/trunk/Vago/soundWizard/soundpage4.ui	(revision 771)
+++ /Vago/trunk/Vago/soundWizard/soundpage4.ui	(revision 771)
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>soundpage4</class>
+ <widget class="QWizardPage" name="soundpage4">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>640</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>WizardPage</string>
+  </property>
+  <property name="title">
+   <string>OSBD.grp file properties</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <item>
+    <widget class="QGroupBox" name="groupBox_3">
+     <property name="title">
+      <string>Properties</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout">
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_2">
+        <item>
+         <widget class="QLabel" name="label">
+          <property name="minimumSize">
+           <size>
+            <width>115</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Volume:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="leVolume">
+          <property name="text">
+           <string>1</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_3">
+        <item>
+         <widget class="QLabel" name="label_2">
+          <property name="minimumSize">
+           <size>
+            <width>115</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Min volume:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="leMinVolume">
+          <property name="text">
+           <string>1</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_4">
+        <item>
+         <widget class="QLabel" name="label_3">
+          <property name="minimumSize">
+           <size>
+            <width>115</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Max volume:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="leMaxVolume">
+          <property name="text">
+           <string>1</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_5">
+        <item>
+         <widget class="QLabel" name="label_4">
+          <property name="minimumSize">
+           <size>
+            <width>115</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Pitch:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="lePitch">
+          <property name="text">
+           <string>1</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_6">
+        <item>
+         <widget class="QLabel" name="label_5">
+          <property name="minimumSize">
+           <size>
+            <width>115</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Min pitch:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="leMinPitch">
+          <property name="text">
+           <string>1</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_7">
+        <item>
+         <widget class="QLabel" name="label_6">
+          <property name="minimumSize">
+           <size>
+            <width>115</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Max pitch:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="leMaxPitch">
+          <property name="text">
+           <string>1</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_8">
+        <item>
+         <widget class="QLabel" name="label_7">
+          <property name="minimumSize">
+           <size>
+            <width>115</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>Weight:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="leWeight">
+          <property name="text">
+           <string>10</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="cbPreventRepeat">
+        <property name="toolTip">
+         <string>This flag forces the engine to always play a different sound</string>
+        </property>
+        <property name="text">
+         <string>Prevent repeat</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_2">
+     <property name="title">
+      <string>Audio Channels</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <item>
+       <widget class="QRadioButton" name="rbStereo22">
+        <property name="text">
+         <string>Stereo - 22.05 kHz</string>
+        </property>
+        <property name="checked">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QRadioButton" name="rbMono22">
+        <property name="text">
+         <string>Mono - 22.05 kHz</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QRadioButton" name="rbMono44Pc">
+        <property name="text">
+         <string>Mono - 44.10 kHz (PC only)</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Index: /Vago/trunk/Vago/soundWizard/soundpagefinal.cpp
===================================================================
--- /Vago/trunk/Vago/soundWizard/soundpagefinal.cpp	(revision 771)
+++ /Vago/trunk/Vago/soundWizard/soundpagefinal.cpp	(revision 771)
@@ -0,0 +1,247 @@
+#include "soundpagefinal.h"
+#include "ui_soundpagefinal.h"
+
+SoundPageFinal::SoundPageFinal(QString soundsLocation, DropTableWidget *page2Table, Logger *myLogger, QHash<QString, QString> *commandMap, QWidget *parent) :
+    QWizardPage(parent),
+    ui(new Ui::soundpagefinal)
+{
+    ui->setupUi(this);
+    this->soundsLocation=soundsLocation;
+    this->page2Table=page2Table;
+    this->myLogger=myLogger;
+    this->commandMap=commandMap;
+
+    this->xmlCommands = new QStringList();
+    this->oniSplitCommands = new QStringList();
+    this->myXmlProcessor = new XmlProcessor(this->myLogger,this->xmlCommands);
+    this->myConverter = new Converter(this->myLogger,this->oniSplitCommands);
+
+    connectSlots();
+}
+
+void SoundPageFinal::openSoundsFolder(){
+    QString outputFolder;
+
+    if(field("rbOther").toBool()){
+        outputFolder=field("leOtherLocation").toString();
+    }
+    else{
+        outputFolder=this->soundsLocation;
+    }
+
+    QDesktopServices::openUrl(QUrl("file:///"+outputFolder));
+}
+
+void SoundPageFinal::initializePage(){
+    startProcessing();
+}
+
+void SoundPageFinal::startProcessing(){
+    // Sample files names
+    QString ambFile="OSBDsample_file.amb.xml";
+    QString grpFile="OSBDsample_file.grp.xml";
+    QString ambFileLocation=GlobalVars::VagoTemporaryDir+"/"+ambFile;
+    QString grpFileLocation=GlobalVars::VagoTemporaryDir+"/"+grpFile;
+
+    // Page 2 variables
+    QString outputFolder;
+
+    // Page 3 variables
+    QString sphereRadious, minElapsedTime, maxElapsedTime, minVolumeDistance,
+            maxVolumeDistance, minOcclusion, treshold, priority;
+    QStringList flags;
+    bool priorityLow = false, priorityNormal = false,
+            priorityHigh = false, priorityHighest = false;
+
+    bool interruptOnStop=false;
+    bool playOnce=false;
+    bool canPan=false;
+
+    // Page 4 variables
+    QString volume, minVolume, maxVolume, pitch, minPitch, weight, maxPitch,
+            numberChannels;
+    bool preventRepeat=false;
+    bool stereo22=false, mono22=false, mono44Pc=false;
+
+    // Get data page 2
+    if(field("rbOther").toBool()){
+        outputFolder=field("leOtherLocation").toString();
+    }
+    else{
+        outputFolder=this->soundsLocation;
+    }
+
+    outputFolder = Util::insertQuotes(outputFolder); // for onisplit work correctly
+
+    // Get data page 3
+
+    priorityLow=field("rbPriorityLow").toBool();
+    priorityNormal=field("rbPriorityNormal").toBool();
+    priorityHigh=field("rbPriorityHigh").toBool();
+    priorityHighest=field("rbPriorityHighest").toBool();
+
+    if(priorityNormal){
+        priority="Normal";
+    }
+    else if(priorityLow){
+        priority="Low";
+    }
+    else if(priorityHigh){
+        priority="High";
+    }
+    else if(priorityHighest){
+        priority="Highest";
+    }
+
+    if(interruptOnStop){
+        flags << "InterruptTracksOnStop";
+    }
+
+    if(playOnce){
+        flags << "PlayOnce";
+    }
+
+    if(canPan){
+        flags << "CanPan";
+    }
+
+    interruptOnStop=field("cbInterruptOnStop").toBool();
+    playOnce=field("cbPlayOnce").toBool();
+    canPan=field("cbCanPan").toBool();
+
+    sphereRadious=Util::normalizeDecimalSeparator(field("leSphereRadious").toString());
+    minElapsedTime=Util::normalizeDecimalSeparator(field("leMinElapsedTime").toString());
+    maxElapsedTime=Util::normalizeDecimalSeparator(field("leMaxElapsedTime").toString());
+    minVolumeDistance=Util::normalizeDecimalSeparator(field("leMinVolumeDistance").toString());
+    maxVolumeDistance=Util::normalizeDecimalSeparator(field("leMaxVolumeDistance").toString());
+    minOcclusion=Util::normalizeDecimalSeparator(field("leMinOcclusion").toString());
+    treshold=Util::normalizeDecimalSeparator(field("leTreshold").toString());
+
+    // Get data page 4
+
+    volume=Util::normalizeDecimalSeparator(field("leVolume").toString());
+    minVolume=Util::normalizeDecimalSeparator(field("leMinVolume").toString());
+    maxVolume=Util::normalizeDecimalSeparator(field("leMaxVolume").toString());
+    pitch=Util::normalizeDecimalSeparator(field("lePitch").toString());
+    minPitch=Util::normalizeDecimalSeparator(field("leMinPitch").toString());
+    maxPitch=Util::normalizeDecimalSeparator(field("leMaxPitch").toString());
+    weight=Util::normalizeDecimalSeparator(field("leWeight").toString());
+
+    preventRepeat=field("cbPreventRepeat").toBool();
+
+    stereo22=field("rbStereo22").toBool();
+    mono22=field("rbMono22").toBool();
+    mono44Pc=field("rbMono44Pc").toBool();
+
+    if(stereo22 || mono44Pc){
+        numberChannels="2";
+    }
+    else if(mono22){
+        numberChannels="1";
+    }
+    //######################################################### Starting xml processing
+
+    // Clean tmp dir
+    if(!Util::rmDir(GlobalVars::VagoTemporaryDir)){
+        QString message="Couldn't clean vago temp dir for complete sound wizard. Aborting.\n"+GlobalVars::VagoTemporaryDir;
+        this->myLogger->writeString(message);
+        Util::showErrorLogPopUp(message);
+        return;
+    }
+
+    if(!QDir(QDir::tempPath()).mkpath("VagoTemp")){
+        QString message="Couldn't reconstruct vago temp dir for complete sound wizard. Aborting.\n"+GlobalVars::VagoTemporaryDir;
+        this->myLogger->writeString(message);
+        Util::showErrorLogPopUp(message);
+    }
+
+    // Copy sample xml files to tmp dir
+    QFile::copy(":/new/sampleFiles/"+ambFile , ambFileLocation);
+    QFile::copy(":/new/sampleFiles/"+grpFile , grpFileLocation);
+    QFile::setPermissions(ambFileLocation, QFile::ReadOwner | QFile::WriteOwner); //remove read only attribute that come from resources
+    QFile::setPermissions(grpFileLocation, QFile::ReadOwner | QFile::WriteOwner);
+
+    (*this->xmlCommands) << "replaceall -element:Priority -value:"+priority+" -filename:"+ambFileLocation+" -nobackups"
+                         << "replaceall -element:Flags -value:"+flags.join(" ")+" -filename:"+ambFileLocation+" -nobackups"
+                         << "replaceall -element:SphereRadius -value:"+sphereRadious+" -filename:"+ambFileLocation+" -nobackups"
+                         << "replaceall -element:Treshold -value:"+treshold+" -filename:"+ambFileLocation+" -nobackups"
+                         << "replaceall -element:MinOcclusion -value:"+minOcclusion+" -filename:"+ambFileLocation+" -nobackups"
+                         << "replaceall -parelement:ElapsedTime -element:Min -value:"+minElapsedTime+" -filename:"+ambFileLocation+" -nobackups"
+                         << "replaceall -parelement:Distance -element:Max -value:"+maxVolumeDistance+" -filename:"+ambFileLocation+" -nobackups"
+                         << "replaceall -parelement:Distance -element:Min -value:"+minVolumeDistance+" -filename:"+ambFileLocation+" -nobackups"
+                         << "replaceall -parelement:SoundGroup -element:Volume -value:"+volume+" -filename:"+grpFileLocation+" -nobackups"
+                         << "replaceall -parelement:SoundGroup -element:Pitch -value:"+pitch+" -filename:"+grpFileLocation+" -nobackups"
+                         << "replaceall -parelement:SoundGroup -element:NumberOfChannels -value:"+numberChannels+" -filename:"+grpFileLocation+" -nobackups"
+                         << "replaceall -parelement:Volume -element:Min -value:"+minVolume+" -filename:"+grpFileLocation+" -nobackups"
+                         << "replaceall -parelement:Volume -element:Max -value:"+maxVolume+" -filename:"+grpFileLocation+" -nobackups"
+                         << "replaceall -parelement:Pitch -element:Min -value:"+minPitch+" -filename:"+grpFileLocation+" -nobackups"
+                         << "replaceall -parelement:Pitch -element:Max -value:"+maxPitch+" -filename:"+grpFileLocation+" -nobackups"
+                         << "replaceall -element:Weight -value:"+weight+" -filename:"+grpFileLocation+" -nobackups";
+
+    if(preventRepeat){
+        (*this->xmlCommands) << "replaceall -parelement:SoundGroup -element:Flags -value:PreventRepeat -filename:"+grpFileLocation+" -nobackups";
+    }
+
+    myXmlProcessor->start();
+    myXmlProcessor->wait(); // Wait until all xml is edited
+
+    QString currFileName;
+    QString currGrpFileLocation;
+    QString currAmbFileLocation;
+
+    for(int i=0; i<this->page2Table->rowCount(); i++){
+
+        (*this->oniSplitCommands) << this->commandMap->value("general->XML->ONI")+" "+outputFolder+" "+Util::insertQuotes(this->page2Table->item(i,1)->text()); // add location of sound file to convert
+
+        currFileName=this->page2Table->item(i,0)->text(); // get current file name
+        currAmbFileLocation = QString(ambFileLocation).replace("sample_file",currFileName); // get the new files, filenames
+        currGrpFileLocation = QString(grpFileLocation).replace("sample_file",currFileName);
+
+        QFile::copy(ambFileLocation, currAmbFileLocation); // make a copy of the sample files that will be the real files
+        QFile::copy(grpFileLocation, currGrpFileLocation);
+
+        (*this->xmlCommands) << "replaceall -element:BaseTrack1 -value:"+currFileName+" -filename:"+currAmbFileLocation+" -nobackups" // process the xml
+                             << "replaceall -element:Sound -value:"+currFileName+" -filename:"+currGrpFileLocation+" -nobackups";
+
+        myXmlProcessor->start();
+        myXmlProcessor->wait(); // Wait until all xml is edited
+    }
+
+    (*this->oniSplitCommands) << this->commandMap->value("general->XML->ONI")+" "+outputFolder+" "+Util::insertQuotes(GlobalVars::VagoTemporaryDir+"/*.xml");
+
+    this->myConverter->start(); // finally process the onisplit commands
+    this->myConverter->wait(); // wait for it to complete
+
+    // Finally remove the sample files, since not needed anymore
+    QFile(ambFileLocation).remove();
+    QFile(grpFileLocation).remove();
+}
+
+void SoundPageFinal::catchXmlAndOSplitProcessingError(QString result, int numErrors){
+
+    if(numErrors!=0){
+        QString sNumErrors=QString::number(numErrors);
+        if(numErrors>1){
+            Util::showErrorLogPopUp(result+"\n This is the last of "+sNumErrors+" Errors.");
+        }
+        else{
+            Util::showErrorLogPopUp(result);
+        }
+    }
+}
+
+void SoundPageFinal::connectSlots(){
+    //This signal is for thread that is working setup the progress bar (make it visible and set it's min-max)
+    connect(this->myXmlProcessor, SIGNAL(resultConversion(QString, int)), this, SLOT(catchXmlAndOSplitProcessingError(QString, int)));
+    connect(this->myConverter, SIGNAL(resultConversion(QString, int)), this, SLOT(catchXmlAndOSplitProcessingError(QString, int)));
+    connect(ui->lbComplete, SIGNAL(linkActivated(const QString & )), this, SLOT(openSoundsFolder()));
+}
+
+SoundPageFinal::~SoundPageFinal()
+{
+    delete this->xmlCommands;
+    delete this->oniSplitCommands;
+    delete this->myXmlProcessor;
+    delete this->myConverter;
+    delete ui;
+}
Index: /Vago/trunk/Vago/soundWizard/soundpagefinal.h
===================================================================
--- /Vago/trunk/Vago/soundWizard/soundpagefinal.h	(revision 771)
+++ /Vago/trunk/Vago/soundWizard/soundpagefinal.h	(revision 771)
@@ -0,0 +1,45 @@
+#ifndef SOUNDPAGEFINAL_H
+#define SOUNDPAGEFINAL_H
+
+#include <QWizardPage>
+#include <QDesktopServices>
+#include <QUrl>
+
+#include "droptablewidget.h"
+#include "logger.h"
+#include "xmlprocessor.h"
+#include "converter.h"
+
+namespace Ui {
+class soundpagefinal;
+}
+
+class SoundPageFinal : public QWizardPage
+{
+    Q_OBJECT
+    
+public:
+    explicit SoundPageFinal(QString soundsLocation, DropTableWidget *page2Table, Logger *myLogger, QHash<QString, QString> *commandMap, QWidget *parent = 0);
+    ~SoundPageFinal();
+    
+private:
+    QString soundsLocation;
+    Ui::soundpagefinal *ui;
+    DropTableWidget *page2Table;
+    Logger *myLogger;
+    XmlProcessor *myXmlProcessor;
+    Converter *myConverter;
+    QStringList *xmlCommands;
+    QStringList *oniSplitCommands;
+    QHash<QString, QString> *commandMap;
+
+    void initializePage();
+    void startProcessing();
+    void connectSlots();
+
+private slots:
+    void openSoundsFolder();
+    void catchXmlAndOSplitProcessingError(QString result, int numErrors);
+};
+
+#endif // SOUNDPAGEFINAL_H
Index: /Vago/trunk/Vago/soundWizard/soundpagefinal.ui
===================================================================
--- /Vago/trunk/Vago/soundWizard/soundpagefinal.ui	(revision 771)
+++ /Vago/trunk/Vago/soundWizard/soundpagefinal.ui	(revision 771)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>soundpagefinal</class>
+ <widget class="QWizardPage" name="soundpagefinal">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>640</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>WizardPage</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QLabel" name="lbComplete">
+     <property name="text">
+      <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;The wizard is now complete. The sounds have been converted. You can view all converted files clicking &lt;/span&gt;&lt;a href=&quot; &quot;&gt;&lt;span style=&quot; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;.&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Click restart to create more sounds from the wizard beggining, otherwise click finish.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Fixed</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>30</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Index: /Vago/trunk/Vago/soundWizard/soundwizard.cpp
===================================================================
--- /Vago/trunk/Vago/soundWizard/soundwizard.cpp	(revision 771)
+++ /Vago/trunk/Vago/soundWizard/soundwizard.cpp	(revision 771)
@@ -0,0 +1,79 @@
+#include "soundwizard.h"
+
+SoundWizard::SoundWizard(QString workspaceWizardLocation, Logger *myLogger, QHash<QString, QString> *commandMap)
+{
+    this->workspaceWizardLocation=workspaceWizardLocation;
+    this->myLogger=myLogger;
+    this->soundsLocation=this->workspaceWizardLocation+"/Sounds";
+    this->commandMap=commandMap;
+}
+
+int SoundWizard::exec(){
+    this->myWizard = new QWizard();
+
+    QPushButton *restartButton = new QPushButton("Restart");
+    this->myWizard->setButton(QWizard::CustomButton1,restartButton);
+    this->myWizard->setOption(QWizard::HaveCustomButton1, true);
+
+    connect(this->myWizard, SIGNAL(currentIdChanged(int)), this, SLOT(pageChanged(int)));
+    connect(restartButton, SIGNAL(clicked(bool)), this, SLOT(restartWizard()));
+
+    this->myWizard->setWindowIcon(QIcon(":/new/icons/sound.png"));
+
+    //Center and resize QWizard (http://www.thedazzlersinc.com/source/2012/06/04/qt-center-window-in-screen/)
+    this->myWizard->resize(640,480);
+    QRect position = this->myWizard->frameGeometry();
+    position.moveCenter(QDesktopWidget().availableGeometry().center());
+    this->myWizard->move(position.topLeft());
+    //
+
+    SoundPage2 *page2 = new SoundPage2();
+    SoundPage3 *page3 = new SoundPage3();
+    SoundPage4 *page4 = new SoundPage4();
+    SoundPageFinal *pageFinal = new SoundPageFinal(this->soundsLocation,page2->soundTable,this->myLogger, this->commandMap);
+
+    this->myWizard->addPage(createIntroPage());
+    this->myWizard->addPage(page2);
+    this->myWizard->addPage(page3);
+    this->myWizard->addPage(page4);
+    this->myWizard->addPage(pageFinal);
+
+    this->myWizard->setWindowTitle("Sound wizard");
+
+    //If wizard finished with sucess
+    if(this->myWizard->exec()){ //modal and wait for finalization
+        //createPackage(this->myWizard, page4);
+    }
+
+    delete this->myWizard; // not needed anymore
+
+    return 0;
+}
+
+QWizardPage* SoundWizard::createIntroPage() {
+    QWizardPage *page = new QWizardPage;
+    page->setTitle("Introduction");
+
+    QLabel *label = new QLabel("Welcome to the Oni Sound wizard.\n"
+                               "This wizard will allow you to convert in a few and simple steps sounds to oni format.");
+    label->setWordWrap(true);
+
+    QVBoxLayout *layout = new QVBoxLayout;
+    layout->addWidget(label);
+    page->setLayout(layout);
+
+    return page;
+}
+
+void SoundWizard::restartWizard(){
+    this->myWizard->restart();
+}
+
+void SoundWizard::pageChanged(int pageId){
+    // Last page?
+    if(pageId==4){
+        this->myWizard->setOption(QWizard::HaveCustomButton1, true); // set visible
+        return;
+    }
+    this->myWizard->setOption(QWizard::HaveCustomButton1, false); // set invisible
+}
Index: /Vago/trunk/Vago/soundWizard/soundwizard.h
===================================================================
--- /Vago/trunk/Vago/soundWizard/soundwizard.h	(revision 771)
+++ /Vago/trunk/Vago/soundWizard/soundwizard.h	(revision 771)
@@ -0,0 +1,40 @@
+#ifndef SOUNDWIZARD_H
+#define SOUNDWIZARD_H
+
+// System includes
+#include <QString>
+#include <QWizard>
+#include <QWizardPage>
+#include <QLabel>
+#include <QDesktopWidget>
+#include <QVBoxLayout>
+#include <QPushButton>
+
+// Local includes
+#include "util.h"
+#include "logger.h"
+#include "soundpage2.h"
+#include "soundpage3.h"
+#include "soundpage4.h"
+#include "soundpagefinal.h"
+
+class SoundWizard: public QObject // for signals and slots
+{
+    Q_OBJECT // for signals and slots
+public:
+    SoundWizard(QString workspaceWizardLocation, Logger *myLogger, QHash<QString, QString> *commandMap);
+    int exec();
+private:
+    QWizardPage* createIntroPage();
+
+    QString workspaceWizardLocation;
+    QString soundsLocation;
+    Logger *myLogger;
+    QWizard *myWizard;
+    QHash<QString, QString> *commandMap;
+private slots:
+    void restartWizard();
+    void pageChanged(int pageId);
+};
+
+#endif // SOUNDWIZARD_H
Index: /Vago/trunk/Vago/util.cpp
===================================================================
--- /Vago/trunk/Vago/util.cpp	(revision 771)
+++ /Vago/trunk/Vago/util.cpp	(revision 771)
@@ -0,0 +1,237 @@
+#include "util.h"
+
+namespace Util{
+
+QString normalizePath(QString path){
+    return path.replace("\\","/");
+}
+
+QString cutName(QString path){
+    return path.remove(0,path.lastIndexOf('/')).remove('"');
+}
+
+QString insertQuotes(QString path){
+    return "\""+path+"\"";
+}
+
+QString normalizeAndQuote(QString path){
+    return insertQuotes(normalizePath(path));
+}
+
+void showPopUp(QString message){
+    QMessageBox msgBox;
+    msgBox.setIcon(QMessageBox::Information);
+    msgBox.setText(message);
+    msgBox.exec();
+}
+
+void showRichPopUp(QString message){
+    QMessageBox msgBox;
+    msgBox.setTextFormat(Qt::RichText);
+    msgBox.setIcon(QMessageBox::Information);
+    msgBox.setText(message);
+    msgBox.exec();
+}
+
+void showWarningPopUp(QString message){
+    QMessageBox msgBox;
+    msgBox.setIcon(QMessageBox::Warning);
+    msgBox.setText(message);
+    msgBox.exec();
+}
+
+void showErrorPopUp(QString message){
+    QMessageBox msgBox;
+    msgBox.setIcon(QMessageBox::Critical);
+    msgBox.setText(message);
+    msgBox.exec();
+}
+
+//Same of above but allow open log file (doesn't right in log file!!)
+void showErrorLogPopUp(QString message){
+    QMessageBox msgBox;
+    msgBox.setIcon(QMessageBox::Critical);
+    msgBox.setText(message);
+    QPushButton *viewb = msgBox.addButton("View log", QMessageBox::ActionRole);
+    msgBox.setStandardButtons(QMessageBox::Close);
+    msgBox.exec();
+    if(msgBox.clickedButton() == (QAbstractButton*) viewb){
+        openLogFile();
+    }
+}
+
+void showRichErrorPopUp(QString message){
+    QMessageBox msgBox;
+    msgBox.setIcon(QMessageBox::Critical);
+    msgBox.setText(message);
+    msgBox.exec();
+}
+
+bool showQuestionPopUp(QWidget * parent, QString message){
+    return QMessageBox::question (parent, "Are you sure?", message, QMessageBox::Yes, QMessageBox::No)==QMessageBox::Yes;
+}
+
+QStringList multipleDirDialog(QString title){
+    QFileDialog w;
+
+    w.setFileMode(QFileDialog::DirectoryOnly);
+
+    w.setWindowTitle(title);
+
+    QListView *l = w.findChild<QListView*>("listView");
+
+    if (l) {
+        l->setSelectionMode(QAbstractItemView::MultiSelection);
+    }
+
+    QTreeView *t = w.findChild<QTreeView*>();
+
+    if (t) {
+        t->setSelectionMode(QAbstractItemView::MultiSelection);
+    }
+
+    if(w.exec()){ //if accepted
+        return w.selectedFiles();
+    }
+    return QStringList(); //return empty
+}
+
+bool checkEmptySpaces(QStringList toCheck){
+    foreach (QString current, toCheck){
+        if(current.trimmed().isEmpty()){
+            return true; //There are empty spaces
+        }
+    }
+    return false;
+}
+
+bool checkIfDoubles(QStringList toCheck){
+    foreach (QString current, toCheck){
+        if(!isStringDouble(current)){
+            return true; // Some aren't valid doubles
+        }
+    }
+    return false;
+}
+
+bool isStringInteger(QString myString){
+    bool isNumber;
+
+    myString.toInt(&isNumber); //convert to int and see if it succeeds
+
+    return isNumber;
+}
+
+bool isStringDouble(QString myString){
+    bool isDouble;
+
+    myString.toDouble(&isDouble); //convert to double and see if it succeeds
+
+    return isDouble;
+}
+
+//Copied from here: http://stackoverflow.com/questions/2536524/copy-directory-using-qt (ty roop)
+bool cpDir(const QString &srcPath, const QString &dstPath)
+{
+    rmDir(dstPath);
+
+    QDir parentDstDir(QFileInfo(dstPath).path());
+    if (!parentDstDir.mkdir(QFileInfo(dstPath).fileName()))
+        return false;
+
+    QDir srcDir(srcPath);
+    foreach(const QFileInfo &info, srcDir.entryInfoList(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot)) {
+        QString srcItemPath = srcPath + "/" + info.fileName();
+        QString dstItemPath = dstPath + "/" + info.fileName();
+        if (info.isDir()) {
+            if (!cpDir(srcItemPath, dstItemPath)) {
+                return false;
+            }
+        } else if (info.isFile()) {
+            if (!QFile::copy(srcItemPath, dstItemPath)) {
+                return false;
+            }
+        } else {
+            qDebug("Unhandled item" + info.filePath().toAscii() + "in cpDir");
+        }
+    }
+    return true;
+}
+
+//Copied from here: http://stackoverflow.com/questions/2536524/copy-directory-using-qt (ty roop)
+bool rmDir(const QString &dirPath)
+{
+    QDir dir(dirPath);
+    if (!dir.exists())
+        return true;
+    foreach(const QFileInfo &info, dir.entryInfoList(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot)) {
+        if (info.isDir()) {
+            if (!rmDir(info.filePath()))
+                return false;
+        } else {
+            if (!dir.remove(info.fileName()))
+                return false;
+        }
+    }
+    QDir parentDir(QFileInfo(dirPath).path());
+    return parentDir.rmdir(QFileInfo(dirPath).fileName());
+}
+
+QString fullTrim(QString str) {
+
+    str = str.simplified(); //convert all invisible chars in normal whitespaces
+    str.replace( " ", "" );
+
+    return str;
+}
+
+void openLogFile(){
+    QDesktopServices::openUrl(QUrl("file:///"+QDir::currentPath()+"/"+GlobalVars::AppLogName));
+}
+
+//Searches for the QString "toSearch" in the "myString" variable backward
+//Returns the index of the first match or -1 if not found
+int indexOfBackward(QString myString, QString toSearch, int from){
+    int myStringSize=myString.size();
+    int toSearchSize=toSearch.size();
+
+    if(from==-1){
+        from=myStringSize;
+    }
+
+    int i=from;
+
+    while(i>=0){
+        for(int j=toSearchSize-1; j>=0; j--){
+            i--;
+            if(myString.at(i)!=toSearch.at(j)){
+                break;
+            }
+            if(j==0){
+                return i;
+            }
+        }
+    }
+
+    return -1;
+}
+
+QStringList substring(QString myString,QString separator, Qt::CaseSensitivity cs){
+    QStringList result = QStringList();
+    int currIdx=0, nextIdx=0;
+
+    while(true){
+        nextIdx=myString.indexOf(separator,currIdx,cs);
+        result << myString.mid(currIdx,nextIdx-currIdx);
+        if(nextIdx==-1) break;
+        currIdx=nextIdx+1;
+    }
+
+    return result;
+}
+
+QString normalizeDecimalSeparator(QString value){
+    return value.replace(',','.');
+}
+
+}
Index: /Vago/trunk/Vago/util.h
===================================================================
--- /Vago/trunk/Vago/util.h	(revision 771)
+++ /Vago/trunk/Vago/util.h	(revision 771)
@@ -0,0 +1,60 @@
+#ifndef UTIL_H
+#define UTIL_H
+
+#include <QString>
+#include <QMessageBox>
+#include <QFileDialog>
+#include <QListView>
+#include <QTreeView>
+#include <QDesktopServices>
+#include <QUrl>
+
+
+namespace GlobalVars{
+    const QString AppVersion="0.8";
+    const QString OniSplitExeName="OniSplit.exe";
+    const QString XmlToolsExeName="xmlTools.exe";
+    const QString AppLogName="logVago.txt";
+    const QString BuiltOniSplitVersion="0.9.86.0";
+    const QString BuiltXmlToolsVersion="0.8d";
+    const QString ModsDomain="www.mods.oni2.net";
+    const QString VagoNode = "247";
+    const QString VagoCheckUpdatesUrl="http://"+ModsDomain+"/?q=api/node/"+VagoNode+".json";
+    const QString VagoWebUrl="http://"+ModsDomain+"/node/"+VagoNode;
+    const QString VagoTemporaryDir=QDir::tempPath()+"/VagoTemp";
+    const QString HelpLocation=QDir::currentPath() + "/help";
+    const char OniSplitProcSeparator=';';
+}
+
+/**
+  Utilities functions (global)
+  **/
+namespace Util{
+    QString normalizePath(QString path);
+    QString cutName(QString path);
+    QString insertQuotes(QString path);
+    QString normalizeAndQuote(QString path);
+    QString fullTrim(QString str);
+    QString normalizeDecimalSeparator(QString value);
+    QStringList multipleDirDialog(QString title);
+    QStringList substring(QString myString,QString separator,Qt::CaseSensitivity cs = Qt::CaseSensitive);
+    int indexOfBackward(QString myString, QString toSearch, int from = -1);
+    bool showQuestionPopUp(QWidget * parent, QString message);
+    bool checkEmptySpaces(QStringList toCheck);
+    bool checkIfDoubles(QStringList toCheck);
+    bool isStringInteger(QString myString);
+    bool isStringDouble(QString myString);
+    bool cpDir(const QString &srcPath, const QString &dstPath);
+    bool rmDir(const QString &dirPath);
+    bool removeDir(const QString &dirName);
+    void showPopUp(QString message);
+    void showRichPopUp(QString message);
+    void showWarningPopUp(QString message);
+    void showErrorPopUp(QString message);
+    void showErrorLogPopUp(QString message);
+    void showRichErrorPopUp(QString message);
+    void openLogFile();
+
+}
+
+#endif // UTIL_H
Index: /Vago/trunk/Vago/xmlprocessor.cpp
===================================================================
--- /Vago/trunk/Vago/xmlprocessor.cpp	(revision 771)
+++ /Vago/trunk/Vago/xmlprocessor.cpp	(revision 771)
@@ -0,0 +1,44 @@
+#include "xmlprocessor.h"
+
+XmlProcessor::XmlProcessor(Logger *myLogger, QStringList *commands)
+{
+    this->myLogger=myLogger;
+    this->commands=commands;
+}
+
+void XmlProcessor::run()
+{
+    QProcess *myProcess = new QProcess();
+    QString result = QString();
+    QString errorMessage = "";
+    int numErrors=0;
+
+    for(int i=0; i<this->commands->size(); i++){
+
+        myProcess->start(GlobalVars::XmlToolsExeName+" "+this->commands->at(i));
+        myProcess->waitForFinished(-1);
+        result=myProcess->readAllStandardError();
+
+        if(!result.isEmpty()){
+            //catch exception
+            myLogger->writeString("Xml Tools Error: \n"+this->commands->at(i)+"\n"+result);
+            errorMessage=result;
+            numErrors++;
+        }
+
+    }
+
+    delete myProcess; //delete object and make pointer invalid
+    this->commands->clear(); //clean list
+
+    //let's cut it a bit, complete error is in log file.
+    if(errorMessage.size()>600){
+        //limit it at 400 characters (not counting the warning at the begin)
+        errorMessage.remove(299,errorMessage.size()-600);
+        errorMessage.insert(299,"\n \t ... \n");
+        errorMessage.insert(0,"This error was been shortened. \nSee the complete error at Vago log file.\n\n");
+    }
+
+    emit resultConversion(errorMessage,numErrors);
+}
+
Index: /Vago/trunk/Vago/xmlprocessor.h
===================================================================
--- /Vago/trunk/Vago/xmlprocessor.h	(revision 771)
+++ /Vago/trunk/Vago/xmlprocessor.h	(revision 771)
@@ -0,0 +1,25 @@
+#ifndef XMLCOMMAND_H
+#define XMLCOMMAND_H
+#include <QProcess>
+#include <logger.h>
+#include <QThread>
+#include <util.h>
+
+class XmlProcessor : public QThread
+{
+     Q_OBJECT
+public:
+    XmlProcessor(Logger *myLogger, QStringList *commands);
+private:
+    Logger *myLogger;
+    QStringList *commands;
+
+protected:
+    void run(); //for thread
+signals:
+    void resultConversion(QString result, int numErrors);
+};
+
+
+
+#endif // XMLCOMMAND_H
