var cancelImage = false, ol_text = '';
function overlibImage(imagePath)
{
	bgImage=new Image();
	bgImage.src=imagePath;
	if(!bgImage.complete)
	{
		setCursor('progress');
		cancelImage=false;
		bgImage.onload=function()
		{
			if(!cancelImage)
			{
				var substringpos=bgImage.src.length-imagePath.length;
				if(bgImage.src.substring(substringpos)==imagePath)
				{
					setCursor('default');
					overlib(BACKGROUND,imagePath,FGCOLOR,'',WIDTH,bgImage.width,HEIGHT,bgImage.height,VAUTO,HAUTO,OFFSETX,30);
				}
			}
		}
	}
	else
	{
	overlib(BACKGROUND,imagePath,FGCOLOR,'',WIDTH,bgImage.width,HEIGHT,bgImage.height,VAUTO,HAUTO,OFFSETX,30);
	}
}

function overlibMouseout()
{
  cancelImage=true;
  setCursor('default');
  return nd();
}

function setCursor(type) 
{
	document.getElementsByTagName('body')[0].style.cursor = typeof type == 'undefined' ? 'default' : type;
	links = document.getElementsByTagName('a');
	for(i = 0; i < links.length; i++) links.item(i).style.cursor = typeof type == 'undefined' ? 'pointer' : type;
}

function showCard(card) 
{
		setCursor('progress');
		var html = '<iframe onload="setCursor();" src="'+card+'" scrolling="no" frameBorder="0" height="135" width="200"></iframe>';
		return overlib(html, BORDER, 0, FULLHTML, WIDTH, 200, HEIGHT, 135, VAUTO, HAUTO);
}

function toggleDiv(divid)
{
	if(document.getElementById(divid).style.display == 'none')
	{
		document.getElementById(divid).style.display = 'block';
    }
	else
	{
		document.getElementById(divid).style.display = 'none';
    }
}
