// JavaScript Document
// Define the browser we have instead of multiple calls throughout the file
var userAgent = navigator.userAgent.toLowerCase();
var is_opera  = (userAgent.indexOf('opera') != -1);
var is_saf    = ((userAgent.indexOf('applewebkit') != -1) || (navigator.vendor == 'Apple Computer, Inc.'));
var is_webtv  = (userAgent.indexOf('webtv') != -1);
var is_ie     = ((userAgent.indexOf('msie') != -1) && (!is_opera) && (!is_saf) && (!is_webtv));
var is_ie4    = ((is_ie) && (userAgent.indexOf('msie 4.') != -1));
var is_moz    = ((navigator.product == 'Gecko') && (!is_saf));
var is_kon    = (userAgent.indexOf('konqueror') != -1);
var is_ns     = ((userAgent.indexOf('compatible') == -1) && (userAgent.indexOf('mozilla') != -1) && (!is_opera) && (!is_webtv) && (!is_saf));
var is_ns4    = ((is_ns) && (parseInt(navigator.appVersion) == 4));
var is_mac    = (userAgent.indexOf('mac') != -1);
var http_request2 = false;

function AddMSNContact(name, url)
{
	MSNCall(url);
	if (!is_ie)
	{
		alert(vbphrase['msn_functions_only_work_in_ie']);
		return false;
	}
	else
	{
		MsgrObj.AddContact(0, name);
		return false;
	}
}

function MSNCall(url) {

	http_request2 = false;
	ip = tempip;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request2 = new XMLHttpRequest();
		if (http_request2.overrideMimeType) {
			http_request2.overrideMimeType('text/xml');
			// zu dieser Zeile siehe weiter unten
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request2 = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request2 = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request2) {
		return false;
	}
	http_request2.onreadystatechange = alertInhaltMSN;
	http_request2.open('GET', url, true);
	http_request2.send(null);
	
}
function alertInhaltMSN(){
	if (http_request2.readyState == 4) {
		return true;
	}			
}

function schedulereload(id,type) {
	URL=" http://www.manulive.de/module/camchat/statuspic.php?sender_id="+id+"&type="+type+"&rand="+Math.random();
	call="reloadImage('"+id+"','"+URL+"','"+type+"')";
	setTimeout(call, 15000);
}

function reloadImage(id,URL,type) {
	document.images[id].src=URL;
	schedulereload(id,type);
}