var url = new Array("freebie.php", "telesales.php", "talkshow.php", "news.php", "broadcast.php", "eyecandy.php", "infomercial.php", "contact.php", "/foro/", "donations.php");


function enciendeTV() {
    var obj = document.getElementById('contenedor');
    if(obj) obj.setAttribute("src", "inicio.html");
        
    if(document.getElementById('tv_03_off')) { 
        document.getElementById('tv_03_off').id = 'tv_03_on'; 
    } 
}

function apagaTV() {
    var obj = document.getElementById('contenedor');
    if(obj) obj.setAttribute("src", "apagada.html");
        
    if(document.getElementById('tv_03_on')) { 
        document.getElementById('tv_03_on').id = 'tv_03_off'; 
    } 
}



function cambiaSeccion(seccion) {
    var obj = document.getElementById('contenedor');
    if(obj)	obj.setAttribute("src", url[seccion]);
}


function ver(num)
{
	for(i=1; i<=3; i++)
	{
		if(num == i)
		{
			document.getElementById('contenedor').contentWindow.document.getElementById("paso"+i).style.display = 'block';
		}
		else
		{
			document.getElementById('contenedor').contentWindow.document.getElementById("paso"+i).style.display = 'none';
		}
	}
	distancia = 0;
	document.getElementById('contenedor').contentWindow.document.getElementById('cajaScroll').scrollTop = 0;
}



/***** Para controlar el scroll del mando ******/

var CANTIDAD = 5; /* Distancia de scroll */
var TIME = 20; /* milisegundos */
var timer = null;
var distancia = 0;


function scrollItDown(v)
{
    if(distancia < document.getElementById('contenedor').contentWindow.document.getElementById('cajaScroll').scrollHeight - 275)
    {
        distancia=distancia+CANTIDAD;
        document.getElementById('contenedor').contentWindow.document.getElementById('cajaScroll').scrollTop = distancia;
    }
}

function scrollItUp(v)
{
	if(distancia > 0) 
	{ 
	    distancia=distancia-CANTIDAD; 
	    document.getElementById('contenedor').contentWindow.document.getElementById('cajaScroll').scrollTop = distancia;
	}
}

function down(v)
{
	if(timer) { clearInterval(timer); timer=null; }
	if(v) timer = setInterval("scrollItDown("+v+")",TIME);
	
}

function up(v)
{
	if(timer) { clearInterval(timer); timer=null; }
	if(v) timer = setInterval("scrollItUp("+v+")",TIME);
}



function fncMenu() {
    if (AC_FL_RunContent == 0) {
        alert("Esta página requiere el archivo AC_RunActiveContent.js.");
    } else {
        AC_FL_RunContent(
            'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
            'width', '206',
            'height', '764',
            'src', 'menu',
            'quality', 'high',
            'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
            'align', 'middle',
            'play', 'true',
            'loop', 'true',
            'scale', 'showall',
            'wmode', 'window',
            'devicefont', 'false',
            'id', 'menu',
            'bgcolor', '#000000',
            'name', 'menu',
            'menu', 'true',
            'allowFullScreen', 'false',
            'allowScriptAccess','sameDomain',
            'movie', 'img/menu',
            'salign', ''
            ); 
    }
}


function fncMando() {
    if (AC_FL_RunContent == 0) {
        alert("Esta página requiere el archivo AC_RunActiveContent.js.");
    } else {
        AC_FL_RunContent(
            'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
            'width', '239',
            'height', '210',
            'src', 'mando',
            'quality', 'high',
            'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
            'align', 'middle',
            'play', 'true',
            'loop', 'true',
            'scale', 'showall',
            'wmode', 'window',
            'devicefont', 'false',
            'id', 'mando',
            'bgcolor', '#000000',
            'name', 'mando',
            'menu', 'true',
            'allowFullScreen', 'false',
            'allowScriptAccess','sameDomain',
            'movie', 'img/mando',
            'salign', ''
            ); 
    }
}



function fncHumo() {
    if (AC_FL_RunContent == 0) {
        alert("Esta página requiere el archivo AC_RunActiveContent.js.");
    } else {
        AC_FL_RunContent(
            'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
            'width', '554',
            'height', '210',
            'src', 'humo',
            'quality', 'high',
            'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
            'align', 'middle',
            'play', 'true',
            'loop', 'true',
            'scale', 'showall',
            'wmode', 'window',
            'devicefont', 'false',
            'id', 'humo',
            'bgcolor', '#000000',
            'name', 'humo',
            'menu', 'true',
            'allowFullScreen', 'false',
            'allowScriptAccess','sameDomain',
            'movie', 'img/humo',
            'salign', ''
            ); 
    }
}


function fncGuitarra() {
    if (AC_FL_RunContent == 0) {
        alert("Esta página requiere el archivo AC_RunActiveContent.js.");
    } else {
        AC_FL_RunContent(
            'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
            'width', '206',
            'height', '474',
            'src', 'menu',
            'quality', 'high',
            'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
            'align', 'middle',
            'play', 'true',
            'loop', 'true',
            'scale', 'showall',
            'wmode', 'window',
            'devicefont', 'false',
            'id', 'guitarra',
            'bgcolor', '#000000',
            'name', 'guitarra',
            'menu', 'true',
            'allowFullScreen', 'false',
            'allowScriptAccess','sameDomain',
            'movie', 'img/guitarra',
            'salign', ''
            ); 
    }
}


function fncTV() {
    if (AC_FL_RunContent == 0) {
        alert("Esta página requiere el archivo AC_RunActiveContent.js.");
    } else {
        AC_FL_RunContent(
            'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
            'width', '661',
            'height', '517',
            'src', 'menu',
            'quality', 'high',
            'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
            'align', 'middle',
            'play', 'true',
            'loop', 'true',
            'scale', 'showall',
            'wmode', 'window',
            'devicefont', 'false',
            'id', 'tv',
            'bgcolor', '#000000',
            'name', 'tv',
            'menu', 'true',
            'allowFullScreen', 'false',
            'allowScriptAccess','sameDomain',
            'movie', 'img/tv',
            'salign', ''
            ); 
    }
}

function verImg(ruta, ancho, alto)
{
	param = 'status=no,scrollbars=no,location=no,resizable=no,width='+ancho+',height='+alto+',left=100,top=100';
	url = 'http://www.royalscumbagorchestra.com/img.php?ruta=' + ruta + '&ancho=' + ancho + '&alto=' + alto;
	window.open(url,'',param);
}
