var openwindow;
var win;
function OpenLink(id,sector,zid){
	win ="window.open('../pl/inmuebles_sectores_revision_detail_rept.pl?lan=es&appid=NuevoCuscatlan&c11_sector_id="+id+"&v64_sector="+sector+"&zid="+zid+"','RevisionDetail','left=100,top=20,width=675,height=550,scrollbars=yes,toolbar=no,menubar=yes,resizable=yes')";
	if (!openwindow || openwindow.closed){
		openwindow=eval(win);
	}else{openwindow.focus()}
}
function OpenSector(id,sector,zid,tsid){
    for (i=1; i<document.getElementById('grid').rows.length-1; i++){
		var sec = document.getElementById('grid').rows[i].cells[1].innerHTML;
		if(id==sec){
			var exp = document.getElementById('grid').rows[i].cells[5].innerHTML;
			//alert(exp)
			if (exp>=250){
				win ="window.open('../pl/inmuebles_sector_revision_rept.pl?c11_sector_id="+id+"&v64_sector="+sector+"&zid="+zid+"','SectoresRevision','left=100,top=20,width=675,height=550,scrollbars=yes,toolbar=no,menubar=yes,resizable=yes')";
			}else{
				win ="window.open('../pl/inmuebles_sectores_revision_detail_rept.pl?&c11_sector_id="+id+"&v64_sector="+sector+"&zid="+zid+"','RevisionDetail','left=100,top=20,width=675,height=550,scrollbars=yes,toolbar=no,menubar=yes,resizable=yes')";
			}
		}
	}
	if (!openwindow || openwindow.closed){
		openwindow=eval(win);
	}else{openwindow.focus()}
}