<?
$sql[0] = "CREATE TABLE `livehelp_autoinvite` (
  `idnum` int(10) NOT NULL auto_increment,
  `isactive` char(1) NOT NULL default '',
  `department` int(10) NOT NULL default '0',
  `message` text NOT NULL,
  `page` varchar(255) NOT NULL default '',
  `visits` int(8) NOT NULL default '0',
  `referer` varchar(255) NOT NULL default '',
  `typeof` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`idnum`)
) TYPE=MyISAM AUTO_INCREMENT=2";
 

$sql[1] = "INSERT INTO `livehelp_autoinvite` VALUES (1, 'Y', 0, '1', '', 0, '', 'layer')";



$sql[2] = "CREATE TABLE `livehelp_channels` (
  `id` int(10) NOT NULL auto_increment,
  `user_id` int(10) NOT NULL default '0',
  `statusof` char(1) NOT NULL default '',
  `startdate` bigint(8) NOT NULL default '0',
  `sessionid` varchar(40) NOT NULL default '',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";



$sql[3] = "CREATE TABLE `livehelp_config` (
  `version` varchar(10) NOT NULL default '2.12.2',
  `site_title` varchar(100) NOT NULL default '',
  `use_flush` varchar(10) NOT NULL default 'YES',
  `membernum` int(8) NOT NULL default '0',
  `offset` int(5) NOT NULL default '0',
  `show_typing` char(1) NOT NULL default '',
  `webpath` varchar(255) NOT NULL default '',
  `s_webpath` varchar(255) NOT NULL default '',
  `speaklanguage` varchar(60) NOT NULL default 'English',
  `scratch_space` text NOT NULL,
  `admin_refresh` varchar(30) NOT NULL default 'auto',
  `maxexe` int(5) default '90',
  `refreshrate` int(5) NOT NULL default '1',
  `chatmode` varchar(60) NOT NULL default '',
  `adminsession` char(1) NOT NULL default 'N',
  `ignoreips` text NOT NULL,
  `directoryid` varchar(32) NOT NULL default '',
  `tracking` char(1) NOT NULL default 'N',
  `colorscheme` varchar(30) NOT NULL default 'blue',
  `matchip` char(1) NOT NULL default 'N',
  `gethostnames` char(1) NOT NULL default 'N',
  `maxrecords` int(10) NOT NULL default '75000',
  `maxreferers` int(10) NOT NULL default '50',
  `maxvisits` int(10) NOT NULL default '75',
  `maxmonths` int(10) NOT NULL default '12',
  `maxoldhits` int(10) NOT NULL default '1',
  `showgames` char(1) NOT NULL default 'Y',
  `showsearch` char(1) NOT NULL default 'Y',
  `showdirectory` char(1) NOT NULL default 'Y',
  `usertracking` char(1) NOT NULL default 'N',
  `resetbutton` char(1) NOT NULL default 'N',
  `keywordtrack` char(1) NOT NULL default 'N',
  `reftracking` char(1) NOT NULL default 'N',
  `topkeywords` int(10) NOT NULL default '50',
  `everythingelse` text NOT NULL,
  `rememberusers` char(1) NOT NULL default 'Y',
  PRIMARY KEY  (`version`)
) TYPE=MyISAM";


$sql[4] = "INSERT INTO `livehelp_config` VALUES ('2.12.2', 'Live Help!', 'YES', 0, 0, 'Y', 'http://$Dominio/$Diretorio/CSLH/', '/', 'English', '\n        \n        <center>\n\n<h2 align=\"center\">Welcome to Crafty Syntax Live Help</h2>\n\n<p>\nAll the administrative functions are located to the left of this text. \n</p>\n<p>\nYou can use this section to keep notes for yourself and other admins, etc. </p>\n<p>\nTo change the text that is located in this box just click on the small edit button on the top right corner of this box.</p>\n\n<br><br>\n\n        ', 'auto', 300, 1, 'xmlhttp-flush-refresh', 'N', '', '', 'N', 'blue', 'N', 'N', 75000, 50, 75, 12, 1, 'Y', 'Y', 'Y', 'N', 'N', 'N', 'N', 50, '', 'Y')";



