// ############################################
// used on contact us page, faq details page level survey
// ##########################################

var versionText = "Quelle version?";
var imNotSure = "Je ne suis pas certain";
var perviousVersion = "Versions antérieures";
var unknownDisplay = "Logiciel inconnu";

var productInfo = {
	'win_easystart' : {
		productLevel1 : 'SuccessPME',
		productName : 'SuccessPME',
		productPlatform : 'w',
		productType : 'QUICKBOOKS_QUICKBOOKS_SIMPLE_START.QUICKBOOKS_SIMPLE_START_QUICKBOOKS_SIMPLE_START',
		boxImageIdentifier : 'SPME-box-',
		displayTopics : 'ps,is,dc,ts,er',
		years : '2009,2007,2006,PREVIOUS',
		yearCodePrefix: '',
		defaultYear: '2009'
	},
	'win_pro' : {
		productLevel1 : 'SuccessPME Pro',
		productName : 'Pro',
		productPlatform : 'w',
		productType : 'QUICKBOOKS_QUICKBOOKS_PRO.QUICKBOOKS_PRO_QUICKBOOKS_PRO',
		boxImageIdentifier : 'SPME-box-pro',
		displayTopics : 'ps,is,dc,ts,ep,er',
		years : '2009,2007,2006,PREVIOUS',
		yearCodePrefix: '',
		defaultYear: '2009'
	},
	'win_premier' : {
		productLevel1 : 'SuccessPME Premier',
		productName : 'Premier',
		productPlatform : 'w',
		productType : 'QUICKBOOKS_QUICKBOOKS_PREMIER.QUICKBOOKS_PREMIER_QUICKBOOKS_PREMIER',
		boxImageIdentifier : 'SPME-box-premier',
		displayTopics : 'ps,is,dc,ts,ep,er',
		years : '2009',
		yearCodePrefix: '',
		defaultYear: '2009'
	},
	'win_dontknow' : {
		productLevel1 : 'Je ne suis pas certain ou l\'édition n\'est pas indiquée',
		productName : 'Premier',
		productPlatform : 'w',
		productType : 'QUICKBOOKS_QUICKBOOKS_PREMIER.QUICKBOOKS_PREMIER_QUICKBOOKS_PREMIER',
		boxImageIdentifier : 'SPME-box-NONE',
		displayTopics : 'ps,is,dc,ts,ep,er',
		years : '',
		yearCodePrefix: '',
		defaultYear: '2009'
	}
}

var problemTypeMap = {
		'products_services': 'FMS_PRODUCTS_AND_SERVICES',
		'install_setup': 'FMS_INSTALL_AND_SETUP',
		'data_company_files': 'FMS_DATA_AND_COMPANY_FILES',
		'run_the_business': 'FMS_RUN_THE_BUSINESS',
		'employees_payroll': 'FMS_EMPLOYEES_AND_PAYROLL',
		'errors': 'FMS_FMS_ERRORS'
};

//############################################
//used to write topics per product select
//##########################################
var bucketTopicMap = Array(
	//Array('Topic Name','BUCKET','online/desktop/both/none', 'folds to hide', 'id');
	Array('Produits et services','SB','deskop','ps','products_services'),
	Array('Installation et configuration','GS','desktop','is','install_setup'),
	Array('Fichiers de données et de compagnie','GS','deskop','dc','data_company_files'),
	Array('Gérer votre entreprise','GS','deskop','ts','run_the_business'),
	Array('Employés et paie','WOMR','deskop','ep','employees_payroll'),
	Array('Erreur','WOMR','deskop', 'er','errors')
);

var phone1 = new Phone('888-333-8580','du Lundi au Vendredi de 9 h à 18 h (HNE)','moins de 5 minutes', '');
var phone2 = new Phone('877-772-9158','du Lundi au Vendredi de 9 h à 18 h (HNE)','moins de 5 minutes', '');

var email1 = new Email('general_fr','du Lundi au Vendredi de 9 h à 18 h (HNE)','Il n\'y a pas d\'attente en ligne!<br />Réponse en moins d\'un jour ouvrable', '');
var email2 = new Email('succespme_soutien','Disponible 24 heures par jour, 7 jours par semaine','Il n\'y a pas d\'attente en ligne!<br />Réponse en moins d\'un jour ouvrable', '');

var chat1 = new Chat('du Lundi au Vendredi de 9 h à 18 h (HNE)','moins de 5 minutes', '');

var asktina1 = new AskTina('No waiting on hold!');

