function Rollover(cual,porcual){
		if(document.images){
			document.images[cual].src = porcual + '.jpg'
		}
	}

function RolloverSub(cual,porcual){
		if(document.images){
			document.images[cual].src = 'img/' + porcual + '.jpg'
		}
	}

	
function Rollover2(cual, porcual)
{
	if(document.images)
	{
		document.images[cual].src = porcual;
		
	}
}
	
	
function validaMail(string){
	if (typeof(string)!='object'){
			valor = string;
	}
	else{
			var X = new String;
			X = string.value;			
			valor = X;
	}
	if (string == ""){
			return(false);
	}
	else{
		if (valor.search(/[A-Za-z0-9ñ\-\.\_]+@[A-Za-z0-9\-]+\.[A-Za-z0-9]+(\.[A-Za-z0-9]*)?/g) != 0)
			return (false);
		else
			return(true);	
	}
}

function PopWindow(url, w, h)
{
	window.open(url, 'pop', 'width=' + w + ',height=' + h + ',menubar=no,scrollbars=no,toolbar=no,location=no, directories=no, resizable=no, top=100, left=100');
}

function PopWindowScrl(url, w, h, scrollbars)
{
	window.open(url, 'pop', 'width=' + w + ',height=' + h + ',menubar=no,scrollbars='+ scrollbars + ',toolbar=no,location=no, directories=no, resizable=no, top=100, left=100');
}



function hilite(strCaracters){
	if(strCaracters!=''){
//Bucle por palabra buscada
		var original=document.getElementById("iluminar").innerHTML;
		if(document.getElementById &&
				document.getElementById("iluminar") &&
				document.getElementById("iluminar").innerHTML){
			
			var iluminado=original;//.toUpperCase();
			var testRegExp = eval('/'+strCaracters+'/g');

			//var match = iluminado.match(testRegExp);
			//alert(match);
			//if(match != '.'+strCaracters+'.' || match != '.'+strCaracters || match!= strCaracters+'.'){
			//	alert(cnvrt2Upper(strCaracters));
			//}
			if (testRegExp.test(iluminado)) {
		    	iluminado=iluminado.replace(eval('/'+strCaracters.toUpperCase()+'/g'),' <span style="color:red;font-weight:bold">'+ strCaracters .toUpperCase()+'</span>');
				document.getElementById("iluminar").innerHTML=iluminado;
				
				iluminado=document.getElementById("iluminar").innerHTML;
				iluminado=iluminado.replace(eval('/'+cnvrt2Upper(strCaracters)+'/g'),' <span style="color:red;font-weight:bold">'+ cnvrt2Upper(strCaracters) +'</span>');
				document.getElementById("iluminar").innerHTML=iluminado;
				
				iluminado=document.getElementById("iluminar").innerHTML;
				iluminado=iluminado.replace(eval('/'+strCaracters.toLowerCase()+'/g'),' <span style="color:red;font-weight:bold">'+ strCaracters.toLowerCase() +'</span>');
				document.getElementById("iluminar").innerHTML=iluminado;
				
				iluminado=document.getElementById("iluminar").innerHTML;
				iluminado=iluminado.replace(eval('/'+strCaracters+'/g'),' <span style="color:red;font-weight:bold">'+ strCaracters +'</span>');
				document.getElementById("iluminar").innerHTML=iluminado;
			}
			
		}
//Fin Bucle palabra
	}
}

function cnvrt2Upper(str) {
        return str.toLowerCase().replace(/\b[a-z]/g, cnvrt);
       
 } 
 function cnvrt() {
            return arguments[0].toUpperCase();
        }
        
        
// Funciones avanzadas de botones
        
function buttonPatch(id, off, on) {
	var img = document.getElementById(id);
	img.onmouseover = function() {this.src = on;};
	img.onmouseout = function() {this.src = off;};
	img.src = off;
}

function createButton(id, offImg, onImg, altText, url, selected) {
	var ael = document.getElementById(id);
	var imgId = id + "__IMG";
	
	var img = new Image();
	img.id = imgId;
	img.alt = altText;
	img.border = "0";
	
	ael.appendChild(img);
	
	if (selected) {
		img.src = onImg;
	} else {
		ael.href = url;
		buttonPatch(imgId, offImg, onImg);
	}
}

function createButtonConv(name, text, root, rurl, imgBase, ext, selected) {
	id = name;
	offImg = root + imgBase + "_off." + ext;
	onImg = root + imgBase + "_on." + ext;
	url = root + rurl;
	createButton(id, offImg, onImg, text, url, selected);
}
        
        
        
        
        
        
        
        
        