var first = true;
var oldActive,oldURL;

function changePicture(img_name,img_src, target)
{
   if (first)
      first = false;
   else
      oldActive.style.color="#333";
     
   oldActive = document.getElementById(img_src);
   document[img_name].src="images/productPicturename/"+target+".jpg";
   document.getElementById(img_src).style.color="orange";
}
