/******************************************************************************
* Proyecto: Videoclub Online
* Descripción: Videoclub a través de internet que permite el alquiler y compra de películas a través de Streaming o descarga de archivo. Sistema de Video on Demand.
* Autores: Iñaki Villaverde Dosil, Jennifer Docampo Viñas, Alfredo Pérez Penalta, Antonio Docampo Romero.
* Nombre archivo: funciones_js.js
* Fecha creación: 15/10/06
* Copyright ® 2005-2010  Nai Soluciones Informáticas S.L.
*************************************************************************************/
//Funcion que cambia el fondo de color 
function cambiarFondoCelda(celda,colorFondo,colorLetra,i)
{
	var enlace='enlace'+i;
	var obj=document.getElementById(enlace);
	
	celda.style.cursor='pointer';
	celda.style.backgroundColor=colorFondo;
	celda.style.color=colorLetra;
	obj.style.color=colorLetra;
}
//Funcion que devuelve la celda a su estado anterior(cineNuevo)
function volverFondoCelda(celda,i)
{
	var enlace='enlace'+i;
	var obj=document.getElementById(enlace);
	
	celda.style.cursor='auto';
	celda.style.backgroundColor='#83303A';
	celda.style.color='#ffffff';
	obj.style.color='#ffffff';
}
/////////////////////////////////////////////////////////
//Funcion ajax
function realizarPeticion(sCadenaURL) {
  var oScript = document.createElement('script');
  oScript.src = sCadenaURL;
  document.body.appendChild(oScript);
  try{
  	document.getElementById('favoritos').innerHTML="Pel&iacute;cula en Favoritos";
	}catch(err){}
}
function comprobarNombre(sCadenaURL) {
   realizarPeticion(sCadenaURL);
}
//////////////////////////////////////////////////////////////////////////////////////////
//Obtiene los parametros de una direccion url
function getParams() {
	var idx = document.URL.indexOf('?');
	var params = new Array();
	if (idx != -1) {
		var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
		for (var i=0; i<pairs.length; i++) {
			nameVal = pairs[i].split('=');
			params[nameVal[0]] = nameVal[1];
		}
	}
return params;
}

function rellenaMail(script){
	try{
		if(script=='1'){
			document.getElementById('comment').value='elGatoConBotas';
		}else if(script=='2'){
			document.getElementById('comment').value='CocodriloDundee';
		} 
	}catch(err){}
	//alert('comment::::'+document.getElementById('comment').value);
}

/////////////////////////////////////////////////////////////////////////////////////////////
