function mostlyPage(type, page)
{
    mostly_type = type;
	var xmlHttpReq = false;
    var self = this;
    var strURL = 'x_mostly.php?type=' + type + '&page=' + page;
    
    if (window.XMLHttpRequest)
    {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject)
    {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    self.xmlHttpReq.open('GET', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-javascript; charset=iso-8859-9');
    self.xmlHttpReq.onreadystatechange = function()
    {
        if (self.xmlHttpReq.readyState == 4)
        {
        	mostlyLoad(type, self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send('');
    return false;
}
function mostlyLoad(type, str)
{
	eval(str);

	document.getElementById("mostly_items_data_" + type).innerHTML = mostly_items;
	changeMostly(type, 0);
}
function changeMostly(type, idx)
{
	eval('elm = mostly_data_' + type);
	
	if(typeof(window['elm']) == "undefined")
		return;

	document.getElementById("mostly_image_" + type).src = './images/news/128x96/' + elm[idx]['image'] + '.jpg';
	document.getElementById("mostly_title_" + type).innerHTML = '<a href="' + elm[idx]['link'] + '">' + elm[idx]['title'] + '</a>';
	document.getElementById("mostly_short_content_" + type).innerHTML = '<a href="' + elm[idx]['link'] + '">' + elm[idx]['short_content'] + '</a>';
}