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

var versionText = "What version?";
var imNotSure = "I'm not sure";
var perviousVersion = "Previous versions";
var unknownDisplay = "Product unknown";

var productInfo = {
	'win_simplestart' : {
		productLevel1 : 'QuickBooks SimpleStart',
		productName : 'EasyStart',
		productPlatform : 'W',
		productType : 'EST',
		boxImageIdentifier : 'QBUK-box-simplestart',
		displayTopics : 'ps,is,dc,ts,er',
		years : '2010,2008,2006,PREVIOUS',
		defaultYear: 'NONE'
	},
	'win_pro' : {
		productLevel1 : 'QuickBooks Pro',
		productName : 'Pro',
		productPlatform : 'W',
		productType : 'PRO',
		boxImageIdentifier : 'QBUK-box-pro',
		displayTopics : 'ps,is,dc,ts,ep,er',
		years : '2010,2008,2006,PREVIOUS',
		defaultYear: 'NONE'
	},
	'win_premier' : {
		productLevel1 : 'QuickBooks Premier',
		productName : 'Premier',
		productPlatform : 'W',
		productType : 'PRM',
		boxImageIdentifier : 'QBUK-box-premier',
		displayTopics : 'ps,is,dc,ts,ep,er',
		years : '2010,2008,2006,PREVIOUS',
		defaultYear: 'NONE'
	},
	'win_dontknow' : {
		productLevel1 : 'I\'m not sure / my edition isn\'t shown',
		productName : 'Premier',
		productPlatform : 'W',
		productType : 'NONE',
		boxImageIdentifier : 'QBUK-box-NONE',
		displayTopics : 'ps,is,dc,ts,ep,er',
		years : '',
		defaultYear: 'NONE'
	}
}

//############################################
//used to write topics per product select
//##########################################
var bucketTopicMap = Array(
	//Array('Topic Name','BUCKET','online/desktop/both/none', 'id');
	Array('Products &amp; Services','SB','deskop','ps','products_services'),
	Array('Install &amp; Setup','GS','desktop','is','install_setup'),
	Array('Data &amp; Company Files','GS','deskop','dc','data_company_files'),
	Array('Run the Business','GS','deskop','ts','run_the_business'),
	Array('Employees &amp; Payroll','WOMR','deskop','ep','employees_payroll'),
	Array('Errors','WOMR','deskop', 'er','errors')
);

var phone1 = new Phone('0808 168 9535','8:00 a.m. to 8:00 p.m.  (BST), weekdays (excluding bank holidays)<br /><br />If you use <strong>Barclays Business Manager:</strong><br /><strong>Call Barclays: 0845 601 5962</strong>','We\'ll respond in less than 3 min', '');
var phone2 = new Phone('0808 168 9536','8:00 a.m. to 8:00 p.m.  (BST), weekdays (excluding bank holidays)<br /><br />If you use <strong>Barclays Business Manager:</strong><br /><strong>Call Barclays: 0845 601 5962</strong>','We\'ll respond in less than 3 min', '');

var email1 = new Email('general','9:00 a.m. to 5:30 p.m. (BST), weekdays','No waiting on hold!<br />We\'ll respond within 1 business day', '');
var email2 = new Email('quickbooks','9:00 a.m. to 5:30 p.m. (GMT), weekdays','No waiting on hold!<br />We\'ll respond within 1 business day', '');

var chat1 = new Chat('9:00 a.m. to 5:30 p.m. (GMT), weekdays (excluding bank holidays)','We\'ll respond in less then 3 min', '');

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

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

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