$(document).ready(function(){

	if($('#infobox').length){ // only do this on a product page
		displayInfoPanelByHash();
	};

});

function getQSHash(){

	var strQueryString=document.location.toString();

	if(strQueryString.match('#')){
		var strAnchorHash='#'+strQueryString.split('#')[1];

		if(strAnchorHash!=''){
			return strAnchorHash;
		}
	}

}

function displayInfoPanelByHash(){

	var strHash=getQSHash();

	if(strHash){
		if($(strHash).parents('div#infobox').length){ // The hash exists within #infobox panel
			var strID;

			if($(strHash).hasClass('content')){
				strID=$(strHash).attr('id');
			}else{
				strID=$(strHash).parents('div.content').attr('id'); // retrieve ID of #infobox panel
			}			

			if(strID){
				if(strID.match('_box')){ // double check that we have an #infobox panel
					strID='#'+strID.replace('_box',''); // add preceding '#' to and remove '_box' from id to find name of appropriate #infobox panel anchor
					$('a'+strID).click(); // fake a click on this box
				}
			}
		}

	}
}
