function processMbox(strMboxDivID, strTargetDivID, strSnippetSelector, strErrorHandlerFunction) {
	var mboxDefault, strMboxContents, strMboxSnippetURL, strProtocol;
	//Get the host root
	var strURL = window.location.href.toLowerCase();
	re = /^https?:\/\/(www\.)?([^/]+)?/i;
	strURL.match( re );
	var arrDomainSpecificSites = new Array("australia/en/","newzealand/en/","cambodia/");
	var strWCMContextRoot = "/cp/wcm/";
	var strConnectServlet = "cp/wcm/connect/";
	var strConnectServletAuth = "cp/wcm/myconnect/";
	var strHost = RegExp.$1 + RegExp.$2;
	switch (document.location.protocol){
		case "https:" : 
			strProtocol = "https:";
			break;
		default: 
			strProtocol = "http:";
	}
	var strMboxURLRoot = strProtocol + "//" + strHost + "/";
	// Check if host is a WCM portlet
	if(strURL.indexOf(strWCMContextRoot) > -1){
		if(strURL.indexOf(strConnectServlet) > -1){
			strMboxURLRoot = strMboxURLRoot + strConnectServlet;
		} else if(strURL.indexOf(strConnectServletAuth) > -1) {
			strMboxURLRoot = strMboxURLRoot + strConnectServletAuth;
		}
		// Tailor the root for domain specific sites 
		for(i=0;i<arrDomainSpecificSites.length;i++){
			if(strURL.indexOf(strMboxURLRoot + arrDomainSpecificSites[i]) > -1){
				strMboxURLRoot = strMboxURLRoot + arrDomainSpecificSites[i];
				break;
			}
		}
	}
	try {
		// Get relative URL path to snippet from mbox
		strMboxContents = $(strMboxDivID).text();
		var whlist = /[^\w\.\/\-]/;
		if(strMboxContents != "" && !whlist.test(strMboxContents)){
				$(strMboxDivID).remove(); // Remove the original mbox content
				strMboxSnippetURL = strMboxURLRoot + strMboxContents;
				// Retrieve snippet
				$.ajax({
					url: strMboxSnippetURL,
					dataType: "html",
					success: function(response) {
						// Validate response with snippet selector	
						response = "<div>"+response+"</div>";
						if($(strSnippetSelector, $(response)).length > 0){
							// Retrieve and insert script required for execution after the snippet is added to the page
							//  if such script exists as the 'snippetOnload' function in the first tag of the response
							var arrTagContents = response.split("<");
							if(arrTagContents.length > 2){
								var rex = new RegExp("^[\\s]*script[\\S\\s]+snippetOnload", "gi");
								if(rex.test(arrTagContents[2])){
									var script = document.createElement('script');
									script.type = 'text/javascript';
									script.text = arrTagContents[2].substr(arrTagContents[2].indexOf(">")+1);
									// The script needs to be added to the document head in order to be executed
									document.getElementsByTagName('head')[0].appendChild(script);
									
								}
							}
							// Retrieve the snippet and assemble the outer and inner html of the selection.
							var snippet = $(strSnippetSelector, $(response));
							var strSnippetInnerHTML = snippet.html();
							var d=document.createElement('div');
							var snippetClone = snippet.eq(0).clone().empty(); 
							d.appendChild(snippetClone[0]);
							var strSnippetOuterHTMLWrapper = d.innerHTML;
							arrTagContents = strSnippetOuterHTMLWrapper.split("<");
							if(arrTagContents.length > 1){
								var strSnippetHTML = "<" + arrTagContents[1] + strSnippetInnerHTML;
								if(arrTagContents.length > 2){
									strSnippetHTML = strSnippetHTML + "<" + arrTagContents[2];		
								}
								// Insert snippet in target and execute the 'snippetOnload'
								var strLoadSnippetScript = "<script>snippetOnload()</scr" + "ipt>";
								$(strTargetDivID).html(strSnippetHTML + strLoadSnippetScript);
							}
						
						} 
					},
					complete: function() {
						// Check target has been loaded successfully
						if($(strTargetDivID + " " + strSnippetSelector).length == 0){
							eval(strErrorHandlerFunction); // Load default on error
						}
					}
				});
		} else {	
			$(strMboxDivID).remove(); // Remove the original mbox content
			eval(strErrorHandlerFunction); // Load default on empty mbox
		}
	} catch (err) {	
		$(strMboxDivID).remove(); // Remove the original mbox content
		eval(strErrorHandlerFunction); // Load default on error
	}
}

