﻿function popUrl(url, width, height)
{
	LeftPosition = (screen.width) ? (screen.width - width)/2 : 0;
	TopPosition = (screen.height) ? (screen.height - height)/2 : 0;

	settings = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',top=' + TopPosition + ',left=' + LeftPosition;
	win = window.open(url, null, settings);

	if(win.focus){
		win.focus();
	}
}

function popUrl2(url, width, height)
{
	LeftPosition = (screen.width) ? (screen.width - width)/2 : 0;
	TopPosition = (screen.height) ? (screen.height - height)/2 : 0;

	settings = 'toolbar=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',top=' + TopPosition + ',left=' + LeftPosition;
	win = window.open(url, null, settings);

	if(win.focus){
		win.focus();
	}
}

function wait() {
    setTimeout('checkImages()',3000);
}

function IsImageOk(img) {
    if (!img.complete)
        return false;

    if (typeof img.naturalWidth != "undefined" && img.naturalWidth == 0)
        return false;

    return true;
}

function checkImages() {
    for (var i = 0; i < document.images.length; i++)
        if (!IsImageOk(document.images[i])) {
            //document.images[i].style.visibility = "hidden";
            //document.images[i].style.display = "none";
            document.images[i].src = '/Images/spacer.gif';
        }
}

