﻿// JScript File

function getElementsByClassName(searchClass,node,tag) {
    getElementsByClass(searchClass,node,tag)
}

function getElementsByClass(searchClass,node,tag) {
    var classElements = new Array();
    node = node || document;
    tag = tag || '*';
    
    var els = node.getElementsByTagName(tag);
    var elsLen = els.length;
    var pattern = new RegExp("(^|\\\\s)"+searchClass+"(\\\\s|$)");
    for (i = 0, j = 0; i < elsLen; i++) {
        if ( pattern.test(els[i].className) ) {
	        classElements[j] = els[i];
	        j++;
        }
    }
    return classElements;
}

function getX( oElement )
{
    oElement = oElement || document.body;
    
    var iReturnValue = 0;
    while( oElement != null ) {
        iReturnValue += oElement.offsetLeft;
        oElement = oElement.offsetParent;
    }
    return iReturnValue;
}

function getY( oElement )
{
    oElement = oElement || document.body;
    
    var iReturnValue = 0;
    while( oElement != null ) {
        iReturnValue += oElement.offsetTop;
        oElement = oElement.offsetParent;
    }
    return iReturnValue;
}