

function logout()
{
	window.open('logout.aspx', '_top');
}

function popup(id, topY, topX, width, height)
{
	window.open("popup.aspx?id="+id, "_blank", "top="+topY+", left="+topX+", width="+width+", height="+height+", statusbar=yes");
}

//------------------------------------------
// Comprobacion de formularios desde canales

function checkSendNewsForm()
{
	var msg='';
	try
	{
		var objForm=document.sendNews;

		//si no hay formulario, no se hace nada
		if(!objForm)
			return false;

		//Comprueba la valided de los correos
		if(objForm.emailFrom.value=='')
			msg+=" - EMail remitente vacío\n";
		else if(!isEmail(objForm.emailFrom.value))
			msg+=" - EMail remitente no válido\n";

		if(objForm.emailDest.value=='')
			msg+=" - EMail destino vacío\n";
		else if(!isEmail(objForm.emailDest.value))
			msg+=" - EMail destino no válido\n";

		//condiciones de privacidad
		if(!objForm.acceptForm.checked)
			msg+=" - No ha aceptado las condiciones de privacidad\n";
	}catch(ex)
	{
		msg+=" - Error desconocido\n";
	}


	if(msg!='')
	{
			alert("Compruebe los siguientes campos:\n\n"+msg);
	}

	return (msg=='');
}



function checkQuestionForm()
{
	var msg='';
	try
	{
		var objForm=document.sendQuestion;

		//si no hay formulario, no se hace nada
		if(!objForm)
			return false;

		//Comprueba la valided de los correos
		if(objForm.email.value=='')
			msg+=" - EMail vacío\n";
		else if(!isEmail(objForm.email.value))
			msg+=" - EMail no válido\n";

		if(objForm.comments.value=='')
			msg+=" - Consulta vacía\n";

		//condiciones de privacidad
		if(!objForm.acceptForm.checked)
			msg+=" - No ha aceptado las condiciones de privacidad\n";
	}catch(ex)
	{
		msg+=" - Error desconocido\n";
	}


	if(msg!='')
	{
			alert("Compruebe los siguientes campos:\n\n"+msg);
	}

	return (msg=='');
}

//------------------------------------------
//Popups del footer y de privacidad

function showSecurity()
{
	window.open("seguridad.aspx", "_blank", "width=400, height=250, statusbar=yes, scrollbars=yes");
}

function showLegal()
{
	window.open("legalidad.aspx", "_blank", "width=400, height=250, statusbar=yes, scrollbars=yes");
}

function showConditions()
{
	window.open("RenderChannelLOPD.aspx", "_blank");
}


function showCompanies()
{
	window.open("http://www.cofares.es/RenderChannel.aspx?idChannel=13383", "_self");
}



//---------------------------------
// Popup de imagen ampliada

function showPopupImage(idImage)
{
	window.open("popupImage.aspx?idFile="+idImage, "_blank", "status=yes,width=100,height=100");
}