function sendForm(g,f){
	f.method="POST";
	f.target=g.name;
}

function showContent(rp){
	gw=window.gw0002;
	gw.location.href='gateWay.php?tar=contenido&rp='+rp;
}

function hiddenId(id){
	if(document.all){
		div=document.all[id];
		div.style.visibility='collapse';
	}
	else{
		div=document.getElementById(id);
		div.style.visibility='collapse';
	}
}

function showMsgAviso(m,wd,hd){
	hs=screen.height;
	ws=screen.width;
	
	if(document.all){
		dm=document.all["msgAviso"];
	}
	else{
		dm=document.getElementById("msgAviso");
	}
	
	dm.innerHTML=m;
	
	dm.style.zIndex="1";
	dm.style.top="200px";
	dm.style.left="30%";
	dm.style.position="absolute";
	
	dm.style.width=wd;
	/*dm.style.height=hd;*/
	
	dm.style.visibility="visible";
}

function hiddenMsgAviso(){
	
	if(document.all){
		dm=document.all["msgAviso"];
	}
	else{
		dm=document.getElementById("msgAviso");
	}
	
	dm.innerHTML="";
	
	dm.style.zIndex="-1";
	dm.style.top="0px";
	dm.style.left="0px";
	//alert(dm.style.top);
	
	dm.style.width="0px";
	dm.style.height="0px";
	dm.style.visibility="hidden";
}

function showWin(doc,tit){
	fd=doc;
	opt="scrollbars=yes, resizable=no, width=360, height=450, status=no, location=no, toolbar=no, left=10, top=50";
	var MyWin= window.open(fd,tit,opt);
}

function showWin2(doc,tit,w,h){
	fd=doc;
	opt="scrollbars=yes, resizable=no, width="+w+", height="+h+", status=no, location=no, toolbar=no, left=10, top=50";
	var MyWin= window.open(fd,tit,opt);
}

