<!--

function SymError()
{
  return true;
}

window.onerror = SymError;

var SymRealWinOpen = window.open;

function SymWinOpen(url, name, attributes){
//alert('function SymWinOpen');
  return (new Object());
}

//window.open = SymWinOpen;

var links = document.getElementsByTagName('a');

for (var i = 0; i < links.length; i++)
	
if(links[i].className == 'livethumbnail'){
	
	var aPicCheck		= new Array(2);
		aPicCheck[0]	= "new";
	var img				= links[i].getElementsByTagName('img')[0];		

	img.state = 'small';
	img.smallSrc = img.getAttribute('src');
	img.smallWidth = parseInt(img.getAttribute('width'),10);
	img.smallHeight = parseInt(img.getAttribute('height'),10);
	img.largeSrc = links[i].getAttribute('href');
	img.largeWidth = parseInt(img.getAttribute('largewidth'),10);
	img.largeHeight = parseInt(img.getAttribute('largeheight'),10);
	img.ratio = img.smallHeight / img.smallWidth;
	links[i].onclick = scale;
}
	

function scale()
{
	var img = this.getElementsByTagName('img')[0];		
	img.src = img.smallSrc;

	
	if(aPicCheck[0] == "new") {
		aPicCheck[0] = img;
	}
	else if(aPicCheck[0] != img) {
		aPicCheck[1] = img;
		aPicCheck[0].setAttribute('width', aPicCheck[0].smallWidth);
		aPicCheck[0].setAttribute('height', aPicCheck[0].smallHeight);
		aPicCheck[0].src = aPicCheck[0].smallSrc;
		window.clearInterval(interval);
		aPicCheck[0].state = 'small';
	}
	
	if(! img.preloaded)
	{
		img.preloaded = new Image();
		img.preloaded.src = img.largeSrc;
	}

	var interval = window.setInterval(scaleStep, 10);
	return false;
	
	function scaleStep()
	{
		var step = 10;
		var width = parseInt(img.getAttribute('width'),10);
		var height = parseInt(img.getAttribute('height'),10);
		
		if(img.state == 'small')
		{
			width += step;
			height += Math.floor(step * img.ratio);
			
			img.setAttribute('width', width);
			img.setAttribute('height', height);
			
			if(width > img.largeWidth - step)
			{
				img.setAttribute('width', img.largeWidth);
				img.setAttribute('height', img.largeHeight);
				img.setAttribute('src', img.largeSrc);
				window.clearInterval(interval);
				img.state = 'large';
				aPicCheck[0] = img;
			}

		}
		else
		{
			width -= step;
			height -= Math.floor(step * img.ratio);

			img.setAttribute('width', width);
			img.setAttribute('height', height);
			
			if(width < img.smallWidth + step)
			{
				img.setAttribute('width', img.smallWidth);
				img.setAttribute('height', img.smallHeight);
				img.src = img.smallSrc;
				window.clearInterval(interval);
				img.state = 'small';
			}
		}
	}			
}

//-->

