// JavaScript Document
arrJS = ["utilidades.js","mouse.js"];
traceEnabled = true;
window.onload = function() {
    cargarJS();
    n6 = (document.getElementById && !document.all)? true:false;
	ie5 = (document.getElementById && document.all)? true:false;
	ns4 = (document.layers)? true:false;
	ie4 = (document.all)? true:false;
}
function ruta(id){	return document.getElementById(id); }
function comenzar() {
	
	var curTarget   = null;
	var lastTarget  = null;
	
	dragHelper = document.createElement('DIV');
	dragHelper.setAttribute('class', 'caja');
	dragHelper.setAttribute('id', 'caja');
	document.body.appendChild(dragHelper);
	document.onmousemove = mouseMove;
	//apunto_cont();
}
function botonera(cual){
	
}
function display(id){
	id.style.display = 'block';
}
function link0(obj){
	obj.removeAttribute('href');
	obj.setAttribute('class', 'Estilo6');
}

function cargarJS() {
    var head = document.getElementsByTagName("head")[0]
    for (var i=0; i<arrJS.length; i++) {
        var script = document.createElement("script");
        script.language = "javascript";
        script.src = "js/" + arrJS[i];
        script.type = "text/javascript";
        head.appendChild(script);
    }      
}
var __cantJSCargados = 0;
function yaEstoyOk() {
    __cantJSCargados++;
    if (__cantJSCargados==arrJS.length){
        comenzar();
	}
}
function apunto_cont(){
	var hijos = document.getElementById('contenido').childNodes;
	var poner='';
	for (i=0; i< hijos.length; i++){
		if (hijos[i].tagName != undefined){
			if (hijos[i].nodeName.toUpperCase() == "DIV"){
				if (hijos[i].className == "cont2"){
					var hijitos=hijos[i].childNodes;
					for (j=0; j< hijitos.length; j++){
						if (hijitos[j].tagName != undefined){
							if (hijitos[j].nodeName.toUpperCase() == "DIV"){
								if (hijitos[j].className == "cuerp"){
									var hijitotes=hijitos[j].childNodes;
									for (h=0; h< hijitotes.length; h++){
										if (hijitotes[h].tagName != undefined){
											if (hijitotes[h].nodeName.toUpperCase() == "DIV"){
												if (hijitotes[h].className == "juego3" || hijitotes[h].className == "juego4"){
													//alert(hijitotes[h].className);
													if(encontrarHijoClase(hijitotes[h],'poner')){
														this.onmousemove=mouseMove;
														/*hijitotes[h].onmouseover=function(){
																ruta('caja').style.display = 'block';
																poner=encontrarHijoClase(this,'poner');
																aponer=poner.cloneNode(true);
																aponer.setAttribute('id', 'borrar');
																aponer.style.cssText = 'display:block;';
																ruta('caja').appendChild(aponer.cloneNode(true));	
																
																
															
															};
															//hijitotes[h]
															hijitotes[h].onmouseout=function(){
																dragHelper.style.display = 'none';
																if(ruta('borrar') != undefined){
																	 elim=ruta('borrar');
																	 padre=elim.parentNode;
																	padre.removeChild(elim);	
																}
																correr=false;
															};*/
													}
												}
												
											}
										}
									}
								}
								//
							}
						}
					}
				}
				
				if (hijos[i].className == "juego3"  || hijos[i].className == "juego4"){
					alert('hola')
					if(encontrarHijoClase(hijos[i],'poner')){
						poner=encontrarHijoClase(hijos[i],'poner');
						alert(hola);
						hijos[i].onmouseover=function(){
							alert('hola')
							}
					}
					
					/*prihijo = primerhijo(hijos[i]);
					nuev_hijos = prihijo.childNodes;
					for (h=0; h< nuev_hijos.length; h++){
						if (nuev_hijos[h].className == "vista"){
							//alert(nuev_hijos[h].tagName);
							for (j=0; j< nuev_hijos[h].childNodes.length; j++){
								if (nuev_hijos[h].childNodes[j].className == "chicaI" ||nuev_hijos[h].childNodes[j].className == "medianaI" ||nuev_hijos[h].childNodes[j].className == "grandeI"){
									nuev_hijos[h].childNodes[j].href = "#";
								}
							}	
						}
					}*/
					
					
					
				}
			}
		}
	}
}
