// ############################################
// 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 : 'PROFILE_T1/TP1',
		boxImageIdentifier : 'PF-box-DEF',
		displayTopics : 'ps,ic,nd,pr,pe',
		years : '',
		yearCodePrefix: 'YEAR_',
		defaultYear: 'NONE'
	},
	'win_t2' : {
		productLevel1 : 'ProFile T2',
		productName : 'T2',
		productPlatform : 'W',
		productType : 'PROFILE_T2',
		boxImageIdentifier : 'PF-box-DEF',
		displayTopics : 'ps,ic,nd,pr,pe',
		years : '',
		yearCodePrefix: 'YEAR_',
		defaultYear: 'NONE'
	},
	'win_t3_tp-646' : {
		productLevel1 : 'ProFile T3/TP-646',
		productName : 'T3//TP-646',
		productPlatform : 'W',
		productType : 'PROFILE_T3/TP-646',
		boxImageIdentifier : 'PF-box-DEF',
		displayTopics : 'ps,ic,nd,pr,pe',
		years : '',
		yearCodePrefix: 'YEAR_',
		defaultYear: 'NONE'
	},
	'win_fx_q' : {
		productLevel1 : 'ProFile FX/Q',
		productName : 'FX//Q',
		productPlatform : 'W',
		productType : 'PROFILE_FX/Q',
		boxImageIdentifier : 'PF-box-DEF',
		displayTopics : 'ps,ic,nd,pr,pe',
		years : '',
		yearCodePrefix: 'YEAR_',
		defaultYear: 'NONE'
	},
	'win_dontknow' : {
		productLevel1 : 'Incertain / autre',
		productName : 'Standard',
		productPlatform : 'W',
		productType : 'PROFILE_T1/TP1',
		boxImageIdentifier : 'PF-box-NONE',
		displayTopics : 'ps,ic,nd,pr,pe',
		years : '',
		yearCodePrefix: 'YEAR_',
		defaultYear: 'NONE'
	}
}

var problemTypeMap = {
		'products_services': 'PROFILE_PROFILE_PRODUCTS_AND_SERVICES',
		'install_configure': 'PROFILE_INSTALL_AND_CONFIGURE',
		'network_database': 'PROFILE_PROFILE_NETWORK_AND_DATABASE',
		'prepare_review': 'PROFILE_PROFILE_PREPARE_AND_REVIEW',
		'print_efile': 'PROFILE_PRINT_AND_EFILE'
};

//############################################
//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 &agrave; 18 h (HNE), lundi au vendredi','moins de 5 minutes', '');
var phone2 = new Phone('1-800-710-8030','9 h &agrave; 20 h (HNE), lundi au vendredi<br />12 h &agrave; 17 h (HNE), samedi','moins de 5 minutes', '');
var phone3 = new Phone('1-866-800-7818','9 h &agrave; 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 asktina1 = new AskTina('No waiting on hold!');

var chat1 = new Chat('9 h &agrave; 20 h (HNE), lundi au vendredi<br />12 h &agrave; 17 h (HNE), samedi','moins de 5 minutes', '');
var chat2 = new Chat('9 h à 18 h (HNE), lundi au vendredi','moins de 5 minutes', '');

//added for the offering option from in-product to change the phone information displayed
if(offering != null && offering == 'premier')
	phone1 = phone2;

var contactInfo = Array(
	//new ContactInformation('Product','topic id',phone,email,chat, asktina)
		new ContactInformation('win_t1_tp1','ps',phone1,email1,chat2,false,null),
		new ContactInformation('win_t1_tp1','ic',phone2,email1,chat1,false,null),
		new ContactInformation('win_t1_tp1','nd',phone2,email1,chat1,false,null),
		new ContactInformation('win_t1_tp1','pr',phone2,email1,chat1,false,null),
		new ContactInformation('win_t1_tp1','pe',phone2,email1,chat1,false,null),
		new ContactInformation('win_t2','ps',phone1,email1,chat2,false,null),
		new ContactInformation('win_t2','ic',phone2,email1,chat1,false,null),
		new ContactInformation('win_t2','nd',phone2,email1,chat1,false,null),
		new ContactInformation('win_t2','pr',phone2,email1,chat1,false,null),
		new ContactInformation('win_t2','pe',phone2,email1,chat1,false,null),
		new ContactInformation('win_t3_tp-646','ps',phone1,email1,chat2,false,null),
		new ContactInformation('win_t3_tp-646','ic',phone2,email1,chat1,false,null),
		new ContactInformation('win_t3_tp-646','nd',phone2,email1,chat1,false,null),
		new ContactInformation('win_t3_tp-646','pr',phone2,email1,chat1,false,null),
		new ContactInformation('win_t3_tp-646','pe',phone2,email1,chat1,false,null),
		new ContactInformation('win_fx_q','ps',phone1,email1,chat2,false,null),
		new ContactInformation('win_fx_q','ic',phone2,email1,chat1,false,null),
		new ContactInformation('win_fx_q','nd',phone2,email1,chat1,false,null),
		new ContactInformation('win_fx_q','pr',phone2,email1,chat1,false,null),
		new ContactInformation('win_fx_q','pe',phone2,email1,chat1,false,null),
		new ContactInformation('win_dontknow','ps',phone1,email1,chat2,false,null),
		new ContactInformation('win_dontknow','ic',phone2,email1,chat1,false,null),
		new ContactInformation('win_dontknow','nd',phone2,email1,chat1,false,null),
		new ContactInformation('win_dontknow','pr',phone2,email1,chat1,false,null),
		new ContactInformation('win_dontknow','pe',phone2,email1,chat1,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.toUpperCase() ) {
			productToken = i;
		}
    });
	return productToken;
}
