var lasolic;
function veCont(str){
	if (window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}else{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
	xmlhttp.onreadystatechange=function(){if (xmlhttp.readyState==4 && xmlhttp.status==200){document.getElementById('lmp').innerHTML = xmlhttp.responseText;}}
	xmlhttp.open("GET","mp.pl?"+str,true);
	xmlhttp.send();
	//document.getElementById('lmp').style.height = '100px';
	document.getElementById('lmp').style.overflow = 'auto';
	document.getElementById('ch').innerHTML='<div style="text-align:right;padding-right:5px;"><a href="javascript:void(0);" onclick="javascript:AchAgra();">+/-</a></div>';
	lasolic=str;
}
	
function MP(f,i,w,h){
	var mp = 'http://fenatraos.sistemaptc.com/images/mp/imag/';
	var obj='';
	obj += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+w+'" height="'+h+'" id="player1" name="player1" value="'+mp+'mediaplayer.swf">';
	obj += '<param name="allowfullscreen" value="true">';
	obj += '<param name="allowscriptaccess" value="always">';
	obj += '<param name="flashvars" value="file='+f+'&image='+i+'&autostart=false&volume=30">';
	obj += '<embed id="player1"';
	obj += 'name="player1"';
	obj += 'src="'+mp+'mediaplayer.swf"';
	obj += 'width="'+w+'"';
	obj += 'height="'+h+'"';
	obj += 'allowscriptaccess="always"';
	obj += 'allowfullscreen="true"';
	obj += 'flashvars="file='+f+'&image='+i+'&autostart=false&volume=30"/>';
	obj += '</object>';
	document.getElementById('mp').innerHTML=obj;
}

function AchAgra(){
	if(document.getElementById('lmp').offsetHeight > 50){
		document.getElementById('lmp').innerHTML = '';
		document.getElementById('lmp').style.overflow = 'hidden';
		document.getElementById('lmp').style.height = '10px';
	}else{
		veCont(lasolic);
	}
}

var lasImags = new Array();
var buImag=0,url,intval;

function imags(){
	buImag=0;
	var obj='';
	for(var i=0;i<lasImags.length;i++){
		obj += '<img src="'+url+lasImags[i]+'" width="60" hspace="2" vspace="2" onclick="javascript:colocaImg('+i+');">';
	}
	document.getElementById('lmp').innerHTML = obj;
	document.getElementById('mp').innerHTML = '<img src="'+url+lasImags[0]+'" width="345">';
	intval = window.setInterval("cambiaImag()",7000);
}

function pasa(i,u){
	lasImags=i.split(';');
	url=u;
	imags();
}

function cambiaImag(){
	buImag++;
	if(buImag==lasImags.length){buImag=0;}
	document.getElementById('mp').innerHTML = '<img src="'+url+lasImags[buImag]+'" width="345">';
}

function menu() {
	var m = new Array('Video;v','Imagenes;i','MP3;m');
	var obj='';
	for(var i=0;i<m.length;i++){
		var d = m[i].split(';');
		obj += '<a href="javascript:void(0);" onclick="javascript:window.clearInterval(intval);veCont(\'qe='+d[1]+'\');">'+d[0]+'</a> | ';
	}
	document.write('<div id="contenedor">');
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr algn="left" valign="top">');
	document.write('<td width="345">');
	document.write('<div id="menu"></div>');
	document.write('<div id="mp"></div>');
	document.write('</td><td width="10"></td><td>');
	document.write('<div id="ch"></div>');
	document.write('<div id="lmp"></div>');
	document.write('</td></tr>');
	document.write('</table>');
	document.write('</div>');
	
	var cierra = '<a href="javascript:void(0);" onclick="javascript:cierra();">X</a>';
	
	document.getElementById('menu').innerHTML=obj+cierra;
}

function cierra(){
	document.getElementById('mp').innerHTML='';
	document.getElementById('ch').innerHTML='';
	document.getElementById('lmp').innerHTML='';
}

menu();
