/**
 * This class is used to pass information regarding the panorama layer dataset to be browsed by this
 * instance of the application.  The information in this class is set and is
 * available to modules needing information about the specifics of this layer dataset. 
 * <br><br>
 * <a href="mailto:ehudsons@andrew.cmu.edu">Ellen Hudson-Snyder</a>, 
 * <a href="mailto:evedar@andrew.cmu.edu">Elvin Vedar</a>,
 * <a href="mailto:cbalz@andrew.cmu.edu">Christopher M. Balz</a>.
 * <br><br>CVS Version Info:<br>
 *  $Id: PanoramaLayerProtocol.js,v 1.5 2005/11/12 18:45:13 evedar Exp $
 * <br><br>
 * @object-prop <code>string</code> <code>strLayerTitle</code>  Title of the layer dataset protocol
 * @object-prop <code>string</code> <code>strForwardFastPath</code>  Path to fast forward layer
 * @object-prop <code>string</code> <code>strForwardMediumPath</code>  Path to medium forward layer
 * @object-prop <code>string</code> <code>strForwardSlowPath</code>  Path to slow forward layer
 * @object-prop <code>string</code> <code>strBackwardSlowPath</code>  Path to slow backward layer
 * @object-prop <code>string</code> <code>strBackwardMediumPath</code>  Path to medium backward layer
 * @object-prop <code>string</code> <code>strBackwardFastPath</code>  Path to fast backward layer
 * @author Team GigaToasted (Fall-2005-CMU-NASA/Google-Practicum Subteam) 
 * @version 1.0
 */


/**
 * Create a <code>PanoramaLayerProtocol</code> object
 * @param pObjParent <code>Object</code>  The parent of this object. In Gigapan Explorer, this 
 *                           should be the controller (Gigapan) object.
 */

function PanoramaLayerProtocol(pObjParent) {
    this.strLayerTitle = null;
    this.strForwardFastPath = null;
    this.strForwardMediumPath = null;
    this.strForwardSlowPath = null;
    this.strBackwardFastPath = null;
    this.strBackwardMediumPath = null;
    this.strBackwardSlowPath = null;

    this.getLayerTitle = PanoramaLayerProtocol_getLayerTitle;
    this.getForwardFastPath = PanoramaLayerProtocol_getForwardFastPath;
    this.getForwardMediumPath = PanoramaLayerProtocol_getForwardMediumPath;
    this.getForwardSlowPath = PanoramaLayerProtocol_getForwardSlowPath;
    this.getBackwardFastPath = PanoramaLayerProtocol_getBackwardFastPath;
    this.getBackwardMediumPath = PanoramaLayerProtocol_getBackwardMediumPath;
    this.getBackwardSlowPath = PanoramaLayerProtocol_getBackwardSlowPath;

    this.setLayerTitle = PanoramaLayerProtocol_setLayerTitle;
    this.setForwardFastPath = PanoramaLayerProtocol_setForwardFastPath;
    this.setForwardMediumPath = PanoramaLayerProtocol_setForwardMediumPath;
    this.setForwardSlowPath = PanoramaLayerProtocol_setForwardSlowPath;
    this.setBackwardFastPath = PanoramaLayerProtocol_setBackwardFastPath;
    this.setBackwardMediumPath = PanoramaLayerProtocol_setBackwardMediumPath;
    this.setBackwardSlowPath = PanoramaLayerProtocol_setBackwardSlowPath;

    this.init = PanoramaLayerProtocol_init;
}
/**
 * This method initializes the <code>PanoramaLayerProtocol</code> object with data from the XmlHttpRequest.  If element is
 * disabled, the corresponding path is set to <code>null</code>.
 * @param  pObjXmlHttpRequest  <code>Object</code> An object containing all the protocol information to fill PanoramaLayerProtocol
 */
function PanoramaLayerProtocol_init(pObjXmlHttpRequest) {
    var retu;
    var objFastForward, objMediumForward, objSlowForward, objFastBackward, objMediumBackward, objSlowBackward;

    objFastForward = pObjXmlHttpRequest.getElementsByTagName('fastforward')[0];
    objMediumForward = pObjXmlHttpRequest.getElementsByTagName('mediumforward')[0];
    objSlowForward = pObjXmlHttpRequest.getElementsByTagName('slowforward')[0];
    objFastBackward = pObjXmlHttpRequest.getElementsByTagName('fastbackward')[0];
    objMediumBackward = pObjXmlHttpRequest.getElementsByTagName('mediumbackward')[0];
    objSlowBackward = pObjXmlHttpRequest.getElementsByTagName('slowbackward')[0];

    this.setLayerTitle(pObjXmlHttpRequest.getElementsByTagName('layer_title')[0].firstChild.data);

    if (objFastForward.getAttributeNode('disabled')) {
        if ( objFastForward.getAttributeNode('disabled').nodeValue != "true") {
             this.setForwardFastPath(objFastForward.firstChild.data);
        } else {
             this.setForwardFastPath(null);
        }
    } else {
        this.setForwardFastPath(objFastForward.firstChild.data);
    }

    if (objMediumForward.getAttributeNode('disabled')) {
        if ( objMediumForward.getAttributeNode('disabled').nodeValue != "true") {
             this.setForwardMediumPath(objMediumForward.firstChild.data);
        } else {
             this.setForwardMediumPath(null);
        }
    } else {
        this.setForwardMediumPath(objMediumForward.firstChild.data);
    }

    if (objSlowForward.getAttributeNode('disabled')) {
        if ( objSlowForward.getAttributeNode('disabled').nodeValue != "true") {
             this.setForwardSlowPath(objSlowForward.firstChild.data);
        } else {
             this.setForwardSlowPath(null);
        }
    } else {
        this.setForwardSlowPath(objSlowForward.firstChild.data);
    }

    if (objFastBackward.getAttributeNode('disabled')) {
        if ( objFastBackward.getAttributeNode('disabled').nodeValue != "true") {
             this.setBackwardFastPath(objFastBackward.firstChild.data);
        } else {
             this.setBackwardFastPath(null);
        }
    } else {
        this.setBackwardFastPath(objFastBackward.firstChild.data);
    }

    if (objMediumBackward.getAttributeNode('disabled')) {
        if ( objMediumBackward.getAttributeNode('disabled').nodeValue != "true") {
             this.setBackwardMediumPath(objMediumBackward.firstChild.data);
        } else {
             this.setBackwardMediumPath(null);
        }
    } else {
        this.setBackwardMediumPath(objMediumBackward.firstChild.data);
    }

    if (objSlowBackward.getAttributeNode('disabled')) {
        if ( objSlowBackward.getAttributeNode('disabled').nodeValue != "true") {
             this.setBackwardSlowPath(objSlowBackward.firstChild.data);
        } else {
             this.setBackwardSlowPath(null);
        }
    } else {
        this.setBackwardSlowPath(objSlowBackward.firstChild.data);
    }
}


