// ============== fonction frame killer ==============
if (top.frames.length!=0) top.location=self.document.location;

// ============== fonction anti-spam ==============
function noSpam(user,domain) {
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
}

// ============== fonction popup ==============
function openPopup(type,url) {
	if (type == 1) { // 1 = Diaporama
		var hauteur = 500;
		var largeur = 840;
		var top=(screen.height-hauteur)/2;
		var left=(screen.width-largeur)/2;
		window.open(url,'diaporama','toolbar=0,location=0,directories=0,status=0,scrollbars=auto,resizable=0,copyhistory=0,menuBar=0,width='+largeur+',height='+hauteur+',left='+left+',top='+top+'');
	}
	else if (type == 2) { // 2 = What is Gift Aid?
		var hauteur = 450;
		var largeur = 500;
		window.open(url,'giftaid','toolbar=0,location=0,directories=0,status=1,scrollbars=1,resizable=1,copyhistory=0,menuBar=0,width='+largeur+',height='+hauteur+',left=200,top=150');
	}			
	else { void(0);	}
}

// ============== fonction femeture popup diaporama ==============
//alert('The name of the opener window is: "' + window.opener.name + '"');
function backToSite(url) {
	// cas 1 : la page est chargée hors PSM (moteur)
	if (!window.opener) {
		//alert("Vous ne venez PAS de PSM");
		window.location = url;
	}
	// cas 2 : on arrive depuis le site PSM via window.open
	else if ( window.opener.name == 'psm' ) {
		//alert("Vous venez de PSM");
		opener.location = url;
		window.self.close();
	}
}