var xmlhttpNews;
var news_id_selected = null;
var image_id_selected = null;
var video_id_selected = null;
var quiniela_id_selected = null;

function createAjaxNews()
{ 
	try 
	{ 
		xmlhttpNews=new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	catch(e)
	{ 
		try
		{ 
			xmlhttpNews=new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch(E) { xmlhttp=false; }
	}
	if (!xmlhttpNews && typeof XMLHttpRequest!='undefined') { xmlhttpNews = new XMLHttpRequest(); } 
}

function PaginaVideosGen(nropagina,sorted_field,channel_id)
{
	
 divContenido = document.getElementById('tabContainer');
	
		var div_comment = document.getElementById("div_comment_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_comment != null)
    layerHeight = (div.offsetTop - div_comment.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Videos. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_comment != null)
		{
				document.getElementById("transSmallComments").style.top = div_comment.style.top;
				document.getElementById("transSmallComments").style.left = div_comment.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_comment.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_comment.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		
		
		var url= './ajax_videos.php?action=load_videos_gen&pag='+nropagina+'&sort='+sorted_field+'&channel_id='+channel_id;
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("comments_with_paginate").innerHTML = xmlhttpNews.responseText;																		
			}
		}
		xmlhttpNews.send(null);	 
		
}

function PaginaVideosAll(nropagina,sorted_field)
{

	 divContenido = document.getElementById('tabContainer');
	
		var div_comment = document.getElementById("div_comment_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_comment != null)
    layerHeight = (div.offsetTop - div_comment.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Videos. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_comment != null)
		{
				document.getElementById("transSmallComments").style.top = div_comment.style.top;
				document.getElementById("transSmallComments").style.left = div_comment.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_comment.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_comment.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		
		
		var url= './ajax_videos.php?action=load_videos_all&pag='+nropagina+'&sort='+sorted_field;
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("comments_with_paginate").innerHTML = xmlhttpNews.responseText;																		
			}
		}
		xmlhttpNews.send(null);	 
	
}

function PaginaBlogsAll(nropagina,sorted_field)
{

	 divContenido = document.getElementById('tabContainer');
	
		var div_comment = document.getElementById("div_comment_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_comment != null)
    layerHeight = (div.offsetTop - div_comment.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Blogs. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_comment != null)
		{
				document.getElementById("transSmallComments").style.top = div_comment.style.top;
				document.getElementById("transSmallComments").style.left = div_comment.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_comment.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_comment.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		
		
		var url= './ajax_videos.php?action=load_blogs_all&pag='+nropagina+'&sort='+sorted_field;
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("comments_with_paginate").innerHTML = xmlhttpNews.responseText;																		
			}
		}
		xmlhttpNews.send(null);	 
	
}

function PaginaVideosAccount(nropagina,sorted_field)
{

	 divContenido = document.getElementById('tabContainer');
	
		var div_comment = document.getElementById("div_comment_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_comment != null)
    layerHeight = (div.offsetTop - div_comment.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Videos. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_comment != null)
		{
				document.getElementById("transSmallComments").style.top = div_comment.style.top;
				document.getElementById("transSmallComments").style.left = div_comment.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_comment.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_comment.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		
		
		var url= './ajax_videos.php?action=load_videos_account&pag='+nropagina+'&sort='+sorted_field;
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("comments_with_paginate").innerHTML = xmlhttpNews.responseText;																		
			}
		}
		xmlhttpNews.send(null);	 
	
}

function loadCommentsQuiniela(quiniela_id)
{
	 quiniela_id_selected = quiniela_id;
		
  divContenido = document.getElementById('tabContainer');
	
		var div_comment = document.getElementById("div_comment_all_"+quiniela_id);
		var div = document.getElementById("paginate_bottom_insert_comment_"+quiniela_id);

  var layerHeight = 100;
		if (div_comment != null)
    layerHeight = (div.offsetTop - div_comment.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px; valign=middle;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Comentarios. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText_"+quiniela_id).innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments_"+quiniela_id).style.width = 618;
					document.getElementById("transSmallComments_"+quiniela_id).style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText_"+quiniela_id).style.width = 618;
					document.getElementById("transSmallCommentsText_"+quiniela_id).style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments_"+quiniela_id).style.width = 638;
					document.getElementById("transSmallComments_"+quiniela_id).style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText_"+quiniela_id).style.width = 638;
					document.getElementById("transSmallCommentsText_"+quiniela_id).style.height = layerHeight;						
		}
			
	
 	if (div_comment != null)
		{
				document.getElementById("transSmallComments_"+quiniela_id).style.top = div_comment.style.top;
				document.getElementById("transSmallComments_"+quiniela_id).style.left = div_comment.style.left;		
				document.getElementById("transSmallCommentsText_"+quiniela_id).style.top = div_comment.style.top;
				document.getElementById("transSmallCommentsText_"+quiniela_id).style.left = div_comment.style.left;	
		}
		
		document.getElementById("transSmallComments_"+quiniela_id).style.display="block";		
		
		
		var url= './ajax.php?action=load_comment_quinielas&quiniela_id='+quiniela_id;
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
      sleep(1000);			    
						document.getElementById("div_comment_all_"+quiniela_id_selected).innerHTML=xmlhttpNews.responseText;				
										
			}
		}
		xmlhttpNews.send(null);	 		
		
}

function hideQuiniComments(quiniela_id)
{
	  document.getElementById("comments_contents_"+quiniela_id).style.display ="none";
   document.getElementById("hide_comm_id_"+quiniela_id).innerHTML = '<a href="javascript:;" onclick="javascript:showQuiniComments('+quiniela_id+')" class="menuCat">Ver comentarios</a>';			
}
function showQuiniComments(quiniela_id)
{
	  document.getElementById("comments_contents_"+quiniela_id).style.display ="block";
   document.getElementById("hide_comm_id_"+quiniela_id).innerHTML = '<a href="javascript:;" onclick="javascript:hideQuiniComments('+quiniela_id+')" class="menuCat">Ocultar comentarios</a>';			
}

