// imprimer la fecha en formato Mayo 20, 2003
function imprimefecha(){
<!--
var months=new Array(13);
months[1]="Enero";
months[2]="Febrero";
months[3]="Marzo";
months[4]="Abril";
months[5]="Mayo";
months[6]="Junio";
months[7]="Julio";
months[8]="Agosto";
months[9]="Septiembre";
months[10]="Octubre";
months[11]="Noviembre";
months[12]="Diciembre";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (year < 2000)    // Y2K Fix, Isaac Powell
year = year + 1900; // http://onyx.idbsu.edu/~ipowell
document.write(lmonth+ " ");
document.write(date + ", " + year + "&nbsp;");
//-->
}
function vali_search(){
/*var str = document.busca.query.value;
var posi=str.indexOf("ñ");
var posi2 = str.indexOf("&aacute;");
var posi3 = str.indexOf("é");
var posi4 = str.indexOf("í");
var posi5 = str.indexOf("ó");
var posi6 = str.indexOf("ú");
var posi7 = str.indexOf("Ñ");
*/

if(document.busca.query.value==''){
alert("Ingrese un criterio");
document.busca.query.focus();
return false;
}
if(document.busca.query.value.length<3){
alert("Criterios de tres caracteres como minimo");
document.busca.query.focus();
return false;
}
if(document.busca.query.value=='turismo'){
alert("Toda la informacion turistica de Bogota\npuede encontrarla en www.bogotaturismo.gov.co");
//location.replace("index.php");
window.open("http://www.bogotaturismo.gov.co","nueva","width=500,height=500,toolbars=yes, location=yes,directories=yes,top=0,left=0, resizable, scrollbars=yes");
return false;
}
if((document.busca.query.value=='Rock al parque 2004')||(document.busca.query.value=='rock al parque 2004')||(document.busca.query.value=='rock al parque')||(document.busca.query.value=='Rockalparque')||(document.busca.query.value=='ROCK AL PARQUE 2004')){
alert("Encuentre toda la información en www.rockalparque.gov.co");
return false;
}

/*if ((posi > -1) || (posi2 > -1) || (posi3 > -1) || (posi4 > -1) || (posi5 > -1) || (posi6 > -1) || (posi7 > -1)){
		   alert("Es preferible que no ingrese consonantes como la ñ o palabras con tildes\npara obtener mayor efectividad en sus resultados");
					document.busca.query.focus();
		   return false;
		}
		*/
}
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no'
win = window.open(mypage,myname,settings)
}



function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("cont").getElementsByTagName("DIV");
		if(el.style.display == "none"){
			for (var i=0; i<ar.length; i++){
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}
function ChangeClass(menu, newClass) { 
	 if (document.getElementById) { 
	 	document.getElementById(menu).className = newClass;
	 } 
} 
document.onselectstart = new Function("return true");

function SwitchMenu2(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("cont").getElementsByTagName("DIV");
		if(el.style.display == "none"){
			for (var i=0; i<ar.length; i++){
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}
function ChangeClass(menu, newClass) { 
	 if (document.getElementById) { 
	 	document.getElementById(menu).className = newClass;
	 } 
} 
document.onselectstart = new Function("return true");


function openwin(url,nombre,specs){
window.open(url,nombre,specs);
}

function NewWindowfull(mypage,myname,settings){
w = screen.width-5;
h = screen.height-55;
settings ='height='+h+',width='+w+',top=0,left=0,scrollbars=yes,resizable=yes'
win = window.open(mypage,myname,settings)
}

function MM_findObj(n,d){
var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}

function MM_validateForm(){
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for(i=0;i<(args.length-2);i+=3){test=args[i+2];val=MM_findObj(args[i]);
if(val){nm=val.name;if((val=val.value)!=""){if(test.indexOf('isEmail')!=-1){p=val.indexOf('@');
if(p<1||p==(val.length-1))errors+='- '+nm+' must contain an e-mail address.\n';}
else if(test!='R'){num=parseFloat(val);if(isNaN(val))errors+='- '+nm+' must contain a number.\n';
if(test.indexOf('inRange')!=-1){p=test.indexOf(':');min=test.substring(8,p);max=test.substring(p+1);
if(num<min||max<num)errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';}}}
else if(test.charAt(0)=='R')errors+='- '+nm+' is required.\n';}}
if((errors)||(document.forms[0].formato[0].checked==false)&&(document.forms[0].formato[1].checked==false))
{
alert('Por favor complete todos los datos del formulario.\nAsegurese de registrar una direccion de correo electronico valida');
return false;}}


function setActiveStyleSheet(title) {
   var i, a, main;

   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {

     if(a.getAttribute("rel").indexOf("style") != -1

        && a.getAttribute("title")) {

       a.disabled = true;

       if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}


/*******************************************************
FLASH DETECT 2.5
All code by Ryan Parman and mjac, unless otherwise noted.
(c) 1997-2004 Ryan Parman and mjac
http://www.skyzyx.com
*******************************************************/

// This script will test up to the following version.
flash_versions = 7;

// Initialize variables and arrays
var flash = new Object();
flash.installed=false;
flash.version='0.0';

// Dig through Netscape-compatible plug-ins first.
if (navigator.plugins && navigator.plugins.length) {
	for (x=0; x < navigator.plugins.length; x++) {
		if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
			flash.version = navigator.plugins[x].description.split('Shockwave Flash ')[1];
			flash.installed = true;
			break;
		}
	}
}

// Then, dig through ActiveX-style plug-ins afterwords
else if (window.ActiveXObject) {
	for (x = 2; x <= flash_versions; x++) {
		try {
			oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
			if(oFlash) {
				flash.installed = true;
				flash.version = x + '.0';
			}
		}
		catch(e) {}
	}
}

// Create sniffing variables in the following style: flash.ver[x]
// Modified by mjac
flash.ver = Array();
for(i = 4; i <= flash_versions; i++) {
	eval("flash.ver[" + i + "] = (flash.installed && parseInt(flash.version) >= " + i + ") ? true : false;");
}