$sql[5] = "CREATE TABLE `livehelp_departments` (
  `recno` int(5) NOT NULL auto_increment,
  `nameof` varchar(30) NOT NULL default '',
  `onlineimage` varchar(255) NOT NULL default '',
  `offlineimage` varchar(255) NOT NULL default '',
  `layerinvite` varchar(255) NOT NULL default '',
  `requirename` char(1) NOT NULL default '',
  `messageemail` varchar(60) NOT NULL default '',
  `leaveamessage` varchar(10) NOT NULL default '',
  `opening` text NOT NULL,
  `offline` text NOT NULL,
  `creditline` char(1) NOT NULL default 'L',
  `imagemap` text NOT NULL,
  `whilewait` text NOT NULL,
  `timeout` int(5) NOT NULL default '0',
  `leavetxt` text NOT NULL,
  `topframeheight` int(10) NOT NULL default '35',
  `topbackground` varchar(255) NOT NULL default '',
  `colorscheme` varchar(255) NOT NULL default '',
  `speaklanguage` varchar(60) NOT NULL default '',
  `busymess` text NOT NULL,
  `emailfun` char(1) NOT NULL default 'Y',
  `dbfun` char(1) NOT NULL default 'Y',
  `everythingelse` text NOT NULL,
  PRIMARY KEY  (`recno`)
) TYPE=MyISAM AUTO_INCREMENT=2 ";




$sql[6] = "CREATE TABLE `livehelp_autoinvite` (
  `idnum` int(10) NOT NULL auto_increment,
  `isactive` char(1) NOT NULL default '',
  `department` int(10) NOT NULL default '0',
  `message` text NOT NULL,
  `page` varchar(255) NOT NULL default '',
  `visits` int(8) NOT NULL default '0',
  `referer` varchar(255) NOT NULL default '',
  `typeof` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`idnum`)
) TYPE=MyISAM AUTO_INCREMENT=2 ";



$sql[7] = "INSERT INTO `livehelp_autoinvite` VALUES (1, 'Y', 0, '1', '', 0, '', 'layer')";



$sql[8] = "CREATE TABLE `livehelp_channels` (
  `id` int(10) NOT NULL auto_increment,
  `user_id` int(10) NOT NULL default '0',
  `statusof` char(1) NOT NULL default '',
  `startdate` bigint(8) NOT NULL default '0',
  `sessionid` varchar(40) NOT NULL default '',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";



$sql[9] = "CREATE TABLE `livehelp_config` (
  `version` varchar(10) NOT NULL default '2.12.2',
  `site_title` varchar(100) NOT NULL default '',
  `use_flush` varchar(10) NOT NULL default 'YES',
  `membernum` int(8) NOT NULL default '0',
  `offset` int(5) NOT NULL default '0',
  `show_typing` char(1) NOT NULL default '',
  `webpath` varchar(255) NOT NULL default '',
  `s_webpath` varchar(255) NOT NULL default '',
  `speaklanguage` varchar(60) NOT NULL default 'English',
  `scratch_space` text NOT NULL,
  `admin_refresh` varchar(30) NOT NULL default 'auto',
  `maxexe` int(5) default '90',
  `refreshrate` int(5) NOT NULL default '1',
  `chatmode` varchar(60) NOT NULL default '',
  `adminsession` char(1) NOT NULL default 'N',
  `ignoreips` text NOT NULL,
  `directoryid` varchar(32) NOT NULL default '',
  `tracking` char(1) NOT NULL default 'N',
  `colorscheme` varchar(30) NOT NULL default 'blue',
  `matchip` char(1) NOT NULL default 'N',
  `gethostnames` char(1) NOT NULL default 'N',
  `maxrecords` int(10) NOT NULL default '75000',
  `maxreferers` int(10) NOT NULL default '50',
  `maxvisits` int(10) NOT NULL default '75',
  `maxmonths` int(10) NOT NULL default '12',
  `maxoldhits` int(10) NOT NULL default '1',
  `showgames` char(1) NOT NULL default 'Y',
  `showsearch` char(1) NOT NULL default 'Y',
  `showdirectory` char(1) NOT NULL default 'Y',
  `usertracking` char(1) NOT NULL default 'N',
  `resetbutton` char(1) NOT NULL default 'N',
  `keywordtrack` char(1) NOT NULL default 'N',
  `reftracking` char(1) NOT NULL default 'N',
  `topkeywords` int(10) NOT NULL default '50',
  `everythingelse` text NOT NULL,
  `rememberusers` char(1) NOT NULL default 'Y',
  PRIMARY KEY  (`version`)
) TYPE=MyISAM";



$sql[10] = "INSERT INTO `livehelp_config` VALUES ('2.12.2', 'Live Help!', 'YES', 0, 0, 'Y', 'http://$Dominio/$Diretorio/CSLH', '/', 'English', '\n        \n        <center>\n\n<h2 align=\"center\">Welcome to Crafty Syntax Live Help</h2>\n\n<p>\nAll the administrative functions are located to the left of this text. \n</p>\n<p>\nYou can use this section to keep notes for yourself and other admins, etc. </p>\n<p>\nTo change the text that is located in this box just click on the small edit button on the top right corner of this box.</p>\n\n<br><br>\n\n        ', 'auto', 300, 1, 'xmlhttp-flush-refresh', 'N', '', '', 'N', 'blue', 'N', 'N', 75000, 50, 75, 12, 1, 'Y', 'Y', 'Y', 'N', 'N', 'N', 'N', 50, '', 'Y')";