function PaginaNews(nropagina,news_id)
{
	 news_id_selected = news_id;
	
	 divContenido = document.getElementById('tabContainer');
	
		var div_comment = document.getElementById("div_comment_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_comment != null)
    layerHeight = (div.offsetTop - div_comment.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Comentarios. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_comment != null)
		{
				document.getElementById("transSmallComments").style.top = div_comment.style.top;
				document.getElementById("transSmallComments").style.left = div_comment.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_comment.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_comment.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		
		
		var url= './ajax.php?action=load_comment&pag='+nropagina+'&news_id='+news_id_selected;
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("comments_with_paginate").innerHTML=xmlhttpNews.responseText;	
						
						if ( document.getElementById("totalComments") != null)
						{
								var totalComments = document.getElementById("totalComments").value;										
								if (totalComments == '1')
								{
											//document.getElementById("number_comments_div_sup").innerHTML = totalComments + ' Comentario';
											document.getElementById("number_comments_div").innerHTML = totalComments + ' Comentario';									
								}
								else
								{
											//document.getElementById("number_comments_div_sup").innerHTML = totalComments + ' Comentarios';
											document.getElementById("number_comments_div").innerHTML = totalComments + ' Comentarios';
								}
						}
						
			}
		}
		xmlhttpNews.send(null);	 
	
}

function PaginaVideos(nropagina,video_id)
{
	 video_id_selected = video_id;
	
	 divContenido = document.getElementById('tabContainer');
	
		var div_comment = document.getElementById("div_comment_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_comment != null)
    layerHeight = (div.offsetTop - div_comment.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Comentarios. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_comment != null)
		{
				document.getElementById("transSmallComments").style.top = div_comment.style.top;
				document.getElementById("transSmallComments").style.left = div_comment.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_comment.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_comment.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		
		
		var url= './ajax.php?action=load_comment_videos&pag='+nropagina+'&video_id='+video_id_selected;
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("comments_with_paginate").innerHTML=xmlhttpNews.responseText;	
						
						if ( document.getElementById("totalComments") != null)
						{
								var totalComments = document.getElementById("totalComments").value;										
								if (totalComments == '1')
								{
											//document.getElementById("number_comments_div_sup").innerHTML = totalComments + ' Comentario';
											document.getElementById("number_comments_div").innerHTML = totalComments + ' Comentario';									
								}
								else
								{
											//document.getElementById("number_comments_div_sup").innerHTML = totalComments + ' Comentarios';
											document.getElementById("number_comments_div").innerHTML = totalComments + ' Comentarios';
								}
						}
						
			}
		}
		xmlhttpNews.send(null);	 
	
}


function PaginaBlogs(nropagina,blog_id)
{
	 video_id_selected = blog_id;
	
	 divContenido = document.getElementById('tabContainer');
	
		var div_comment = document.getElementById("div_comment_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_comment != null)
    layerHeight = (div.offsetTop - div_comment.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Comentarios. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_comment != null)
		{
				document.getElementById("transSmallComments").style.top = div_comment.style.top;
				document.getElementById("transSmallComments").style.left = div_comment.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_comment.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_comment.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		
		
		var url= './ajax.php?action=load_comment_blogs&pag='+nropagina+'&blog_id='+video_id_selected;
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("comments_with_paginate").innerHTML=xmlhttpNews.responseText;	
						
						if ( document.getElementById("totalComments") != null)
						{
								var totalComments = document.getElementById("totalComments").value;										
								if (totalComments == '1')
								{
											//document.getElementById("number_comments_div_sup").innerHTML = totalComments + ' Comentario';
											document.getElementById("number_comments_div").innerHTML = totalComments + ' Comentario';									
								}
								else
								{
											//document.getElementById("number_comments_div_sup").innerHTML = totalComments + ' Comentarios';
											document.getElementById("number_comments_div").innerHTML = totalComments + ' Comentarios';
								}
						}
						
			}
		}
		xmlhttpNews.send(null);	 
	
}



function PaginaNewsImages(nropagina,image_id)
{
	 image_id_selected = image_id;
	
	 divContenido = document.getElementById('tabContainer');
	
		var div_comment = document.getElementById("div_comment_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_comment != null)
    layerHeight = (div.offsetTop - div_comment.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Comentarios. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_comment != null)
		{
				document.getElementById("transSmallComments").style.top = div_comment.style.top;
				document.getElementById("transSmallComments").style.left = div_comment.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_comment.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_comment.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		
		
		var url= './ajax.php?action=load_comment_images&pag='+nropagina+'&image_id='+image_id_selected;
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("comments_with_paginate").innerHTML=xmlhttpNews.responseText;	
						
						if ( document.getElementById("totalComments") != null)
						{
								var totalComments = document.getElementById("totalComments").value;										
								if (totalComments == '1')
								{
											//document.getElementById("number_comments_div_sup").innerHTML = totalComments + ' Comentario';
											document.getElementById("number_comments_div").innerHTML = totalComments + ' Comentario';									
								}
								else
								{
											//document.getElementById("number_comments_div_sup").innerHTML = totalComments + ' Comentarios';
											document.getElementById("number_comments_div").innerHTML = totalComments + ' Comentarios';
								}
						}
						
			}
		}
		xmlhttpNews.send(null);	 
	
}

