// 
// $Id: wgny-context.js.jsp 326 2009-01-20 00:26:59Z brian $
// Javascript Context
// 
// Copyright (c) 2008 Wolter Group New York, Inc., All rights reserved.
// 
// This software ("WGNY Software") is supplied to you by Wolter Group New York
// ("WGNY") in consideration of your acceptance of the terms of the Agreement
// under which the software was licensed to you. Your use or installation of
// this Software constitutes acceptance of these terms.  If you do not agree
// with these terms, do not use or install this software.
// 
// The WGNY Software is provided by WGNY on an "AS IS" basis.  WGNY MAKES NO
// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
// WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE, REGARDING THE WGNY SOFTWARE OR ITS USE AND OPERATION
// ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
// 
// IN NO EVENT SHALL WGNY BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION
// AND/OR DISTRIBUTION OF THE WGNY SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER
// THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR
// OTHERWISE, EVEN IF WGNY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// 
// Engineered by Wolter Group in New York City
// 





/**
 * Obtain the application context root
 * 
 * @return context root
 */
function WGGetContextRoot() {
  return "/NeonMonster/";
}

/**
 * Obtain a URL under the context root.
 * 
 * @param u path from context root
 * @return translated URL
 */
function WGGetContextURL(u) {
  return WGGetContextRoot() + ((u.indexOf('/') == 0) ? u.substring(1) : u);
}

/**
 * Obtain the session identifier
 * 
 * @return session identifier
 */
function WGGetSessionID() {
  return "983B4A46236C8D2E12784FA62F0C4CFD";
}

/**
 * Obtain a constant
 * 
 * @param constant name
 * @return value
 */
function WGGetConstant(n) {
  switch(n){
    case "JSONResponseSupport.RESULT_OK": return "ok";
    case "JSONResponseSupport.RESULT_EXCEPTION": return "exception";
    case "Article.STATUS_NONE": return "0";
    case "Article.STATUS_PUBLISHED": return "1";
    case "Product.STATUS_NONE": return "0";
    case "Product.STATUS_ACTIVE": return "1";
    case "Product.STATUS_SOLD_OUT": return "2";
    case "Product.STATUS_EVERY": return "255";
    case "StoreSupport.BIT_OPERATION_AND": return "1";
    case "StoreSupport.BIT_OPERATION_OR": return "2";
    case "StoreSupport.BIT_OPERATION_NOT": return "3";
    case "BitOperation.AND": return "AND";
    case "BitOperation.OR": return "OR";
    case "BitOperation.NOT": return "NOT";
    default: return null;
  }
}

