if (typeof(GSLCore) != 'undefined') {

/**
 * GSLPhoto
 */
GSLPhoto = {
    setLeft:function(oObj, oLeft) {
        oObj = GSLCore.styleObj(oObj);
        if (!GSLCore.isStyleObj(oObj)) {
            return;
        }        
        oLeft = GSLCore.fromInt(oLeft);
        if (GSLCore.isInt(oLeft)) {
            oObj.style.left = oLeft + 'px';
        }        
    },
    setTop:function(oObj, oTop) {
        oObj = GSLCore.styleObj(oObj);
        if (!GSLCore.isStyleObj(oObj)) {
            return;
        }        
        oTop = GSLCore.fromInt(oTop);
        if (GSLCore.isInt(oTop)) {           
            oObj.style.top = oTop + 'px';
        }        
    },
    appendChild:function(oParentObj, oObj) {
        oParentObj = GSLCore.styleObj(oParentObj);
        if (!GSLCore.isStyleObj(oParentObj)) {
            return(null);
        }
        if (GSLCore.isStr(oObj)) {
            var oChild = document.createElement(oObj);
            oParentObj.appendChild(oChild);
            return(oChild);
        }
        oObj = GSLCore.styleObj(oObj);
        if (GSLCore.isStyleObj(oObj)) {
            oParentObj.appendChild(oObj);
            return(oObj);            
        }
        return(null);
        
    },
    appendAttribute:function(oObj, oAttribute, oValue) {
        oObj = GSLCore.styleObj(oObj);
        if (!GSLCore.isStyleObj(oObj)) {
            return(null);
        }
        if (!GSLCore.isStr(oAttribute)) {
            return(null);
        }
        var oAttributeObj = document.createAttribute(oAttribute);
        if (GSLCore.isStr(oValue)) {
            oAttributeObj.nodeValue = oValue;
        } else {
            oAttributeObj.nodeValue = '';
        }
        oObj.setAttributeNode(oAttributeObj);
        return(oAttributeObj);
    },
    removePhoto:function() {
        var oContainer = document.getElementById('photo_container');
        if (GSLCore.isStyleObj(oContainer)) {
            document.body.removeChild(oContainer);
        }
    },
    activatePhoto:function(oPhoto, oTitle, oColor) {
        GSLPhoto.removePhoto();
        var oContainer = GSLPhoto.appendChild(document.body, 'div');
        GSLPhoto.appendAttribute(oContainer, 'id', 'photo_container');
        GSLPhoto.appendAttribute(oContainer, 'name', 'photo_container');
        if (GSLCore.isStr(oColor)) {
            oColor = 'photo_container photo_container_' + oColor;
        } else {
            oColor = 'photo_container photo_container_black';
        }    
        GSLPhoto.appendAttribute(oContainer, 'class', oColor); 
        var oClose = GSLPhoto.appendChild(oContainer, 'div');
        GSLPhoto.appendAttribute(oClose, 'class', 'photo_close');
        var oCloseLink = GSLPhoto.appendChild(oClose, 'a');
        GSLPhoto.appendAttribute(oCloseLink, 'title' , 'Schließen');
        GSLPhoto.appendAttribute(oCloseLink, 'alt' , '');
        GSLPhoto.appendAttribute(oCloseLink, 'href' , "javascript:GSLPhoto.removePhoto()");
        GSLPhoto.appendAttribute(oCloseLink, 'class' , 'photo_close');
        oCloseLink.appendChild(document.createTextNode('X'));
        var oImageLink = GSLPhoto.appendChild(oContainer, 'a');
        GSLPhoto.appendAttribute(oImageLink, 'alt' , '');    
        GSLPhoto.appendAttribute(oImageLink, 'title' , oTitle);    
        GSLPhoto.appendAttribute(oImageLink, 'class', 'photo_image');
        var oImage = GSLPhoto.appendChild(oImageLink, 'img');
        GSLPhoto.appendAttribute(oImage, 'src', oPhoto);
        GSLPhoto.appendAttribute(oImage, 'title', oTitle);    
        GSLPhoto.appendAttribute(oImage, 'class', 'photo_image');
        GSLAni.fadeIn(oContainer);
    }    
}

}
