| Server IP : 10.200.247.200 / Your IP : 216.73.217.19 Web Server : Apache System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : jeremy ( 1001) PHP Version : 8.4.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/usa_sites/usagrantapplications.org/vsa/agentfiles/ |
Upload File : |
<?php
/*
Copyright (c) 2007-present InnAnTech Industries
Author: Dave Guindon
Web: www.VirtualSmartAgent.com
Support: www.DaveGuindonSupport.com
Please send bug reports, suggestions and/or feedback to the support
website given above.
Virtual Smart Agent is a commercial software. Any distribution is strictly prohibited
unless a resale rights license was delivered along with this software.
This is the guts of the agent chat window ... I highly adivce
NOT to edit this page unless you know php, javascript, MySQL,
html, css and Ajax!
*/
include('../modfiles/db.php');
include('../functions.php');
include('../globals.php');
//get posted data
$cid = $_GET['cid'];//get the campaign id
$ip = $_GET['ip']; //get ip address
$testmode = $_GET['tmd']; //test mode variable
//select a random agent
$conn = mysql_connect("$dbhost", "$dblogin", "$dbpass") or die ('I cannot connect to the database.');
mysql_select_db($dbname, $conn);
//select a random agent from the agents table
$sql = "SELECT * FROM $agentsTable WHERE cid='$cid' ORDER BY RAND() LIMIT 1";
$result = mysql_query($sql, $conn);
$agentdata = mysql_fetch_assoc($result);
$agent = $agentdata['name'];
$picid = $agentdata['picid'];
$agentid = $agentdata['id'];
//get the picture location for this agent
$sql = "SELECT * FROM $agentpicsTable WHERE id='$picid'";
$result = mysql_query($sql, $conn);
$picdata = mysql_fetch_assoc($result);
$agentpic = $picdata['location'];
$agentpiclabel = $picdata['label'];
//get the total number of preset instant messages
$sql = "SELECT * FROM $messTable WHERE cid='$cid'";
$result = mysql_query($sql, $conn);
$totalcomments = mysql_num_rows($result);
//get the total number of preset smart agent messages
$sql = "SELECT * FROM $smartTable WHERE cid='$cid'";
$result = mysql_query($sql, $conn);
$totalsmartcomments = mysql_num_rows($result);
//get some data from the campaign table
$sql = "SELECT * FROM $campaignTable WHERE id='$cid'";
$result = mysql_query($sql, $conn);
$cdata = mysql_fetch_assoc($result);
$instantdelay = $cdata['instantdelay'];
$smartdelay = $cdata['smartdelay'];
$backcolor = $cdata['backcolor'];
$buttonhovercolor = $cdata['buttonhovercolor'];
$buttoncolor = $cdata['buttoncolor'];
$buttonbordercolor = $cdata['buttonbordercolor'];
$buttonbordersize = $cdata['buttonbordersize'];
$buttonborderstyle = $cdata['buttonborderstyle'];
$buttontextbold = $cdata['buttontextbold'];
$buttontextitalic = $cdata['buttontextitalic'];
$showbuttoncolor = MakeVisibleColor('#'.$buttoncolor);
$showcolor = MakeVisibleColor('#'.$backcolor);
$texthovercolor = MakeVisibleColor('#'.$buttonhovercolor);
if ($cdata['usecustomcode'] == '1'){
$customcode = $cdata['customcode'];
$customcode = stripslashes($customcode);
$customcodeTop = '';
$customcodeBottom = '';
if ($cdata['customcodelocation'] == 'top'){
$customcodeTop = $customcode;
}else{
$customcodeBottom = $customcode;
}
}
$aweber_useaweber = $cdata['aweber_useaweber'];
if ($aweber_useaweber == '1'){
$aweber_listname = $cdata['aweber_listname'];
$aweber_thankyoupage = $cdata['aweber_thankyoupage'];
$aweber_forwardvars = $cdata['aweber_forwardvars'];
$aweber_adtracking = $cdata['aweber_adtracking'];
$aweber = '<form name="emailform" target="_blank" action="http://www.aweber.com/scripts/addlead.pl" onsubmit="return CheckSend()">';
$aweber .= '<input type="hidden" name="unit" value="'.$aweber_listname.'">';
$aweber .= '<input type="hidden" name="redirect" value="'.$aweber_thankyoupage.'">';
$aweber .= '<input type="hidden" name="meta_forward_vars" value="'.$aweber_forwardvars.'">';
$aweber .= '<input type="hidden" name="meta_adtracking" value="'.$aweber_adtracking.'">';
$aweber .= '<input type="hidden" name="meta_required" value="from,name">';
$aweber .= '<table width="460" height="46" border="0" align="center" cellpadding="2" cellspacing="0">';
$aweber .= ' <tr>';
$aweber .= ' <td width="126"><input type="text" class="emailinput" name="name" id="vsaname" value="'.$aweber_nametext.'" onclick="if (this.value==\''.$aweber_nametext.'\') this.value=\'\';" onmouseover="this.style.color=\'#404040\';" onblur="if (this.value==\'\') {this.value=\''.$aweber_nametext.'\'; this.style.color=\'#808080\';}" onmouseout="if (this.value==\'\' || this.value==\''.$aweber_nametext.'\') this.style.color=\'#808080\';"></td>';
$aweber .= ' <td width="167" height="23"><input type="text" class="emailinput" name="from" id="vsaemail" value="'.$aweber_emailtext.'" onclick="if (this.value==\''.$aweber_emailtext.'\') this.value=\'\';" onmouseover="this.style.color=\'#404040\';" onblur="if (this.value==\'\') {this.value=\''.$aweber_emailtext.'\'; this.style.color=\'#808080\';}" onmouseout="if (this.value==\'\' || this.value==\''.$aweber_emailtext.'\') this.style.color=\'#808080\';"></td>';
$aweber .= ' <td width="150"><input class="submitbutton" type="submit" name="button2" id="button2" value="Submit" /></td>';
$aweber .= ' </tr>';
$aweber .= '</table>';
$aweber .= '</form>';
}
//build the clickbank affiliate link here
$trackid = $cdata['trackid'];
$afflinktext = $cdata['afflinktext'];
$trackid = trim($trackid);
$afflinktext = trim($afflinktext);
$trackid = stripslashes($trackid);
$afflinktext = stripslashes($afflinktext);
if ($afflinktext == ''){
$afflinktext = 'Powered by VSA';
}
if ($trackid != ''){
$vsalink = $trackid;
}else{
$vsalink = 'http://www.virtualsmartagent.com';
}
$vsalinkshow = '<div align="right"><a href="'.$vsalink.'" target="_blank" style="font-family:Arial, Helvetica, sans-serif; font-size:9px; text-decoration:underline; color: #'.$showcolor.';" onMouseOver="window.status=\'http://www.virtualsmartagent.com\';return true" onMouseOut="window.status=\'\'">'.$afflinktext.'</a></div>';
//check if agent picture is set to be displayed
$agentpiclabel = trim($agentpiclabel);
$agentpiclabel = strtolower($agentpiclabel);
if ($agentpiclabel == 'no display'){
$chatwidth = '450px';
$chatshow = '<td colspan="2"><div id="commentdiv" class="commentbox"></div></td>';
}else{
$chatwidth = '290px';
$chatshow = '<td><div id="commentdiv" class="commentbox"></div></td>'."\n";
$chatshow .= '<td><table width="100%" cellpadding="0" cellspacing="0" border="0" class="agentborder"><tr><td><img src="'.$agentpic.'" width="150" height="220" border="0" /></td></tr></table></td>'."\n";
}
//start chat data here
$chatlogid = SetChatlog(1,$cid,0,$ip,$agentid,$testmode);
//increment the chat window initiation
SetStats($cid,$agentid,$picid,$chatlogid,0,$ip,'initiation',$testmode);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Agent</title>
<script type="text/javascript" src="ajaxroutine.js"></script>
<style type="text/css">
div.commentbox {
WIDTH: <?php echo $chatwidth; ?>;
HEIGHT: 208px;
FONT-FAMILY: Arial, Helvetica, sans-serif;
FONT-SIZE: 12px;
COLOR: #000000;
BORDER-RIGHT: #999999 1px solid;
BORDER-TOP: #999999 1px solid;
BORDER-LEFT: #999999 1px solid;
BORDER-BOTTOM: #999999 1px solid;
PADDING-RIGHT: 6px;
PADDING-LEFT: 6px;
PADDING-BOTTOM: 6px;
PADDING-TOP: 6px;
OVERFLOW: auto;
BACKGROUND-COLOR: #FFFFFF;
}
div.instantmessage {
WIDTH: auto;
HEIGHT: 18px;
FONT-FAMILY: Arial, Helvetica, sans-serif;
FONT-SIZE: 12px;
COLOR: #<?php echo $showcolor; ?>;
PADDING-RIGHT: 0px;
PADDING-LEFT: 6px;
PADDING-BOTTOM: 0px;
PADDING-TOP: 0px;
}
INPUT.input {
width: 297px;
height: 29px;
BORDER-RIGHT: #999999 1px solid;
BORDER-TOP: #999999 1px solid;
BORDER-LEFT: #999999 1px solid;
BORDER-BOTTOM: #999999 1px solid;
font-family: Arial, Helvetica, sans-serif;
font-size : 18px;
color: #0099FF;
BACKGROUND-COLOR: #FFFFFF;
padding: 5px 0 0 5px;
}
.button {
width: 152px;
height: 36px;
font-family: Arial, Helvetica, sans-serif;
font-size : 12px;
BORDER: <?php echo '#'.$buttonbordercolor.' '.$buttonbordersize.'px '.$buttonborderstyle; ?>;
BACKGROUND-COLOR: #<?php echo $buttoncolor; ?>;
font-weight: <?php echo $buttontextbold; ?>;
font-style: <?php echo $buttontextitalic; ?>;
color: #<?php echo $showbuttoncolor; ?>;
}
.button:hover {
BACKGROUND-COLOR: #<?php echo $buttonhovercolor; ?>;
color: #<?php echo $texthovercolor; ?>;
}
INPUT.emailinput {
width: 146px;
height: 17px;
BORDER-RIGHT: #999999 1px solid;
BORDER-TOP: #999999 1px solid;
BORDER-LEFT: #999999 1px solid;
BORDER-BOTTOM: #999999 1px solid;
font-family: Arial, Helvetica, sans-serif;
font-size : 12px;
BACKGROUND-COLOR: #FFFFFF;
color: #808080;
padding-left: 2px;
}
.submitbutton {
width: 152px;
height: 21px;
font-family: Arial, Helvetica, sans-serif;
font-size : 12px;
BORDER: <?php echo '#'.$buttonbordercolor.' '.$buttonbordersize.'px '.$buttonborderstyle; ?>;
BACKGROUND-COLOR: #<?php echo $buttoncolor; ?>;
font-weight: <?php echo $buttontextbold; ?>;
font-style: <?php echo $buttontextitalic; ?>;
color: #<?php echo $showbuttoncolor; ?>;
}
.submitbutton:hover {
BACKGROUND-COLOR: #<?php echo $buttonhovercolor; ?>;
color: #<?php echo $texthovercolor; ?>;
}
TABLE.agentborder{
BORDER-RIGHT: #999999 1px solid;
BORDER-TOP: #999999 1px solid;
BORDER-LEFT: #999999 1px solid;
BORDER-BOTTOM: #999999 1px solid;
BACKGROUND: #ffffff;
}
TABLE.maintable{
}
form {
margin: 0;
padding: 0;
}
</style>
<script type="text/javascript">
//define variables
var gx = 0;
var IDL = <?php echo $instantdelay; ?>; //instant comments delay (ms)
var MDL = <?php echo $smartdelay; ?>; //instant message delay offset (ms)
var ITT = <?php echo $totalcomments; ?>;
var RTT = <?php echo $totalsmartcomments; ?>;
var HNT = 0; //instant comments interval handle
var IND = 0; //instant comments index
var RND = 0; //response comments index
var agent = '<?php echo $agent; ?>'; //the agent name
var CID = '<?php echo $cid; ?>'; // the campaign id
var CLI = '<?php echo $chatlogid; ?>'; //the chat lot id
var CIP = '<?php echo $ip; ?>'; //the client ip address
var AID = '<?php echo $agentid; ?>'; //the agent id
var PID = '<?php echo $picid; ?>'; //the agent pic id
var TMD = '<?php echo $testmode; ?>'; //testmode variable
var AWB = '<?php echo $aweber_useaweber; ?>'; //aweber form
var AWU = '<?php echo $aweber_nametext; ?>'; //default name text from globals.php
var AWE = '<?php echo $aweber_emailtext; ?>'; //default email text from globals.php
var IDX = 1; //used for the name and email id parameters
//this initiates the virtual agent comments
function GetAgent(){
//set focus to the chat textbox
//document.agentform.sendbox.focus();
//instantly show the first comment
GetInstantComment(1);
//go through the rest of the instant comments
IND = 2;
SetMessage(1);
HNT = setInterval ( "GetNextComment()", IDL );
}
//this calls the next comment in the data php file and
//displays comments on a pre-defined interval
function GetNextComment(){
if (IND <= ITT){
SetMessage(0);
GetInstantComment(IND);
if (IND < ITT) setTimeout ( "SetMessage(1)", MDL );
IND = IND + 1;
}else{
clearInterval(HNT);
SetMessage(0);
}
}
//this send the users comments into the comments box
function SendComment(){
var comment = '';
var mytbox = document.agentform.sendbox;
var message = mytbox.value;
var msg = message;
if (message != ''){
//have to try to send name and email before writing to the comments box or else it won't work in firefox?
SendData();
AddUserComment(message);
mytbox.value = '';
//stop instant messages if there has been a posted comment from user
if (IND <= ITT){
clearInterval(HNT);
SetMessage(0);
}
//insert smart response message
setTimeout ( "SetMessage(1)", MDL );
//msg = msg.replace(/'/g, "\\'"); //escape single quotes
msg = msg.replace(/'/g, ""); //remove single quotes
msg = msg.replace(/\\/g, ""); //remove back slashes
msg = msg.toLowerCase(); //convert text to lowercase
setTimeout ( "GetResponseComment('"+msg+"')", IDL );
setTimeout ( "SetMessage(0)", IDL );
}
}
/*
//this function is used when the built-in aweber subscription form is used
//or custom html contains the proper id parameters
function SendData(){
//need to check for multiple occurances of the ids and check if anything was given
if (document.getElementById('vsaemail')){ //only execute if the id exists
//check for name id
var user_name = document.getElementById('vsaname').value;
if ((user_name == '')||(user_name == AWU)){
user_name = 'not given';
}
//check for email id
var user_email = document.getElementById('vsaemail').value;
if ((user_email != AWE)&&(user_email != '')){ //check if email was given
ajaxpack.sendGetAjax('userdata.php','cid='+CID+'&cli='+CLI+'&ip='+CIP+'&aid='+AID+'&name='+user_name+'&email='+user_email+'&tmd='+TMD);
}else if((user_email == AWE)||(user_email == '')){
SendData2();
}
}else{
SendData2();
}
}
//this function is used if multiple id parameters are inserted into the messages
function SendData2(){
var user_name = '';
var user_email = '';
for(var i=IDX; i>0; i--){ //check for most recent first
if(document.getElementById('vsaemail'+i)){
user_name = document.getElementById('vsaname'+i).value;
user_email = document.getElementById('vsaemail'+i).value;
if ((user_name == '')||(user_name == AWU)){
user_name = 'not given';
}
if ((user_email != AWE)&&(user_email != '')){ //check if email was given
ajaxpack.sendGetAjax('userdata.php','cid='+CID+'&cli='+CLI+'&ip='+CIP+'&aid='+AID+'&name='+user_name+'&email='+user_email+'&tmd='+TMD);
break;
}
}
}//end for
}
*/
//this function is used when the built-in aweber subscription form is used
//or custom html contains the proper id parameters
function SendData(){
var dosend = 0;
//check for name id
if (document.getElementById('vsaname')){
var user_name = document.getElementById('vsaname').value;
if ((user_name == '')||(user_name == AWU)){
user_name = 'user';
}else{
//only record the user's name if it was given
ajaxpack.sendGetAjax('username.php','cid='+CID+'&cli='+CLI+'&ip='+CIP+'&aid='+AID+'&name='+user_name+'&tmd='+TMD);
}
}else{
user_name = 'user';
}
//check for email id
if (document.getElementById('vsaemail')){
var user_email = document.getElementById('vsaemail').value;
if ((user_email != AWE)&&(user_email != '')){ //check if email was given
//send the user data
ajaxpack.sendGetAjax('userdata.php','cid='+CID+'&cli='+CLI+'&ip='+CIP+'&aid='+AID+'&name='+user_name+'&email='+user_email+'&tmd='+TMD);
}
}
//check for multiple occurances of the ids next ... this may occur in the messages
SendData2();
}
//this function is used if multiple id parameters are inserted into the messages
function SendData2(){
var user_name = '';
var user_email = '';
for(var i=IDX; i>0; i--){ //check for most recent first
//check for name id
if(document.getElementById('vsaname'+i)){
user_name = document.getElementById('vsaname'+i).value;
if ((user_name == '')||(user_name == AWU)){
user_name = 'user';
}else{
//only record the user's name if it was given
ajaxpack.sendGetAjax('username.php','cid='+CID+'&cli='+CLI+'&ip='+CIP+'&aid='+AID+'&name='+user_name+'&tmd='+TMD);
}
}else{
user_name = 'user';
}
//check for email id
if(document.getElementById('vsaemail'+i)){
user_email = document.getElementById('vsaemail'+i).value;
if ((user_email != AWE)&&(user_email != '')){ //check if email was given
//send the user data
ajaxpack.sendGetAjax('userdata.php','cid='+CID+'&cli='+CLI+'&ip='+CIP+'&aid='+AID+'&name='+user_name+'&email='+user_email+'&tmd='+TMD);
break;
}
}
}//end for
}
//this function is used with the built-in aweber form
function CheckSend(){
var name = document.emailform.name.value;
var email = document.emailform.from.value;
var wm = "You forgot to fill in the following:\n\n";
var noerror = 0;
if (name == "" || name == " " || name == AWU) {
wm += "Name\r\n";
noerror = 1;
}
if (email == "" || email == " " || email == AWE) {
wm += "Email address\r\n";
noerror = 1;
}
if (noerror==1){
alert(wm);
return false;
}else{
SendData();
return true;
}
}
//this displays the instant messages
function SetMessage(t){
var mydiv = document.getElementById('messagediv');
if (t == 0){
mydiv.innerHTML = '';
}else{
mydiv.innerHTML = '<strong>'+agent+' is typing a message ...</strong>';
}
}
//this inserts the comment into the comment box
function AddComment(comment){
var mydiv = document.getElementById('commentdiv');
if (mydiv.innerHTML != ''){
mydiv.innerHTML = mydiv.innerHTML +"<br /><br />"+ comment;
}else{
mydiv.innerHTML = mydiv.innerHTML + comment;
}
mydiv.scrollTop = mydiv.scrollHeight; //autoscroll
}
//this inserts the comment into the comment box by user
function AddUserComment(comment){
comment = HTMLentities(comment);
var comment = '<font color="#0099FF"><strong>You:</strong> '+comment+'</font>';
var mydiv = document.getElementById('commentdiv');
if (mydiv.innerHTML != ''){
mydiv.innerHTML = mydiv.innerHTML +"<br /><br />"+ comment;
}else{
mydiv.innerHTML = mydiv.innerHTML + comment;
}
mydiv.scrollTop = mydiv.scrollHeight; //autoscroll
}
function GetInstantComment(i){
ajaxpack.getAjaxRequest('data.php','n='+i+'&a='+agent+'&cid='+CID+'&cli='+CLI+'&aid='+AID+'&ip='+CIP+'&pid='+PID+'&tmd='+TMD,processGetPost,'txt');
}
function GetResponseComment(comment){
comment = URLencode(comment);
ajaxpack.getAjaxRequest('data.php','a='+agent+'&cid='+CID+'&cli='+CLI+'&aid='+AID+'&ip='+CIP+'&pid='+PID+'&tmd='+TMD+'&c='+comment,processGetPost,'txt');
}
//this is the ajax function
function processGetPost(){
var myajax=ajaxpack.ajaxobj;
var myfiletype=ajaxpack.filetype;
if (myajax.readyState == 4){ //if request of file completed
if (myajax.status==200 || window.location.href.indexOf("http")==-1){ //if request was successful or running script locally
if (myfiletype=="txt"){
var thetext = myajax.responseText;
//must deal with multiple id parameters
var tmp = myajax.responseText;
tmp.toLowerCase();
if ((tmp.indexOf('id="vsaname"') > -1)||(tmp.indexOf('id="vsaemail"') > -1)){
thetext = thetext.replace(/id="vsaname"/i, 'id="vsaname'+IDX+'"');
thetext = thetext.replace(/id="vsaemail"/i, 'id="vsaemail'+IDX+'"');
//thetext = thetext+'<br>id="vsaname'+IDX+'"<br>'+'id="vsaemail'+IDX+'"'; //for testing
IDX++;
}
AddComment(thetext);
}
}
}
}
//this function converts characters to html entities so they display in the chat
function HTMLentities(texte) {
//texte = texte.replace(/"/g,'"'); // 34 22
texte = texte.replace(/&/g,'&'); // 38 26
texte = texte.replace(/\'/g,'''); // 39 27
texte = texte.replace(/</g,'<'); // 60 3C
texte = texte.replace(/>/g,'>'); // 62 3E
texte = texte.replace(/\^/g,'ˆ'); // 94 5E
texte = texte.replace(/‘/g,'‘'); // 145 91
texte = texte.replace(/’/g,'’'); // 146 92
texte = texte.replace(/“/g,'“'); // 147 93
texte = texte.replace(/”/g,'”'); // 148 94
texte = texte.replace(/•/g,'•'); // 149 95
texte = texte.replace(/–/g,'–'); // 150 96
texte = texte.replace(/—/g,'—'); // 151 97
texte = texte.replace(/˜/g,'˜'); // 152 98
texte = texte.replace(/™/g,'™'); // 153 99
texte = texte.replace(/š/g,'š'); // 154 9A
texte = texte.replace(/›/g,'›'); // 155 9B
texte = texte.replace(/œ/g,'œ'); // 156 9C
texte = texte.replace(//g,'ť'); // 157 9D
texte = texte.replace(/ž/g,'ž'); // 158 9E
texte = texte.replace(/Ÿ/g,'Ÿ'); // 159 9F
// texte = texte.replace(/ /g,' '); // 160 A0
texte = texte.replace(/¡/g,'¡'); // 161 A1
texte = texte.replace(/¢/g,'¢'); // 162 A2
texte = texte.replace(/£/g,'£'); // 163 A3
//texte = texte.replace(/ /g,'¤'); // 164 A4
texte = texte.replace(/¥/g,'¥'); // 165 A5
texte = texte.replace(/¦/g,'¦'); // 166 A6
texte = texte.replace(/§/g,'§'); // 167 A7
texte = texte.replace(/¨/g,'¨'); // 168 A8
texte = texte.replace(/©/g,'©'); // 169 A9
texte = texte.replace(/ª/g,'ª'); // 170 AA
texte = texte.replace(/«/g,'«'); // 171 AB
texte = texte.replace(/¬/g,'¬'); // 172 AC
texte = texte.replace(//g,'­'); // 173 AD
texte = texte.replace(/®/g,'®'); // 174 AE
texte = texte.replace(/¯/g,'¯'); // 175 AF
texte = texte.replace(/°/g,'°'); // 176 B0
texte = texte.replace(/±/g,'±'); // 177 B1
texte = texte.replace(/²/g,'²'); // 178 B2
texte = texte.replace(/³/g,'³'); // 179 B3
texte = texte.replace(/´/g,'´'); // 180 B4
texte = texte.replace(/µ/g,'µ'); // 181 B5
texte = texte.replace(/¶/g,'¶'); // 182 B6
texte = texte.replace(/·/g,'·'); // 183 B7
texte = texte.replace(/¸/g,'¸'); // 184 B8
texte = texte.replace(/¹/g,'¹'); // 185 B9
texte = texte.replace(/º/g,'º'); // 186 BA
texte = texte.replace(/»/g,'»'); // 187 BB
texte = texte.replace(/¼/g,'¼'); // 188 BC
texte = texte.replace(/½/g,'½'); // 189 BD
texte = texte.replace(/¾/g,'¾'); // 190 BE
texte = texte.replace(/¿/g,'¿'); // 191 BF
texte = texte.replace(/À/g,'À'); // 192 C0
texte = texte.replace(/Á/g,'Á'); // 193 C1
texte = texte.replace(/Â/g,'Â'); // 194 C2
texte = texte.replace(/Ã/g,'Ã'); // 195 C3
texte = texte.replace(/Ä/g,'Ä'); // 196 C4
texte = texte.replace(/Å/g,'Å'); // 197 C5
texte = texte.replace(/Æ/g,'Æ'); // 198 C6
texte = texte.replace(/Ç/g,'Ç'); // 199 C7
texte = texte.replace(/È/g,'È'); // 200 C8
texte = texte.replace(/É/g,'É'); // 201 C9
texte = texte.replace(/Ê/g,'Ê'); // 202 CA
texte = texte.replace(/Ë/g,'Ë'); // 203 CB
texte = texte.replace(/Ì/g,'Ì'); // 204 CC
texte = texte.replace(/Í/g,'Í'); // 205 CD
texte = texte.replace(/Î/g,'Î'); // 206 CE
texte = texte.replace(/Ï/g,'Ï'); // 207 CF
texte = texte.replace(/Ð/g,'Ð'); // 208 D0
texte = texte.replace(/Ñ/g,'Ñ'); // 209 D1
texte = texte.replace(/Ò/g,'Ò'); // 210 D2
texte = texte.replace(/Ó/g,'Ó'); // 211 D3
texte = texte.replace(/Ô/g,'Ô'); // 212 D4
texte = texte.replace(/Õ/g,'Õ'); // 213 D5
texte = texte.replace(/Ö/g,'Ö'); // 214 D6
texte = texte.replace(/×/g,'×'); // 215 D7
texte = texte.replace(/Ø/g,'Ø'); // 216 D8
texte = texte.replace(/Ù/g,'Ù'); // 217 D9
texte = texte.replace(/Ú/g,'Ú'); // 218 DA
texte = texte.replace(/Û/g,'Û'); // 219 DB
texte = texte.replace(/Ü/g,'Ü'); // 220 DC
texte = texte.replace(/Ý/g,'Ý'); // 221 DD
texte = texte.replace(/Þ/g,'Þ'); // 222 DE
texte = texte.replace(/ß/g,'ß'); // 223 DF
texte = texte.replace(/à/g,'á'); // 224 E0
texte = texte.replace(/á/g,'á'); // 225 E1
texte = texte.replace(/â/g,'â'); // 226 E2
texte = texte.replace(/ã/g,'ã'); // 227 E3
texte = texte.replace(/ä/g,'ä'); // 228 E4
texte = texte.replace(/å/g,'å'); // 229 E5
texte = texte.replace(/æ/g,'æ'); // 230 E6
texte = texte.replace(/ç/g,'ç'); // 231 E7
texte = texte.replace(/è/g,'è'); // 232 E8
texte = texte.replace(/é/g,'é'); // 233 E9
texte = texte.replace(/ê/g,'ê'); // 234 EA
texte = texte.replace(/ë/g,'ë'); // 235 EB
texte = texte.replace(/ì/g,'ì'); // 236 EC
texte = texte.replace(/í/g,'í'); // 237 ED
texte = texte.replace(/î/g,'î'); // 238 EE
texte = texte.replace(/ï/g,'ï'); // 239 EF
texte = texte.replace(/ð/g,'ð'); // 240 F0
texte = texte.replace(/ñ/g,'ñ'); // 241 F1
texte = texte.replace(/ò/g,'ò'); // 242 F2
texte = texte.replace(/ó/g,'ó'); // 243 F3
texte = texte.replace(/ô/g,'ô'); // 244 F4
texte = texte.replace(/õ/g,'õ'); // 245 F5
texte = texte.replace(/ö/g,'ö'); // 246 F6
texte = texte.replace(/÷/g,'÷'); // 247 F7
texte = texte.replace(/ø/g,'ø'); // 248 F8
texte = texte.replace(/ù/g,'ù'); // 249 F9
texte = texte.replace(/ú/g,'ú'); // 250 FA
texte = texte.replace(/û/g,'û'); // 251 FB
texte = texte.replace(/ü/g,'ü'); // 252 FC
texte = texte.replace(/ý/g,'ý'); // 253 FD
texte = texte.replace(/þ/g,'þ'); // 254 FE
texte = texte.replace(/ÿ/g,'ÿ'); // 255 FF
return texte;
}
//used to encode posted data
function URLencode(sStr) { return escape(sStr).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27');}
//capture the return key to send a comment to the comment box
function kH(e) {var pK = e ? e.which : window.event.keyCode;if (pK == 13) {SendComment();return false;}}
//disable right click
function clickIE4(){if (event.button==2){return false;}}
function clickNS4(e){if (document.layers||document.getElementById&&!document.all){if (e.which==2||e.which==3){return false;}}}
//for detecting the enter key
document.onkeypress = kH;
if (document.layers){document.captureEvents(Event.KEYPRESS);document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS4;
}else if (document.all&&!document.getElementById){document.onmousedown=clickIE4;}
document.oncontextmenu=new Function("return false");
//this chat has ended
window.onbeforeunload = function (){
if (gx == 0){
gx = 1;
ajaxpack.sendGetAjax('chatend.php','n=2&cid='+CID+'&cli='+CLI+'&ip='+CIP+'&aid='+AID+'&tmd='+TMD);
}
}
</script>
</head>
<body onload="GetAgent()" topmargin="10" rightmargin="0" bottommargin="0" leftmargin="0" bgcolor="<?php echo $backcolor; ?>">
<?php echo $customcodeTop; ?>
<?php echo $aweber; ?>
<form name="agentform">
<table width="455" height="270" border="0" align="center" cellpadding="2" cellspacing="0" class="maintable">
<tr>
<?php echo $chatshow; ?>
</tr>
<tr>
<td width="304"><input class="input" type="text" name="sendbox" id="sendbox" /></td>
<td width="150"><input type="button" name="button" id="button" value="Send" onclick="SendComment()" class="button" /></td>
</tr>
<tr>
<td><div id="messagediv" class="instantmessage"></div></td>
<td><?php echo $vsalinkshow; ?></td>
</tr>
</table>
</form>
<?php echo $customcodeBottom; ?>
</body>
</html>