function getComplianceInfo() {
	//<![CDATA[
	$('compliancewindow').show();
	$('compliancewindow').update('<p><strong>Loading...</strong></p>');
	var url = 'compliancelookup.php';
    var item = $F('complianceitem');
	var infoRequest = new Ajax.Request(url, {
                                   method:'get',
								   parameters: { item: item },
                                   onSuccess: function(transport){
                                   var json = transport.responseText.evalJSON();
								   buildComplianceInfo(json);
                                   }
                                   });
	
	//]]>
}	

function buildComplianceInfo(json) {
    //<![CDATA[
	var output = '<h4>Compliance Information for ' + json.item_cd + '</h4>';
	if (json.hasCompInfo=='false') {
	    output += '<p>No compliance data available</p>';
	} else {
	    output += '<blockquote>';
		if (json.hasUL == 'true') {
            output += '<p><strong><img src="/images/ul.gif" alt="UL Info" align="bottom" hspace="5"/> UL Information</strong></p>';
			output += '<ul>';
			output += '<li class="maincell">UL Listed: ' + json.ul_listed + '</li>';
			output += '<li class="maincell">UL Recognized: ' + json.ul_recognized + '</li>';
			output += '<li class="maincell">UL Haz. Loc.: ' + json.ul_hazardous_locs + '</li>';
			output += '</ul>';
			var ulURL = 'http://database.ul.com/cgi-bin/XYV/template/LISEXT/1FRAME/gfilenbr.html';
            output += '<a href="' + ulURL + '" target="_blank">Search UL file numbers here</a>';			
		}
		output += '<p><strong><img src="/images/CE_logo.gif" alt="CE Info" align="bottom" hspace="5"/> CE Information</strong>';
		if (json.hasCELink != 'true') {
		    output += ': None';
		}
		output += '</p>';
		
		if (json.hasCELink == 'true') {	
            output += '<ul>';		
			output += '<li class="maincell"><a href="' + json.ce_link + '" target="_blank">' + json.ce_link + '</a></li>';	
            output += '</ul>';			
		}
		output += '<p><strong><img src="/images/csa_ca.gif" alt="CSA Info" align="bottom" hspace="5"/> CSA File Number:</strong> ';
		if (json.csa.length > 1) {
            output += json.csa + '<br/>';
			var csaURL = 'http://directories.csa-international.org';
			output += '<a href="' + csaURL + '" target="_blank">Search CSA file numbers here</a>';			
        } else {
            output += 'None';
        }		
		output += '</p>';
		var rohsStatus = "None";
        if(json.rohs == "2") {
	        rohsStatus = "EXEMPT";
	    }
        else if(json.rohs == "1") {
	        rohsStatus = "YES";
	    }
		output += '<p> <img src="/images/rohs.gif" alt="RoHS Info" align="bottom" hspace="5"/>';
		output += '<strong>RoHS Status:</strong> ' + rohsStatus;
		if (json.rohs_date.length > 1) {
		    output += '<br/><strong>RoHS Date: </strong>' + json.rohs_date;
		}	
		output += '</p>';
		if (json.compliance_comments.length > 1) {
            output += '<hr/>';
			output += '<p><strong>Comments:</strong> ' + json.compliance_comments + '</p>';
        }		
        output += '</blockquote>';		
	}
	$('compliancewindow').update(output);
	//]]>
}