﻿
function addPopup() {
$("<div id='popupDiv' style='display:block;text-align:right;padding:10px 10px;position:absolute;background-color:#ffffff;left:-100px;top:100px;z-index:9000;'>"+
			"<a href='#' id='popupClose' style='color:#ff0000;text-decoration:none;' >X</a><br />"+
			"<a TARGET='_blank' href='http://www.telescopicforks.com'><img src='img/rollerforks/popup.gif' border=0 /></a>"+
			"</div>").appendTo("body");
		
		$("#popupClose").bind("click",function()
			{
				$("#popupDiv").hide();
			});
		
		$("#popupDiv").each(function() {
		    this.style.left = 690 + 'px';
		    this.style.top = 546 + 'px';
		});
		$("#popupDiv").show();

}

function DL_GetElementLeft(eElement)
{
    if (!eElement && this)                      // if argument is invalid</font>
    {                                           // (not specified, is <tt>null</tt> or is <tt>0</tt>)</font>
        eElement = this;                        // and function is a method</font>
    }                                           // identify the element as the method owner</font>
    
    var nLeftPos = eElement.offsetLeft;         // initialize var to store calculations</font>
    var eParElement = eElement.offsetParent;    // identify first offset parent element</font>  
    while (eParElement != null)
    {                                           // move up through element hierarchy</font>
        nLeftPos += eParElement.offsetLeft;     // appending left offset of each parent</font>
        eParElement = eParElement.offsetParent; // until no more offset parents exist</font>
    }
    return nLeftPos;                            // return the number calculated</font>
}


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 writeFlashObj(str) 
{
	document.write(str); 
}

function ChangeBackground(id, color)
{
	document.getElementById(id).style.backgroundColor = color;
}

function SureLink(link, message)
{
	if (confirm(message))
		location.href=link;
}