$sql[11] = "CREATE TABLE `livehelp_departments` (
  `recno` int(5) NOT NULL auto_increment,
  `nameof` varchar(30) NOT NULL default '',
  `onlineimage` varchar(255) NOT NULL default '',
  `offlineimage` varchar(255) NOT NULL default '',
  `layerinvite` varchar(255) NOT NULL default '',
  `requirename` char(1) NOT NULL default '',
  `messageemail` varchar(60) NOT NULL default '',
  `leaveamessage` varchar(10) NOT NULL default '',
  `opening` text NOT NULL,
  `offline` text NOT NULL,
  `creditline` char(1) NOT NULL default 'L',
  `imagemap` text NOT NULL,
  `whilewait` text NOT NULL,
  `timeout` int(5) NOT NULL default '0',
  `leavetxt` text NOT NULL,
  `topframeheight` int(10) NOT NULL default '35',
  `topbackground` varchar(255) NOT NULL default '',
  `colorscheme` varchar(255) NOT NULL default '',
  `speaklanguage` varchar(60) NOT NULL default '',
  `busymess` text NOT NULL,
  `emailfun` char(1) NOT NULL default 'Y',
  `dbfun` char(1) NOT NULL default 'Y',
  `everythingelse` text NOT NULL,
  PRIMARY KEY  (`recno`)
) TYPE=MyISAM AUTO_INCREMENT=2 ";


$sql[12] = "INSERT INTO `livehelp_departments` VALUES (1, 'default', 'online.gif', 'leavemessage.gif', 'dhtmlimage.gif', 'Y', 'admin@email.com', 'YES', '<blockquote>Welcome to our Live Help. Please enter your name in the input box below to begin.</blockquote>', '<blockquote>Sorry no operators are currently online to provide Live support at this time.</blockquote>', 'L', '<MAP NAME=myimagemap><AREA HREF=javascript:openLiveHelp() SHAPE=RECT COORDS=0,0,400,197><AREA HREF=javascript:openLiveHelp() SHAPE=RECT COORDS=0,157,213,257><AREA HREF=javascript:closeDHTML() SHAPE=RECT COORDS=237,157,400,257></MAP>', 'Please be patient while an operator is contacted... ', 500, '<h3><SPAN CLASS=wh>LEAVE A MESSAGE:</SPAN></h3>Please type in your comments/questions in the below box <br> and provide an e-mail address so we can get back to you', 35, 'linedback.gif', 'yellow', '', '<blockquote>Sorry all operators are currently helping other clients and are unable to provide Live support at this time.<br>Would you like to continue to wait for an operator or leave a message?<br><table width=450><tr><td width=40%><a href=livehelp.php?page=livehelp.php&department=[department]&tab=1 target=_top><font size=+1>Continue to wait</font></a></td><td width=20% align=center><b>or</b></td><td width=40%><a href=leavemessage.php?department=[department]><font size=+1>Leave A Message</a></td></tr></table><blockquote>', 'Y', 'Y', '')";