function changeText(obj,txt){
	tar=window.document.getElementById(obj);
	//alert(tar);
	tar.innerHTML=txt;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function JumpToMap(targ,selObj,restore,image_dir,doc_dir){
	//alert(image_dir);
	ide=selObj.options[selObj.selectedIndex].value;
	switch(ide){
		case "1":
			changeImages('iEstado', image_dir+'estado_aguascalientes.gif');
			changeText("nestado","Aguascalientes");
			showWin2(doc_dir+'&basedir=aguascalientes',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "2":
			changeImages('iEstado', image_dir+'estado_bcn.gif');
			changeText("nestado","Baja California Norte");
			showWin2(doc_dir+'basedir=bajacalifornia',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "3":
			changeImages('iEstado', image_dir+'estado_bcs.gif');
			changeText("nestado","Baja California Sur");
			showWin2(doc_dir+'&basedir=bajacaliforniasur',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "4":
			changeImages('iEstado', image_dir+'estado_campeche.gif');
			changeText("nestado","Campeche");
			showWin2(doc_dir+'&basedir=campeche',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "5":
			changeImages('iEstado', image_dir+'estado_chiapas.gif');
			changeText("nestado","Chiapas");
			showWin2(doc_dir+'&basedir=chiapas',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "6":
			changeImages('iEstado', image_dir+'estado_chihuahua.gif');
			changeText("nestado","Chihuahua");
			showWin2(doc_dir+'&basedir=chihuahua',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "7":
			changeImages('iEstado', image_dir+'estado_coahuila.gif');
			changeText("nestado","Coahuila");
			showWin2(doc_dir+'&basedir=coahuila',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "8":
			changeImages('iEstado', image_dir+'estado_colima.gif');
			changeText("nestado","Colima");
			showWin2(doc_dir+'&basedir=colima',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "9":
			changeImages('iEstado', image_dir+'estado_df.gif');
			changeText("nestado","Distrito Federal");
			showWin2(doc_dir+'&basedir=distritofederal',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "10":
			changeImages('iEstado', image_dir+'estado_durango.gif');
			changeText("nestado","Durango");
			showWin2(doc_dir+'&basedir=durango',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "11":
			changeImages('iEstado', image_dir+'estado_guanajuato.gif');
			changeText("nestado","Guanajuato");
			showWin2(doc_dir+'&basedir=guanajuato',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "12":
			changeImages('iEstado', image_dir+'estado_guerrero.gif');
			changeText("nestado","Guerrero");
			showWin2(doc_dir+'&basedir=guerrero',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "13":
			changeImages('iEstado', image_dir+'estado_hidalgo.gif');
			changeText("nestado","Hidalgo");
			showWin2(doc_dir+'&basedir=hidalgo',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "14":
			changeImages('iEstado', image_dir+'estado_jalisco.gif');
			changeText("nestado","Jalisco");
			showWin2(doc_dir+'&basedir=jalisco',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "15":
			changeImages('iEstado', image_dir+'estado_mexico.gif');
			changeText("nestado","M&eacute;xico");
			showWin2(doc_dir+'&basedir=mexico',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "16":
			changeImages('iEstado', image_dir+'estado_michoacan.gif');
			changeText("nestado","Michoac&aacute;n");
			showWin2(doc_dir+'&basedir=michoacan',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "17":
			changeImages('iEstado', image_dir+'estado_morelos.gif');
			changeText("nestado","Morelos");
			showWin2(doc_dir+'&basedir=morelos',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "18":
			changeImages('iEstado', image_dir+'estado_nayarit.gif');
			changeText("nestado","Nayarit");
			showWin2(doc_dir+'&basedir=nayarit',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "19":
			changeImages('iEstado', image_dir+'estado_nuevoleon.gif');
			changeText("nestado","Nuevo Le&oacute;n");
			showWin2(doc_dir+'&basedir=nuevoleon',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "20":
			changeImages('iEstado', image_dir+'estado_oaxaca.gif');
			changeText("nestado","Oaxaca");
			showWin2(doc_dir+'&basedir=oaxaca',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "21":
			changeImages('iEstado', image_dir+'estado_puebla.gif');
			changeText("nestado","Puebla");
			showWin2(doc_dir+'&basedir=puebla',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "22":
			changeImages('iEstado', image_dir+'estado_queretaro.gif');
			changeText("nestado","Quer&eacute;taro");
			showWin2(doc_dir+'&basedir=queretaro',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "23":
			changeImages('iEstado', image_dir+'estado_qroo.gif');
			changeText("nestado","Quintana Roo");
			showWin2(doc_dir+'&basedir=quintanaroo',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "24":
			changeImages('iEstado', image_dir+'estado_slp.gif');
			changeText("nestado","San Luis Potos&iacute;");
			showWin2(doc_dir+'&basedir=sanluispotosi',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "25":
			changeImages('iEstado', image_dir+'estado_sinaloa.gif');
			changeText("nestado","Sinaloa");
			showWin2(doc_dir+'&basedir=sinaloa',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "26":
			changeImages('iEstado', image_dir+'estado_sonora.gif');
			changeText("nestado","Sonora");
			showWin2(doc_dir+'&basedir=sonora',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "27":
			changeImages('iEstado', image_dir+'estado_tabasco.gif');
			changeText("nestado","Tabasco");
			showWin2(doc_dir+'&basedir=tabasco',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "28":
			changeImages('iEstado', image_dir+'estado_tamaulipas.gif');
			changeText("nestado","Tamaulipas");
			showWin2(doc_dir+'&basedir=tamaulipas',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "29":
			changeImages('iEstado', image_dir+'estado_tlaxcala.gif');
			changeText("nestado","Tlaxcala");
			showWin2(doc_dir+'&basedir=tlaxcala',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "30":
			changeImages('iEstado', image_dir+'estado_veracruz.gif');
			changeText("nestado","Veracruz");
			showWin2(doc_dir+'&basedir=veracruz',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "31":
			changeImages('iEstado', image_dir+'estado_yucatan.gif');
			changeText("nestado","Yucat&aacute;n");
			showWin2(doc_dir+'&basedir=yucatan',selObj.options[selObj.selectedIndex].text,800,600);
		break;
		case "32":
			changeImages('iEstado', image_dir+'estado_zacatecas.gif');
			changeText("nestado","Zacatecas");
			showWin2(doc_dir+'&basedir=zacatecas',selObj.options[selObj.selectedIndex].text,800,600);
		break;
	}
	//cmd=targ+".location='"+selObj.options[selObj.selectedIndex].value+"'";
  //eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// --------------------------------------------
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		preloadFlag = true;
	}
}



function initCal(n,e){
	str="var "+n+"=new calendar1(e);";
	eval(str);
	str=n+".year_scroll = true;";
	eval(str);
	str=n+".time_comp = false;";
	eval(str);
	str=n+".popup();";
	eval(str);
}

function Imprimir(div){
	
	if (document.getElementById != null){
						var html = "<HTML><HEAD>";

						if (document.getElementsByTagName != null){
							var headTags = document.getElementsByTagName("head");
							//if (headTags.length > 0) html += headTags[0].innerHTML;
						}

						html += "</HE" + "AD><BODY>";

						var printReadyElem = document.getElementById(div);

						if (printReadyElem != null){
							html += printReadyElem.innerHTML;
						}
						else{
							alert("No se encuentra el texto a imprimir en el codigo HTML");
							return;
						}

						html += " </BO" + "DY> </HT" + "ML>";

						var printWin = window.open("","Imprimir","location=no,directories=no,status=no,width=100,height=100,scrollbars=no,resizable=no");
						printWin.document.open();
						printWin.document.write(html);
						printWin.document.close();
						
						printWin.print();
						
						//if (gAutoPrint) printWin.print();
					}
					else{
						alert("Lo sentimos, pero su navegador no soporta esta opción.");
	
					}
}
