

	/* As per wakeside requirement, function to highlight customer review tab on click of Customer Review Button on Detail Page. */

	function highlightCustomerReviewTab(customerReviewrTabId) {
           setActiveTab(customerReviewrTabId)
	}
	
	/**
	 * Sets the current tab to its on state and other other tabs to their off states,
	 * it also displays the tabs associated content. 
	 * @param {String} sTabID This is the string ID of the active tab.
	 */
	function setActiveTab(sTabID){
		/** A DOM ref to the tab content block element. */
		var oTabContent = document.getElementById("tabContent");
		/** A DOM ref to the tab's assocated content. */
		var oNewContent = document.getElementById(sTabID+"_content");
		/** A DOM ref to the active tab. */
		var oTab = document.getElementById(sTabID);

		
    // set the current tab state to On and the others to Off
    // works for both text and img tabs
    for(var i=0; i<oTab.parentNode.childNodes.length; i++){
        var tempNode = oTab.parentNode.childNodes[i];
        if (tempNode.id && tempNode.id.indexOf("tab_") != -1){
            var oImg = getTabImg(tempNode.id, tempNode);
            if (tempNode.id == sTabID){
                tempNode.className="infoTabOn";
                if (oImg) oImg.src = eval(oImg.id+"_ON.src");
            } else {
                tempNode.className="infoTabOff";
                if (oImg) oImg.src = eval(oImg.id+"_OFF.src");
            }
        }
    }
  
		// display the content associated with the active tab
		// first hide current child noce and move it back 
		if( oTabContent.childNodes[0]) {
			oTabContent.childNodes[0].style.display="none";
			oNewContent.parentNode.appendChild(oTabContent.childNodes[0]);
		}
		// next append new content node to tab content and unhide
		oTabContent.appendChild( oNewContent );
		oNewContent.style.display="block";
	}

	/**
	 * Gets a DOM image object ref for the active tab if one exists.  
	 * @param {String} sTabID This is the string ID of the active tab.
	 * @param {Object} oTab This is a DOM ref to the active tab.
	 * @return A DOM image object ref or null if one could not be found.
	 * @type Object 
	 */
	function getTabImg(sTabID, oTab){
		/** An image object. */
		var oImage = null;

		// Loop through the tab's child nodes checking for an image that matches the active tab's ID.
		for (var i=0; i<oTab.childNodes.length; i++){
			var oTempNode = oTab.childNodes[i];
			if (oTempNode.tagName == "IMG" && oTempNode.id && oTempNode.id == sTabID +"_IMG"){
				oImage = oTempNode;
			}
		}

		return oImage;
	}

	/**
	 * Creates an image object with a give source string.  
	 * @param {String} sImgSrc This is the string to be used as the image's srouce.
	 * @return An image object.
	 * @type Object 
	 */
	function createImg(sImgSrc){
		/** A new image object. */
		var newImg = new Image();

		// update the image's source.
		newImg.src = sImgSrc;

		return newImg;
	}

