FiftyHeaderSandbox = function()
{
    var core = null;
    this.init = function(core_p)
    {
        core = core_p;
    };
    /*
    Function: addListener
    Parameters: htmlObject_p : An id, an element reference, or a collection of ids and/or elements to assign the listener to
                eventType_p:The type of event to append
                fnCallback_p:The method the event invokes
                myObject_p:An arbitrary object that will be passed as a parameter to the handler
                scopeObject_p:   If true, the obj passed in becomes the execution context of the listener. If an object, this object becomes the execution context.
    Returns: True if the action was successful or defered, false if one or more of the elements could not have the listener attached, or if the operation throws an exception.
    */
    this.addListener = function(htmlObject_p,eventType_p,fnCallback_p,myObject_p,scopeObject_p)
    {
        //returns true if the event handler was attached succesfully
        return core.addListener(htmlObject_p,eventType_p,fnCallback_p,myObject_p,scopeObject_p);
    };
    /*
    Funtion: removeListener
    Parameters:
                htmlObject_p => <String|HTMLElement|Array|NodeList> An id, an element reference, or a collection of ids and/or elements to remove the listener from.
                eventType_p => <String> the type of event to remove. 
                fnCallback_p => <Function> the method the event invokes. If fn is undefined, then all event handlers for the type of event are removed.
    Returns:
                true if the unbind was successful, false otherwise.
    */
    this.removeListener = function(htmlObject_p,eventType_p,fnCallback_p)
    {
        return core.removeListener(htmlObject_p,eventType_p,fnCallback_p);
    };
    /*
     Function: ajaxRequest
     Parameters: handleEvent_p: json object
     Returns the connection object
    */
    this.ajaxRequest = function(handleEvent_p)
    {
        //Method for initiating an asynchronous request via the XHR object. 
        //Returns the connection object
        if(typeof(handleEvent_p) == 'undefined' || handleEvent_p == null)
        {
            throw new Error("The main object for ajaxRequest function is undefined");
        }
        if(typeof(handleEvent_p.url) == 'undefined' || handleEvent_p.url == null)
        {
            throw new Error("URL is obligatory");
        }
        var handleEventObject = null;
        var method = (typeof(handleEvent_p.method) == 'undefined') ? 'POST' : handleEvent_p.method;
        var url = (typeof(handleEvent_p.url) == 'undefined') ? null : handleEvent_p.url;
        var scope = (typeof(handleEvent_p.scope) == 'undefined') ? null : handleEvent_p.scope;
        var success = (typeof(handleEvent_p.success) == 'undefined') ? null : handleEvent_p.success;
        var failure = (typeof(handleEvent_p.failure) == 'undefined') ? null : handleEvent_p.failure;
        var postData = (typeof(handleEvent_p.postData) == 'undefined' ) ? null : handleEvent_p.postData;
        var args = (typeof(handleEvent_p.argument) == 'undefined') ? null : handleEvent_p.argument;
        //Create handleEventObject
        handleEventObject = {
            method: method,
            url: url,
            scope: scope,
            success: success,
            failure: failure,
            postData: postData,
            argument: args
        };
        return core.ajaxRequest(handleEventObject);
    };
    /*
     Function: addClass
     Parameters: objectId_p: id of the html object
                 className_p: class to be added
     Add a class to an html object.
     A pass/fail boolean or array of booleans
    */
    this.addClass = function(objectId_p, className_p)
    {
        return core.addClass(objectId_p, className_p);
    };
    /*
     Function: removeClass
     Parameters: objectId_p: id of the html object
                 className_p: class to be removed
     A pass/fail boolean or array of booleans
    */
    this.removeClass = function(objectId_p, className_p)
    {
        return core.removeClass(objectId_p, className_p);
    };
    
    /*
     Function: replaceClass
     Parameters: objectId_p: id of the html object
                 oldClassName_p: class to be removed
                 newClassName_p: class to be added
     A pass/fail boolean or array of booleans
    */
    this.replaceClass = function(objectId_p, oldClassName_p, newClassName_p)
    {
        return core.replaceClass(objectId_p, oldClassName_p, newClassName_p);
    }
    
	/*
     Function: get
     Parameters: objectId_p: id of the html object
     Returns the Html object with the id
    */
	this.get = function(objectId_p)
	{
		return core.get(objectId_p);
	}
	
    /*
     Function: jsonParse
     Parameters: jsonObject_p: a json object
     Returns: the native JavaScript representation. Changes the json object to an array.
    */
    this.jsonParse = function(jsonObject_p)
    {
        return core.jsonParse(jsonObject_p);
    };
    /*
     Function: notify
     Parameters: event_p : case of event, data_p: a json object
     Returns: Notify whose event has to do.
    */
    this.notify = function(event_p, data_p)
    {
        core.handleNotification(event_p, data_p);
    };
    /*
     Function: onContentReady
     Parameters: moduleId_p: classname, fnHandler: handler function, data: json object, scope:this
     Returns: calls handler when the content is ready.
    */
    this.onContentReady = function(moduleId_p, fnHandler, data, scope)
    {
        return core.onContentReady(moduleId_p, fnHandler, data, scope);
    };
    /*
    Function selectorQuery
    Parameters: selector (<string> The CSS Selector to test the node against),
                root (<HTMLElement|String> optional An id or HTMLElement to start the query from. Defaults to Selector.document.),
                firstOnly (<Boolean> optional Whether or not to return only the first match.)
    Returns:An array of nodes that match the given selector.
    */
    this.selectorQuery = function(selector_p, root_p, firstOnly_p)
    {
        return core.selectorQuery(selector_p, root_p, firstOnly_p);
    };
    /*
    Function removeChild
    Parameters:
        parent => <HTMLElement|String> to create a YUI element instance
        child => <HTMLElement|String> The HTMLElement to remove
    Returns:
        The removed DOM element
    */        
    this.removeChild = function(parent_p,child_p)
    {
        return core.removeChild(parent_p,child_p);
    };
    /*
    Function: getViewportHeight
    Parameters:
        No parameters
    Returns:
        Returns the current height of the viewport. 
    */
    this.getViewportHeight = function()
    {
        return core.getViewportHeight();
    };
    /*
    Function: setStyle
        Wrapper for setting style properties of HTMLElements. Normalizes "opacity" across modern browsers. 
    Parameters:
        element_p => <String | HTMLElement | Array> => Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.  
        property_p => <String> => The style property to be set. 
        value_p => <String> => The value to apply to the given property.     
    */
    this.setStyle = function(element_p, property_p, value_p)
    {
        return core.setStyle(element_p, property_p, value_p);
    };
    /*
    Function: hasClass
        Determines whether an HTMLElement has the given className.
    Parameters:
        element_p => <String | HTMLElement | Array> => The element or collection to test  
        className_p => <String> => the class name to search for
    Returns:
        A boolean value or array of boolean values
    */
    this.hasClass = function(element_p, className_p)
    {
        return core.hasClass(element_p, className_p);
    };
    /*
    Function getXY
        Gets the current position of an element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). 
    Parameters:
        element_p => <String | HTMLElement | Array> => Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements  
    Returns:
        Array => The XY position of the element(s)
    */    
    this.getXY = function(element_p)
    {
        return core.getXY(element_p);  
    };

    /*
    Function: getX
        Gets the current X position of an element based on page coordinates. The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
    Parameters:
        element_p => <String | HTMLElement | Array> => Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements 
    Returns:
        Number | Array => The X position of the element(s)
    */
    this.getX = function(element_p)
    {
        return core.getX(element_p);  
    };
    /*
    Function: getY
        Gets the current Y position of an element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
    Parameters:
        element_p => <String | HTMLElement | Array> => Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements 
    Returns:
        Number | Array => The Y position of the element(s)
    */
    this.getY = function(element_p)
    {
        return core.getY(element_p);  
    };
    /*
    Function: motion
    Parameters:
        element_p => <String | HTMLElement> => Reference to the element that will be animated 
        attributes_p => <Object> => The attribute(s) to be animated.
            Each attribute is an object with at minimum a "to" or "by" member defined.
            Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). All attribute names use camelCase. 
        duration_p => <Number> => (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based 
        method_p => <Function> => (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)
    */
    this.motion = function(element_p, attributes_p, duration_p, method_p)
    {
        return core.motion(element_p, attributes_p, duration_p, method_p);
    };
    /*
    Function setXY
        Set the position of an html element in page coordinates, regardless of how the element is positioned.
        The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
    Parameters:
        element_p => <String | HTMLElement | Array> => Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements 
        position_p => <Array> => Contains X & Y values for new position (coordinates are page-based)
        noRetry_p => <Boolean> => By default we try and set the position a second time if the first fails 
    */
    this.setXY = function(element_p, position_p, noRetry_p)
    {
        return core.setXY(element_p, position_p, noRetry_p);
    };
    
    
    this.deleteCookie = function(name,options)
    {
        core.deleteCookie(name,options);
    };
  	this.setCookie = function(name,value,options)
    {
        return core.setCookie(name,value,options);
    };
    this.readCookie = function(name)
    {
        return core.readCookie(name);
    };
    this.newModuleInstance = function(name_p)
    {
        return core.newModuleInstance(name_p);
    };
    this.newOverlayInstance = function(objectName,data)
    {
      return core.newOverlayInstance(objectName,data);
    };
    this.stringify = function(ffvisitor)
    {
        return core.stringify(ffvisitor);
    };
	this.Calendar = function(container,config)
	{
		return core.Calendar(container,config);
	};
	this.Dialog = function(container,config)
	{
		return core.Dialog(container,config);
	};
	this.isAncestor = function(haystack,needle)
    {
        return core.isAncestor(haystack,needle);  
    };
	this.getTarget = function(e)
    {
        return core.getTarget(e);
    };
    this.EventOn = function(el,sType,fn,obj,overrideContext)
    {
        return core.EventOn(el,sType,fn,obj,overrideContext);
    };
    this.base64_encode = function(data_p)
    {
        return core.base64_encode(data_p);
    };
    this.base64_decode = function(data_p)
    {
        return core.base64_decode(data_p);
    };
	this.phoneNumberChars = function(e,obj)
	{
		return core.phoneNumberChars(e,obj);
	};
	this.isValidTelephoneNumber = function(strPhone)
	{
		return core.isValidTelephoneNumber(strPhone);
	};
	this.dateChars = function(e,obj)
	{
		return core.dateChars(e,obj);
	};
	this.isValidDate = function(dateStr, format)
	{
		return core.isValidDate(dateStr, format);
	}
	this.isValidEmail = function(emailStr)
	{
		return core.isValidEmail(emailStr);
	}
	this.hasOnlyLetters = function(e,obj)
	{
		return core.hasOnlyLetters(e,obj);
	}
};


