/* ----- rep. 20081128 -----
function SetBgColor() {
//	alert("SetBgColor");
	document.body.style.backgroundColor = parent.Frame21.document.body.style.backgroundColor;
}
---------- */
function SetBgColor(){
	if (parent.closed) {
	} else {
		document.bgColor=parent.Frame21.document.bgColor;
	}
}

function SetBgClr(obj) {
var sURL;
//	alert(obj.style.backgroundColor);
	document.body.style.backgroundColor = obj.style.backgroundColor;
//	document.bgColor = obj.style.backgroundColor;
	parent.Frame22.document.body.style.backgroundColor = obj.style.backgroundColor;
//	parent.Frame22.document.bgColor = obj.style.backgroundColor;
	sURL = parent.Frame22.location.toString();
	/* if window=tapa */
	if (sURL.indexOf("frame22.htm") >= 0) {
//		alert("backgroundColor=" + obj.style.backgroundColor);
//		alert("Frame221.backgroundColor=" + parent.Frame22.Frame221.document.bgColor);
		parent.Frame22.Frame221.document.bgColor = obj.style.backgroundColor;
	}
}
function if_ie() {
	if (navigator.appName.indexOf("Microsoft") >= 0) {
		return true;
	} else {
		return false;
	}
}
/* Set text in <input> tab */
function Set_innerText(obj, value) {
//	alert("Set_innerText=" + obj.name + " " + value);
	obj.innerHTML = value;
}
/* Get from <input> tag */
function Get_innerText(obj) {
//	alert("Get_innerText=" + obj.name);
	return obj.value;
}
/* Set text in <td> */
function Set_innerText_Td(obj,value) {
//	alert("Set_innerText_Td =" + obj.name);
	if (if_ie()) {
		obj.innerText = value;
	} else {
		obj.textContent = value;
	}
}
/* Get text from <td> */
function Get_innerText_Td(obj) {
//	alert("Get_innerText_Td =" + obj.name);
	if (if_ie()) {
		return obj.innerText;
	} else {
		return obj.textContent;
	}
}

function sound_ie(iNo) {
//	alert("sound_ie"+ ssonido_wma[iNo]);
	if (if_ie()) {
		document.write("<bgsound src='" + ssonido_wma[iNo] + "' id='mySND'><br>");
	}
}
function sound_mozilla(iNo) {
//	alert("sound_mozilla");

	if (!if_ie()) {
		document.write("<object data='" + ssonido[iNo] + "' id='sound' width='200' height='20' type='audio/midi'>");
		document.write("<param name='src' value='" + ssonido[iNo] + "'>");
		document.write("<param name='autostart' value='true'>");

		document.write("</object>");
	}
}
/* Open Window de Juegos */
var spage=new Array(6);		/* paginas	*/
spage[0]="./fosforos.htm";
spage[1]="./juego_piramides.htm";
spage[2]="./quince.htm";
spage[3]="./magico_4x4.htm";
spage[4]="";
spage[5]="";

function OpenWin_juego(no) {

	window.open(spage[no], "Frame22");
}

/*  Move Imagen */
imgLeftStart = -150;
imgLeftEnd = 1024;
imgLeft = imgLeftStart;
imgTop = 550;
moveStep = 5;
moveSpeed = 30;
function moveImgX(){
	document.getElementById("img1").style.top = imgTop;
	document.getElementById("img1").style.left = imgLeft;
	if(imgLeftEnd-imgLeftStart > 0){
		imgLeft += moveStep;
		if(imgLeft > imgLeftEnd){
			imgLeft = imgLeftStart;
		}
	}else{
		imgLeft -= moveStep;
		if(imgLeft < imgLeftEnd){
			imgLeft = imgLeftStart;
		}
	}
	document.getElementById("img1").style.visibility="visible";
	setTimeout("moveImgX()",moveSpeed);
}

