/*
* All the functions are suffixed with a word 'Listener' so that the calls don't get
* into a loop
*/
function trilogy_autoretail_onMakeSelectionListener(make) {
	if('Firefox' == BrowserDetect.browser ){
		trilogy_autoretail_onMakeSelectionCallbackListener(make);
		return;
	}
	
	if( domainNameToBeSet.length > 0){
		var oldDomain = document.domain;
		document.domain = domainNameToBeSet;
		trilogy_autoretail_onMakeSelectionCallbackListener(make);
		document.domain = oldDomain;
	}
}

function trilogy_autoretail_onMakeSelectionCallbackListener(make) {
	try{
		if(typeof this.parent.trilogy_autoretail_onMakeSelection =="undefined" ){
        	return;
    	}
    	this.parent.trilogy_autoretail_onMakeSelection(make);
	}catch(e){
		return;
	}
}

function trilogy_autoretail_onModelSelectionListener(make, model, year) {
	if('Firefox' == BrowserDetect.browser ){
		trilogy_autoretail_onModelSelectionCallbackListener(make, model, year);
		return;
	}
	
	if( domainNameToBeSet.length > 0){
		var oldDomain = document.domain;
		document.domain = domainNameToBeSet;
		trilogy_autoretail_onModelSelectionCallbackListener(make, model, year);
		document.domain = oldDomain;
	}
}

function trilogy_autoretail_onModelSelectionCallbackListener(make, model, year) {
	try{
		if(typeof this.parent.trilogy_autoretail_onModelSelection =="undefined" ){
        	return;
    	}
    	this.parent.trilogy_autoretail_onModelSelection(make, model, year);
	}catch(e){
		return;
	}
}

function trilogy_autoretail_onTrimSelectionListener(make, model, trim) {
	if('Firefox' == BrowserDetect.browser ){
		trilogy_autoretail_onTrimSelectionCallbackListener(make, model, trim);
		return;
	}
	
	if( domainNameToBeSet.length > 0){
		var oldDomain = document.domain;
		document.domain = domainNameToBeSet;
		trilogy_autoretail_onTrimSelectionCallbackListener(make, model, trim);
		document.domain = oldDomain;
	}
}

function trilogy_autoretail_onTrimSelectionCallbackListener(make, model, trim) {
	try{
		if(typeof this.parent.trilogy_autoretail_onTrimSelection =="undefined" ){
        	return;
    	}
    	this.parent.trilogy_autoretail_onTrimSelection(make, model, trim);
	}catch(e){
	}
}

function trilogy_autoretail_onZipSelectionListener(zipCode) {
	if('Firefox' == BrowserDetect.browser ){
		trilogy_autoretail_onZipSelectionCallbackListener(zipCode);
		return;
	}
	
	if( domainNameToBeSet.length > 0){
		var oldDomain = document.domain;
		document.domain = domainNameToBeSet;
		trilogy_autoretail_onZipSelectionCallbackListener(zipCode);
		document.domain = oldDomain;
	}
}

function trilogy_autoretail_onZipSelectionCallbackListener(zipCode) {
	try{
		if(typeof this.parent.trilogy_autoretail_onZipSelection =="undefined" ){
        	return;
    	}
    	this.parent.trilogy_autoretail_onZipSelection(zipCode);
	}catch(e){
	}
	
}