function PaginaAllNewsQuery(nropagina,query,date_from,date_to,news_content)
{
			var div_news = document.getElementById("div_news_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_news != null)
    layerHeight = (div.offsetTop - div_news.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Noticias. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_news != null)
		{
				document.getElementById("transSmallComments").style.top = div_news.style.top;
				document.getElementById("transSmallComments").style.left = div_news.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_news.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_news.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		
		
		var url= './ajax.php?action=load_news&pag='+nropagina+'&query='+encodeURIComponent(query)+'&date_from='+date_from+'&date_to='+date_to+'&news_content='+news_content;	 				
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("news_with_paginate").innerHTML=xmlhttpNews.responseText;																		
			}
		}
		xmlhttpNews.send(null);	 
}
function PaginaAllNewsCategories(nropagina,cat_to_search)
{
	 var div_news = document.getElementById("div_news_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_news != null)
    layerHeight = (div.offsetTop - div_news.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Noticias. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_news != null)
		{
				document.getElementById("transSmallComments").style.top = div_news.style.top;
				document.getElementById("transSmallComments").style.left = div_news.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_news.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_news.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		
		
		var url= './ajax.php?action=load_news_categories&pag='+nropagina+'&cat_to_search='+cat_to_search;
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("news_with_paginate").innerHTML=xmlhttpNews.responseText;																		
			}
		}
		xmlhttpNews.send(null);	 
		
}

function PaginaAllNews(nropagina)
{
	
		var div_news = document.getElementById("div_news_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_news != null)
    layerHeight = (div.offsetTop - div_news.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Noticias. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_news != null)
		{
				document.getElementById("transSmallComments").style.top = div_news.style.top;
				document.getElementById("transSmallComments").style.left = div_news.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_news.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_news.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		
		
		var url= './ajax.php?action=load_news&pag='+nropagina;
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("news_with_paginate").innerHTML=xmlhttpNews.responseText;																		
			}
		}
		xmlhttpNews.send(null);	 
	
}


function PaginaAllTeams(nropagina,query,categories_search,teams_content)
{
	
		var div_news = document.getElementById("div_news_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_news != null)
    layerHeight = (div.offsetTop - div_news.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Equipos. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_news != null)
		{
				document.getElementById("transSmallComments").style.top = div_news.style.top;
				document.getElementById("transSmallComments").style.left = div_news.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_news.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_news.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		
		
		var url= './ajax.php?action=load_teams&pag='+nropagina+'&query='+encodeURIComponent(query)+'&categories_search='+categories_search+'&teams_content='+teams_content;

		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("news_with_paginate").innerHTML=xmlhttpNews.responseText;																		
			}
		}
		xmlhttpNews.send(null);	 
	
}
function PaginaAllImagesQuery(nropagina,query,date_from,date_to,news_content)
{
	
		var div_images = document.getElementById("div_image_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_images != null)
    layerHeight = (div.offsetTop - div_images.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Fotos. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_images != null)
		{
				document.getElementById("transSmallComments").style.top = div_images.style.top;
				document.getElementById("transSmallComments").style.left = div_images.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_images.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_images.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		

		
		var url= './ajax.php?action=load_images&pag='+nropagina+'&query='+encodeURIComponent(query)+'&date_from='+date_from+'&date_to='+date_to+'&news_content='+news_content;
		

		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("image_with_paginate").innerHTML=xmlhttpNews.responseText;																		
			}
		}
		xmlhttpNews.send(null);	 
		
}


function PaginaAllVideosQuery(nropagina,query,date_from,date_to,news_content)
{
	
		var div_images = document.getElementById("div_image_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_images != null)
    layerHeight = (div.offsetTop - div_images.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Fotos. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_images != null)
		{
				document.getElementById("transSmallComments").style.top = div_images.style.top;
				document.getElementById("transSmallComments").style.left = div_images.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_images.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_images.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		

		
		var url= './ajax_videos.php?action=load_videos_search&pag='+nropagina+'&query='+encodeURIComponent(query)+'&date_from='+date_from+'&date_to='+date_to+'&news_content='+news_content;
		

		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("image_with_paginate").innerHTML=xmlhttpNews.responseText;																		
			}
		}
		xmlhttpNews.send(null);	 
		
}

function PaginaAllImages(nropagina)
{
	
		var div_images = document.getElementById("div_image_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_images != null)
    layerHeight = (div.offsetTop - div_images.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Fotos. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_images != null)
		{
				document.getElementById("transSmallComments").style.top = div_images.style.top;
				document.getElementById("transSmallComments").style.left = div_images.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_images.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_images.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		

		
		var url= './ajax.php?action=load_images&pag='+nropagina;
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("image_with_paginate").innerHTML=xmlhttpNews.responseText;																		
			}
		}
		xmlhttpNews.send(null);	 
	
}

function PaginaAllImagesCategories(nropagina, categories_id)
{
	
		var div_images = document.getElementById("div_image_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_images != null)
    layerHeight = (div.offsetTop - div_images.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Fotos. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_images != null)
		{
				document.getElementById("transSmallComments").style.top = div_images.style.top;
				document.getElementById("transSmallComments").style.left = div_images.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_images.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_images.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		

		
		var url= './ajax.php?action=load_images_categories&pag='+nropagina+'&categories_id='+categories_id;
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("image_with_paginate").innerHTML=xmlhttpNews.responseText;																		
			}
		}
		xmlhttpNews.send(null);	 
	
}


function PaginaAllImagesTeams(nropagina, team_id)
{
	
		var div_images = document.getElementById("div_image_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_images != null)
    layerHeight = (div.offsetTop - div_images.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Fotos. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_images != null)
		{
				document.getElementById("transSmallComments").style.top = div_images.style.top;
				document.getElementById("transSmallComments").style.left = div_images.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_images.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_images.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		

		
		var url= './ajax.php?action=load_images_team&pag='+nropagina+'&team_id='+team_id;
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("image_with_paginate").innerHTML=xmlhttpNews.responseText;																		
			}
		}
		xmlhttpNews.send(null);	 
	
}

