var wijd = window.screen.availWidth * 75 / 100;
var hoog = window.screen.availHeight * 75 / 100;
var boven = (screen.availHeight - hoog) / 2;
var links = (screen.availWidth - wijd) / 2;
function open_mail() {
    var adres = encodeURIComponent(window.location.href);
    window.open('http://api.addthis.com/oexchange/0.8/forward/email/offer?url='+adres+'&username=Sj0m0', 'email', 'status=0,toolbar=0,location=1,menubar=0, directories=0,resizable=0,scrollbars=1,height='+hoog+',width='+wijd+',top='+boven+',left='+links);
}
function open_facebook() {
    var adres = encodeURIComponent(window.location.href);
    window.open('http://api.addthis.com/oexchange/0.8/forward/facebook/offer?url='+adres+'&username=Sj0m0', 'email', 'status=0,toolbar=0,location=1,menubar=0, directories=0,resizable=0,scrollbars=1,height='+hoog+',width='+wijd+',top='+boven+',left='+links);
}
function open_twitter() {
    var adres = encodeURIComponent(window.location.href);
    var t = escape('Kijk even naar deze foto van @Sj0m0');
    window.open('http://api.addthis.com/oexchange/0.8/forward/twitter/offer?url='+adres+'&title='+t+'&username=Sj0m0', 'twitter', 'status=0,toolbar=0,location=1,menubar=0, directories=0,resizable=0,scrollbars=1,height='+hoog+',width='+wijd+',top='+boven+',left='+links);
}
function open_anders() {
    var adres = encodeURIComponent(window.location.href);
    window.open('http://api.addthis.com/oexchange/0.8/forward/offer?url='+adres+'&username=Sj0m0', 'email', 'status=0,toolbar=0,location=1,menubar=0, directories=0,resizable=0,scrollbars=1,height='+hoog+',width='+wijd+',top='+boven+',left='+links);
}
function getFlashMovieObject(movieName)
{
    if (window.document[movieName])
    {
        return window.document[movieName];
    }
    if (navigator.appName.indexOf("Microsoft Internet")==-1)
    {
        if (document.embeds && document.embeds[movieName])
            return document.embeds[movieName];
    }
    else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
    {
        return document.getElementById(movieName);
    }
}
function open_albums() {
    var flash = getFlashMovieObject('albums');
    flash.albumkiezer();
}
function eerste_keer() {
	if (document.referrer.indexOf('mouissie.net') > -1) {
	    //var openen = true;
	} else if (document.referrer.indexOf('mouissie-fotografie.nl') > -1) {
		//var openen = true;
	} else if (document.referrer.indexOf('sjoerdmouissie.nl') > -1) {
		//var openen = true;
	} else {
		//var openen = false;
	}

	if (openen) {
		var flash = getFlashMovieObject('albums');
		flash.beginAlbums();
	}
}

$(document).ready(function(){
    $("#menu_img img").hover(function() {
        $(this).attr("src", $(this).attr("src").split(".").join("-hover."));
    }, function() {
        $(this).attr("src", $(this).attr("src").split("-hover.").join("."));
    });

});
