// ############################################
// 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&eacute;rieures";
var unknownDisplay = "Logiciel inconnu";

var productInfo = {
	'win_t1_tp1' : {
		productLevel1 : 'ProFile T1/TP1',
		productName : 'T1//TP1',
		productPlatform : 'W',
		productType : 'T1_TP1',
		boxImageIdentifier : 'PF-box-DEF',
		displayTopics : 'ps,ic,nd,pr,pe',
		years : '',
		defaultYear: 'NONE'
	},
	'win_t2' : {
		productLevel1 : 'ProFile T2',
		productName : 'T2',
		productPlatform : 'W',
		productType : 'T2',
		boxImageIdentifier : 'PF-box-DEF',
		displayTopics : 'ps,ic,nd,pr,pe',
		years : '',
		defaultYear: 'NONE'
	},
	'win_t3_tp-646' : {
		productLevel1 : 'ProFile T3/TP-646',
		productName : 'T3//TP-646',
		productPlatform : 'W',
		productType : 'T3_TP-646',
		boxImageIdentifier : 'PF-box-DEF',
		displayTopics : 'ps,ic,nd,pr,pe',
		years : '',
		defaultYear: 'NONE'
	},
	'win_fx_q' : {
		productLevel1 : 'ProFile FX/Q',
		productName : 'FX//Q',
		productPlatform : 'W',
		productType : 'FX_Q',
		boxImageIdentifier : 'PF-box-DEF',
		displayTopics : 'ps,ic,nd,pr,pe',
		years : '',
		defaultYear: 'NONE'
	},
	'win_dontknow' : {
		productLevel1 : 'Incertain / autre',
		productName : 'Standard',
		productPlatform : 'W',
		productType : 'NONE',
		boxImageIdentifier : 'PF-box-NONE',
		displayTopics : 'ps,ic,nd,pr,pe',
		years : '',
		defaultYear: 'NONE'
	}
}

//############################################
//used to write topics per product select
//##########################################
var bucketTopicMap = Array(
	//Array('Topic Name','BUCKET','online/desktop/both/none', 'id');
	Array('Produits et services','SB','desktop','ps','products_services'),
	Array('Installation et configuration','SB','desktop','ic','install_configure'),
	Array('Réseau et base de données','GS','desktop','nd','network_database'),
	Array('Préparation et révision','GS','desktop','pr','prepare_review'),
	Array('Impression et TED','GS','desktop','pe','print_efile')
);

var phone1 = new Phone('1-800-710-8030','9 h à 18 h (HNE), Lundi au Vendredi','moins de 5 minutes', '');

var email1 = new Email('scp_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 contactInfo = Array(
	//new ContactInformation('Product','topic id',phone,email,chat)
		new ContactInformation('win_t1_tp1','ps',phone1,email1,null,false),
		new ContactInformation('win_t1_tp1','ic',phone1,email1,null,false),
		new ContactInformation('win_t1_tp1','nd',phone1,email1,null,false),
		new ContactInformation('win_t1_tp1','pr',phone1,email1,null,false),
		new ContactInformation('win_t1_tp1','pe',phone1,email1,null,false),
		new ContactInformation('win_t2','ps',phone1,email1,null,false),
		new ContactInformation('win_t2','ic',phone1,email1,null,false),
		new ContactInformation('win_t2','nd',phone1,email1,null,false),
		new ContactInformation('win_t2','pr',phone1,email1,null,false),
		new ContactInformation('win_t2','pe',phone1,email1,null,false),
		new ContactInformation('win_t3_tp-646','ps',phone1,email1,null,false),
		new ContactInformation('win_t3_tp-646','ic',phone1,email1,null,false),
		new ContactInformation('win_t3_tp-646','nd',phone1,email1,null,false),
		new ContactInformation('win_t3_tp-646','pr',phone1,email1,null,false),
		new ContactInformation('win_t3_tp-646','pe',phone1,email1,null,false),
		new ContactInformation('win_fx_q','ps',phone1,email1,null,false),
		new ContactInformation('win_fx_q','ic',phone1,email1,null,false),
		new ContactInformation('win_fx_q','nd',phone1,email1,null,false),
		new ContactInformation('win_fx_q','pr',phone1,email1,null,false),
		new ContactInformation('win_fx_q','pe',phone1,email1,null,false),
		new ContactInformation('win_dontknow','ps',phone1,email1,null,false),
		new ContactInformation('win_dontknow','ic',phone1,email1,null,false),
		new ContactInformation('win_dontknow','nd',phone1,email1,null,false),
		new ContactInformation('win_dontknow','pr',phone1,email1,null,false),
		new ContactInformation('win_dontknow','pe',phone1,email1,null,false)
);

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 ContactInformation(product, topicId, phone, email, chat, advisor){
	this.product = product;
	this.topicId = topicId;
	this.phone = phone;
	this.email = email;
	this.chat = chat;
	this.advisor = advisor
}

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 convertProdPlatform2ProductToken (product, platform) {
	var productToken = null;
	$.each(productInfo, function(i) {
		if (this.productType == product && this.productPlatform == platform.toUpperCase() ) {
			productToken = i;
		}
    });
	return productToken;
}