function fbs_click() {
	u=document.location;t=document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'Pir 2','toolbar=0,status=0,width=626,height=436');
	return false;
}
$(document).ready(function(){
	// redesigns the projects page for using in Facebook iframes
	if (window!=window.top) {
		var link = $("<link>");
		link.attr({
		        type: 'text/css',
		        rel: 'stylesheet',
		        href: '/static/openweb/css/facebook_iframe.css'
		});
		$("head").append( link ); 
		$("a").attr("target", "_blank");
	}
	
	if($("div#map_canvas").get() != ''){
		initializeGmaps();
	}
	
	$('#cannes_modal form').submit(function(event){
		event.preventDefault();
		if($(this).find('.input_text').val() ==  'aprikos'){
			$.cookie('cannes_cookie', 'accepted', { expires: 30, path: '/' });
			window.location = '/cannes-2011/';
		} else {
			$('#cannes_modal h3').text('Feil passord. Prøv igjen.');
		}
	});
});
