/**
 * @author Jason
 */
function changeItem(img,title){ //,price
    changeSrc(img);
    changeTitle(title); //price
    
}   
    
function changeSrc(img){
    //document.getElementById("bigImage").src=img;
    swapImage(img);
}

function changeTitle(t){ //,p
    var oldElem = document.getElementById("title").childNodes[0];
    var ttl = document.createTextNode(t); //+' - $'+p
    document.getElementById("title").replaceChild(ttl, oldElem);
    document.getElementById("bigImage").setAttribute('title', t);
}

function swapImage(img) {
	var thumb = img.substring(img.length-6,0);
	var temp = thumb.split('/');
	var secondtolast = temp[temp.length-2];
	var last = secondtolast + "/" + temp[temp.length-1];
	var ext = img.substring(img.length-4,img.length);
	//alert(last+ext);
	document.getElementById("bigImage").src=last+ext;
}