// Getters:

/**
 * This method returns the <code>panoramaLayerProtocol</code> title of the dataset
 * @return <code>string</code>  A str representing the title
 */
function PanoramaLayerProtocol_getLayerTitle() {
    return this.strLayerTitle;
}


/**
 * This method returns the <code>panoramaLayerProtocol</code> forward fast path
 * @return <code>string</code>  A str representing the path
 */
function PanoramaLayerProtocol_getForwardFastPath() {
    return this.strForwardFastPath;
}


/**
 * This method returns the <code>panoramaLayerProtocol</code> forward medium path
 * @return <code>string</code>  A str representing the path
 */
function PanoramaLayerProtocol_getForwardMediumPath() {
    return this.strForwardMediumPath;
}


/**
 * This method returns the <code>panoramaLayerProtocol</code> forward slow path
 * @return <code>string</code>  A str representing the path
 */
function PanoramaLayerProtocol_getForwardSlowPath() {
    return this.strForwardSlowPath;
}


/**
 * This method returns the <code>panoramaLayerProtocol</code> backward fast path
 * @return <code>string</code>  A str representing the path
 */
function PanoramaLayerProtocol_getBackwardFastPath() {
    return this.strBackwardFastPath;
}


/**
 * This method returns the <code>panoramaLayerProtocol</code> backward medium path
 * @return <code>string</code>  A str representing the path
 */
function PanoramaLayerProtocol_getBackwardMediumPath() {
    return this.strBackwardMediumPath;
}


/**
 * This method returns the <code>panoramaLayerProtocol</code> backward slow path
 * @return <code>string</code>  A str representing the path
 */
function PanoramaLayerProtocol_getBackwardSlowPath() {
    return this.strBackwardSlowPath;
}


// Setters:


/**
 * This method sets the <code>panoramaLayerProtocol</code> title of the dataset
 * @param strLayerTitle  <code>string</code> A str representing the layer title
 */
function PanoramaLayerProtocol_setLayerTitle(strLayerTitle) {
    this.strLayerTitle = strLayerTitle;
}


/**
 * This method sets the <code>panoramaLayerProtocol</code> fast forward path
 * @param strLayerTitle  <code>string</code> A str representing the fast foward path
 */
function PanoramaLayerProtocol_setForwardFastPath(strForwardFastPath) {
    this.strForwardFastPath = strForwardFastPath;
}


/**
 * This method sets the <code>panoramaLayerProtocol</code> medium forward path
 * @param strLayerTitle  <code>string</code> A str representing the medium foward path
 */
function PanoramaLayerProtocol_setForwardMediumPath(strForwardMediumPath) {
    this.strForwardMediumPath = strForwardMediumPath;
}


/**
 * This method sets the <code>panoramaLayerProtocol</code> medium forward path
 * @param strLayerTitle  <code>string</code> A str representing the medium foward path
 */
function PanoramaLayerProtocol_setForwardSlowPath(strForwardSlowPath) {
    this.strForwardSlowPath = strForwardSlowPath;
}


/**
 * This method sets the <code>panoramaLayerProtocol</code> fast backward path
 * @param strLayerTitle  <code>string</code> A str representing the fast foward path
 */
function PanoramaLayerProtocol_setBackwardFastPath(strBackwardFastPath) {
    this.strBackwardFastPath = strBackwardFastPath;
}


/**
 * This method sets the <code>panoramaLayerProtocol</code> medium backward path
 * @param strLayerTitle  <code>string</code> A str representing the medium foward path
 */
function PanoramaLayerProtocol_setBackwardMediumPath(strBackwardMediumPath) {
    this.strBackwardMediumPath = strBackwardMediumPath;
}


/**
 * This method sets the <code>panoramaLayerProtocol</code> medium backward path
 * @param strLayerTitle  <code>string</code> A str representing the medium foward path
 */
function PanoramaLayerProtocol_setBackwardSlowPath(strBackwardSlowPath) {
    this.strBackwardSlowPath = strBackwardSlowPath;
}