function PaginaAllImagesUser(nropagina, customers_id)
{
	
		var div_images = document.getElementById("div_image_all");
		var div = document.getElementById("paginate_bottom");

  var layerHeight = 100;
		if (div_images != null)
    layerHeight = (div.offsetTop - div_images.offsetTop) - 10;
				  
		var message="<table border='0' cellpadding='0' cellspacing='0'><tr><td valign='middle' style='height:"+layerHeight+"px;' align='center'><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Cargando Fotos. Por favor espere.</b></span></td></tr></table>";
				
		document.getElementById("transSmallCommentsText").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallComments").style.width = 640;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 640;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallComments").style.width = 660;
					document.getElementById("transSmallComments").style.height =  layerHeight;		
					document.getElementById("transSmallCommentsText").style.width = 660;
					document.getElementById("transSmallCommentsText").style.height = layerHeight;						
		}
			
	
 	if (div_images != null)
		{
				document.getElementById("transSmallComments").style.top = div_images.style.top;
				document.getElementById("transSmallComments").style.left = div_images.style.left;		
				document.getElementById("transSmallCommentsText").style.top = div_images.style.top;
				document.getElementById("transSmallCommentsText").style.left = div_images.style.left;	
		}
		
		document.getElementById("transSmallComments").style.display="block";		

		
		var url= './ajax.php?action=load_images_user&pag='+nropagina+'&customers_id='+customers_id;
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{				
						document.getElementById("transSmallComments").style.display="none";
						sleep(1000);
						document.getElementById("image_with_paginate").innerHTML=xmlhttpNews.responseText;																		
			}
		}
		xmlhttpNews.send(null);	 
	
}

function valorarVideo(video_id,valor)
{
	
		video_id_selected = video_id;
				
  var url= './ajax.php?action=value_video&video_id='+video_id+'&valor='+valor;

		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{					
						document.getElementById("valoracionNoticia").innerHTML=xmlhttpNews.responseText;									
			}
		}
		xmlhttpNews.send(null);	 
		
}

function valorarBlog(blog_id,valor)
{
	
		video_id_selected = blog_id;
				
  var url= './ajax.php?action=value_blog&blog_id='+blog_id+'&valor='+valor;

		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{					
						document.getElementById("valoracionNoticia").innerHTML=xmlhttpNews.responseText;									
			}
		}
		xmlhttpNews.send(null);	 
		
}

function valorarNoticia(news_id,valor)
{
	
		news_id_selected = news_id;
				
  var url= './ajax.php?action=value_news&news_id='+news_id+'&valor='+valor;

		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{					
						document.getElementById("valoracionNoticia").innerHTML=xmlhttpNews.responseText;									
			}
		}
		xmlhttpNews.send(null);	 
		
}

function valorarImagen(image_id,valor)
{
	
		image_id_selected = image_id;
				
  var url= './ajax.php?action=value_news_image&image_id='+image_id+'&valor='+valor;

		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{					
						document.getElementById("valoracionNoticia").innerHTML=xmlhttpNews.responseText;									
			}
		}
		xmlhttpNews.send(null);	 
		
}


function sendMailNews(news_id)
{
	
		news_id_selected = news_id;
		var message="<br/><br/><br/><br/><br/><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Enviando Peticion. Por favor espere.</b></span><br><br>";
				
		var div_comment = document.getElementById("div_enviar");
		
		document.getElementById("transSmallSendMessageEdit").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallSendEdit").style.width = 640;
					document.getElementById("transSmallSendEdit").style.height =  214;		
					document.getElementById("transSmallSendMessageEdit").style.width = 640;
					document.getElementById("transSmallSendMessageEdit").style.height = 214;			
		}
		else
		{
					document.getElementById("transSmallSendEdit").style.width = 660;
					document.getElementById("transSmallSendEdit").style.height =  244;		
					document.getElementById("transSmallSendMessageEdit").style.width = 660;
					document.getElementById("transSmallSendMessageEdit").style.height = 244;						
		}
			

		document.getElementById("transSmallSendEdit").style.top = div_comment.style.top;
		document.getElementById("transSmallSendEdit").style.left = div_comment.style.left;		
		

		document.getElementById("transSmallSendMessageEdit").style.top = div_comment.style.top;
		document.getElementById("transSmallSendMessageEdit").style.left = div_comment.style.left;		
		
		document.getElementById("transSmallSendEdit").style.display="block";	
			
		var to_mail = document.getElementById("to_mail").value;
		var to_name = document.getElementById("to_name").value;	
		var from_mail = document.getElementById('from_mail').value;
		var from_name = document.getElementById('from_name').value;
		var from_comment = document.getElementById('from_comment').value;
		
  var url= './ajax.php?action=send_news&news_id='+news_id+'&to_mail='+encodeURIComponent(to_mail)+'&to_name='+encodeURIComponent(to_name)+'&from_mail='+encodeURIComponent(from_mail)+'&from_name='+encodeURIComponent(from_name)+'&from_comment='+encodeURIComponent(from_comment);
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{
						document.getElementById('img_captcha').src = "./captcha.php?"+Math.random()+"="+Math.random();
						document.getElementById("code").value = "";
						var message = '<table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="div_select_attr_header"></div></td></tr><tr><td><div><table cellpadding="0" cellspacing="0" border="0"><tr><td class="div_edit_cart_right" width="9"></td><td width="438"><table cellpadding="0" cellspacing="0" border="0" class="div_table_desc" width="438"><tr><td>'+xmlhttpNews.responseText+'</td></tr></table></td><td class="div_edit_cart_left" width="9"></td></tr></table></div></td></tr><tr><td><div class="div_edit_cart_footer" align="center"></div></td></tr></table>';
						
						document.getElementById("transSmallSendMessageEdit").innerHTML=message;									
			}
		}
		xmlhttpNews.send(null);	 
		
}

