function returnProtocol() {
    if (window && 
        window.location && 
        window.location.protocol && 
        window.location.protocol.toString().toLowerCase() == "https:") 
    return"https:";

    return"http:"
}

function BDC_RecordConversion(conversion_value, conversion_id) {
	var newDate = new Date;
	var newTime = escape(newDate.getTime());
	
	var bdcImgServer = returnProtocol() + "//roi.business.com/crm/images/conversion.gif";
	var queryString="?time=" + newTime + "&convId=" + conversion_id;
	
	if (conversion_value != null) {
	    queryString += "&convValue=" + conversion_value;
	}
	
	var url = bdcImgServer + queryString;
	
	if (window.BDC_DEBUG != null && BDC_DEBUG == true) {
	    alert("About to contact Business.com server with the following request : " + url);
	}
		
	var image = new Image(1,1);
	image.src = url;
		
	if (window.BDC_DEBUG != null && BDC_DEBUG == true) {
	    var image = document.getElementById("bdcConversionImage");
	    if (image == null) {
	        alert("ERROR: The request wasn't received properly.");
	    } else {
	        alert("The request was received properly. Please remember to disable the DEBUG flag from your script.");
	    }
	}
}

