/**
 * The following function removes the following
 * 	 single quotes
 * 	 double quotes
 * 	 registered symbol
 */
function removeQuotesAndR(str) {

	str = str.replace("&amp;#34;", "");
	str = str.replace("&amp;#39;", "");
	str = str.replace("&amp;quot;", "");
	str = str.replace("&amp;reg;", "");

	return str;
}

/** 
 * Removes amp from encoded querystring
 * due to & separators between parameters
 * 
 */
function removeAmp(urlString) {
	
	return urlString.replace("amp;", "");
}

function initZoom() {
		
	var zoomOptions = {
			zoomWidth: 380,	
			zoomHeight: 319,
			title: false
		};

	jQuery(".zoomimage").jqzoom(zoomOptions);
}

function swapImage(mainImage, zoomImage, productName, anchorID) {
	
	jQuery("#pdpMain .productimage").html("<a class=\"zoomimage\" href=\"" + zoomImage + "\">" +
		                         "<img src=\"" + mainImage + "\" title=\"" + productName + "\" onload=\"initZoom()\"/></a>");
	
	jQuery(".productthumbnails a").each(function(){
		if(jQuery(this).attr("id") != anchorID) {
			jQuery(this).removeClass("selectedthumb");
		} else {
			jQuery(this).addClass("selectedthumb");
		}
	});	
}

