var current;
function moveIt(i,el){
	if(current)shrinkIt(false);
	current = i;
	var close;
	close = '<input type="button" id="c'+i+'" class="close" onclick="shrinkIt(true);" value="X"/>';
	$('i'+i).insert({after:close});
	$('p'+i).morph('width:385px;font-size:16px;line-height:20px;padding-right:10px;');
	if($('da'+i))
	{
		$('da'+i).morph('margin-top:30px');
		$('db'+i).morph('margin-top:30px');
		bestelnummer = $('dc'+i).value;
		$('aantal_'+bestelnummer).morph('margin-top:30px;');
	}



	$('h'+i).morph('margin-top:70px;width:395px;font-size:28px;');
	$('w'+i).morph('height:310px;width:810px');
	string = $('i'+i).src;
	$('i'+i).src = string.sub('x_thumbs/','');	
	$('i'+i).morph('width:400px; height:300px;');
	Element.remove(el);	
	element = $('w'+i);
	$('lijst').insert({top:element});
	scrollTo(0,0);
	
}
function shrinkIt(close)
{
	
	i =current;
	$('w'+i).hide();
	$('c'+i).remove();
	if($('da'+i))
	{
		$('da'+i).morph('margin-top:0px',{duration:0});
		$('db'+i).morph('margin-top:0px',{duration:0});
		bestelnummer = $('dc'+i).value;
		$('aantal_'+bestelnummer).morph('margin-top:0px;',{duration:0});
	}

	$('p'+i).morph('width:595px;font-size:10px;line-height:12px;padding-right:0px;',{duration:0});
	$('h'+i).morph('margin-top:5px;width:595px;font-size:16px;',{duration:0});
	$('w'+i).morph('height:155px;width:810px',{duration:0});
	$('i'+i).morph('width:195px; height:145px;',{duration:0});
	element = '<div onclick="moveIt('+i+',this)" class="meercont"><input type="button" class="minfo1" value="Voor vergroting klik hier"/><input class="minfo2" type="image" src="'+BASE+'images/btnpijl.png"/></div>';
	$('w'+i).insert({bottom:element});
	$('w'+i).show();
	if(close)current=0;
}

