function correctPNG() {}

function fixheight()
{
	zVmenu = document.getElementById('vmenu');
	zCntnt = document.getElementById('cntnt');
	var vmenuHeight = zVmenu.offsetHeight;
	var cntntHeight = zCntnt.offsetHeight;

	if (vmenuHeight > cntntHeight) { var zHeight = vmenuHeight };
	if (cntntHeight > vmenuHeight) { var zHeight = cntntHeight };
	if (cntntHeight == vmenuHeight) { var zHeight = cntntHeight };

	if (zHeight < 450) { var zHeight = 450; }	
	zVmenu.style.height = zHeight + 'px';
	zCntnt.style.height = zHeight + 'px';
}



function js_border(which, what)
{
	if (what == '1') 
	{ 
		which.style.border = 'solid 1px #072251';
	} else
	{
		which.style.border = 'solid 1px #98BADE';
	}
}



function t(color, type, front, back, _dir)
{
	document.getElementById('tsh').className = type+'-'+color+'-'+document.getElementById('state').value;	
	
	document.getElementById('c').value = color;

	chb = document.getElementById('state');
	if (chb.value == "front") 
	{
		document.getElementById('mia').href = _dir+'/i.php?i='+front+'&c='+color;
	} else	
	{
		document.getElementById('mia').href = _dir+'/i.php?i='+back+'&c='+color;
	}

	//update-wame i size-ovete!
	s = document.getElementById('size');
	s.innerHTML = '';
	for (var i=0; i < sizes[color].length; i++) {
		o = document.createElement('OPTION');
		o.value = sizes[color][i];
		o.innerHTML = sizes[color][i];
		s.appendChild(o);
	}

}



function _state(ob, front, back, _dir, type)
{

	chb = document.getElementById('state');


	if (type == "o") 
	{
		imgdir = 'middle';
	} else
	{
		imgdir = 'thumbs';
	}
	
	if (chb.value == 'front') 
	{ 
		chb.value = 'back';

		document.getElementById('tthumb').src = _dir+'/images/'+imgdir+'/'+back;
		//document.getElementById('tthumb').style.marginLeft = '63px';
		//document.getElementById('tthumb').style.marginTop = '30px';

		ob.innerHTML = 'покажи лицето';
	} else
	{
		chb.value = 'front';		

		document.getElementById('tthumb').src = _dir+'/images/'+imgdir+'/'+front;
		//document.getElementById('tthumb').style.marginLeft = '63px';
		//document.getElementById('tthumb').style.marginTop = '30px';

		ob.innerHTML = 'покажи гърба';
	}

	t(document.getElementById('c').value, type, front, back, _dir); 
	
	correctPNG();

}





function do_sel(ar, state)
{

	for (var i=0; i < ar.length; i++) {
		if (document.getElementById(ar[i])) 
		{
			document.getElementById(ar[i]).checked = state;
		}
	}

}