// muestra mensaje barra de estados **************

function mostrar(msg){
 window.status=msg;
 return true;
}

// efecto raton **********************************

function efecto(obj, colorF) {
		obj.style.backgroundColor = colorF;
} 

// abrir ventana *********************************

function MM_openBrWindow(theURL,winName,features) {
    window.open(theURL,winName,features);
}

//imprimir****************************************

function printThis(){
if (!window.print){
alert("Lo sentimos pero necesitas un explorador más actual")
return
}
window.print()
}

// recorrido virtual ******************************

//retardo entre imagenes en la reproduccion automatica (milisegundos)
var retardo_rotacion = 7
//indice imagen inicial
actual = 0

//ir a la siguiente imagen
function siguiente() {
	if (document.formulario.imagen[actual+1]) 
	{
		document.images.visor.src = document.formulario.imagen[actual+1].value
		document.formulario.imagen.selectedIndex = ++actual
	}
	else inicio()
}

//ir a la imagen anterior
function anterior() {
	if (actual-1 >= 0) 
	{
		document.images.visor.src = document.formulario.imagen[actual-1].value
		document.formulario.imagen.selectedIndex = --actual
   	}
	else ultimo()
}

//ir a la primera imagen
function inicio()
{
	actual = 0
	document.images.visor.src = document.formulario.imagen[0].value
	document.formulario.imagen.selectedIndex = 0
}

//ir a la ultima imagen
function ultimo()
{
	actual = document.formulario.imagen.length-1
	document.images.visor.src = document.formulario.imagen[actual].value
	document.formulario.imagen.selectedIndex = actual
}

//cambia a modo reproduccion automatica
function repAuto(text) {
	document.formulario.automatico.value = (text == "Detener") ? "Reproducir" : "Detener"
	reproducir()
}


function cambiaLista()
{
	actual = document.formulario.imagen.selectedIndex
	document.images.visor.src = document.formulario.imagen[actual].value
}

//realiza reproduccion automatica
function reproducir() {
	if (document.formulario.automatico.value == "Detener")
	{
		actual = (actual == document.formulario.imagen.length-1) ? 0 : actual+1
		document.images.visor.src = document.formulario.imagen[actual].value
		document.formulario.imagen.selectedIndex = actual
		window.setTimeout("reproducir()", retardo_rotacion)
	}
}

// puzle ************************************************************

// puzzle head

function tile(bgname){ 
win2=window.open("","","width=480,height=336") // dimensiones ventana solucion
if (win2){
win2.focus()
win2.document.open()
win2.document.write("<head><title>"+bgname+"</title></head>")
win2.document.write("<body background="+'"'+bgname+'"'+">") 
win2.document.write("</body>")
win2.document.close()
}
else
alert("Fallo en la apertura de la imagen!")
}

// puzzle body


var temp = new Image()
var loc
var gotit
function checkit()
{
        if ((navigator.appName=="Microsoft Internet Explorer")
        && (parseInt(navigator.appVersion) >= 4))
        return
        else
        alert("To play, you need MSIE 4 or greater")
}
function exch()
{
        if ((event.button == 1) && (event.srcElement.className == "drag"))
        {
                 if (gotit == 1)
                {
                        gotit = 0
                        document.images[loc].src = document.images[event.srcElement.name].src
                        document.images[event.srcElement.name].src = temp.src
                }
                else
                {
                        gotit = 1
                        loc = event.srcElement.name
                        temp.src = document.images[loc].src
                }
        }
}
document.onmousedown=exch

//************************* no seleccionar texto pagina


//function disableselect(e){
//return false
//}
//function reEnable(){
//return true
//}
//document.onselectstart=new Function ("return false")
//if (window.sidebar){
//document.onmousedown=disableselect
//document.onclick=reEnable
//}
