var timerWidth=new Array();
var timerHeight=new Array();
function expandImg(id, widthOld, heightOld, widthNew, heightNew){	
	if (document.images["bloggImg"+id].width == widthOld && document.images["bloggImg"+id].height == heightOld){
		Timerw(id,widthOld,widthNew);
		Timerh(id,heightOld,heightNew);	 	
	}
	else{
		if (document.images["bloggImg"+id].width == "" && document.images["bloggImg"+id].height == ""){
			document.images["bloggImg"+id].width = widthOld;
			document.images["bloggImg"+id].height = heightOld;
			Timerw(id,widthOld,widthNew);
			Timerh(id,heightOld,heightNew);	 	
		}
		else{
			document.images["bloggImg"+id].width=widthOld;
			document.images["bloggImg"+id].height=heightOld;
			document.images["bloggImg"+id].style.marginRight="2px";
			document.images["bloggImg"+id].style.marginLeft="2px";
			document.images["bloggImg"+id].style.borderLeftStyle="solid";
			document.images["bloggImg"+id].style.borderRightStyle="solid";
			document.images["bloggImg"+id].style.borderBottomStyle="solid";
			clearTimeout(timerHeight[id]);
			clearTimeout(timerWidth[id]);
		}
	}
}

function Timerw(id,curWidth,widthNew){
	if (curWidth < widthNew){
		document.images["bloggImg"+id].width = curWidth;
		var alphaWidth = widthNew-curWidth;
		curWidth = curWidth+(alphaWidth*0.2);
		if (alphaWidth < 1.1){
			document.images["bloggImg"+id].width = widthNew;
			curWidth = widthNew;
			if (widthNew == 600){
				document.images["bloggImg"+id].style.borderLeftStyle="none";
				document.images["bloggImg"+id].style.borderRightStyle="none";
			}
		}
		else{
			document.images["bloggImg"+id].style.marginRight= (580-curWidth)/2+"px";
			document.images["bloggImg"+id].style.marginLeft=  (580-curWidth)/2+"px";
			timerWidth[id]=setTimeout("Timerw("+id+","+curWidth+","+widthNew+")",2);
		}
	}
}

function Timerh(id,curHeight,heightNew){
	if (curHeight < heightNew){
		document.images["bloggImg"+id].height=curHeight;
		alphaHeight = heightNew-curHeight;
		curHeight = curHeight+(alphaHeight*0.2);
		if (alphaHeight < 1.1){
			document.images["bloggImg"+id].height=heightNew;
			curHeight = heightNew;
		}
		else{
			timerHeight[id]=setTimeout("Timerh("+id+","+curHeight+","+heightNew+")",2);
		}
	}
}

function imgGetFocus(id){
	document.images["bloggImg"+id].style.borderColor = "white";
}
function imgLoseFocus(id){
	document.images["bloggImg"+id].style.borderColor = "#cecece";
}

