var respID   = "";
var respCont = "";
var respFunc = "";

var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try 
{
	xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} 
catch (e)
{
	try 
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	} 
	catch (e2) 
	{
		xmlHttp = false;
	}
}
@end @*/

if (!xmlHttp && typeof XMLHttpRequest != 'undefined') 
{
  xmlHttp = new XMLHttpRequest();
}


function ajaxPostInfo(url,param,ajaxResponseFunc) 
{						
	respFunc = ajaxResponseFunc;
	
	xmlHttp.open("POST", url, true);
	xmlHttp.onreadystatechange = response;				
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlHttp.setRequestHeader("Accept-Language", "ru, en");
	xmlHttp.setRequestHeader("Accept-Charset", "utf-8;q=1");	
	xmlHttp.send(param);	
}

function js_exe(script){
	var start_string = "<script";
	var mid_string = ">";
	var end_string = "</script>";
	
	var i=0;
	while (script.indexOf(start_string) != -1){
		i=i+1;
		
		var tmp_pos = '';
		var script_elem = '';		
		
		tmp_pos=script.indexOf(start_string)+start_string.length;
		script=script.substring(tmp_pos);
		
		tmp_pos=script.indexOf(mid_string)+mid_string.length;
		script=script.substring(tmp_pos);		
		
		script_elem=script.substring(0,script.indexOf(end_string));
		script_elem=script_elem.replace(/&amp;/, "&")

		eval(script_elem);
		
					
		tmp_pos=script.indexOf(end_string)+end_string.length;
		script=script.substring(tmp_pos);
	}				
}	


function response(){
	if (xmlHttp.readyState == 4){ 
    	if (xmlHttp.status == 200){
			if (xmlHttp.responseText != "") 
			{
				respCont = xmlHttp.responseText;
				
				if (respFunc != "")	eval(respFunc);
			
				if (respID != "") document.getElementById(respID).innerHTML = respCont;
													
				js_exe(respCont);
			}		
		}
	}
}


function add_loading(tag_id,box_height){
	document.getElementById(tag_id).innerHTML='<table width="100%" height="'+box_height+'"  cellspacing="0" cellpadding="0" border="1"><tr><td align="center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="35" height="35"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="../images/loading.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent"><embed src="../images/loading.swf" quality="high" wmode="transparent" width="35" height="35" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></td></tr></table>';
}