var tt, op, nowid = 0;
var IE = (navigator.appVersion.indexOf("MSIE") != -1 && navigator.systemLanguage);

NC = (document.layers);
Opera = (document.getElementById);

function getHeight() {
	if (IE || Opera) send = document.body.clientHeight;
	if (NC) send = window.innerHeight;
	return send;
}

function showphoto(id)
{
	if(id == 0) id = nowid;
	document.getElementById('photobody').style.height = getHeight()+'px';
	document.getElementById('photobody').style.display = 'block';
	document.getElementById('bigphoto').src = '/img/models/big/0.jpg';
	document.getElementById('bigphoto').src = '/img/models/big/'+goods[id]+'.jpg';
	document.getElementById('photobody').style.display = 'block';
	op = 0;
	tt = setTimeout("showing()",15);
	return false;
}

function closephoto()
{
	clearTimeout(tt);
	document.getElementById('photobody').style.display = 'none';
	return false;
}

function showing()
{
	op += 5;
	if(op > 100) clearTimeout(tt);
	else
	{
		if(IE) document.getElementById('bigphoto').filters.opacity=op; else { document.getElementById('bigphoto').style.opacity=op/100; document.getElementById('bigphoto').style.mozopacity=op/100; }
		tt = setTimeout("showing()",15);
	}
}

function next()
{
	nowid += 1;
	if(nowid > allgoods - 1) nowid = 0;
	document.getElementById('bigphoto').src='/img/models/big/'+goods[nowid]+'.jpg';
	return false;
}

function back()
{
	nowid -= 1;
	if(nowid < 0) nowid = allgoods - 1;
	document.getElementById('bigphoto').src='/img/models/big/'+goods[nowid]+'.jpg';
	return false;
}