if(!window.saveInnerWidth){
	window.onresize = resize;
	window.saveInnerWidth = window.innerWidth;
	window.saveInnerHeight = window.innerHeight;
}
function getApplicationVar(name) {
	var v = $.ajax({
		url: "/ajax/getApplicationVar.cfm",
		data: "v="+name,
		async: false,
		cache: false
	}).responseText;
	return $.trim(v.substring(0,v.search(/;/)));
}
function resize(){
	if (saveInnerWidth < window.innerWidth || saveInnerWidth > window.innerWidth || saveInnerHeight > window.innerHeight || saveInnerHeight < window.innerHeight){
		window.history.go(0);
	}
}
var bLoaded = {b1: false, b2: false};
function bannerLoaded(id) {
	var doc = (document.getElementById(id).contentDocument) ? document.getElementById(id).contentDocument : document.frames[id].document;
	if (doc.getElementById(id).offsetHeight <= 20 && !(id == 'bannerSuperior234') && !(id == 'bannerSuperior'))
		$("#"+id).hide();
	if (id == 'bannerSuperior') bLoaded.b1 = true;
	if ((id == 'bannerSuperior234') || !document.getElementById('bannerSuperior234')) bLoaded.b2 = true;
	if (bLoaded.b1 && bLoaded.b2) {
		doc = (document.getElementById('bannerSuperior').contentDocument) ? document.getElementById('bannerSuperior').contentDocument : document.frames['bannerSuperior'].document;
		if (document.getElementById('bannerSuperior234')) var doc2 = (document.getElementById('bannerSuperior234').contentDocument) ? document.getElementById('bannerSuperior234').contentDocument : document.frames['bannerSuperior234'].document;
		else var doc2 = '';
		if ((doc.getElementById('bannerSuperior').offsetHeight > 20) && ((doc2 == '') || (doc2.getElementById('bannerSuperior234').offsetHeight > 20)))
			$("#bannerSuperiorBg").css("margin-top", "0");
		bLoaded.b1 = false;
		bLoaded.b2 = false;
	}
}
function handlerResize(){location.reload(); return false;}
// deteccion navegadores
var NS6 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) > 4)
var IE = (navigator.appName.substring(0,9)=='Microsoft' && parseInt(navigator.appVersion) > 3)
var isNS = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) == 4)
var pos=new Array();
function cargar(imagen,foto){
	foto2=new Image();
	foto2.src=imagen;
	if (NS6 || isNS || IE){document[foto].src=eval("foto2.src")}
}
function popUpHablaGratis(var1, var2, AuthorizeURL, Template, CodigoEmpresa, Sector, Subsector, iTipoPush){
	//webVoicePop('var1=#OrigenCanal#','var2=#StructFind(FichaOferta, "eStara")#','AuthorizeURL=http://www.solostocks.com/authorizeEstara.cfm?id=#StructFind(FichaOferta, "eStara")#','Template=41909');
	var pagina;
	if(CodigoEmpresa == null || Sector == null || Subsector == null || iTipoPush == null) pagina = "http://www.solostocks.com/hablaGratisRun.cfm?"+var1+"&"+var2+"&"+AuthorizeURL+"&"+Template;
	else pagina = "http://www.solostocks.com/hablaGratisRun.cfm?"+var1+"&"+var2+"&"+AuthorizeURL+"&"+Template+"&"+CodigoEmpresa+"&"+Sector+"&"+Subsector+"&"+iTipoPush;
	nova=window.open(pagina,'HablaGratisRun','toolbar=no,location=yes,directories=no,scrollbars=no,status=no,menubar=no,resizable=no,width=380,height=325,top=50,left=50');
	nova.focus();
}
function ensenar(id, idLink){
	$("#" + id).show();
	$("#" + idLink).attr("href", "javascript:esconder('" + id + "', '" + idLink + "')");
}
function ensenarLucene(id, idLink){
	$("#masProvincias, #masPaises, #masCategorias").css("visibility", "hidden");
	var pos = $("#"+idLink).offset();
	$("#"+id).css({top: pos.top-30+"px", left: (($(window).width() - $("#botonera").width())/2)+210+"px", visibility: "visible"}).show();
}
function esconder(id, idLink){
	$("#"+id).hide();
}
function esconderLucene(id, idLink){
	$("#"+id).css("visibility", "hidden");
	$("#"+idLink).attr("href", "javascript:ensenarLucene('" + id + "', '" + idLink + "')");
}
function seccionOnOff(id) {
	($("#"+id).is(":hidden")) ? $("#"+id).show() : $("#"+id).hide();
}