Hide and Show elements

found in http://www.testbox.de/fileadmin/hideshow.js:

%STARTINCLUDE%
<script type="text/javascript">
<!--
function getStyleObject(objectId) {
        if(document.getElementById && document.getElementById(objectId)) {
                return document.getElementById(objectId).style;
        } else if (document.all && document.all(objectId)) {
                return document.all(objectId).style;
        } else if (document.layers && document.layers[objectId]) {
                return getObjNN4(document,objectId);
        } else {
                return false;
        }
}

function changeObjectVisibility(objectId,type) {
        var styleObject = getStyleObject(objectId, document);
        if(styleObject) {
                styleObject.display = type;
        } else {
                alert('FEHLER, BOXID NICHT GEFUNDEN');
                return false;
        }
}
function changeObjectVisibilityAndBG(objectId,type) {
        var styleObject = getStyleObject(objectId, document);
        if(styleObject) {
                styleObject.display = type;
                return true;
        } else {
                alert('FEHLER, BOXID NICHT GEFUNDEN');
                return false;
        }
}

function setVisible(boxid,current,type) {
        var current;
        var myField = current.checked;
        changeObjectVisibility(boxid,type);
}
function setVisible2(boxid,current,type) {
        var current;
        var myField = current.checked;
        changeObjectVisibilityAndBG(boxid,type);
}

function justshow(boxid) {
        changeObjectVisibility(boxid,'block');
}

function setClip(val) {
        var styleObject = getStyleObject('scroller', document);
        var myVar;
        if(styleObject) {
                //styleObject.clip = 'rect(0px 400px 50px 20px)';
                styleObject.clip = styleObject.clip;
                alert(styleObject.clip);
                styleObject.left = '200px';
                myVar = styleObject.clip.substr(5,10);
                alert(myVar);
        } else {
                alert('SOMETHING WENT TERRIBLY WRONG');
        }
}

function scroll(val) {
        setClip(val);
        return true;
}
function stopScroll() {
}

function markMandatory(boxid,formvalue) {
        //alert(boxid+' Value '+formvalue);
        if(formvalue == '') {
                if(document.getElementById && document.getElementById(boxid)) {
                        document.getElementById(boxid).className = 'mandatory';
                } else if (document.all && document.all(boxid)) {
                        document.all(boxid).className = 'mandatory';
                } else if (document.layers && document.layers[boxid]) {
                        return getObjNN4(document,boxid);
                } else {
                        return false;
                }
        }
}

-->
</script>
%STOPINCLUDE%


-- PeterZumbruch - 28 Jun 2007
Topic revision: r2 - 2007-06-28, PeterZumbruch
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)