﻿// JScript File
//If Not Label = top.window.document.getElementById('HiddenNameDefault').value='aaa'
//[Flag Layer]///////////////////////////////////////////////////////////////////////////////
    function koFlagLayer(LayerName,LayerFlash) {
        //IE FireFox
        if (document.getElementById) {
            thisLayerName = document.getElementById(LayerName);
            if (LayerFlash == 'show') {
                thisLayerName.style.display = 'block';
            }
            
            if (LayerFlash == 'hide') {
                thisLayerName.style.display = 'none';
            }
            
            if (LayerFlash == 'flag' || LayerFlash == '') {
                if (thisLayerName.style.display == 'block' || thisLayerName.style.display == ''){
                    thisLayerName.style.display = 'none';
                } else {
                    thisLayerName.style.display = 'block';
                }
            }
        }
        
        //NETSCAPE 4 or below
        if (document.layers) { 
            if (LayerFlash == 'show') {
                document.layers[LayerName].display = 'block';
            }
            
            if (LayerFlash == 'hide') {
                document.layers[LayerName].display = 'none';
            }
            
            if (LayerFlash == 'flag' || LayerFlash == '') {
                if (document.layers[LayerName].display == 'block'){
                    document.layers[LayerName].display = 'none';
                } else {
                    document.layers[LayerName].display = 'block';
                }
            }        
        }
        
    }
//[Flag Layer (iFrame)]///////////////////////////////////////////////////////////////////////////////
    function koIframeFlagLayer(LayerName,LayerFlash) {
        //IE FireFox
        if (document.getElementById) {
            thisLayerName = top.window.document.getElementById(LayerName);
            if (LayerFlash == 'show') {
                thisLayerName.style.display = 'block';
            }
            
            if (LayerFlash == 'hide') {
                thisLayerName.style.display = 'none';
            }
            
            if (LayerFlash == 'flag' || LayerFlash == '') {
                if (thisLayerName.style.display == 'block'){
                    thisLayerName.style.display = 'none';
                } else {
                    thisLayerName.style.display = 'block';
                }
            }
        }
        
        //NETSCAPE 4 or below
        if (document.layers) { 
            if (LayerFlash == 'show') {
                top.window.document.layers[LayerName].display = 'block';
            }
            
            if (LayerFlash == 'hide') {
                top.window.document.layers[LayerName].display = 'none';
            }
            
            if (LayerFlash == 'flag' || LayerFlash == '') {
                if (top.window.document.layers[LayerName].display == 'block'){
                    top.window.document.layers[LayerName].display = 'none';
                } else {
                    top.window.document.layers[LayerName].display = 'block';
                }
            }        
        }
        
    }    
//[innerHTML]///////////////////////////////////////////////////////////////////////////////
    
    function koInnerHTMLWrite(LayerName,LayerText) {
        //IE FireFox
        if (document.getElementById) {
            thisLayerName = document.getElementById(LayerName);
            thisLayerName.innerHTML = LayerText;
        }
        
        //NETSCAPE 4 or below
        if (document.layers) { 
            document.layers[LayerName].document.writeln(LayerText);
            document.layers[LayerName].document.close();       
        }
    }
    
    function koInnerHTMLRead(LayerName) {
        //IE FireFox
        if (document.getElementById) {
            thisLayerName = document.getElementById(LayerName);
            return thisLayerName.innerHTML;
        }
        
        //NETSCAPE 4 or below
        if (document.layers) { 
            return document.layers[LayerName];
        }
    }
    
//[innerHTML (iFrame) ]///////////////////////////////////////////////////////////////////////////////    
    function koIframeInnerHTMLWrite(LayerName,LayerText) {
        //Check in Iframe
        if (window != top) {
           //iframe
        } else {
            alert("Work in iFrame Only!");
            top.location.href = '/';
        }
        
        //IE FireFox
        if (document.getElementById) {
            thisLayerName = top.window.document.getElementById(LayerName);
            thisLayerName.innerHTML = LayerText;
        }
        
        //NETSCAPE 4 or below
        if (document.layers) { 
            top.window.document.layers[LayerName].document.writeln(LayerText);
            top.window.document.layers[LayerName].document.close();       
        }
    }
    
    function koIframeInnerHTMLRead(LayerName) {
        //Check in Iframe
        if (window != top) {
           //iframe
        } else {
            alert("Work in iFrame Only!");
            top.location.href = '/';
            return false;
        }    
        //IE FireFox
        if (document.getElementById) {
            thisLayerName = top.window.document.getElementById(LayerName);
            return thisLayerName.innerHTML;
        }
        
        //NETSCAPE 4 or below
        if (document.layers) { 
            return top.window.document.layers[LayerName];
        }
    }

//[Check Layer]///////////////////////////////////////////////////////////////////////////////
    function koCheckLayer(LayerName) {
        //IE FireFox
        if (document.getElementById) {
				thisLayerName = document.getElementById(LayerName);
                if (thisLayerName.style.display == 'block' || thisLayerName.style.display == ''){
                    return 'show';
                } else {
                    return 'hide';
                }
        }
        
        //NETSCAPE 4 or below
        if (document.layers) { 
                if (document.layers[LayerName].display == 'block'){
                    return 'show';
                } else {
                    return 'hide';
                }
        }

	}

//[Check Layer (iFrame)]///////////////////////////////////////////////////////////////////////////////
    function koIframeCheckLayer(LayerName) {
        //IE FireFox
        if (document.getElementById) {
				thisLayerName = top.window.document.getElementById(LayerName);
                if (thisLayerName.style.display == 'block' || thisLayerName.style.display == ''){
                    return 'show';
                } else {
                    return 'hide';
                }
        }
        
        //NETSCAPE 4 or below
        if (document.layers) { 
                if (top.window.document.layers[LayerName].display == 'block'){
        	            return 'show';
                } else {
            	       return 'hide';
                }
        }
        
    }    
	
//[Find Layer]///////////////////////////////////////////////////////////////////////////////
    function koFindLayer(LayerName) {
        //IE FireFox
        if (document.getElementById) {
				return document.getElementById(LayerName);
        }
        
        //NETSCAPE 4 or below
        if (document.layers) { 
                return document.layers[LayerName];
        }

	}

//[Find Layer (iFrame)]///////////////////////////////////////////////////////////////////////////////
    function koIframeFindLayer(LayerName) {
        //IE FireFox
        if (document.getElementById) {
				return top.window.document.getElementById(LayerName);
        }
        
        //NETSCAPE 4 or below
        if (document.layers) { 
                return top.window.document.layers[LayerName];
        }
        
    }    
