/**
 * videoHandler, for ectract the mitele video uri from a known ID
 */
			
function changeVideo(title, section, video_id, foto, text, date, author, link, bool ){
	var url = '/informativos/mitele/INFORM/D-mod-gal-mm-video-destacado/' + video_id +'.xml';
	//var url = '/informativos/mitele' + section +  video_id +'.xml';
	//var url = 'http://mitele.telecinco.es' + section + 'D-mod-gal-mm-video-destacado/' + video_id +'.xml';
	//var url = 'http://mitele.telecinco.es' + section + 'D-mod-gal-mm-video-destacado/14407.xml';
	
	if (bool == undefined) { bool = false;}
	
	new Ajax.Request(url , { 
		method: 'get',
		onSuccess: function(transport) {
			/* 
			Midele send a xml file like this
			<config>
			   <item>
				  <id>thumb01</id>
				  <imagen/>
				  <tcorto>Traslado a Granada</tcorto>
				  <titulo>El Ciudad de Murcia de Carlos Marsá</titulo>
				  <descripcion>El equipo jugará en Granada</descripcion>
				  <video>http://tele5.communi.tv/jsp/getResource.jsp?uri=resources/flv/3/5/1197650495553.flv</video>
				  <enlace>http://www.tele5.communi.tv/informativos/deportes/889.shtml</enlace>
				  <apoyo/>
			   </item>
			</config>
			*/
			var videourl = transport.responseXML.getElementsByTagName('video')[0].firstChild.nodeValue;				
			if (soFlash != undefined) {
				if (title != undefined && title != '') {		
					soFlash.addVariable("title",title);
				}
				else if (bool == true) {
					soFlash.addVariable("title",'');
				}
				if (text != undefined && text != '') {		
					soFlash.addVariable("description", text);
				}
				else if (bool == true) {
					soFlash.addVariable("description",'');
				}
				if (foto != undefined && foto != '') {		
					soFlash.addVariable("image", foto);
				}
				if (date != undefined && date != '') {		
					soFlash.addVariable("date",	date);
				}
				else if (bool == true) {
					soFlash.addVariable("date",'');
				}
				if (author != undefined && author != '') {		
					soFlash.addVariable("author",author);
				}
				else if (bool == true) {
					soFlash.addVariable("author",'');
				}
				if (videourl != undefined && videourl != '') {						
					soFlash.addVariable("file", videourl);
				}
				if (link != undefined && link != '') {						
					soFlash.addVariable("link", link);
				}
				soFlash.write("videoFlash");
			}
		},
		onFailure: function() {
			if (soFlash != undefined) {
				if (title != undefined && title != '') {		
					soFlash.addVariable("title",title);
				}
				else if (bool == true) {
					soFlash.addVariable("title",'');
				}
				if (text != undefined && text != '') {		
					soFlash.addVariable("description", text);
				}
				else if (bool == true) {
					soFlash.addVariable("description",'');
				}
				if (foto != undefined && foto != '') {		
					soFlash.addVariable("image", foto);
				}
				if (date != undefined && date != '') {		
					soFlash.addVariable("date",	date);
				}
				else if (bool == true) {
					soFlash.addVariable("date",'');
				}
				if (author != undefined && author != '') {		
					soFlash.addVariable("author",author);
				}
				else if (bool == true) {
					soFlash.addVariable("author",'');
				}				
				if (link != undefined && link != '') {						
					soFlash.addVariable("link", link);
				}
				soFlash.write("videoFlash");
			}
		} 		
	});	
}
