var highlightcolor="#ffffcc";
var ie=navigator.userAgent.indexOf('MSIE')
var name="'Powered by David Bravo'";
var message="'Haz Click para ir al recurso'";
//mensaje de aviso
if (ie==-1){
	var Message = "";
	Message = '<div id="warning"><p><span class="warning">Aviso Importante</span><br/>';
	Message += 'Mucha funcionalidad requiere Internet Explorer 5.5 o superior.<br/>'
	Message += 'Este sitio ha sido diseñado para una resolución de pantalla de 1024 x 768.<br/>'
	Message += '© 2003-2005 por David Bravo Davila. Todos los derechos reservados.</p></div>';
	document.write(Message);
}
//función de busqueda en google
function search(){
	document.getElementById("q").value += " site:www.webpersonal.net/arda";
	formSearch.submit();
}
//añade un item de una lista a otra
function AddItem(listSource,listDestination){
	var index = document.getElementById(listSource).selectedIndex;
	var repeat = document.getElementById(listDestination).repeatItems;
	var group = document.getElementById(listDestination).groupItems;
	if(index!=-1){
		if(repeat=="false"){
			for(j=0;j<document.getElementById(listDestination).options.length;j++){
				if(document.getElementById(listSource).options[index].value==document.getElementById(listDestination).options[j].value){
					return false;
				}
			}
		}else if(group=="true"){
			for(j=0;j<document.getElementById(listDestination).options.length;j++){
				if(document.getElementById(listSource).options[index].value==document.getElementById(listDestination).options[j].value){
					document.getElementById(listDestination).options[j].amount++;
					document.getElementById(listDestination).options[j].text = document.getElementById(listSource).options[index].text+' ('+document.getElementById(listDestination).options[j].amount+')';
					return true;
				}
			}
		}
		document.getElementById(listDestination).options.add(new Option(document.getElementById(listSource).options[index].text,document.getElementById(listSource).options[index].value));
		document.getElementById(listDestination).options[document.getElementById(listDestination).length-1].amount=1;
	}
}
//borra una lista completamente
function ClearList(listName){
	var numItems = document.getElementById(listName).options.length;
	for(i=0;i<numItems;i++){
		document.getElementById(listName).options[0]=null;
	}
}
//borra un item de una lista
function DelItem(listName){
	var index = document.getElementById(listName).selectedIndex;
	if(index!=-1){
		document.getElementById(listName).options[index]=null;
	}
}

//agregar a la lista de favoritos
function AddFavorite(){
	window.external.AddFavorite('http://www.webpersonal.net/arda', 'Fudge Fantasy');
	return true;
}
//escribir un vínculo
function WriteLink(object_id){
	document.write('<a href="' + object_id.data + '"><span onMouseOver="window.status=' + message + ';" onMouseOut="window.status=' + name + ';" datasrc="#' + object_id.id + '" datafld="caption"></span></a>');
}

// Muestra una capa de la pagina y oculta el resto de capas
function ViewDiv(divNum,numDivs){ 
	var a;
	for (a=1;a<numDivs+1;a++){
		if (divNum == a){
			document.getElementById("div"+divNum).style.visibility="visible";
		}else{
			document.getElementById("div"+a).style.visibility="hidden";
		}
	}
}

// Abre una ventana para seleccionar el codigo hexadecimal de un color 
function LanzarMenuColores(opc){ 
   window.open("../subMenuColores.aspx?opc=" + opc,"SubMenuColores","width=400,height=400,scrollbars=yes");
}

// Comienza un Scrolling con un texto                  
function ActiveScroll(x) {
   msg = document.getElementById("Nombre").value;
   if (x){
      timeoutID=window.setTimeout('scrollIt()',200);
   }else{
      window.clearTimeout(timeoutID);
   }
}

function scrollIt() {
   window.status = msg;
   msg = msg.substring(1,msg.length) + msg.charAt(0);
   timeoutID=window.setTimeout('scrollIt()',200);
}

// Ilumina un objeto seleccionado
function highlight(myObject){
	myObject.style.backgroundColor=highlightcolor;
}

// Desilumina un objeto seleccionado
function dishighlight(myObject){
	myObject.style.backgroundColor="#ffffff";
}

// Muestra un texto del manual o lo oculta
function showItem(ItemID){
	if (document.getElementById(ItemID).style.visibility=="hidden"){
		document.getElementById(ItemID).style.visibility="visible";
		document.getElementById(ItemID).style.position="relative";
	}else{
		document.getElementById(ItemID).style.visibility="hidden";
		document.getElementById(ItemID).style.position="absolute";
	}
}