function sendMailImage(image_id)
{
	
		image_id_selected = image_id;
		var message="<br/><br/><br/><br/><br/><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Enviando Peticion. Por favor espere.</b></span><br><br>";
				
		var div_comment = document.getElementById("div_enviar");
		
		document.getElementById("transSmallSendMessageEdit").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallSendEdit").style.width = 640;
					document.getElementById("transSmallSendEdit").style.height =  214;		
					document.getElementById("transSmallSendMessageEdit").style.width = 640;
					document.getElementById("transSmallSendMessageEdit").style.height = 214;			
		}
		else
		{
					document.getElementById("transSmallSendEdit").style.width = 660;
					document.getElementById("transSmallSendEdit").style.height =  244;		
					document.getElementById("transSmallSendMessageEdit").style.width = 660;
					document.getElementById("transSmallSendMessageEdit").style.height = 244;						
		}
			

		document.getElementById("transSmallSendEdit").style.top = div_comment.style.top;
		document.getElementById("transSmallSendEdit").style.left = div_comment.style.left;		
		

		document.getElementById("transSmallSendMessageEdit").style.top = div_comment.style.top;
		document.getElementById("transSmallSendMessageEdit").style.left = div_comment.style.left;		
		
		document.getElementById("transSmallSendEdit").style.display="block";	
			
		var to_mail = document.getElementById("to_mail").value;
		var to_name = document.getElementById("to_name").value;	
		var from_mail = document.getElementById('from_mail').value;
		var from_name = document.getElementById('from_name').value;
		var from_comment = document.getElementById('from_comment').value;
		
  var url= './ajax.php?action=send_image&image_id='+image_id+'&to_mail='+encodeURIComponent(to_mail)+'&to_name='+encodeURIComponent(to_name)+'&from_mail='+encodeURIComponent(from_mail)+'&from_name='+encodeURIComponent(from_name)+'&from_comment='+encodeURIComponent(from_comment);
		
		createAjaxNews();
		xmlhttpNews.open("GET", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{
						document.getElementById('img_captcha').src = "./captcha.php?"+Math.random()+"="+Math.random();
						document.getElementById("code").value = "";
						var message = '<table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="div_select_attr_header"></div></td></tr><tr><td><div><table cellpadding="0" cellspacing="0" border="0"><tr><td class="div_edit_cart_right" width="9"></td><td width="438"><table cellpadding="0" cellspacing="0" border="0" class="div_table_desc" width="438"><tr><td>'+xmlhttpNews.responseText+'</td></tr></table></td><td class="div_edit_cart_left" width="9"></td></tr></table></div></td></tr><tr><td><div class="div_edit_cart_footer" align="center"></div></td></tr></table>';
						
						document.getElementById("transSmallSendMessageEdit").innerHTML=message;									
			}
		}
		xmlhttpNews.send(null);	 
		
}

function sendCommentVideo(video_id)
{
		video_id_selected = video_id;
		var message="<br/><br/><br/><br/><br/><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Enviando Peticion. Por favor espere.</b></span><br><br>";
				
		var div_comment = document.getElementById("div_comment");
		
		var div = document.getElementById("paginate_bottom_insert_comment");

  var layerHeight = 100;
		if (div_comment != null)
    layerHeight = (div.offsetTop - div_comment.offsetTop) - 10;				
		
		document.getElementById("transSmallMessageEdit").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallEdit").style.width = 640;
					document.getElementById("transSmallEdit").style.height =  layerHeight;		
					document.getElementById("transSmallMessageEdit").style.width = 640;
					document.getElementById("transSmallMessageEdit").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallEdit").style.width = 660;
					document.getElementById("transSmallEdit").style.height =  layerHeight;		
					document.getElementById("transSmallMessageEdit").style.width = 660;
					document.getElementById("transSmallMessageEdit").style.height = layerHeight;						
		}
			

		document.getElementById("transSmallEdit").style.top = div_comment.style.top;
		document.getElementById("transSmallEdit").style.left = div_comment.style.left;		
		

		document.getElementById("transSmallMessageEdit").style.top = div_comment.style.top;
		document.getElementById("transSmallMessageEdit").style.left = div_comment.style.left;		
		
		document.getElementById("transSmallEdit").style.display="block";	
		
		var comment_name = document.getElementById("comment_name").value;
		var comment_comment = document.getElementById("comment_comment").value;	
		var code = document.getElementById('code').value;
		var comment_priv = document.getElementById('comment_priv');
		
		if (comment_priv.checked)
		 comment_priv = 1;
		else
		 comment_priv = 0;		
			
		var ed = tinyMCE.get('comment_comment');
								
		c_1 = new String(ed.getContent());
	 c_1 = c_1.replace("\n","");
  c_1 = c_1.replace("\r","");
	 c_1 = c_1.replace("<br>","");
  c_1 = c_1.replace("<br \>","");	
		
		var texto = c_1.toString();						
		
  var url= './ajax.php?action=insert_comment_video&video_id='+video_id+'&comment_name='+encodeURIComponent(comment_name)+'&code='+encodeURIComponent(code)+'&comment_priv='+comment_priv;
		var params = 'comment_comment='+encodeURIComponent(texto);		
		
		createAjaxNews();
		xmlhttpNews.open("POST", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{
						document.getElementById('img_captcha').src = "./captcha.php?"+Math.random()+"="+Math.random();
						document.getElementById("code").value = "";
						var message = '<table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="div_select_attr_header"></div></td></tr><tr><td><div><table cellpadding="0" cellspacing="0" border="0"><tr><td class="div_edit_cart_right" width="9"></td><td width="438"><table cellpadding="0" cellspacing="0" border="0" class="div_table_desc" width="438"><tr><td>'+xmlhttpNews.responseText+'</td></tr></table></td><td class="div_edit_cart_left" width="9"></td></tr></table></div></td></tr><tr><td><div class="div_edit_cart_footer" align="center"></div></td></tr></table>';
						
						document.getElementById("transSmallMessageEdit").innerHTML=message;									
			}
		}
		xmlhttpNews.send(params);	 
		
}

