var userAgent = navigator.userAgent.toLowerCase();
var is_opera = userAgent.indexOf('opera') != -1 && opera.version();
var is_moz = (navigator.product == 'Gecko') && userAgent.substr(userAgent.indexOf('firefox') + 8, 3);
var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera) && userAgent.substr(userAgent.indexOf('msie') + 5, 3);
var is_safari = (userAgent.indexOf('webkit') != -1 || userAgent.indexOf('safari') != -1);

function D(ele)
{
    return document.getElementById(ele);
}
function strlen(str) 
{
	return (is_ie && str.indexOf('\n') != -1) ? str.replace(/\r?\n/g, '_').length : str.length;
}
function isUndefined(variable) 
{
	return typeof variable == 'undefined' ? true : false;
}
function set_feed(feed_type, uid, touid, game)
{
    if(typeof touid == 'undefined')
    {
        touid = 0;
    }
    $.ajax({
    		type:"POST",
    		url:'index.php?control=feed&action=hxm',
            data: 'feed_type='+ feed_type + '&uid='+ uid + '&touid='+touid + '&game='+game,
    		dataType: 'json',
    		success : function(msg){}
    		}
    	);
}
function set_notification(uid, touid, type, note)
{
    if(uid != '' && touid != '' && type != '' && note != '')
    {
        $.ajax({
            type: "POST",
            url : "index.php?control=feed&action=note",
            data: "uid=" + uid + "&touid=" + touid + "&type="+ type + "&note="+escape(note),
            dateType : 'html',
            success: function(msg){}
        });
    }
}