$sql[13] = "CREATE TABLE `livehelp_identity_daily` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `isnamed` char(1) NOT NULL default 'N',
  `groupidentity` int(11) NOT NULL default '0',
  `groupusername` int(11) NOT NULL default '0',
  `identity` varchar(100) NOT NULL default '',
  `cookieid` varchar(40) NOT NULL default '',
  `ipaddress` varchar(30) NOT NULL default '',
  `username` varchar(100) NOT NULL default '',
  `dateof` bigint(14) NOT NULL default '0',
  `uservisits` int(10) NOT NULL default '0',
  `seconds` int(10) NOT NULL default '0',
  `useragent` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `isnamed` (`isnamed`),
  KEY `groupidentity` (`groupidentity`),
  KEY `groupusername` (`groupusername`),
  KEY `identity` (`identity`),
  KEY `cookieid` (`cookieid`),
  KEY `username` (`username`),
  KEY `dateof` (`dateof`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";



$sql[14] = "CREATE TABLE `livehelp_identity_monthly` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `isnamed` char(1) NOT NULL default 'N',
  `groupidentity` int(11) NOT NULL default '0',
  `groupusername` int(11) NOT NULL default '0',
  `identity` varchar(100) NOT NULL default '',
  `cookieid` varchar(40) NOT NULL default '',
  `ipaddress` varchar(30) NOT NULL default '',
  `username` varchar(100) NOT NULL default '',
  `dateof` bigint(14) NOT NULL default '0',
  `uservisits` int(10) NOT NULL default '0',
  `seconds` int(10) NOT NULL default '0',
  `useragent` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `isnamed` (`isnamed`),
  KEY `groupidentity` (`groupidentity`),
  KEY `groupusername` (`groupusername`),
  KEY `identity` (`identity`),
  KEY `cookieid` (`cookieid`),
  KEY `username` (`username`),
  KEY `dateof` (`dateof`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";



$sql[96] = "CREATE TABLE `livehelp_keywords_daily` (
  `recno` int(11) NOT NULL auto_increment,
  `parentrec` int(11) unsigned NOT NULL default '0',
  `referer` varchar(255) NOT NULL default '',
  `pageurl` varchar(255) NOT NULL default '',
  `keywords` varchar(255) NOT NULL default '',
  `dateof` int(8) NOT NULL default '0',
  `levelvisits` int(11) unsigned NOT NULL default '0',
  `directvisits` int(11) unsigned NOT NULL default '0',
  PRIMARY KEY  (`recno`),
  KEY `levelvisits` (`levelvisits`),
  KEY `dateof` (`dateof`),
  KEY `referer` (`referer`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";



$sql[15] = "CREATE TABLE `livehelp_keywords_monthly` (
  `recno` int(11) NOT NULL auto_increment,
  `parentrec` int(11) unsigned NOT NULL default '0',
  `referer` varchar(255) NOT NULL default '',
  `pageurl` varchar(255) NOT NULL default '',
  `keywords` varchar(255) NOT NULL default '',
  `dateof` int(8) NOT NULL default '0',
  `levelvisits` int(11) unsigned NOT NULL default '0',
  `directvisits` int(11) unsigned NOT NULL default '0',
  PRIMARY KEY  (`recno`),
  KEY `levelvisits` (`levelvisits`),
  KEY `dateof` (`dateof`),
  KEY `referer` (`referer`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";



$sql[16] = "CREATE TABLE `livehelp_layerinvites` (
  `layerid` int(10) NOT NULL default '0',
  `name` varchar(60) NOT NULL default '',
  `imagename` varchar(60) NOT NULL default '',
  `imagemap` text NOT NULL,
  `department` varchar(60) NOT NULL default '',
  `user` int(10) NOT NULL default '0',
  PRIMARY KEY  (`layerid`)
) TYPE=MyISAM";



$sql[17] = "CREATE TABLE `livehelp_leavemessage` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `email` varchar(255) NOT NULL default '',
  `subject` varchar(200) NOT NULL default '',
  `department` int(11) unsigned NOT NULL default '0',
  `dateof` bigint(14) NOT NULL default '0',
  `sessiondata` text NOT NULL,
  `deliminated` text NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `department` (`department`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";


$sql[18] = "CREATE TABLE `livehelp_messages` (
  `id_num` int(10) NOT NULL auto_increment,
  `message` text NOT NULL,
  `channel` int(10) NOT NULL default '0',
  `timeof` bigint(14) NOT NULL default '0',
  `saidfrom` int(10) NOT NULL default '0',
  `saidto` int(10) NOT NULL default '0',
  `typeof` varchar(30) NOT NULL default '',
  PRIMARY KEY  (`id_num`),
  KEY `channel` (`channel`),
  KEY `timeof` (`timeof`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";


$sql[19] = "CREATE TABLE `livehelp_modules` (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(30) NOT NULL default '',
  `path` varchar(255) NOT NULL default '',
  `adminpath` varchar(255) NOT NULL default '',
  `query_string` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=4 ";



$sql[20] = "INSERT INTO `livehelp_modules` VALUES (1, 'Live Help!', 'livehelp.php', '', '')";
$sql[21] = "INSERT INTO `livehelp_modules` VALUES (2, 'Contact', 'leavemessage.php', '', '')";
$sql[22] = "INSERT INTO `livehelp_modules` VALUES (3, 'Q & A', 'user_qa.php', 'qa.php', '')";



$sql[23] = "CREATE TABLE `livehelp_modules_dep` (
  `rec` int(10) NOT NULL auto_increment,
  `departmentid` int(10) NOT NULL default '0',
  `modid` int(10) NOT NULL default '0',
  `ordernum` int(8) NOT NULL default '0',
  `defaultset` char(1) NOT NULL default '',
  PRIMARY KEY  (`rec`)
) TYPE=MyISAM AUTO_INCREMENT=3 ";



$sql[24] = "INSERT INTO `livehelp_modules_dep` VALUES (1, 1, 1, 1, '')";
$sql[25] = "INSERT INTO `livehelp_modules_dep` VALUES (2, 1, 2, 2, 'Y')";



$sql[26] = "CREATE TABLE `livehelp_operator_channels` (
  `id` int(10) NOT NULL auto_increment,
  `user_id` int(10) NOT NULL default '0',
  `channel` int(10) NOT NULL default '0',
  `userid` int(10) NOT NULL default '0',
  `statusof` char(1) NOT NULL default '',
  `startdate` bigint(8) NOT NULL default '0',
  `bgcolor` varchar(10) NOT NULL default '000000',
  `txtcolor` varchar(10) NOT NULL default '000000',
  `channelcolor` varchar(10) NOT NULL default 'F7FAFF',
  `txtcolor_alt` varchar(10) NOT NULL default '000000',
  PRIMARY KEY  (`id`),
  KEY `channel` (`channel`),
  KEY `user_id` (`user_id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";



$sql[27] = "CREATE TABLE `livehelp_operator_departments` (
  `recno` int(10) NOT NULL auto_increment,
  `user_id` int(10) NOT NULL default '0',
  `department` int(10) NOT NULL default '0',
  `extra` varchar(100) NOT NULL default '',
  PRIMARY KEY  (`recno`),
  KEY `user_id` (`user_id`),
  KEY `department` (`department`)
) TYPE=MyISAM AUTO_INCREMENT=2 ";



$sql[28] = "INSERT INTO `livehelp_operator_departments` VALUES (1, 1, 1, '')";



$sql[29] = "CREATE TABLE `livehelp_operator_history` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `opid` int(11) unsigned NOT NULL default '0',
  `action` varchar(60) NOT NULL default '',
  `dateof` bigint(14) NOT NULL default '0',
  `sessionid` varchar(40) NOT NULL default '',
  `transcriptid` int(10) NOT NULL default '0',
  `totaltime` int(10) NOT NULL default '0',
  `channel` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `opid` (`opid`),
  KEY `dateof` (`dateof`)
) TYPE=MyISAM AUTO_INCREMENT=6 ";



$sql[30] = "INSERT INTO `livehelp_operator_history` VALUES (1, 1, 'login', 20050722151356, '561cade152d49ab1c8bbbd3339b47aa6', 0, 0, 0)";

$sql[31] = "INSERT INTO `livehelp_operator_history` VALUES (2, 1, 'login', 20050722151420, '561cade152d49ab1c8bbbd3339b47aa6', 0, 0, 0)";

$sql[32] = "INSERT INTO `livehelp_operator_history` VALUES (3, 1, 'login', 20050722151509, 'f31313f7ce3b2d904231ed35a4c0dc2b', 0, 0, 0)";

$sql[33] = "INSERT INTO `livehelp_operator_history` VALUES (4, 1, 'login', 20050722151512, 'f31313f7ce3b2d904231ed35a4c0dc2b', 0, 0, 0)";

$sql[34] = "INSERT INTO `livehelp_operator_history` VALUES (5, 1, 'login', 20050722151548, 'abde85813990737b6533dd205d4d106b', 0, 0, 0)";



$sql[35] = "CREATE TABLE `livehelp_qa` (
  `recno` int(10) NOT NULL auto_increment,
  `parent` int(10) NOT NULL default '0',
  `question` text NOT NULL,
  `typeof` varchar(10) NOT NULL default '',
  `status` varchar(20) NOT NULL default '',
  `username` varchar(60) NOT NULL default '',
  `ordernum` int(10) NOT NULL default '0',
  PRIMARY KEY  (`recno`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";



$sql[36] = "CREATE TABLE `livehelp_questions` (
  `id` int(10) NOT NULL auto_increment,
  `department` int(10) NOT NULL default '0',
  `ordering` int(8) NOT NULL default '0',
  `headertext` text NOT NULL,
  `fieldtype` varchar(30) NOT NULL default '',
  `options` text NOT NULL,
  `flags` varchar(60) NOT NULL default '',
  `module` varchar(60) NOT NULL default '',
  `required` char(1) NOT NULL default 'N',
  PRIMARY KEY  (`id`),
  KEY `department` (`department`)
) TYPE=MyISAM AUTO_INCREMENT=6 ";



$sql[37] = "INSERT INTO `livehelp_questions` VALUES (1, 1, 0, 'E-mail:', 'email', '', '', 'leavemessage', 'N')";
$sql[38] = "INSERT INTO `livehelp_questions` VALUES (2, 1, 0, 'Questão:', 'textarea', '', '', 'leavemessage', 'N')";
$sql[39] = "INSERT INTO `livehelp_questions` VALUES (3, 1, 0, 'Nome', 'username', '', '', 'livehelp', 'N')";
$sql[40] = "INSERT INTO `livehelp_questions` VALUES (4, 1, 1, 'E-mail', 'email', '', '', 'livehelp', 'N')";
$sql[41] = "INSERT INTO `livehelp_questions` VALUES (5, 1, 1, 'Questão', 'textarea', '', '', 'livehelp', 'N')";



$sql[42] = "CREATE TABLE `livehelp_quick` (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(50) NOT NULL default '',
  `typeof` varchar(30) NOT NULL default '',
  `message` text NOT NULL,
  `visiblity` varchar(20) NOT NULL default '',
  `department` varchar(60) NOT NULL default '0',
  `user` int(10) NOT NULL default '0',
  `ishtml` char(3) NOT NULL default '',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";


$sql[43] = "CREATE TABLE `livehelp_referers_daily` (
  `recno` int(11) NOT NULL auto_increment,
  `pageurl` varchar(255) NOT NULL default '0',
  `dateof` int(8) NOT NULL default '0',
  `levelvisits` int(11) unsigned NOT NULL default '0',
  `directvisits` int(11) unsigned NOT NULL default '0',
  `parentrec` int(11) unsigned NOT NULL default '0',
  `level` int(10) NOT NULL default '0',
  PRIMARY KEY  (`recno`),
  KEY `pageurl` (`pageurl`),
  KEY `parentrec` (`parentrec`),
  KEY `levelvisits` (`levelvisits`),
  KEY `directvisits` (`directvisits`),
  KEY `dateof` (`dateof`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";



$sql[44] = "CREATE TABLE `livehelp_referers_monthly` (
  `recno` int(11) NOT NULL auto_increment,
  `pageurl` varchar(255) NOT NULL default '0',
  `dateof` int(8) NOT NULL default '0',
  `levelvisits` int(11) unsigned NOT NULL default '0',
  `directvisits` int(11) unsigned NOT NULL default '0',
  `parentrec` int(11) unsigned NOT NULL default '0',
  `level` int(10) NOT NULL default '0',
  PRIMARY KEY  (`recno`),
  KEY `pageurl` (`pageurl`),
  KEY `parentrec` (`parentrec`),
  KEY `levelvisits` (`levelvisits`),
  KEY `directvisits` (`directvisits`),
  KEY `dateof` (`dateof`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";


$sql[45] = "CREATE TABLE `livehelp_smilies` (
  `smilies_id` smallint(5) unsigned NOT NULL auto_increment,
  `code` varchar(50) default NULL,
  `smile_url` varchar(100) default NULL,
  `emoticon` varchar(75) default NULL,
  PRIMARY KEY  (`smilies_id`)
) TYPE=MyISAM AUTO_INCREMENT=43 ";


$sql[46] = "INSERT INTO `livehelp_smilies` VALUES (1, ':D', 'icon_biggrin.gif', 'Very Happy')";
$sql[47] = "INSERT INTO `livehelp_smilies` VALUES (2, ':-D', 'icon_biggrin.gif', 'Very Happy')";
$sql[48] = "INSERT INTO `livehelp_smilies` VALUES (3, ':grin:', 'icon_biggrin.gif', 'Very Happy')";
$sql[49] = "INSERT INTO `livehelp_smilies` VALUES (4, ':)', 'icon_smile.gif', 'Smile')";
$sql[50] = "INSERT INTO `livehelp_smilies` VALUES (5, ':-)', 'icon_smile.gif', 'Smile')";
$sql[51] = "INSERT INTO `livehelp_smilies` VALUES (6, ':smile:', 'icon_smile.gif', 'Smile')";
$sql[52] = "INSERT INTO `livehelp_smilies` VALUES (7, ':(', 'icon_sad.gif', 'Sad')";
$sql[53] = "INSERT INTO `livehelp_smilies` VALUES (8, ':-(', 'icon_sad.gif', 'Sad')";
$sql[54] = "INSERT INTO `livehelp_smilies` VALUES (9, ':sad:', 'icon_sad.gif', 'Sad')";
$sql[55] = "INSERT INTO `livehelp_smilies` VALUES (10, ':o', 'icon_surprised.gif', 'Surprised')";
$sql[56] = "INSERT INTO `livehelp_smilies` VALUES (11, ':-o', 'icon_surprised.gif', 'Surprised')";
$sql[57] = "INSERT INTO `livehelp_smilies` VALUES (12, ':eek:', 'icon_surprised.gif', 'Surprised')";
$sql[58] = "INSERT INTO `livehelp_smilies` VALUES (13, ':shock:', 'icon_eek.gif', 'Shocked')";
$sql[59] = "INSERT INTO `livehelp_smilies` VALUES (14, ':?', 'icon_confused.gif', 'Confused')";
$sql[60] = "INSERT INTO `livehelp_smilies` VALUES (15, ':-?', 'icon_confused.gif', 'Confused')";
$sql[61] = "INSERT INTO `livehelp_smilies` VALUES (16, ':???:', 'icon_confused.gif', 'Confused')";
$sql[62] = "INSERT INTO `livehelp_smilies` VALUES (17, '8)', 'icon_cool.gif', 'Cool')";
$sql[63] = "INSERT INTO `livehelp_smilies` VALUES (18, '8-)', 'icon_cool.gif', 'Cool')";
$sql[64] = "INSERT INTO `livehelp_smilies` VALUES (19, ':cool:', 'icon_cool.gif', 'Cool')";
$sql[65] = "INSERT INTO `livehelp_smilies` VALUES (20, ':lol:', 'icon_lol.gif', 'Laughing')";
$sql[66] = "INSERT INTO `livehelp_smilies` VALUES (21, ':x', 'icon_mad.gif', 'Mad')";
$sql[67] = "INSERT INTO `livehelp_smilies` VALUES (22, ':-x', 'icon_mad.gif', 'Mad')";
$sql[68] = "INSERT INTO `livehelp_smilies` VALUES (23, ':mad:', 'icon_mad.gif', 'Mad')";
$sql[69] = "INSERT INTO `livehelp_smilies` VALUES (24, ':P', 'icon_razz.gif', 'Razz')";
$sql[70] = "INSERT INTO `livehelp_smilies` VALUES (25, ':-P', 'icon_razz.gif', 'Razz')";
$sql[71] = "INSERT INTO `livehelp_smilies` VALUES (26, ':razz:', 'icon_razz.gif', 'Razz')";
$sql[72] = "INSERT INTO `livehelp_smilies` VALUES (27, ':oops:', 'icon_redface.gif', 'Embarassed')";
$sql[73] = "INSERT INTO `livehelp_smilies` VALUES (28, ':cry:', 'icon_cry.gif', 'Crying or Very sad')";
$sql[74] = "INSERT INTO `livehelp_smilies` VALUES (29, ':evil:', 'icon_evil.gif', 'Evil or Very Mad')";
$sql[75] = "INSERT INTO `livehelp_smilies` VALUES (30, ':twisted:', 'icon_twisted.gif', 'Twisted Evil')";
$sql[76] = "INSERT INTO `livehelp_smilies` VALUES (31, ':roll:', 'icon_rolleyes.gif', 'Rolling Eyes')";
$sql[77] = "INSERT INTO `livehelp_smilies` VALUES (32, ':wink:', 'icon_wink.gif', 'Wink')";
$sql[78] = "INSERT INTO `livehelp_smilies` VALUES (33, ';)', 'icon_wink.gif', 'Wink')";
$sql[79] = "INSERT INTO `livehelp_smilies` VALUES (34, ';-)', 'icon_wink.gif', 'Wink')";
$sql[80] = "INSERT INTO `livehelp_smilies` VALUES (35, ':!:', 'icon_exclaim.gif', 'Exclamation')";
$sql[81] = "INSERT INTO `livehelp_smilies` VALUES (36, ':?:', 'icon_question.gif', 'Question')";
$sql[82] = "INSERT INTO `livehelp_smilies` VALUES (37, ':idea:', 'icon_idea.gif', 'Idea')";
$sql[83] = "INSERT INTO `livehelp_smilies` VALUES (38, ':arrow:', 'icon_arrow.gif', 'Arrow')";
$sql[84] = "INSERT INTO `livehelp_smilies` VALUES (39, ':|', 'icon_neutral.gif', 'Neutral')";
$sql[85] = "INSERT INTO `livehelp_smilies` VALUES (40, ':-|', 'icon_neutral.gif', 'Neutral')";
$sql[86] = "INSERT INTO `livehelp_smilies` VALUES (41, ':neutral:', 'icon_neutral.gif', 'Neutral')";
$sql[87] = "INSERT INTO `livehelp_smilies` VALUES (42, ':mrgreen:', 'icon_mrgreen.gif', 'Mr. Green')";


$sql[88] = "CREATE TABLE `livehelp_transcripts` (
  `recno` int(10) NOT NULL auto_increment,
  `who` varchar(100) NOT NULL default '',
  `endtime` bigint(14) default NULL,
  `transcript` text NOT NULL,
  `sessionid` varchar(40) NOT NULL default '',
  `sessiondata` text NOT NULL,
  `department` int(10) NOT NULL default '0',
  `email` varchar(100) NOT NULL default '',
  `starttime` bigint(14) NOT NULL default '0',
  `duration` int(11) unsigned NOT NULL default '0',
  `operators` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`recno`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";



$sql[89] = "CREATE TABLE `livehelp_users` (
  `user_id` int(10) NOT NULL auto_increment,
  `lastaction` bigint(14) default '0',
  `username` varchar(30) NOT NULL default '',
  `password` varchar(60) NOT NULL default '',
  `isonline` char(1) NOT NULL default '',
  `isoperator` char(1) NOT NULL default 'N',
  `onchannel` int(10) NOT NULL default '0',
  `isadmin` char(1) NOT NULL default 'N',
  `department` int(5) NOT NULL default '0',
  `identity` varchar(255) NOT NULL default '',
  `status` varchar(30) NOT NULL default '',
  `isnamed` char(1) NOT NULL default 'N',
  `showedup` bigint(14) default NULL,
  `email` varchar(60) NOT NULL default '',
  `camefrom` varchar(255) NOT NULL default '',
  `show_arrival` char(1) NOT NULL default 'N',
  `user_alert` char(1) NOT NULL default '',
  `auto_invite` char(1) NOT NULL default '',
  `istyping` char(1) NOT NULL default '1',
  `visits` int(8) NOT NULL default '0',
  `jsrn` int(5) NOT NULL default '0',
  `hostname` varchar(255) NOT NULL default '',
  `useragent` varchar(255) NOT NULL default '',
  `ipaddress` varchar(255) NOT NULL default '',
  `sessionid` varchar(40) NOT NULL default '',
  `authenticated` char(1) NOT NULL default '',
  `cookied` char(1) NOT NULL default 'N',
  `sessiondata` text NOT NULL,
  `expires` bigint(14) NOT NULL default '0',
  `greeting` text NOT NULL,
  `photo` varchar(255) NOT NULL default '',
  `chataction` bigint(14) default '0',
  `new_session` char(1) NOT NULL default 'Y',
  `showtype` char(1) NOT NULL default 'Y',
  `chattype` char(1) NOT NULL default 'Y',
  `externalchats` varchar(255) NOT NULL default '',
  `layerinvite` int(10) NOT NULL default '0',
  `askquestions` char(1) NOT NULL default 'Y',
  `showvisitors` char(1) NOT NULL default 'N',
  `cookieid` varchar(40) NOT NULL default '',
  PRIMARY KEY  (`user_id`)
) TYPE=MyISAM AUTO_INCREMENT=2 ";



$sql[90] = "INSERT INTO `livehelp_users` VALUES (1, 0, 'admin', '$senha_adm', 'N', 'Y', 0, 'Y', 0, '', '', 'Y', NULL, '$Email', '', 'N', 'N', 'N', '1', 5, 0, 'host_lookup_not_enabled', '', '', '', 'Y', 'Y', '', 20050722153552, 'Em que posso ajudar ?', '', 0, 'N', 'Y', 'Y', '', 0, 'Y', 'N', '')";



$sql[91] = "CREATE TABLE `livehelp_visit_track` (
  `recno` int(10) NOT NULL auto_increment,
  `sessionid` varchar(40) NOT NULL default '0',
  `location` varchar(255) NOT NULL default '',
  `page` bigint(14) NOT NULL default '0',
  `title` varchar(100) NOT NULL default '',
  `whendone` bigint(14) NOT NULL default '0',
  `referrer` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`recno`),
  KEY `sessionid` (`sessionid`),
  KEY `location` (`location`),
  KEY `page` (`page`),
  KEY `whendone` (`whendone`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";



$sql[92] = "CREATE TABLE `livehelp_visits_daily` (
  `recno` int(11) NOT NULL auto_increment,
  `pageurl` varchar(255) NOT NULL default '0',
  `dateof` int(8) NOT NULL default '0',
  `levelvisits` int(11) unsigned NOT NULL default '0',
  `directvisits` int(11) unsigned NOT NULL default '0',
  `parentrec` int(11) unsigned NOT NULL default '0',
  `level` int(10) NOT NULL default '0',
  PRIMARY KEY  (`recno`),
  KEY `pageurl` (`pageurl`),
  KEY `parentrec` (`parentrec`),
  KEY `levelvisits` (`levelvisits`),
  KEY `directvisits` (`directvisits`),
  KEY `dateof` (`dateof`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";



$sql[93] = "CREATE TABLE `livehelp_visits_monthly` (
  `recno` int(11) NOT NULL auto_increment,
  `pageurl` varchar(255) NOT NULL default '0',
  `dateof` int(8) NOT NULL default '0',
  `levelvisits` int(11) unsigned NOT NULL default '0',
  `directvisits` int(11) unsigned NOT NULL default '0',
  `parentrec` int(11) unsigned NOT NULL default '0',
  `level` int(10) NOT NULL default '0',
  PRIMARY KEY  (`recno`),
  KEY `pageurl` (`pageurl`),
  KEY `parentrec` (`parentrec`),
  KEY `levelvisits` (`levelvisits`),
  KEY `directvisits` (`directvisits`),
  KEY `dateof` (`dateof`)
) TYPE=MyISAM AUTO_INCREMENT=1 ";

$sql[94] = "CREATE TABLE `livehelp_configuration` (
        `usuario` char(255) NOT NULL ,
        `senha` char(255) NOT NULL default '',
        `banco` char(255) NOT NULL default '',
        `dominio` char(255) NOT NULL default ''
      ) TYPE=MyISAM";

$sql[95] = "INSERT INTO `livehelp_configuration` ( `usuario` , `senha` , `banco` , `dominio` )
VALUES ('$Usuario_banco', '$Senha_banco', '$Banco', '$Dominio')";
?>
