/*
 * @package AJAX_Chat
 * @author Sebastian Tschan
 * @copyright (c) Sebastian Tschan
 * @license GNU Affero General Public License
 * @link https://blueimp.net/ajax/
 */

// Ajax Chat config parameters:
var ajaxChatConfig = {

	// The channelID of the channel to enter on login (the loginChannelName is used if set to null):
	loginChannelID: null,
	// The channelName of the channel to enter on login (the default channel is used if set to null):
	loginChannelName: null,	
	
	// The time in ms between update calls to retrieve new chat messages:
	timerRate: 2000,
	
	// The URL to retrieve the XML chat messages (must at least contain one parameter):
	ajaxURL: './?ajax=true',
	// The base URL of the chat directory, used to retrieve media files (images, sound files, etc.):
	baseURL: './',

	// A regular expression for allowed source URL's for media content (e.g. images displayed inline);
	regExpMediaUrl: '^((http)|(https)):\\/\\/',
	
	// If set to false the chat update is delayed until the event defined in ajaxChat.setStartChatHandler():
	startChatOnLoad: true,
	
	// Defines the IDs of DOM nodes accessed by the chat:
	domIDs: {
		// The ID of the chat messages list:
		chatList: 'chatList',
		// The ID of the online users list:
		onlineList: 'onlineList',
		// The ID of the message text input field:
		inputField: 'inputField',
		// The ID of the message text length counter:
		messageLengthCounter: 'messageLengthCounter',
		// The ID of the channel selection:
		channelSelection: 'channelSelection',
		// The ID of the style selection:
		styleSelection: 'styleSelection',
		// The ID of the emoticons container:
		emoticonsContainer: 'emoticonsContainer',
		// The ID of the color codes container:
		colorCodesContainer: 'colorCodesContainer',
		// The ID of the flash interface container:
		flashInterfaceContainer: 'flashInterfaceContainer'
	},

	// Defines the settings which can be modified by users:
	settings: {
		// Defines if BBCode tags are replaced with the associated HTML code tags:
		bbCode: true,
		// Defines if image BBCode is replaced with the associated image HTML code:
		bbCodeImages: true,
		// Defines if color BBCode is replaced with the associated color HTML code:
		bbCodeColors: true,
		// Defines if hyperlinks are made clickable:
		hyperLinks: true,
		// Defines if line breaks are enabled:
		lineBreaks: true,
		// Defines if emoticon codes are replaced with their associated images:
		emoticons: true,
	
		// Defines if the focus is automatically set to the input field on chat load or channel switch:
		autoFocus: true,
		// Defines if the chat list scrolls automatically to display the latest messages:
		autoScroll: true,	
		// The maximum count of messages displayed in the chat list (will be ignored if set to 0):
		maxMessages: 0,
		
		// Defines if long words are wrapped to avoid vertical scrolling:
		wordWrap: true,
		// Defines the maximum length before a word gets wrapped: 
		maxWordLength: 32,
		
		// Defines the format of the date and time displayed for each chat message:
		dateFormat: '(%H:%i:%s)',
		
		// Defines if font colors persist without the need to assign them to each message:
		persistFontColor: false,	
		// The default font color, uses the page default font color if set to null:
		fontColor: null,
		
		// Defines if sounds are played:
		audio: true,
		// Defines the sound volume (0.0 = mute, 1.0 = max):
		audioVolume: 1.0,

		// Defines the sound that is played when normal messages are reveived:
		soundReceive: 'sound_1',
		// Defines the sound that is played on sending normal messages:
		soundSend: 'sound_2',
		// Defines the sound that is played on channel enter or login:
		soundEnter: 'sound_3',
		// Defines the sound that is played on channel leave or logout:
		soundLeave: 'sound_4',
		// Defines the sound that is played on chatBot messages:
		soundChatBot: 'sound_5',
		// Defines the sound that is played on error messages:
		soundError: 'sound_6',
		
		// Defines if the document title blinks on new messages:
		blink: true,
		// Defines the blink interval in ms:
		blinkInterval: 500,
		// Defines the number of blink intervals:
		blinkIntervalNumber: 10
	},
	
	// Defines a list of settings which are not to be stored in a session cookie:
	nonPersistentSettings: new Array(
	),

	// Defines the list of allowed BBCodes:
	bbCodeTags: new Array(
		'b',
		'i',
		'u',
		'quote',
		'code',
		'color',
		'url',
		'img'
	),
	
	// Defines the list of allowed color codes:
	colorCodes: new Array(
		'gray',
		'silver',
		'white',	
		'yellow',
		'orange',
		'red',
		'fuchsia',
		'purple',
		'navy',
		'blue',
		'aqua',
		'teal',
		'green',
		'lime',
		'olive',
		'maroon',
		'black'
	),
	
emoticonCodes: new Array(
		':beach:',
		':beee:',
		':blush:',
		':bow:',
		':box:',
		':bye:',
		':clapping:',
		':club:',
		':clueless:',
		':cool2:',
		':cray:',
		':crazy:',
		':crybye:',
		':eat:',
		':help:',
		':hug:',
		':hi:',
		':jester:',
		':shock:',
		':sinking:',
		':sleep:',
		':unwell:',
		':wizard:',
		':yahoo:',
		':yes2:',
		':whistle:',
		':paper:',
		':coffeesmile:',
		':coffee:',
		':jedi:',
		':drinks:',
		':cheeky:',
		':acute:',
		':aggressive:',
		':agree:',
		':aikido:',
		':air_kiss:',
		':amen:',
		':angel:',
		':angry2:',
		':angry:',
		':arrgghh:',
		':assassin:',
		':bad:',
		':bananas:',
		':band:',
		':banghead:',
		':banned:',
		':bb:',
		':beg:',
		':beta:',
		':big_boss:',
		':biggrin:',
		':blackeye:',
		':blind:',
		':blink:',
		':blush2:',
		':bomb:',
		':bored:',
		':boredom:',
		':buba:',
		':butcher:',
		':censored:',
		':cheerful:',
		':clap:',
		':close_tema:',
		':closedeyes:',
		':comando:',
		':confused:',
		':cool:',
		':crosself:',
		':cry:',
		':dance:',
		':dancing:',
		':derisive:',
		':dirol:',
		':dizzy:',
		':doh:',
		':dontknow:',
		':download:',
		':dry:',
		':duel:',
		':dwarf:',
		':eek:',
		':elf:',
		':fan_1:',
		':fie:',
		':first_move:',
		':flirt:',
		':flood:',
		':focus:',
		':fool:',
		':friends:',
		':fright:',
		':frown:',
		':frustrated:',
		':give_heart:',
		':give_rose:',
		':giverose:',
		':glare:',
		':good:',
		':grin2:',
		':grin:',
		':groupray:',
		':guitarplayer:',
		':haha:',
		':happy:',
		':heart:',
		':heristical:',
		':hmm:',
		':huh:',
		':hunter:',
		':icon_arrow:',
		':icon_biggrin:',
		':icon_confused:',
		':icon_cool:',
		':icon_cry:',
		':icon_eek:',
		':icon_exclaim:',
		':icon_frown:',
		':icon_idea:',
		':icon_lol:',
		':icon_mad:',
		':icon_mrgreen:',
		':icon_neutral:',
		':icon_question:',
		':icon_razz:',
		':icon_redface:',
		':icon_rolleyes:',
		':icon_sad:',
		':icon_smile:',
		':icon_surprised:',
		':icon_wink:',
		':idea:',
		':indiff:',
		':kawaii:',
		':king:',
		':kiss:',
		':laughing:',
		':listen:',
		':mail:',
		':man_in_love:',
		':meeting:',
		':mellow:',
		':menu_open:',
		':moil:',
		':morpheus:',
		':navbits_finallink:',
		':navbits_start:',
		':nea:',
		':neo:',
		':nhl2:',
		':nhl3:',
		':nhl:',
		':nhl_checking:',
		':nhl_crach:',
		':nhl_fight:',
		':ninja:',
		':no2:',
		':no:',
		':nono:',
		':notme2:',
		':notme:',
		':nyam:',
		':offtopic:',
		':ohmy:',
		':ok:',
		':oops:',
		':orc:',
		':paladin:',
		':pardon:',
		':patsak:',
		':ph34r:',
		':phi:',
		':pilot:',
		':pioneer:',
		':pleasantry:',
		':polling:',
		':pray:',
		':prayer:',
		':protest:',
		':queen:',
		':rant:',
		':ranting:',
		':rap:',
		':razz:',
		':read:',
		':redface:',
		':resent:',
		':rolleyes:',
		':rotfl:',
		':rules2:',
		':rules:',
		':sad:',
		':saint:',
		':scared:',
		':scenic:',
		':sclerosis:',
		':scout_en:',
		':scratch:',
		':search:',
		':secret:',
		':shok:',
		':shout:',
		':sick:',
		':sigh:',
		':skull:',
		':sleeping:',
		':slow_en:',
		':smile2:',
		':smile3:',
		':smile:',
		':snooks:',
		':snooze:',
		':sorry:',
		':spiteful:',
		':spruce_up:',
		':star-wars2:',
		':star-wars:',
		':stink:',
		':stinker:',
		':stop:',
		':superman2:',
		':superman:',
		':superstition:',
		':swoon2:',
		':swoon:',
		':sword:',
		':talkative:',
		':taunt:',
		':tease:',
		':telephone:',
		':think:',
		':this:',
		':threaten:',
		':thumbsup:',
		':to_become_senile:',
		':to_keep_order:',
		':tomato2:',
		':tomato:',
		':tommy:',
		':tongue:',
		':triniti:',
		':umnik:',
		':unsure:',
		':victory:',
		':vinsent:',
		':wacko:',
		':warning:',
		':wave:',
		':wink2:',
		':wink:',
		':worried:',
		':wow:',
		':write:',
		':yawn:',
		':yes:',
		':yu:',
		':yum:',
		':D',
		':-D',
		':)',
		':-)',
		';)',
		';-)',
		':(',
		':-(',
		':o',
		':-o',
		':?',
		':-?',
		':???:',
		'8-)',
		':lol:',
		':x',
		':-x',
		':mad:',
		':P',
		':-P',
		':roll:',
		':!:',
		':?:',
		':arrow:',
		':|',
		':-|',
		':mrgreen:',
		':geek:',
		':ugeek:',
		':chicken:',
		':birthday:',
		':welcome:',
		':agree:',
		':ninja2:',
		':ohyeah:',
		':opps:',
		':robber:',
		':pirate:',
		':trooper:',
		':yourock:',
		':cheers:',
		':party:',
		':patriot:',
		':popcorn:' 
	),

	// Defines the list of emoticon files associated with the emoticon codes:
	emoticonFiles: new Array(
		'beach.gif',
		'beee.gif',
		'blush.gif',
		'bow.gif',
		'box.gif',
		'bye.gif',
		'clapping.gif',
		'club.gif',
		'Clueless.gif',
		'cool2.gif',
		'cray.gif',
		'crazy.gif',
		'crybye.gif',
		'eat.gif',
		'help.gif',
		'hug.gif',
		'hi.gif',
		'jester.gif',
		'shock.gif',
		'sinking.gif',
		'sleep.gif',
		'unwell.gif',
		'wizard.gif',
		'yahoo.gif',
		'yes2.gif',
		'U_Whistle.gif',
		'W_CoffeeAndPaper.gif',
		'W_SmileInCoffee.gif',
		'W_LovesCoffee.gif',
		'U_Jedi.gif',
		'drinks.gif',
		'Cheeky.gif',
		'acute.gif',
		'aggressive.gif',
		'agree.gif',
		'aikido.gif',
		'air_kiss.gif',
		'amen.gif',
		'angel.gif',
		'angry2.gif',
		'angry.gif',
		'Arrgghh.gif',
		'assassin.gif',
		'bad.gif',
		'Bananas.gif',
		'band.gif',
		'banghead.gif',
		'banned.gif',
		'bb.gif',
		'beg.gif',
		'beta.gif',
		'big_boss.gif',
		'biggrin.gif',
		'blackeye.gif',
		'blind.gif',
		'blink.gif',
		'blush2.gif',
		'bomb.gif',
		'Bored.gif',
		'boredom.gif',
		'buba.gif',
		'butcher.gif',
		'censored.gif',
		'Cheerful.gif',
		'clap.gif',
		'close_tema.gif',
		'closedeyes.gif',
		'comando.gif',
		'confused.gif',
		'cool.gif',
		'crosself.gif',
		'cry.gif',
		'dance.gif',
		'Dancing.gif',
		'derisive.gif',
		'dirol.gif',
		'Dizzy.gif',
		'doh.gif',
		'dontknow.gif',
		'download.gif',
		'dry.gif',
		'duel.gif',
		'dwarf.gif',
		'eek.gif',
		'elf.gif',
		'fan_1.gif',
		'fie.gif',
		'first_move.gif',
		'flirt.gif',
		'flood.gif',
		'focus.gif',
		'fool.gif',
		'friends.gif',
		'fright.gif',
		'frown.gif',
		'frustrated.gif',
		'give_heart.gif',
		'give_rose.gif',
		'giverose.gif',
		'glare.gif',
		'good.gif',
		'grin2.gif',
		'grin.gif',
		'groupray.gif',
		'guitarplayer.gif',
		'haha.gif',
		'happy.gif',
		'heart.gif',
		'Heristical.gif',
		'hmm.gif',
		'huh.gif',
		'hunter.gif',
		'icon_arrow.gif',
		'icon_biggrin.gif',
		'icon_confused.gif',
		'icon_cool.gif',
		'icon_cry.gif',
		'icon_eek.gif',
		'icon_exclaim.gif',
		'icon_frown.gif',
		'icon_idea.gif',
		'icon_lol.gif',
		'icon_mad.gif',
		'icon_mrgreen.gif',
		'icon_neutral.gif',
		'icon_question.gif',
		'icon_razz.gif',
		'icon_redface.gif',
		'icon_rolleyes.gif',
		'icon_sad.gif',
		'icon_smile.gif',
		'icon_surprised.gif',
		'icon_wink.gif',
		'idea.gif',
		'indiff.gif',
		'kawaii.gif',
		'king.gif',
		'kiss.gif',
		'laughing.gif',
		'listen.gif',
		'mail.gif',
		'man_in_love.gif',
		'meeting.gif',
		'mellow.gif',
		'menu_open.gif',
		'moil.gif',
		'morpheus.gif',
		'navbits_finallink.gif',
		'navbits_start.gif',
		'nea.gif',
		'neo.gif',
		'nhl2.gif',
		'nhl3.gif',
		'nhl.gif',
		'nhl_checking.gif',
		'nhl_crach.gif',
		'nhl_fight.gif',
		'ninja.gif',
		'no2.gif',
		'no.gif',
		'nono.gif',
		'notme2.gif',
		'notme.gif',
		'nyam.gif',
		'offtopic.gif',
		'ohmy.gif',
		'ok.gif',
		'oops.gif',
		'orc.gif',
		'paladin.gif',
		'pardon.gif',
		'patsak.gif',
		'ph34r.gif',
		'phi.gif',
		'pilot.gif',
		'pioneer.gif',
		'pleasantry.gif',
		'polling.gif',
		'pray.gif',
		'prayer.gif',
		'protest.gif',
		'queen.gif',
		'rant.gif',
		'ranting.gif',
		'rap.gif',
		'razz.gif',
		'read.gif',
		'redface.gif',
		'resent.gif',
		'rolleyes.gif',
		'rotfl.gif',
		'rules2.gif',
		'rules.gif',
		'sad.gif',
		'saint.gif',
		'scared.gif',
		'scenic.gif',
		'sclerosis.gif',
		'scout_en.gif',
		'scratch.gif',
		'search.gif',
		'secret.gif',
		'shok.gif',
		'shout.gif',
		'sick.gif',
		'sigh.gif',
		'skull.gif',
		'sleeping.gif',
		'slow_en.gif',
		'smile2.gif',
		'smile3.gif',
		'smile.gif',
		'snooks.gif',
		'snooze.gif',
		'sorry.gif',
		'spiteful.gif',
		'spruce_up.gif',
		'star-wars2.gif',
		'star-wars.gif',
		'stink.gif',
		'stinker.gif',
		'stop.gif',
		'superman2.gif',
		'superman.gif',
		'superstition.gif',
		'swoon2.gif',
		'swoon.gif',
		'sword.gif',
		'Talkative.gif',
		'taunt.gif',
		'tease.gif',
		'telephone.gif',
		'think.gif',
		'this.gif',
		'threaten.gif',
		'thumbsup.gif',
		'to_become_senile.gif',
		'to_keep_order.gif',
		'tomato2.gif',
		'tomato.gif',
		'tommy.gif',
		'tongue.gif',
		'triniti.gif',
		'umnik.gif',
		'unsure.gif',
		'victory.gif',
		'vinsent.gif',
		'wacko.gif',
		'warning.gif',
		'wave.gif',
		'wink2.gif',
		'wink.gif',
		'Worried.gif',
		'wow.gif',
		'write.gif',
		'yawn.gif',
		'yes.gif',
		'yu.gif',
		'yum.gif',
		'icon_e_biggrin.gif',
		'icon_e_biggrin.gif',
		'icon_e_smile.gif',
		'icon_e_smile.gif',
		'icon_e_wink.gif',
		'icon_e_wink.gif',
		'icon_e_sad.gif',
		'icon_e_sad.gif',
		'icon_e_surprised.gif',
		'icon_e_surprised.gif',
		'icon_e_confused.gif',
		'icon_e_confused.gif',
		'icon_e_confused.gif',
		'icon_cool.gif',
		'icon_lol.gif',
		'icon_mad.gif',
		'icon_mad.gif',
		'icon_mad.gif',
		'icon_razz.gif',
		'icon_razz.gif',
		'icon_rolleyes.gif',
		'icon_exclaim.gif',
		'icon_question.gif',
		'icon_arrow.gif',
		'icon_neutral.gif',
		'icon_neutral.gif',
		'icon_mrgreen.gif',
		'icon_e_geek.gif',
		'icon_e_ugeek.gif',
		'U_ChickenDance.gif',
		'U_HappyBirthday.gif',
		'U_HelloAndWelcome.gif',
		'U_IAgree.gif',
		'U_Ninja2.gif',
		'U_OhYeah.gif',
		'U_OppsSign.gif',
		'U_Robber.gif',
		'U_ToughPirate.gif',
		'U_Trooper.gif',
		'U_YouRockSign.gif',
		'W_Cheers.gif',
		'W_Party.gif',
		'W_Patriot.gif',
		'W_Popcorn.gif'
	),

	// Defines the available sounds loaded on chat start:
	soundFiles: {
		sound_1: 'sound_1.mp3',
		sound_2: 'sound_2.mp3',
		sound_3: 'sound_3.mp3',
		sound_4: 'sound_4.mp3',
		sound_5: 'sound_5.mp3',
		sound_6: 'sound_6.mp3'
	},
	
	
	// The following configuration options are usually overwritten by server-side values:
	
	// Session identification, used for style and setting cookies:
	sessionName: 'ajax_chat',

	// The time in days until the style and setting cookies expire:
	cookieExpiration: 365,
	// The path of the cookies, '/' allows to read the cookies from all directories:
	cookiePath: '/',
	// The domain of the cookies, defaults to the hostname of the server if set to null:
	cookieDomain: null,
	// If enabled, cookies must be sent over secure (SSL/TLS encrypted) connections:
	cookieSecure: null,
	
	// The name of the chat bot:
	chatBotName: 'SysMessage',
	// The userID of the chat bot:
	chatBotID: 2147483647,

	// Allow/Disallow registered users to delete their own messages:
	allowUserMessageDelete: true,
	
	// Minutes until a user is declared inactive (last status update) - the minimum is 2 minutes:
	inactiveTimeout: 30,

	// UserID plus this value are private channels (this is also the max userID and max channelID):
	privateChannelDiff: 500000000,
	// UserID plus this value are used for private messages:
	privateMessageDiff: 1000000000,

	// Defines if login/logout and channel enter/leave are displayed:
	showChannelMessages: false,

	// Max messageText length:
	messageTextMaxLength: 1040,
	
	// Defines if the socket server is enabled:
	socketServerEnabled: false,
	// Defines the hostname of the socket server used to connect from client side:
	socketServerHost: 'localhost',
	// Defines the port of the socket server:
	socketServerPort: 1935,
	// This ID can be used to distinguish between different chat installations using the same socket server:
	socketServerChatID: 0

}
