function addBookmark() 
{
    var bm = location.href;
    
    bm = bm.replace("/portfolios/","/index/");
    bm = bm.replace("/albums/","/agency/");
    
    if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) 
    {
        window.external.AddFavorite(bm, document.title);
    } 
    else if (navigator.appName == "Netscape" || navigator.userAgent.indexOf("Safari") >= 0) 
    {

	lang = document.getElementById('lang').value;
 	
	if(lang == "e")
	        q = confirm("Due to a browser limitation, this page must be refreshed before it can be bookmarked. Click OK to refresh the page. When you return, press CTRL-D to bookmark the page.");
        else
       		q = confirm("Browser securit\u00E9 : Pour ajouter aux favoris, \" CLIQUEZ SUR  OK \"  ensuite, une fois la page stabilis\u00E9e  \" CTRL - D \"");
         	
        if(q)
        	self.parent.location = bm;
    } 
    else 
    {
        alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
    }
}

function openWindow(url, name, height, width)
{
    var params = 'width=' + width + ', height=' + height

    window.open(url, name, params);
}

function openAlbum(id, height, width)
{
    var params = 'width=' + width + ', height=' + height
    window.open('/album_pics/album/' + id + '/', 'album' + id, params);
}

function algobaLogin()
{
	var changeitback = document.CONNECT.action;
	
	document.CONNECT.action = '/users/login';
	
	Spry.Utils.submitForm(document.CONNECT);
	
	document.CONNECT.action = changeitback;
	
	return true;
}