function sendCommentBlog(blog_id)
{
		video_id_selected = blog_id;
		var message="<br/><br/><br/><br/><br/><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Enviando Peticion. Por favor espere.</b></span><br><br>";
				
		var div_comment = document.getElementById("div_comment");
		
		var div = document.getElementById("paginate_bottom_insert_comment");

  var layerHeight = 100;
		if (div_comment != null)
    layerHeight = (div.offsetTop - div_comment.offsetTop) - 10;		
		
		document.getElementById("transSmallMessageEdit").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallEdit").style.width = 640;
					document.getElementById("transSmallEdit").style.height =  layerHeight;		
					document.getElementById("transSmallMessageEdit").style.width = 640;
					document.getElementById("transSmallMessageEdit").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallEdit").style.width = 660;
					document.getElementById("transSmallEdit").style.height =  layerHeight;		
					document.getElementById("transSmallMessageEdit").style.width = 660;
					document.getElementById("transSmallMessageEdit").style.height = layerHeight;						
		}
			

		document.getElementById("transSmallEdit").style.top = div_comment.style.top;
		document.getElementById("transSmallEdit").style.left = div_comment.style.left;		
		

		document.getElementById("transSmallMessageEdit").style.top = div_comment.style.top;
		document.getElementById("transSmallMessageEdit").style.left = div_comment.style.left;		
		
		document.getElementById("transSmallEdit").style.display="block";	
		
		var comment_name = document.getElementById("comment_name").value;
		var comment_comment = document.getElementById("comment_comment").value;	
		var code = document.getElementById('code').value;
		var comment_priv = document.getElementById('comment_priv');
		
		if (comment_priv.checked)
		 comment_priv = 1;
		else
		 comment_priv = 0;		
		
		var ed = tinyMCE.get('comment_comment');
								
		c_1 = new String(ed.getContent());
	 c_1 = c_1.replace("\n","");
  c_1 = c_1.replace("\r","");
	 c_1 = c_1.replace("<br>","");
  c_1 = c_1.replace("<br \>","");	
		
		var texto = c_1.toString();

  var url= './ajax.php?action=insert_comment_blog&blog_id='+blog_id+'&comment_name='+encodeURIComponent(comment_name)+'&code='+encodeURIComponent(code)+'&comment_priv='+comment_priv;
		var params = 'comment_comment='+encodeURIComponent(texto);
		
		createAjaxNews();
		xmlhttpNews.open("POST", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{
						document.getElementById('img_captcha').src = "./captcha.php?"+Math.random()+"="+Math.random();
						document.getElementById("code").value = "";
						var message = '<table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="div_select_attr_header"></div></td></tr><tr><td><div><table cellpadding="0" cellspacing="0" border="0"><tr><td class="div_edit_cart_right" width="9"></td><td width="438"><table cellpadding="0" cellspacing="0" border="0" class="div_table_desc" width="438"><tr><td>'+xmlhttpNews.responseText+'</td></tr></table></td><td class="div_edit_cart_left" width="9"></td></tr></table></div></td></tr><tr><td><div class="div_edit_cart_footer" align="center"></div></td></tr></table>';
						
						document.getElementById("transSmallMessageEdit").innerHTML=message;									
			}
		}
		xmlhttpNews.send(params);	 
		
}

function sendCommentQuiniela(quiniela_id)
{
	
  quiniela_id_selected = quiniela_id;
		var message="<br/><br/><br/><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Enviando Peticion. Por favor espere.</b></span><br>";
				
		var div_comment = document.getElementById("div_comment_"+quiniela_id);
		
		var div = document.getElementById("paginate_bottom_insert_comment_"+quiniela_id);

  var layerHeight = 100;
		if (div_comment != null)
    layerHeight = (div.offsetTop - div_comment.offsetTop) - 5;		
		
		
		document.getElementById("transSmallMessageEdit_"+quiniela_id).innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallEdit_"+quiniela_id).style.width = 618;
					document.getElementById("transSmallEdit_"+quiniela_id).style.height =  layerHeight;		
					document.getElementById("transSmallMessageEdit_"+quiniela_id).style.width = 618;
					document.getElementById("transSmallMessageEdit_"+quiniela_id).style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallEdit_"+quiniela_id).style.width = 638;
					document.getElementById("transSmallEdit_"+quiniela_id).style.height =  layerHeight;		
					document.getElementById("transSmallMessageEdit_"+quiniela_id).style.width = 638;
					document.getElementById("transSmallMessageEdit_"+quiniela_id).style.height = layerHeight;						
		}
			

		document.getElementById("transSmallEdit_"+quiniela_id).style.top = div_comment.style.top;
		document.getElementById("transSmallEdit_"+quiniela_id).style.left = div_comment.style.left;		
		

		document.getElementById("transSmallMessageEdit_"+quiniela_id).style.top = div_comment.style.top;
		document.getElementById("transSmallMessageEdit_"+quiniela_id).style.left = div_comment.style.left;		
		
		document.getElementById("transSmallEdit_"+quiniela_id).style.display="block";	
		
		
		var comment_name = document.getElementById("comment_name_"+quiniela_id).value;
		var comment_comment = document.getElementById("comment_comment_"+quiniela_id).value;			
			
								
		c_1 = new String(comment_comment);
	 c_1 = c_1.replace("\n","");
  c_1 = c_1.replace("\r","");
	 c_1 = c_1.replace("<br>","");
  c_1 = c_1.replace("<br \>","");	
		
		var texto = c_1.toString();			
		
  var url= './ajax.php?action=insert_comment_quiniela&quiniela_id='+quiniela_id+'&comment_name='+encodeURIComponent(comment_name);		
		var params = 'comment_comment='+encodeURIComponent(texto);
		
		createAjaxNews();
		xmlhttpNews.open("POST", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{						
			
			
						var message = '<table border="0" cellpadding="0" cellspacing="0"><tr><td style="border:none">'+xmlhttpNews.responseText+'</td></tr></table>';

						document.getElementById("transSmallMessageEdit_"+quiniela_id_selected).innerHTML=message;									
			}
		}
		xmlhttpNews.send(params);	 
		
}
function sendCommentQuinielawithComments(quiniela_id)
{
	
  quiniela_id_selected = quiniela_id;
		var message="<br/><br/><br/><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Enviando Peticion. Por favor espere.</b></span><br>";
				
		var div_comment = document.getElementById("escribe_tu_comentario_"+quiniela_id);
		
		var div = document.getElementById("paginate_bottom_insert_comment_"+quiniela_id);

  var layerHeight = 75;
	//	if (div_comment != null)
 //   layerHeight = (div.offsetTop - div_comment.offsetTop) - 5;		
		
		
		document.getElementById("transSmallMessageEdit_"+quiniela_id).innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallEdit_"+quiniela_id).style.width = 618;
					document.getElementById("transSmallEdit_"+quiniela_id).style.height =  layerHeight;		
					document.getElementById("transSmallMessageEdit_"+quiniela_id).style.width = 618;
					document.getElementById("transSmallMessageEdit_"+quiniela_id).style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallEdit_"+quiniela_id).style.width = 638;
					document.getElementById("transSmallEdit_"+quiniela_id).style.height =  layerHeight;		
					document.getElementById("transSmallMessageEdit_"+quiniela_id).style.width = 638;
					document.getElementById("transSmallMessageEdit_"+quiniela_id).style.height = layerHeight;						
		}
			

		document.getElementById("transSmallEdit_"+quiniela_id).style.top = div_comment.style.top;
		document.getElementById("transSmallEdit_"+quiniela_id).style.left = div_comment.style.left;		
		

		document.getElementById("transSmallMessageEdit_"+quiniela_id).style.top = div_comment.style.top;
		document.getElementById("transSmallMessageEdit_"+quiniela_id).style.left = div_comment.style.left;		
		
		document.getElementById("transSmallEdit_"+quiniela_id).style.display="block";	
		
		
		var comment_name = document.getElementById("comment_name_"+quiniela_id).value;
		var comment_comment = document.getElementById("comment_comment_"+quiniela_id).value;			
			
								
		c_1 = new String(comment_comment);
	 c_1 = c_1.replace("\n","");
  c_1 = c_1.replace("\r","");
	 c_1 = c_1.replace("<br>","");
  c_1 = c_1.replace("<br \>","");	
		
		var texto = c_1.toString();			

  var url= './ajax.php?action=insert_comment_quiniela&quiniela_id='+quiniela_id+'&comment_name='+encodeURIComponent(comment_name);		
		var params = 'comment_comment='+encodeURIComponent(texto);
		
		createAjaxNews();
		xmlhttpNews.open("POST", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{						
						  
						var message = '<table border="0" cellpadding="0" cellspacing="0"><tr><td style="border:none">'+xmlhttpNews.responseText+'</td></tr></table>';

						document.getElementById("transSmallMessageEdit_"+quiniela_id_selected).innerHTML=message;									
			}
		}
		xmlhttpNews.send(params);	 
		
}

