// modifié le 18/11/04 par LG

function openWin(URL,w,h,resize,scroll,windowName)
{
lAttributes = '';
lAttributes += 'toolbar=0,';
lAttributes += 'Location=0,';
lAttributes += 'directory=0,';
lAttributes += 'status=0,';
lAttributes += 'menubar=0,';
lAttributes += 'scrollbars='+scroll+',';
lAttributes += 'resizable='+resize+',';
lAttributes += 'width='+w+',';
lAttributes += 'height='+h+'';
if(!windowName) windowName="new";
if(windowName='') windowName="new";
winId = window.open(URL,windowName,lAttributes);
}
function openPrint(URL,w,h,resize,scroll,windowName)
{
lAttributes = '';
lAttributes += 'toolbar=1,';
lAttributes += 'Location=0,';
lAttributes += 'directory=0,';
lAttributes += 'status=0,';
lAttributes += 'menubar=1,';
lAttributes += 'scrollbars='+scroll+',';
lAttributes += 'resizable='+resize+',';
lAttributes += 'width='+w+',';
lAttributes += 'height='+h+'';
if(!windowName) windowName="";
winId = window.open(URL,windowName,lAttributes);
}

function openMagazine(URL)
{
	var x,y;
	if(clientIs.mac)
	{x = 781; y = 532;
	}
	else
	{
		if(clientIs.ie)
		{x = 781	; y = 532;}
		else
		if(clientIs.dom)
		{x = 783	; y = 536;}
		else
		{x = 781; y = 532	;}
	}
	openWin(URL,x,y,0,1);	
}
function gotoArticle(URL)
{
	readArticle(URL);
	return false;
		
}
function findLanguagePath()
{
	var lPath = top.document.location.href;
	var langue = (lPath.indexOf('/en/')>=0) ? "en" : "fr" ;
	var endPath
	var newLanguage = "";
	if (langue=="en") lPos = lPath.indexOf('/en/');
		else lPos = lPath.indexOf('/fr/');

	if(lPos<0) {
		lPos = lPath.lastIndexOf('/');
		endPath = lPath.substring(0,lPos);
	}
	else{
	endPath = lPath.substring(0,lPos+4);
	}
	return endPath;
}

function checkForSlash(URL)
{	

	if(URL.substring(URL.length-1,URL.length)!="/") URL+="/";
	return URL;
}
function showPersonnalData(relativePath)
{
	if(!relativePath) relativePath ="";
	relativePath=checkForSlash(relativePath);
	openWin(relativePath+"ow/mentions_legales.htm#personnal",468,422,0,1,"_blank");
}


function openLegal(cheminTransverse)
{

	if(!cheminTransverse) cheminTransverse ="../";
		cheminTransverse=checkForSlash(cheminTransverse);

	openWin(cheminTransverse+"legal.htm",422,400,0,1);
}
function openCredits(cheminTransverse)
{

	if(!cheminTransverse) cheminTransverse ="../";
		cheminTransverse=checkForSlash(cheminTransverse);

	openWin(cheminTransverse+"credits.htm",422,300,0,1);
}

function openContributeurs(cheminTransverse)
{

	if(!cheminTransverse) cheminTransverse ="../";
		cheminTransverse=checkForSlash(cheminTransverse);

	openWin(cheminTransverse+"contributeurs.htm",422,500,0,1);
}

function openAllIssues(cheminTransverse,langue)
{

	if(!cheminTransverse) cheminTransverse ="../";
		cheminTransverse=checkForSlash(cheminTransverse);

	//openWin(cheminTransverse+"tousnumeros.htm",420,400,0,1);
	
	pos = cheminTransverse.indexOf("css");
	path = cheminTransverse.substring(0,pos);

	openWin(path+"../allissues/"+langue+"/tousnumeros.htm",422,400,0,1);
	//
}

function readIssue(URL)
{
	openWin("../../../"+URL,800,534,0,1);
}
function readArticle(URL)
{
	openPrint(URL,584,550,1,1);
}
function showMap(URL)
{
	openPrint(URL,680,575,1,1);
}
function readShortArticle(URL)
{
	openPrint(URL,584,282,1,1);
}

function sendArticle(cheminTransverse,docTitle)
{

	if(!cheminTransverse) cheminTransverse ="../";
		cheminTransverse=checkForSlash(cheminTransverse);
		openWin(cheminTransverse+"envoyerarticle.htm?url="+escape(document.location.href)+"&title="+escape(docTitle),420,400,0,1);
}

function closeArticle()
{
	this.window.opener.focus();
	this.window.close();
}