function getCookieVal(offset)
{
	var endstr=document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function LireCookie(nom)
{
	var arg = nom + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen)
	{
		var j = i+alen;
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal(j);
		i = document.cookie.indexOf(" ",i) + 1;
		if (i == 0)
		break;
	}
	return null;
}
		
netehash = LireCookie('netesession');

/////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////

function openchatv2(login,sex,id)
{
	if (window.opener && window.opener.openchatv2 && !window.opener.openDialogue) // pas dans nav
		window.opener.openchatv2(login,sex,id);
	else {
		if (parent.frames['nav'])
			parent.frames['nav'].openDialogue(login,sex,id);
		else
			if (window.opener)
				window.opener.openDialogue(login,sex,id);
	}
}
	
function openfichev2(aspidf, hashcode)
	{
		ffiche = window.open('?tpl=fiche&aspidf='+aspidf+'&hash='+hashcode,'fichenetech','width=700,height=650,toolbar=no,location=no,scrollbars=yes')
		if (ffiche)
			ffiche.focus();
	}

function opencontactv2(aspidf, hashcode)
	{
		fcontact = window.open('?tpl=addcontact&aspidf='+aspidf+'&hash='+hashcode,'contactnetech','width=575,height=300,toolbar=no,location=no,scrollbars=no')
		if (fcontact)
			fcontact.focus();
	}
	
function openalbumsv2(aspidf,album_id,hashcode)
	{
		falbums = window.open('?tpl=albumshowphotos&aspidf=' + aspidf +'&album_id=' +album_id +'&hash='+hashcode, 'albumnetech','width=300,height=400,toolbar=no,location=no,scrollbars=yes')
		if (falbums)
			falbums.focus();
	}

(function () {
window['jsRedirect2Abonnement'] = function () {
	parent.frames['TopDesk'].location='?tpl=abonnement';
}
})();