function sendComment(news_id)
{
		news_id_selected = news_id;
		var message="<br/><br/><br/><br/><br/><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Enviando Peticion. Por favor espere.</b></span><br><br>";
				
		var div_comment = document.getElementById("div_comment");
		
		var div = document.getElementById("paginate_bottom_insert_comment");

  var layerHeight = 100;
		if (div_comment != null)
    layerHeight = (div.offsetTop - div_comment.offsetTop) - 10;		
		
		
		document.getElementById("transSmallMessageEdit").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallEdit").style.width = 640;
					document.getElementById("transSmallEdit").style.height =  layerHeight;		
					document.getElementById("transSmallMessageEdit").style.width = 640;
					document.getElementById("transSmallMessageEdit").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallEdit").style.width = 660;
					document.getElementById("transSmallEdit").style.height =  layerHeight;		
					document.getElementById("transSmallMessageEdit").style.width = 660;
					document.getElementById("transSmallMessageEdit").style.height = layerHeight;						
		}
			

		document.getElementById("transSmallEdit").style.top = div_comment.style.top;
		document.getElementById("transSmallEdit").style.left = div_comment.style.left;		
		

		document.getElementById("transSmallMessageEdit").style.top = div_comment.style.top;
		document.getElementById("transSmallMessageEdit").style.left = div_comment.style.left;		
		
		document.getElementById("transSmallEdit").style.display="block";	
		
		var comment_name = document.getElementById("comment_name").value;
		var comment_comment = document.getElementById("comment_comment").value;	
		var code = document.getElementById('code').value;
		var comment_priv = document.getElementById('comment_priv');
		
		if (comment_priv.checked)
		 comment_priv = 1;
		else
		 comment_priv = 0;		
			
		var ed = tinyMCE.get('comment_comment');
								
		c_1 = new String(ed.getContent());
	 c_1 = c_1.replace("\n","");
  c_1 = c_1.replace("\r","");
	 c_1 = c_1.replace("<br>","");
  c_1 = c_1.replace("<br \>","");	
		
		var texto = c_1.toString();			
		
  var url= './ajax.php?action=insert_comment&news_id='+news_id+'&comment_name='+encodeURIComponent(comment_name)+'&code='+encodeURIComponent(code)+'&comment_priv='+comment_priv;
		var params = 'comment_comment='+encodeURIComponent(texto);
		
		createAjaxNews();
		xmlhttpNews.open("POST", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{
						document.getElementById('img_captcha').src = "./captcha.php?"+Math.random()+"="+Math.random();
						document.getElementById("code").value = "";
						var message = '<table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="div_select_attr_header"></div></td></tr><tr><td><div><table cellpadding="0" cellspacing="0" border="0"><tr><td class="div_edit_cart_right" width="9"></td><td width="438"><table cellpadding="0" cellspacing="0" border="0" class="div_table_desc" width="438"><tr><td>'+xmlhttpNews.responseText+'</td></tr></table></td><td class="div_edit_cart_left" width="9"></td></tr></table></div></td></tr><tr><td><div class="div_edit_cart_footer" align="center"></div></td></tr></table>';
						
						document.getElementById("transSmallMessageEdit").innerHTML=message;									
			}
		}
		xmlhttpNews.send(params);	 
		
}

