function createObject() {
		var xmlhttp;
		  try {
		  	 xmlhttp = new ActiveXObject('Msxml2.XMLHTTP.3.0'); 
		  } catch (e) {
		    try {
		      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		    } catch (E) {
			    try {
			      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			    } catch (EE) {
			      xmlhttp = false;
			    }
		    }
		  }
		  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		    xmlhttp = new XMLHttpRequest();
		  }
		  return xmlhttp;
}
var ajax_obj = createObject();
var global_div = 'div_info';

function ajaxState() {
	if(ajax_obj.readyState == 4){
		var response = ajax_obj.responseText;
		document.getElementById('div_info').innerHTML = response;
	}
}

function quickBuy(obj){
	window.document.forms["payForm"].elements["id_goods"].value = obj;
	window.document.forms["payForm"].submit();
}
function DownLoadGame(obj){
	window.document.forms["gameForm"].elements["file"].value = obj;
	window.document.forms["gameForm"].submit();
}

function sendGreet(formName){
	var data= window.document.forms[formName];
	var payFrm = [];
	var ii = 0;
	for (ii=0; ii<data.elements.length; ii++){
        payFrm.push(data.elements[ii].name + "=" + data.elements[ii].value);
    }

	document.getElementById('div_info').innerHTML = '<div style="text-align:center;"><img style="margin:10px;" src="/images/ajax-loader.gif"><p>Загрузка</p></div>';
    
   	ajax_obj.open('POST', '/units/vsend.php');	
	ajax_obj.onreadystatechange =  ajaxState;   
	ajax_obj.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	ajax_obj.send(payFrm.join('&'));
}	

function CheckClick(obj){
	document.forms["greetForm"].elements["time"].value = obj;
	var n_elem = document.getElementById('div_time');
	
	if (obj=="0"){
		n_elem.style.display = 'none';
	}
	else{
		n_elem.style.display = 'block';
	}
}

function addBookmark(url, title) 
{ 
if (!url) url = location.href; 
if (!title) title = document.title; 
if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel (title, url, ""); 
else if (typeof window.external == "object") window.external.AddFavorite(url, title); 
else if (window.opera && document.createElement) 
{ 
var a = document.createElement('A'); 
if (!a) return false;
a.setAttribute('rel','sidebar'); 
a.setAttribute('href',url); 
a.setAttribute('title',title); 
a.click(); 
} 
else return false; 
return true; 
}