<!--



//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// DHTML POSITIONING
// CODE FROM http://www.webreference.com/dhtml/diner/realpos1/8.html 
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
function DL_GetElementLeft(eElement)
{
    if (!eElement && this)                       // if argument is invalid
    {                                            // (not specified, is null or is 0)
        eElement = this;                         // and function is a method
    }                                            // identify the element as the method owner
    
    var nLeftPos = eElement.offsetLeft;          // initialize var to store calculations
    var eParElement = eElement.offsetParent;     // identify first offset parent element  
    while (eParElement != null)
    {                                            // move up through element hierarchy
        nLeftPos += eParElement.offsetLeft;      // appending left offset of each parent
        eParElement = eParElement.offsetParent;  // until no more offset parents exist
    }
    return nLeftPos;                             // return the number calculated
}


function DL_GetParentElementLeft(eElement) // BY ANT
{
    if (!eElement && this)                       // if argument is invalid
    {                                            // (not specified, is null or is 0)
        eElement = this;                         // and function is a method
    }                                            // identify the element as the method owner
    
    var nLeftPos = 0; //eElement.offsetLeft;          // initialize var to store calculations
    var eParElement = eElement.offsetParent;     // identify first offset parent element  
    while (eParElement != null)
    {                                            // move up through element hierarchy
        nLeftPos += eParElement.offsetLeft;      // appending left offset of each parent
        eParElement = eParElement.offsetParent;  // until no more offset parents exist
    }
    var actualLeftPos = nLeftPos - eElement.offsetLeft;
    
    return actualLeftPos;                             // return the number calculated
}


function DL_GetElementTop(eElement)
{
    if (!eElement && this)
    {
        eElement = this;
    }

    var nTopPos = eElement.offsetTop;
    var eParElement = eElement.offsetParent;
    while (eParElement != null)
    {
        nTopPos += eParElement.offsetTop;
        eParElement = eParElement.offsetParent;
    }
    return nTopPos;
}


function DL_GetParentElementTop(eElement) // BY ANT
{
    if (!eElement && this)                       // if argument is invalid
    {                                            // (not specified, is null or is 0)
        eElement = this;                         // and function is a method
    }                                            // identify the element as the method owner
    
    var nTopPos = 0; //eElement.offsetLeft;          // initialize var to store calculations
    var eParElement = eElement.offsetParent;     // identify first offset parent element  
    while (eParElement != null)
    {                                            // move up through element hierarchy
        nTopPos += eParElement.offsetTop;      // appending left offset of each parent
        eParElement = eParElement.offsetParent;  // until no more offset parents exist
    }
    var actualTopPos = nTopPos - eElement.offsetLeft;
    
    return actualTopPos;                             // return the number calculated
}


//These functions can be called in either of two ways:

//elementReference.getTrueXPosition = DL_GetElementLeft;
//elementReference.getTrueYPosition = DL_GetElementTop;
//var nMyElementsTrueXPosition = elementReference.getTrueXPosition();
//var nMyElementsTrueYPosition = elementReference.getTrueYPosition();

//or:

//var nMyElementsTrueXPosition = DL_GetElementLeft(elementReference);
//var nMyElementsTrueYPosition = DL_GetElementTop(elementReference);







//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// get viewport width and height...
// http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/


 var viewportwidth;
 var viewportheight;

function getViewPortSize()
{ 
     // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
     
     if (typeof window.innerWidth != 'undefined')
     {
          viewportwidth = window.innerWidth,
          viewportheight = window.innerHeight
     }
     
    // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

     else if (typeof document.documentElement != 'undefined'
         && typeof document.documentElement.clientWidth !=
         'undefined' && document.documentElement.clientWidth != 0)
     {
           viewportwidth = document.documentElement.clientWidth,
           viewportheight = document.documentElement.clientHeight
     }
     
     // older versions of IE
     
     else
     {
           viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
           viewportheight = document.getElementsByTagName('body')[0].clientHeight
     }
     
}

//-->

