function pageWidth() {
return window.innerWidth != null ? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
}
function RemoteRequestObject()
{
var A = false;
try
{
A = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
A = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(err)
{
A = false;
}
}
if(!A && typeof(XMLHttpRequest) != 'undefined') A = new XMLHttpRequest();
return A;
}
function doitChat()
{
var x = RemoteRequestObject();
x.open("GET","getchat.php");
x.onreadystatechange=function()
{
if(x.readyState == 4 && x.status == 200)
{
var msgCont = x.responseText;
document.getElementById("chtbox").innerHTML=msgCont;
}
};
x.send(null);
}
function doit()
{
var xa = RemoteRequestObject();
xa.open("GET","getpp.php");
xa.onreadystatechange=function()
{
if(xa.readyState == 4 && xa.status == 200)
{
var r = xa.responseText;
var spl = r.split(" ");
var newpp = parseInt(spl[0]);
var pstat = parseInt(spl[1]);
if (newpp == 0) {
document.getElementById("privp").style.border="1px solid #ffd7e6";
document.getElementById("privp").innerHTML = "Privatne poruke";
} else {
document.getElementById("privp").style.border="1px solid #ff0000";
document.getElementById("privp").innerHTML = "Privatne poruke ("+newpp+")";
}
if (pstat == 0) {
document.getElementById("vasprof").style.border="1px solid #ffd7e6";
} else {
document.getElementById("vasprof").style.border="1px solid #ff0000";
}
}
};
xa.send(null);
}