$(function(){
	if($('.bannerHome').length != 0){
		$(".bannerHome").click(function () {
			num_bannerHome=$('.bannerHome').index(this);
			if(num_bannerHome > 16 && num_bannerHome <= 24)num_bannerHome=num_bannerHome-2;
			if(num_bannerHome >= 25)num_bannerHome=num_bannerHome-1;
			caja=$(this).attr("id");
			if(num_bannerHome < 0)num_bannerHome=0;
			enlace=$('.bannerHome a').eq(num_bannerHome).attr("href");
			if(caja == "buscador")enlace=$('#q').val();
			if(caja == "banner")enlace="flash";
			if(caja == "promo_1_dominios")enlace="/billing/order/";
			infoBanners(caja, enlace);
			//alert(num_bannerHome + " - " +enlace);
		});
	}
});
		
	function nuevoAjax(){
		var xmlhttp=false;
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				xmlhttp = false;
			}
		}
		if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
			xmlhttp = new XMLHttpRequest();
		}
		return xmlhttp;
	}
	function infoBanners(id_banner, enlace){
		t1 = id_banner;
		t2 = enlace;
		ajax=nuevoAjax();
		ajax.open("POST", "/marketing/bannersHome/conn.php",true);
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; text/html; charset=iso-8859-1");
		ajax.send("id_banner="+t1+"&enlace="+t2);
	}