function authorChange(author_id, author_name, article_id, article_link, _title, _date)
{
	document.getElementById("author_img").src = '../images/author/' + author_id + "_s.jpg";
	document.getElementById("author_article_name").innerHTML = author_name;
	document.getElementById("author_article_title").innerHTML = '<a href="' + article_link + '">' + _title + "</a>";
	document.getElementById("author_article_date").innerHTML = _date;
}
function heightOptimizer()
{
	_height = document.getElementById('base_middle').offsetHeight;
	
	if(_height < document.getElementById('base_right').offsetHeight)
		_height = document.getElementById('base_right').offsetHeight;
	
	_height += 60;
	
	document.getElementById('base').style.height = _height + "px";
	document.getElementById('base_middle').style.height = _height + "px";
	document.getElementById('base_right').style.height = _height + "px";
}
function goGazette(idx)
{
	if(idx == "")
		return false;
	
	window.open("newspaper.php?newspaper=" + idx, "", "");
	return false;
}
function changeLeftTab(index, no)
{
	var xmlHttpReq = false;
    var self = this;
    var strURL = 'x_tab_content.php?index=' + index + '&no=' + no;
    
    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.onreadystatechange = function()
    {
        if (self.xmlHttpReq.readyState == 4)
        {
			document.getElementById('left_tab_' + index + '_' + prevLeftTab[index]).className = 'pas';
        	document.getElementById('left_tab_' + index + '_' + no).className = 'act';
			document.getElementById('left_tab_container_' + index).innerHTML = self.xmlHttpReq.responseText;
			prevLeftTab[index] = no;
        }
    }
    self.xmlHttpReq.send('');
    return false;
}
function changeMostlyTab()
{
	var xmlHttpReq = false;
    var self = this;
    var strURL = 'x_mostly.php?type=' + mostlyType + '&page=' + mostlyPage;
    
    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.onreadystatechange = function()
    {
        if (self.xmlHttpReq.readyState == 4)
        {
        	document.getElementById('mostly_tab_' + mostlyType).className = 'act';
			document.getElementById('mostly_tab_' + (3 - mostlyType) * 1).className = 'pas';
			if (prevMostlyPage > 1)
	        	document.getElementById('mostly_page_' + prevMostlyPage).style.color = 'white';
			if (mostlyPage > 1)
	        	document.getElementById('mostly_page_' + mostlyPage).style.color = 'yellow';
			document.getElementById('mostly_tab_container').innerHTML = self.xmlHttpReq.responseText;
			prevMostlyPage = mostlyPage;
        }
    }
    self.xmlHttpReq.send('');
    return false;
}