function xmlDocReady() {	
	storeTags();
	//alert(tagArr[0][0]);
	//showTags();
	//play_by_searchkey("18413");
	play(0, true);
     } //function xmlDocReady()
	 
	 function play(idx, go) { 
	if (go) { createPlayer(tagArr[idx][0], tagArr[idx][4], 'true'); } 
	else { createPlayer(tagArr[idx][0], tagArr[idx][4], 'false'); }	
    }
	 
	function storeTags() { //asx playlist

	getListOf("entry");

	for (i=0; i<tagList.length; i++) { 
		clearRow();

		addToRow(getAttr(i, "ref", "href"));
		addToRow(getTag(i, "title"));
		addToRow(getTag(i, "author"));
		addToRow(getAttr(i, "moreinfo", "href"));
		addToRow(getValueByAttrVal(i, "param", "name", "image", "value"));

		addRowToArr();
	} 
}  //function storeTags()
	 
	function play_by_searchkey(my_key){
		
		for (i=0; i<tagArr.length; i++) {
		if(tagArr[i][1] == my_key){  play(i,true); }
		} //alert(tagArr[1][1]);
} //function play_by


function showTags() { //alert('first cell:' + tagArr[0][0] );
	
// videos en demanda
	var txt_end=''; 	
    
	txt_end+='<table border=0><tr>';
	for (i=0; i<tagArr.length; i++) {
 		txt_end+='<td onclick="play(' + i + ', true)";>';
		
		//var patt1=new RegExp("video");
     	//if (patt1.test(tagArr[i][1])){
		txt_end+= asCell(asImage(tagArr[i][4], "60", "36", "1", "Clic en este icono para reproducir video-stream"));
		//txt_end+='<td valign="middle" class="teletica_ppv_endemanda_menu_playlistlo">';
		//txt_end+='<b>' + tagArr[i][1] + '</b><br\>';
		txt_end+='' + tagArr[i][2] + '<br\>';
		//txt_end+='' + asLink(tagArr[i][3], "_self", "Clic der. para descargar.");
		txt_end+='</td>';
		//}
		//txt_end+='</table>';
	}
	txt_end+='</tr></table>';
    // videos en demanda	
    
	document.getElementById("teletica_ppv_endemanda_menu_writeroot").innerHTML = txt_end;

	
}


function init() {
	//Drag.init(document.getElementById("playerhandle"), document.getElementById("playerroot"));	
	//Drag.init(document.getElementById("listhandle"), document.getElementById("listroot"));

	//document.getElementById("playerhandle").style.cursor = 'move';
	//document.getElementById("listhandle").style.cursor = 'move';

	//importXML(''); 
	//alert("function init()");
	importXML('xml-asx/ppv_intro.xml');
	//alert("depues de importXML()");
} //function init()

function createPlayer(theFile, theImg, go) {
	var cnt = document.getElementById("mediaspace");
	var src = 'js/wmvplayer/wmvplayer.xaml';
	var cfg = {
		file: theFile,
		image: 'preview.jpg',
		autostart: go,
		overstretch: 'false',
		height:'279',
		width:'302',
		volume:'60'
	};
	
	var ply = new jeroenwijering.Player(cnt,src,cfg);	
} //function createPlayer(
