function changeOpac(opacity,id) 
{
	var object = document.getElementById(id).style;
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}

function newPic(pic_new,marg)
{
	var duration = 600;
	var speed = Math.round(duration / 100);
	var timer = 0;

	document.getElementById('pic').src = pic_new;
	
	document.getElementById('pic_box').style.marginLeft = marg+"px";
	
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac(" + i + ",'" + 'pic' + "')",(timer * speed));
		timer++;
	}
}
	
function change(pic_new,marg)
{
	var duration = 600;
	var speed = Math.round(duration / 100);
	var timer = 0;
	var i = 100;
	
	for(i = 100; i >= 0; i--) {
		setTimeout("changeOpac(" + i + ",'" + 'pic' + "')",(timer * speed));
		timer++;
	}
	
	setTimeout("newPic('" + pic_new + "','"+ marg + "')",1000);
	
}

function roll(pic_id,pic_new)
{
	document.getElementById(pic_id).src = pic_new;
}	