function sendCommentImage(image_id)
{
		image_id_selected = image_id;
		var message="<br/><br/><br/><br/><br/><img src='http://www.futbolsalanacional.es/images/ajax-loader.gif' alt='Enviando'><br/><br/><span class='text_news'><b>Enviando Peticion. Por favor espere.</b></span><br><br>";
				
		var div_comment = document.getElementById("div_comment");
		
		var div = document.getElementById("paginate_bottom_insert_comment");

  var layerHeight = 100;
		if (div_comment != null)
    layerHeight = (div.offsetTop - div_comment.offsetTop) - 10;				
		
		document.getElementById("transSmallMessageEdit").innerHTML=message;
		
		if (navigator.appName.indexOf("Explorer") != -1)
		{	
					document.getElementById("transSmallEdit").style.width = 640;
					document.getElementById("transSmallEdit").style.height =  layerHeight;		
					document.getElementById("transSmallMessageEdit").style.width = 640;
					document.getElementById("transSmallMessageEdit").style.height = layerHeight;			
		}
		else
		{
					document.getElementById("transSmallEdit").style.width = 660;
					document.getElementById("transSmallEdit").style.height =  layerHeight;		
					document.getElementById("transSmallMessageEdit").style.width = 660;
					document.getElementById("transSmallMessageEdit").style.height = layerHeight;						
		}
			

		document.getElementById("transSmallEdit").style.top = div_comment.style.top;
		document.getElementById("transSmallEdit").style.left = div_comment.style.left;		
		

		document.getElementById("transSmallMessageEdit").style.top = div_comment.style.top;
		document.getElementById("transSmallMessageEdit").style.left = div_comment.style.left;		
		
		document.getElementById("transSmallEdit").style.display="block";	
		
		var comment_name = document.getElementById("comment_name").value;
		var comment_comment = document.getElementById("comment_comment").value;	
		var code = document.getElementById('code').value;
		var comment_priv = document.getElementById('comment_priv');
		
		if (comment_priv.checked)
		 comment_priv = 1;
		else
		 comment_priv = 0;
			
		var ed = tinyMCE.get('comment_comment');
								
		c_1 = new String(ed.getContent());
	 c_1 = c_1.replace("\n","");
  c_1 = c_1.replace("\r","");
	 c_1 = c_1.replace("<br>","");
  c_1 = c_1.replace("<br \>","");	
		
		var texto = c_1.toString();					
		
		
  var url= './ajax.php?action=insert_comment_image&image_id='+image_id+'&comment_name='+encodeURIComponent(comment_name)+'&code='+encodeURIComponent(code)+'&comment_priv='+comment_priv;
		
		var params = 'comment_comment='+encodeURIComponent(texto);		

		createAjaxNews();
		xmlhttpNews.open("POST", url+'', true);
		xmlhttpNews.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttpNews.onreadystatechange=function()
		{
			if (xmlhttpNews.readyState==4)
			{
				
						document.getElementById('img_captcha').src = "./captcha.php?"+Math.random()+"="+Math.random();
						document.getElementById("code").value = "";				
						var message = '<table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="div_select_attr_header"></div></td></tr><tr><td><div><table cellpadding="0" cellspacing="0" border="0"><tr><td class="div_edit_cart_right" width="9"></td><td width="438"><table cellpadding="0" cellspacing="0" border="0" class="div_table_desc" width="438"><tr><td>'+xmlhttpNews.responseText+'</td></tr></table></td><td class="div_edit_cart_left" width="9"></td></tr></table></div></td></tr><tr><td><div class="div_edit_cart_footer" align="center"></div></td></tr></table>';
						
						document.getElementById("transSmallMessageEdit").innerHTML=message;									
			}
		}
		xmlhttpNews.send(params);	 
		
}

function hideUpdateCommentError()
{
	 	document.getElementById("transSmallEdit").style.display="none";
}


function hideUpdateCommentErrorQuiniela()
{
	 	document.getElementById("transSmallEdit_"+quiniela_id_selected).style.display="none";
}

function hideUpdateSendError()
{
	 	document.getElementById("transSmallSendEdit").style.display="none";
}

function hideUpdateCommentVideoOk()
{
			//document.getElementById("comment_name").value = "";
	 	//document.getElementById("comment_comment").value = "";

	 	document.getElementById("transSmallEdit").style.display="none";
			PaginaVideos(1,video_id_selected);			
}

function hideUpdateCommentBlogOk()
{
			//document.getElementById("comment_name").value = "";
	 	//document.getElementById("comment_comment").value = "";

	 	document.getElementById("transSmallEdit").style.display="none";
			PaginaBlogs(1,video_id_selected);			
}

function hideUpdateCommentImageOk()
{
			//document.getElementById("comment_name").value = "";
	 	//document.getElementById("comment_comment").value = "";

	 	document.getElementById("transSmallEdit").style.display="none";
			PaginaNewsImages(1,image_id_selected);
}

function hideUpdateCommentOk()
{
			//document.getElementById("comment_name").value = "";
	 	//document.getElementById("comment_comment").value = "";

	 	document.getElementById("transSmallEdit").style.display="none";
			PaginaNews(1,news_id_selected);
}

function hideUpdateCommentOkQuinielas()
{
			//document.getElementById("comment_name").value = "";
	 	//document.getElementById("comment_comment").value = "";

	 	document.getElementById("transSmallEdit_"+quiniela_id_selected).style.display="none";
			loadCommentsQuiniela(quiniela_id_selected);
}

function hideUpdateSendNewsOk()
{
			document.getElementById("to_name").value = "";
	 	document.getElementById("to_mail").value = "";
			document.getElementById("from_name").value = "";
	 	document.getElementById("from_mail").value = "";
			document.getElementById("from_comment").value = "";			

	 	document.getElementById("transSmallSendEdit").style.display="none";
}


function sleep(millisecondi)
{
		var now = new Date();
		var exitTime = now.getTime() + millisecondi;
		while(true)
		{
				now = new Date();
				if(now.getTime() > exitTime) return;
		}
}
