var verticalpos="fromtop"

if (!document.layers){
        document.write('</div>')
}
function JSFX_FloatTopDiv(startX, startY){


	  startY = startY  - 12;
        var ns = (navigator.appName.indexOf("Netscape") != -1);
        var d = document;
        function ml(id) {
                var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
                if(d.layers)el.style=el;
                       el.sP=function(x,y){this.style.left=x;this.style.top=y;}
                el.x = startX;
                if (verticalpos=="fromtop"){
                        el.y = startY;
                }else{
                        el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
                        el.y -= startY;
                }
                return el;
        }
        window.stayTopLeft=function(){

	 	  


                if (verticalpos=="fromtop"){
                        var pY = ns ? pageYOffset : document.body.scrollTop;
                        ftlObj.y += (pY + startY - ftlObj.y)/40;
                }else{
                        var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
                        ftlObj.y += (pY - startY - ftlObj.y)/40;
                }

		    //if(alertSize() < 780)
		    //ftlObj.y= startY;
			
                ftlObj.sP(ftlObj.x, ftlObj.y);
                
		    //if(alertSize() < 780)
		    //return;

                setTimeout("stayTopLeft()", 20);

        }

        ftlObj = ml("divStayTopLeft");
        stayTopLeft();
}


function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
    myHeight = 0;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );

 return myHeight;
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft + 7;
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x + 5;
	return curleft;
}



function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop -10
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y -10;
	return curtop;
}
