build_bookmarks = {
	icons: new Array(
	'facebook',
	'twitter',
	'google',
	'icio',
	'myspace',
	'digg',
	'webnews',
	'yigg',
	'live',
	'mrwong',
	'yahoo'
	),
	names: new Array(
	'Facebook',
	'Twitter',
	'Google',
	'Icio',
	'MySpace',
	'Digg',
	'Webnews',
	'Yigg',
	'Windows Live',
	'Mister Wong',
	'Yahoo'
	),
	links: new Array(
	'http://www.facebook.com/sharer.php?u='+self.location.href,
	'http://twitthis.com/twit?url='+self.location.href+'&title='+document.title,
	'http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk='+self.location.href+'&title='+document.title,
	'http://www.icio.de/add.php?url='+self.location.href+'&title='+document.title,
	'http://www.myspace.com/Modules/PostTo/Pages/?l=2&u='+self.location.href+'&title='+document.title,
	'http://digg.com/submit?phase=2&url='+self.location.href+'&title='+document.title,
	'http://www.webnews.de/einstellen?url='+self.location.href,
	'http://www.yigg.de/neu?exturl='+self.location.href+'&title='+document.title,
	'https://favorites.live.com/quickadd.aspx?marklet=1&amp;mkt=en-us&amp;url='+self.location.href,
	'http://www.mister-wong.de/index.php?action=addurl&bm_url='+self.location.href+'&bm_description='+document.title,
	'http://myweb2.search.yahoo.com/myresults/bookmarklet?u='+self.location.href+'&t='+document.title
	),
	html: '',	
	text_title: new Array(
	'Diesen Artikel bookmarken oder weiterempfehlen',
	'Recommander cet article'
	),
	text_emaillink: new Array(
	'per Mail versenden',
	'Par e-mail'
	),
	build: function(language) {
		this.html += '<div class="social_bookmarks">';
		this.html += '<p>' + this.text_title[language] + ':</p>';
		this.html += '<ul>';
		//switch
		if (!$.cookie('facebookoff')) {
			this.html += '<li><iframe src="http://www.facebook.com/plugins/like.php?href=' + self.location.href + '&amp;layout=button_count&amp;show_faces=false&amp;width=135&amp;action=recommend&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="float:left;margin:7px 0 0 0;border:none; overflow:hidden; width:135px; height:20px"></iframe></li>';
		}
		for (x=0; x < 2; x++) {
			this.html += '<li><a href="' + this.links[x] + '" target="_blank" title="' + this.names[x] + '"><span class="icon_'+ this.icons[x] +'"></span> '+ this.names[x] +'</a></li>';
		}
		this.html += '<li><a href="javascript:;" onclick="emailForm(' + language + ');"><span class="icon_mail"></span> ' + this.text_emaillink[language] + '</a></li>';
		this.html += '</ul>';
		this.html += '<ul class="clear">';
		for (x=2; x < this.icons.length; x++) {
			this.html += '<li><a href="' + this.links[x] + '" target="_blank" title="' + this.names[x] + '" class="icon_'+ this.icons[x] +'">'+ this.names[x] +'</a></li>';
		}
		this.html += '</ul>';
		this.html += '</div>';
		document.write(this.html);
	}
};


//get rid of facebook iframe, depends on jQuery + Plugin
facebookoff = {
	undo:function(){
	//set
	$.cookie('facebookoff', 'off', { expires: 3000, path: '/', domain: '20min.ch' });
	//feedback
	alert( "Der Facebook-Button wird nun nicht mehr angezeigt!" );
	},
	redo:function(){
	//set
	$.cookie('facebookoff', null, { path: '/', domain: '20min.ch' });
	//test
	alert( "Der Facebook-Button wird wieder angezeigt!" );
	}	
};


function emailForm(language) {
	var text_emailtitle = new Array(
	'Weiterempfehlung einer Story von 20 Minuten',
	'Recommandation d\'un reportage de 20 minutes'
	)
	var subject = text_emailtitle[language];
	var daReferrer = document.URL;
	var email = "";
	var body_message = "Story Link: "+daReferrer;
	var mailto_link = 'mailto:'+email+'?subject='+subject+'&body='+body_message;
	win = window.open(mailto_link,'emailWindow');
	if (win && win.open &&!win.closed) win.close();
}
