function getInnerCode(node)
	{
		var innerCode = '';
		var totalChilds = node.childNodes.length - 1;
		for(var counter = totalChilds, child; child = node.childNodes[counter]; counter--)
		{
			innerCode += child.outerHTML;
		}
		return innerCode;
	}
	

	function activar(){
		objeto=document.getElementById("flash_object");
		//alert("!!");
		objeto.outerHTML = objeto.innerHTML;;
	}



function escribe_flash(pelicula,dimX,dimY,texto){
document.write('<div style="width:100%;height:100%">');
document.write('	<object type="application/x-shockwave-flash" data="'+pelicula+'" width="'+dimX+'" height="'+dimY+'">');
document.write('		<param name="movie" value="'+pelicula+'" />');
document.write('		<param name="allowfullscreen" value="true" />');
document.write('		<p>');
document.write('			'+texto);
document.write('		</p>');
document.write('	</object>');
document.write('</div>');
}



function escribe_chat(pelicula,dimX,dimY,id_chat){
document.write('<div style="width:100%;height:100%">');
document.write('	<object type="application/x-shockwave-flash" data="'+pelicula+'" width="'+dimX+'" height="'+dimY+'">');
document.write('		<param name="movie" value="'+pelicula+'" />');
document.write('		<param name="allowscriptaccess" value="always" />');
document.write('		<param name="allowfullscreen" value="true" />');
document.write('		<param name="sesion_ruta" value="/chat/" />');
document.write('		<param name="idApp" value="'+id_chat+'" />');
//document.write('<embed src="'+pelicula+'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+dimX+'" height="'+dimY+'" idApp="'+id_chat+'" sesion_ruta="/chat/"></embed>');
document.write('	</object>');
document.write('</div>');
}


function escribe_flash_youtube(identificador){
	document.write('	<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/'+identificador+'" width="425" height="355">');
	document.write('		<param name="movie" value="http://www.youtube.com/v/'+identificador+'" />');
	document.write('	</object>');
}

function escribe_flash_youtube2(identificador){
	document.write('	<object type="application/x-shockwave-flash" data="http://www.tuamo.net/flash/reproductor.swf?peli='+identificador+'" width="425" height="355">');
	document.write('		<param name="movie" value="http://www.tuamo.net/flash/reproductor.swf?peli='+identificador+'" />');
	document.write('	</object>');
}

function escribe_flash_xtube(identificador,indice){
	document.write('	<object type="application/x-shockwave-flash" data="http://pc'+indice+'.xtube.com/embed_splayer.swf?&idx='+indice+'&auto=0&video_id='+identificador+'" width="499" height="428">');
	document.write('		<param name="movie" value="http://pc'+indice+'.xtube.com/embed_splayer.swf?&idx='+indice+'&auto=0&video_id='+identificador+'" />');
	document.write('		<param name="allowScriptAccess" value="sameDomain" />');
	document.write('	</object>');
}


function setSwf(swf, id, w, h, flashvars){
	document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"'+w+'\" height=\"'+h+'\" id=\"'+id+'\" align=\"top\">');
	document.write('<param name=\"movie\" value=\"'+swf+'\">');
	document.write('<param name=\"flashvars\" value=\"'+flashvars+'\">');
	//document.write('<param name=\"bgcolor\" value=\"'+bgColor+'\">');
	document.write('<param name=\"allowScriptAccess\" value=\"sameDomain\">');
	document.write('<param name=\"quality\" value=\"high\">');
	document.write('<param name=\"salign\" value=\"t\">'); 
	document.write('<param name=\"menu\" value=\"true\">');
	 document.write('<param name=\"scale\" value=\"noscale\">'); 
	document.write('<embed src=\"'+swf+'\" flashvars=\"'+flashvars+'\" width=\"'+w+'\" height=\"'+h+'\" name=\"'+id+'\" scale=\"noscale\"  salign=\"t\" align=\"top\" quality=\"high\" menu=\"true\"allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">');
	document.write('</object>');
	//alert('hi');
	//setTimeout("alert('hi')",5000);
}


	function setFlashWidth(divid, newW){
		document.getElementById(divid).style.width = newW+"px";
	}
	//
	//
	function setFlashHeight(divid, newH){
		
		
		
		document.getElementById(divid).style.height = newH+"px";		
		document.getElementById('mymovie').style.height = newH+"px";
		//alert("setFlashHeight("+divid+","+newH+")");
	}
	//
	//
	function setFlashSize(divid, newW, newH){
		setFlashWidth(divid, newW);
		setFlashHeight(divid, newH);
	}
	//
	//
	function canResizeFlash() {
		var ua = navigator.userAgent.toLowerCase();
		var opera = ua.indexOf("opera");
		if (document.getElementById) {
			if (opera == -1) {
				return true;
			} else if (parseInt(ua.substr(opera+6, 1))>=7) {
				return true;
			}
		}
		return false;
	}