function clear_doc(_id)
{
	elem = document.getElementById("zone"+_id);
	document.getElementById("zone"+_id).innerHTML="";
}

function swapy(_id,_doc, page, start, subject, type, lang, order, sort, ratio )
{
	if(document.getElementById("zone"+_id).innerHTML)
		clear_doc(_id)
	else
		getDoc(_id,_doc, page, start, subject, type, lang, order, sort, ratio );
}

function getDoc(_id,_doc, page, start, subject, type, lang, order, sort, ratio )
{
	elem = document.getElementById("zone"+_id);
	elem.innerHTML = "<img src='/image/wait.gif'>&nbsp;";
	
	var url = '/summary/include?id=' + _doc + '&type=' + page + '&start=' + start+ '&S=' + subject + '&T=' + type + '&L=' + lang + '&order=' + order + '&sort=' + sort + '&ratio=' + ratio + '&idd=' + _id;
	try{
		url += "&footer="+footer;
	}catch(err){
	}
	
	if (window.XMLHttpRequest) 
	{ 
		xmlhttp = new XMLHttpRequest();
		xmlhttp.open('GET',url,false);
		xmlhttp.send(null);
		html_rep = xmlhttp.responseText;
		elem.innerHTML = html_rep;
	}
	else if (window.ActiveXObject)
	{ 	
		xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
		if (xmlhttp)
		{ 
			xmlhttp.open('GET',url,false);
			xmlhttp.send(null);
			html_rep = xmlhttp.responseText;
			elem.innerHTML = html_rep;
		}
	}
}

function getPrice(id)
{
	var url = '/index/eprice?doc_id=' + id;
	
	if (window.XMLHttpRequest) 
	{ 
		xmlhttp = new XMLHttpRequest();
		xmlhttp.open('GET',url,false);
		xmlhttp.send(null);
		html_rep = xmlhttp.responseText;
		document.write(html_rep);
	}
	else if (window.ActiveXObject)
	{ 	
		xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
		if (xmlhttp)
		{ 
			xmlhttp.open('GET',url,false);
			xmlhttp.send(null);
			html_rep = xmlhttp.responseText;
			document.write(html_rep);
		}
	}
}
