function click() { 
if (event.button==2) { 
alert ('Jardin Cascanueces') 
} 
} 
document.onmousedown=click 

var qTipTag = "a"; //Which tag do you want to qTip-ize? Keep it lowercase!//
var qTipX = 10; //This is qTip's X offset//
var qTipY = 6; //This is qTip's Y offset//

tooltip = {
  name : "qTip",
  offsetX : qTipX,
  offsetY : qTipY,
  tip : null
}

tooltip.init = function () {
	var tipNameSpaceURI = "http://www.w3.org/1999/xhtml";
	if(!tipContainerID){ var tipContainerID = "qTip";}
	var tipContainer = document.getElementById(tipContainerID);

	if(!tipContainer) {
	  tipContainer = document.createElementNS ? document.createElementNS(tipNameSpaceURI, "div") : document.createElement("div");
		tipContainer.setAttribute("id", tipContainerID);
	  document.getElementsByTagName("body").item(0).appendChild(tipContainer);
	}

	if (!document.getElementById) return;
	this.tip = document.getElementById (this.name);
	if (this.tip) document.onmousemove = function (evt) {tooltip.move (evt)};

	var a, sTitle;
	var anchors = document.getElementsByTagName (qTipTag);

	for (var i = 0; i < anchors.length; i ++) {
		a = anchors[i];
		sTitle = a.getAttribute("title");
		if(sTitle) {
			a.setAttribute("tiptitle", sTitle);
			a.removeAttribute("title");
			a.onmouseover = function() {tooltip.show(this.getAttribute('tiptitle'))};
			a.onmouseout = function() {tooltip.hide()};
		}
	}

/*=====================================================================================*/
// Modificado por mi yeah!! para input
	var anchorsX = document.getElementsByTagName ("input");
	for (var i = 0; i < anchorsX.length; i ++) {
		aX = anchorsX[i];
		sTitle = aX.getAttribute("title");
		if(sTitle) {
			aX.setAttribute("tiptitle", sTitle);
			aX.removeAttribute("title");
			aX.onmouseover = function() {tooltip.show(this.getAttribute('tiptitle'))};
			aX.onmouseout = function() {tooltip.hide()};
		}
	}

// Modificado por mi yeah!! para select
	var anchorsX = document.getElementsByTagName ("select");
	for (var i = 0; i < anchorsX.length; i ++) {
		aX = anchorsX[i];
		sTitle = aX.getAttribute("title");
		if(sTitle) {
			aX.setAttribute("tiptitle", sTitle);
			aX.removeAttribute("title");
			aX.onmouseover = function() {tooltip.show(this.getAttribute('tiptitle'))};
			aX.onmouseout = function() {tooltip.hide()};
		}
	}

// Modificado por mi yeah!! para textarea
	var anchorsX = document.getElementsByTagName ("textarea");
	for (var i = 0; i < anchorsX.length; i ++) {
		aX = anchorsX[i];
		sTitle = aX.getAttribute("title");
		if(sTitle) {
			aX.setAttribute("tiptitle", sTitle);
			aX.removeAttribute("title");
			aX.onmouseover = function() {tooltip.show(this.getAttribute('tiptitle'))};
			aX.onmouseout = function() {tooltip.hide()};
		}
	}

/*=====================================================================================*/	
}

tooltip.move = function (evt) {
	var x=0, y=0;
	if (document.all) {//IE
		x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		x += window.event.clientX;
		y += window.event.clientY;
		
	} else {//Good Browsers
		x = evt.pageX;
		y = evt.pageY;
	}
	this.tip.style.left = (x + this.offsetX) + "px";
	this.tip.style.top = (y + this.offsetY) + "px";
}

tooltip.show = function (text) {
	if (!this.tip) return;
	this.tip.innerHTML = text;
	this.tip.style.display = "block";
}

tooltip.hide = function () {
	if (!this.tip) return;
	this.tip.innerHTML = "";
	this.tip.style.display = "none";
}

//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////

var id = setInterval("reloj()",1000);
function reloj() {
	var fObj = new Date() ; 
	var horas = fObj.getHours() ; 
	var minutos = fObj.getMinutes() ; 
	var segundos = fObj.getSeconds() ; 
	if (horas <= 9) horas = "0" + horas; 
	if (minutos <= 9) minutos = "0" + minutos; 
	if (segundos <= 9) segundos = "0" + segundos; 
	window.status = horas+":"+minutos+":"+segundos;
}

var miarray = new Array ("info","mail","nivel","nom_nino","sexo","edad","dia_fn","mes_fn","anio_fn","dir","tel","nom_padre","nom_madre");

function Resetear(){
if (confirm("Se perderan todos los datos registrados hasta el momento.. Desea continuar?")){
	document.formulario.reset();
	for (var t=0; t<miarray.length; t++) {
		var tobjJS = document.getElementById(miarray[t])
			tobjJS.style.border = "1px solid #999999";
			tobjJS.style.color = "#333333";
			tobjJS.style.background = "#FFFFFF";
	}
	window.scrollTo(0,0);
}else{
	return false;
}
}

function Validar(){
	var Valores = new Array();
	var kaos = 0;
	var InvMail = 0;
	for (var t=0; t<miarray.length; t++) {
		var tobjJS = document.getElementById(miarray[t])
			tobjJS.style.border = "1px solid #999999";
			tobjJS.style.color = "#333333";
			tobjJS.style.background = "#FFFFFF";
	}

	for (var k=0; k<miarray.length; k++) {
		var objJS = document.getElementById(miarray[k])
		if(objJS.tagName == 'INPUT') SinVacios(miarray[k]);
		if(vacio(objJS.value)){
			objJS.style.border = "1px solid #C95D00";
			objJS.style.color = "#FFFFFF";
			objJS.style.background = "#FF9E3B";
			Valores[kaos] = miarray[k];
			kaos++;
		}else{
			var tmpObj = document.getElementById('mail');
			if(vacio(tmpObj.value)==false){
				if(IsEmail(tmpObj.value)==false){
					document.getElementById('msj').innerHTML = "(e-mail inv&aacute;lido)";
					tmpObj.style.border = "1px solid #C95D00";
					tmpObj.style.color = "#FFFFFF";
					tmpObj.style.background = "#FF9E3B";
					InvMail = 1;
				}else{
					document.getElementById('msj').innerHTML = "";
				}
			}
		}
	}
	if(kaos>0){
		document.getElementById(Valores[0]).focus();
		alert('Los Campos marcados son datos obligatios\r\nPor favor revise la ficha e ingrese los datos respectivos');
		return true;
	}else{
		if(InvMail==1){
			alert("Ingrese un mail valido");		
			document.getElementById('mail').focus();
		}else{
			document.formulario.submit();	
		}
	}
}

///////////////////////////////////////////////////////////////////////////

function trim(cadena) 
{	for(i=0; i<cadena.length; )	{if(cadena.charAt(i)==" ") cadena=cadena.substring(i+1, cadena.length); else break;}
	for(i=cadena.length-1; i>=0; i=cadena.length-1)	{if(cadena.charAt(i)==" ") cadena=cadena.substring(0,i); else break;}	
	return cadena; }

function vacio(q) {
for ( i = 0; i < q.length; i++ ) {
if ( q.charAt(i) != " " ) {return false}
}return true}

function SinVacios(input){
document.getElementById(input).value=trim(document.getElementById(input).value);
}

function IsEmail(mail) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail)){
		return true; //CORRECTA
	}else{
		return false; //INCORRECTA
	}
}
