// CTracker_Ignore: File Checked By Human
// Tell the Security Scanner that reachable code in this file is not a security issue
/***************************************************************************
* Advanced Guestbook for phpBB2 VERSION 2.0
* CODING AND COPYRIGHT BY GFX-United :: http://www.gfx-united.de
* CODER Jojoponn139
* CONTACT jojoponn139@gfx-united.de
*
*
****************************************************************************/
var xmlHttp = false;

try {
    xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
    try {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch(e) {
        xmlHttp  = false;
    }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
    xmlHttp = new XMLHttpRequest();
}

function check_cap()
{
	var ltmsgs = cap_tl;
	var gbid = gbd;
	if(document.book.cap.value.length == 6) {
		xmlHttp.open('POST', 'gb-data/cap_answ.php?mode=cap&gbd='+gbid);
		xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		xmlHttp.send('code='+document.book.cap.value);
		xmlHttp.onreadystatechange = function () {
			if (xmlHttp.readyState == 4) {
				document.getElementById("answer").innerHTML = '';
				document.getElementById("answer").innerHTML = xmlHttp.responseText;
			}
		};
	} else {
		document.getElementById("answer").innerHTML = '';
		document.getElementById("answer").innerHTML = ltmsgs;
	}
}

function check_com()
{
	var min = t_min;
	var max = t_max;
	if(document.book.gb_comment.value.length < min) {
		document.getElementById("check_comment").innerHTML = m_min;
	} else {
		if(document.book.gb_comment.value.length > max) {
			document.getElementById("check_comment").innerHTML = m_max;
		} else {
			document.getElementById("check_comment").innerHTML = '';
		}
	}
}

