var isNav = navigator.appName == "Netscape";

function popup(url)
{
	var xPos, yPos;
	var height = "280";
	var width = "445";
	if(isNav)
	{
		xPos = window.screenX + 60;
		yPos = window.screenY + 140;
	}
	else
	{	
		xPos = window.screenLeft + 60;
		yPos = window.screenTop;
	}
	popupSizePos(url, xPos, yPos, height, width);
}

function popupSize(url, height, width)
{
	var xPos, yPos;
	if(isNav)
	{
		xPos = window.screenX + 60;
		yPos = window.screenY + 140;
	}
	else
	{	
		xPos = window.screenLeft + 60;
		yPos = window.screenTop;
	}
	popupSizePos(url, xPos, yPos, height, width);
}

function popupSizePos(url, xPos, yPos, height, width)
{
	window.open(url, "termsandconditions", "toolbar=no,directories=no,alwaysRaised=yes,dependent=yes,location=no,menubar=no,resizable=no,scrollbars=yes,screenX="+xPos+",screenY="+yPos+",height="+height+",width="+width+",left="+xPos+",top="+yPos);
}

function popupNormal(url)
{
	var xPos = 50;
	var yPos = 50;
	var height = screen.availHeight - yPos - 200;
	var width = screen.availWidth - xPos - 50;;
	popupSizePosNormal(url, xPos, yPos, height, width);
}

function popupSizePosNormal(url, xPos, yPos, height, width)
{
	window.open(url, "termsandconditions", "toolbar=yes,location=yes,menubar=yes,resizable=yes,scrollbars=yes,links=yes,status=yes,ScreenX="+xPos+",screenY="+yPos+",height="+height+",width="+width+",left="+xPos+",top="+yPos);
}

function popupMe()
{
	var xPos, yPos;
	var height = "280";
	var width = "450";
	if(isNav)
	{
		xPos = opener.window.screenX + 60;
		yPos = opener.window.screenY + 140;
	}
	else
	{	
		xPos = opener.window.screenLeft + 60;
		yPos = opener.window.screenTop;
	}
	popupSizeAndPositionMe(xPos, yPos, height, width);
}

function popupSizeMe(height, width)
{
	var xPos, yPos;
	if(isNav)
	{
		xPos = opener.window.screenX + 60;
		yPos = opener.window.screenY + 140;
	}
	else
	{	
		xPos = opener.window.screenLeft + 60;
		yPos = opener.window.screenTop;
	}
	popupSizeAndPositionMe(xPos, yPos, height, width);
}

function popupSizeAndPositionMe(xPos, yPos, height, width)
{
	window.moveTo(xPos, yPos);
	window.resizeTo(width, height);
	if(isNav)
	{	
		window.locationbar.visible = false;
		window.menubar.visible = false;
		window.personalbar.visible = false;
		window.statusbar.visible = false;
		window.toolbar.visible = false;
	}
}

function fnConfirmOptOut(obj)
{
	if(obj.checked)
	{
		if(confirm("Nota:\n\nSi seleccionas esta opción, no podremos enviarte información acerca de ofertas y promociones, tales como cupones de bonificación de puntos a tu correo, tu estado de cuenta, o información sobre premios especiales y ofertas de puntos.\n\nSi deseas recibir esta información, selecciona Aceptar."))
		{
			obj.checked=false;
			if(null != document.enrolment.hiddenhasPreferredMarketingCommunication.value)
			{
				document.enrolment.hiddenhasPreferredMarketingCommunication.value='N';
			}
			return true;
		}
		else
		{    
			if(null != document.enrolment.hiddenhasPreferredMarketingCommunication.value)
			{
				document.enrolment.hiddenhasPreferredMarketingCommunication.value='Y';
			}
			return false;
		}
	}
}

function fnConfirmOptOutLogin(obj)
{
	if(obj.checked)
	{
		if(confirm("¿Está seguro que no quiere información sobre ofertas y promociones (incluyendo ofertas de Puntos Especiales)de Círculo Más S.A. y/o de las compañías particpantes?\nSeleccionar Aceptar si desea recibir información"))
		{
			obj.checked=false;	
			return true;
		}
		else
		{
			return false;
		}
	}
}

function fnConfirmReceivePartnersInfo(obj)
{
	if(obj.checked)
	{
		if(confirm("¿Está seguro que no quiere ser incluido en el envío de ofertas especiales, publicidad, otra información y comunicaciones por correo electrónico?\nSeleccionar Aceptar si desea recibir información"))
		{
			obj.checked=false;	
			return true;
		}
		else
		{
			return false;
		}
	}
}

function fnConfirmReferMktResComm(obj)
{
	if(obj.checked)
	{
		if(confirm("¿Está seguro que no quiere ser contactado con fines de estudio de mercados?\nSeleccionar Aceptar si desea recibir información"))
		{
			obj.checked=false;	
			return true;
		}
		else
		{
			return false;
		}
	}
}

function setPartnerInformation(obj)
{
	if(obj.checked)
	{
		document.enrolment.hiddenhasPreferredPartnersInformation.value='Y';
	}
	else
	{
		document.enrolment.hiddenhasPreferredPartnersInformation.value='N';
	}
}

function setMarketingResearch(obj)
{
	if(obj.checked)
	{
		document.enrolment.hiddenhasPreferredMarketingResearch.value='Y';
	}
	else
	{
		document.enrolment.hiddenhasPreferredMarketingResearch.value='N';
	}
} 
