/*	This script is (c) 2000 Ivanopulo http://www.damn.to
	Please leave this message intact if you use the script.
	Updated by DuhA, Y2k.*/
var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");

function CheckUIElements(obj)
{
	var yLogoFrom, yLogoTo, yOffset, timeoutNextCheck;
	
/*	if ( bNetscape4plus ) {
		yLogoFrom   = document.divLogo.top;
		yLogoTo     = top.pageYOffset + 1;
	}
	else*/ //if ( bExplorer4plus ) 
//	{
		yLogoFrom   = parseInt (document.all.divLogo.style.top, 10);
		yLogoTo     = document.body.scrollTop + 1;
//	}
	timeoutNextCheck = 500;

	if ( yLogoFrom != yLogoTo ) 
	{
		yOffset = Math.ceil( Math.abs( yLogoTo - yLogoFrom ) / 20 );
		if ( yLogoTo < yLogoFrom )
			yOffset = -yOffset;
		
	/*	if ( bNetscape4plus )
			document.divLogo.top += yOffset;
		else */ //if ( bExplorer4plus )
			divLogo.style.top = parseInt (document.all.divLogo.style.top, 10) + yOffset;
		timeoutNextCheck = 10;
	}
	setTimeout ("CheckUIElements()", timeoutNextCheck);
}
function OnLoad1111()
{

	if ( top.frames.length )
		top.location.href = self.location.href;

	var y;
	// we're not gonna be loaded in frames
	// setting initial UI elements positions
/*	if ( bNetscape4plus) {
		document.divLogo.top = top.pageYOffset + 1;
		document.divLogo.visibility = "visible";
	}
	else*/ //if ( bExplorer4plus ) 
//	{
		document.all.divLogo.style.top = document.body.scrollTop + 1;
		document.all.divLogo.style.visibility = "visible";
//	}
	// initializing UI update timer
	CheckUIElements();
	return true;
}

/*
	public partial class MainPage : UserControl
	    {
        public MainPage()
        {
            InitializeComponent();
            System.Windows.Browser.HtmlPage.Window.AttachEvent("onunload", new EventHandler(Handler));
        }

        public void Handler(object sender, EventArgs args)
        {
            // обрабатываем закрытие!
			alert('test');
        }
    }
*/
