
//////////////////////////////////////////////////////////////////////////////////////

// PROTOTYPES

/////////////

if( typeof HTMLElement != "undefined" && !HTMLElement.prototype.insertAdjacentElement ) {

    HTMLElement.prototype.insertAdjacentElement = function( where , parsedNode ) 	{
    
        switch ( where ) {
        
        case 'beforeBegin':
        this.parentNode.insertBefore( parsedNode ,this )
        break;
        
        case 'afterBegin':
        this.insertBefore( parsedNode , this.firstChild );
        break;
        
        case 'beforeEnd':
        this.appendChild( parsedNode );
        break;
        
        case 'afterEnd':
        
        if ( this.nextSibling ) 
        this.parentNode.insertBefore( parsedNode , this.nextSibling );
        else this.parentNode.appendChild( parsedNode );
        break;
        
        }
    		
    }

    HTMLElement.prototype.insertAdjacentHTML = function( where , htmlStr ) {
	
    var r = this.ownerDocument.createRange();
    r.setStartBefore( this );
    var parsedHTML = r.createContextualFragment( htmlStr );
    this.insertAdjacentElement( where , parsedHTML );
		
    }

    HTMLElement.prototype.insertAdjacentText = function ( where , txtStr ) {
    
    var parsedText = document.createTextNode( txtStr );
    this.insertAdjacentElement( where , parsedText );
    
    }
	
}

// -------------------------------------------------------------------------------------

function hd_is_child_of( parent , child ) {

		if (child != null) {

				while (child.parentNode) {

						if ((child = child.parentNode) == parent) {

						return true;

						}

				}

		}

return false;

}

function hd_onmouseout( element , event , JavaScript_code ) {

var current_mouse_target = null;

		if (event.toElement) {

		current_mouse_target = event.toElement;

		} else if (event.relatedTarget) {

		current_mouse_target = event.relatedTarget;

		}

		if (!hd_is_child_of(element, current_mouse_target) && element != current_mouse_target) {

		eval(JavaScript_code);

		}

}


//////////////////////////////////////////////////////////////////////////////////////

// ONLOAD

/////////////

function addLoadEvent(func) {

var oldonload = window.onload; 

    if (typeof window.onload != 'function') { 
    
    window.onload = func; 
    
    } else { 
    
        window.onload = function() { 
        
            if (oldonload) { 
            
            oldonload(); 
            
            } 
        
        func(); 
        
        } 
    
    } 

} 


//////////////////////////////////////////////////////////////////////////////////////

// FRAMES

/////////////

if ( self != top ) {

top.location = self.location;

}


//////////////////////////////////////////////////////////////////////////////////////

// STATUS BAR

/////////////

// -------------------------------------------------------------------------------------

function hidestatus () {

window.status=''
return true

}

// -------------------------------------------------------------------------------------

    if ( document.layers ) document.captureEvents( Event.MOUSEOVER | Event.MOUSEOUT )

document.onmouseover = hidestatus;
document.onmouseout = hidestatus;

// -------------------------------------------------------------------------------------


//////////////////////////////////////////////////////////////////////////////////////

// VARIABLES

/////////////

// -------------------------------------------------------------------------------------

