/********************************************************************
*                   open window                                     *
********************************************************************/
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="";
winId = window.open(URL,windowName,lAttributes);
return winId;
}

function openNormal(URL,windowName)
{
lAttributes = '';
lAttributes += 'toolbar=0,';
lAttributes += 'Location=0,';
lAttributes += 'directory=0,';
lAttributes += 'status=0,';
lAttributes += 'menubar=0,';
lAttributes += 'scrollbars=1,';
lAttributes += 'resizable=0,';
lAttributes += 'width=470,';
lAttributes += 'height=420';
if(!windowName) windowName="";
winId = window.open(URL,windowName,lAttributes);
return winId;
}

function openPrint(URL,w,h,resize,scroll,windowName)
{
lAttributes = '';
lAttributes += 'toolbar=1,';
lAttributes += 'Location=1,';
lAttributes += 'directory=1,';
lAttributes += 'status=1,';
lAttributes += 'menubar=1,';
lAttributes += 'scrollbars='+scroll+',';
lAttributes += 'resizable='+resize+',';
lAttributes += 'width='+w+',';
lAttributes += 'height='+h+'';
if(!windowName) windowName="windowprint";
winId = window.open(URL,windowName,lAttributes);
return winId;
}

function printPage()
{
	var currentURL = document.location.href;
	pos = currentURL.lastIndexOf("/");
	if(pos<0) return;
	
	path = currentURL.substring(0,pos)+"/";
	filename = currentURL.substring(pos,currentURL.length);
	printFilename = path+"print"+filename;

	windId = openPrint(printFilename,600,414,1,1,"print")
	windId.print();

}

function openMail()
{
lAttributes = '';
lAttributes += 'toolbar=0,';
lAttributes += 'Location=0,';
lAttributes += 'directory=0,';
lAttributes += 'status=0,';
lAttributes += 'menubar=0,';
lAttributes += 'scrollbars=0,';
lAttributes += 'resizable=0,';
lAttributes += 'width=450,';
lAttributes += 'height=422';
winId = window.open('','',lAttributes);
}

function openContact(isHP)
{
lAttributes = '';
lAttributes += 'toolbar=0,';
lAttributes += 'Location=0,';
lAttributes += 'directory=0,';
lAttributes += 'status=0,';
lAttributes += 'menubar=0,';
lAttributes += 'scrollbars=0,';
lAttributes += 'resizable=0,';
lAttributes += 'width=450,';
lAttributes += 'height=422';
var str = (isHP==1) ? '':'../';
winId = window.open(str+'','',lAttributes);
}

function personal()
{
openLegal(0,'#perso');
}

function openSites(langue)
{
if(langue!='en')
{
	langue='fr';
}

lAttributes = '';
lAttributes += 'toolbar=0,';
lAttributes += 'Location=0,';
lAttributes += 'directory=0,';
lAttributes += 'status=0,';
lAttributes += 'menubar=0,';
lAttributes += 'scrollbars=1,';
lAttributes += 'resizable=0,';
lAttributes += 'width=487,';
lAttributes += 'height=400';
winId = window.open('http://www.total.com/ho/'+langue+'/transverse/siteswebdugroupe.htm','',lAttributes);
}

function openMag(langue,URL)
{
//path = 'http://129.35.162.71/energies/';
path = 'http://www.total.com';
if (!URL) 
{
URL = 'http://www.total.com/energies/' + langue;
}
else
{
URL = path+URL;
}

lAttributes = '';
lAttributes += 'toolbar=0,';
lAttributes += 'Location=0,';
lAttributes += 'directory=0,';
lAttributes += 'status=0,';
lAttributes += 'menubar=0,';
lAttributes += 'scrollbars=0,';
lAttributes += 'resizable=0,';
lAttributes += 'width=780,';
lAttributes += 'height=532';
winId = window.open(URL,'',lAttributes);
}