var reqArticles;

function showArticles(section, article, issue, year, month)
{
//    var select_year = document.getElementById('select_year');
//    var year = 0;
//    if (select_year != undefined)
//    {
//    	year = select_year.value;
//    }
//    var select_month = document.getElementById('select_month');
//    var month = 0;
//    if (select_month != undefined)
//    {
//    	month = select_month.value;
//    }

	if (year == undefined)
	{
	    if (document.getElementById('select_year') != undefined) year = document.getElementById('select_year').value; else year = 0;
	}
	if (month == undefined)
	{
	    if (document.getElementById('select_month') != undefined) month = document.getElementById('select_month').value; else month = 0;
	}

    var url = "/include/article/same-section.php?section="+section+"&article="+article+"&issue="+issue+"&year="+year+"&month="+month+"&rand="+Math.random();
    if (document.getElementById('same_section_indicator') != undefined) document.getElementById('same_section_indicator').style.visibility = 'visible';

	if (window.XMLHttpRequest)
	{
		reqArticles = new XMLHttpRequest();
		reqArticles.onreadystatechange = loadArticles;
		reqArticles.open("GET", url, true);
		reqArticles.send(null);
	}
	else if (window.ActiveXObject)
	{
		reqArticles = new ActiveXObject("Microsoft.XMLHTTP");
		if (reqArticles)
		{
			reqArticles.onreadystatechange = loadArticles;
			reqArticles.open("GET", url, true);
			reqArticles.send();
		}
	}
}


function showArticles1(section, article, issue, year, month)
{
//    var select_year = document.getElementById('select_year');
//    var year = 0;
//    if (select_year != undefined)
//    {
//    	year = select_year.value;
//    }
//    var select_month = document.getElementById('select_month');
//    var month = 0;
//    if (select_month != undefined)
//    {
//    	month = select_month.value;
//    }

	if (year == undefined)
	{
	    if (document.getElementById('select_year') != undefined) year = document.getElementById('select_year').value; else year = 0;
	}
	if (month == undefined)
	{
	    if (document.getElementById('select_month') != undefined) month = document.getElementById('select_month').value; else month = 0;
	}

    var url = "/include/article/same-section1.php?section="+section+"&article="+article+"&issue="+issue+"&year="+year+"&month="+month+"&rand="+Math.random();
    if (document.getElementById('same_section_indicator') != undefined) document.getElementById('same_section_indicator').style.visibility = 'visible';

	if (window.XMLHttpRequest)
	{
		reqArticles = new XMLHttpRequest();
		reqArticles.onreadystatechange = loadArticles;
		reqArticles.open("GET", url, true);
		reqArticles.send(null);
	}
	else if (window.ActiveXObject)
	{
		reqArticles = new ActiveXObject("Microsoft.XMLHTTP");
		if (reqArticles)
		{
			reqArticles.onreadystatechange = loadArticles;
			reqArticles.open("GET", url, true);
			reqArticles.send();
		}
	}
}

function loadArticles()
{
	if (reqArticles.readyState == 4)
	{
	//	alert(reqArticles.responseText);
		var same_section = document.getElementById('same_section');
		same_section.innerHTML = reqArticles.responseText;
	    if (document.getElementById('same_section_indicator') != undefined) document.getElementById('same_section_indicator').style.visibility = 'hidden';
	}
}

function showPhoto(name, width, height)
{
	var win = window.open("/photo.html?name="+name+"&width="+width, name, "width="+width+",height="+height);
}




function megafunc()
{
	ed=document.getElementById('mda').value;
	//alert(ed);
	
	window.open('/articles/'+ed,'_self');

}