var contactInfo = Array(
	//new ContactInformation('Product','topic id',phone,email,chat,asktina)
	new ContactInformation('win_easystart','ps',phone1,email1,null,false,null),
	new ContactInformation('win_easystart','is',phone2,email2,chat1,false,null),
	new ContactInformation('win_easystart','dc',phone2,email2,chat1,false,null),
	new ContactInformation('win_easystart','ts',phone2,email2,chat1,false,null),
	new ContactInformation('win_easystart','er',phone2,email2,chat1,false,null),
	new ContactInformation('win_pro','ps',phone1,email1,null,false,null),
	new ContactInformation('win_pro','is',phone2,email2,chat1,false,null),
	new ContactInformation('win_pro','dc',phone2,email2,chat1,false,null),
	new ContactInformation('win_pro','ts',phone2,email2,chat1,false,null),
	new ContactInformation('win_pro','ep',phone2,email2,chat1,false,null),
	new ContactInformation('win_pro','er',phone2,email2,chat1,false,null),
	new ContactInformation('win_premier','ps',phone1,email1,null,false,null),
	new ContactInformation('win_premier','is',phone2,email2,chat1,false,null),
	new ContactInformation('win_premier','dc',phone2,email2,chat1,false,null),
	new ContactInformation('win_premier','ts',phone2,email2,chat1,false,null),
	new ContactInformation('win_premier','ep',phone2,email2,chat1,false,null),
	new ContactInformation('win_premier','er',phone2,email2,chat1,false,null),
	new ContactInformation('win_dontknow','ps',phone1,email1,null,false,null),
	new ContactInformation('win_dontknow','is',phone2,email2,chat1,false,null),
	new ContactInformation('win_dontknow','dc',phone2,email2,chat1,false,null),
	new ContactInformation('win_dontknow','ts',phone2,email2,chat1,false,null),
	new ContactInformation('win_dontknow','ep',phone2,email2,chat1,false,null),
	new ContactInformation('win_dontknow','er',phone2,email2,chat1,false,null)
	/*new ContactInformation('win_easystart','ps',phone1,null,null,false,null),
	new ContactInformation('win_easystart','is',phone2,null,null,false,null),
	new ContactInformation('win_easystart','dc',phone2,null,null,false,null),
	new ContactInformation('win_easystart','ts',phone2,null,null,false,null),
	new ContactInformation('win_easystart','er',phone2,null,null,false,null),
	new ContactInformation('win_pro','ps',phone1,null,null,false,null),
	new ContactInformation('win_pro','is',phone2,null,null,false,null),
	new ContactInformation('win_pro','dc',phone2,null,null,false,null),
	new ContactInformation('win_pro','ts',phone2,null,null,false,null),
	new ContactInformation('win_pro','ep',phone2,null,null,false,null),
	new ContactInformation('win_pro','er',phone2,null,null,false,null),
	new ContactInformation('win_premier','ps',phone1,null,null,false,null),
	new ContactInformation('win_premier','is',phone2,null,null,false,null),
	new ContactInformation('win_premier','dc',phone2,null,null,false,null),
	new ContactInformation('win_premier','ts',phone2,null,null,false,null),
	new ContactInformation('win_premier','ep',phone2,null,null,false,null),
	new ContactInformation('win_premier','er',phone2,null,null,false,null),
	new ContactInformation('win_dontknow','ps',phone1,null,null,false,null),
	new ContactInformation('win_dontknow','is',phone2,null,null,false,null),
	new ContactInformation('win_dontknow','dc',phone2,null,null,false,null),
	new ContactInformation('win_dontknow','ts',phone2,null,null,false,null),
	new ContactInformation('win_dontknow','ep',phone2,null,null,false,null),
	new ContactInformation('win_dontknow','er',phone2,null,null,false,null)*/
);

function Email(key, hours, wait, ignoreYears){
	this.key = key;
	this.hours = hours;
	this.wait = wait;
	this.ignoreYears = ignoreYears;
}

function Phone(number, hours, wait, ignoreYears){
	this.number = number;
	this.hours = hours;
	this.wait = wait;
	this.ignoreYears = ignoreYears;
}

function Chat(hours, wait, ignoreYears){
	this.hours = hours;
	this.wait = wait;
	this.ignoreYears = ignoreYears;
}

function AskTina(message){
	this.message = message;
}

function ContactInformation(product, topicId, phone, email, chat, advisor, asktina){
	this.product = product;
	this.topicId = topicId;
	this.phone = phone;
	this.email = email;
	this.chat = chat;
	this.advisor = advisor;
	this.asktina = asktina;
}

function getStep1ProductName (productToken) {
	if (productToken == 'nan_dontknow') {
		return 'I\'m Not Sure';
	}
	var productLevel1 = productInfo[productToken].productLevel1;
	// this should return something like: TurboTax Home & Business Online
	return productLevel1.replace('for',productInfo[productToken].productName,'gi');
}

function convertProdPlatform2ProductTokenNew (product) {
	var productToken = null;
	$.each(productInfo, function(i) {
		if (this.productType == product) {
			productToken = i;
		}
    });
	return productToken;
}

function convertProdPlatform2ProductToken (product, platform) {
	var productToken = null;
	$.each(productInfo, function(i) {
		if (this.productType == product && this.productPlatform == platform.toLowerCase() ) {
			productToken = i;
		}
    });
	return productToken;
}
