/*
 * MEDIAOBJECT CONSTANTS
 */

var url_prefix = "";


function fbs_click(u) {
	if (u == undefined) {
		u=document.location;
	}
	t=document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'Visuelt','toolbar=0,status=0,width=626,height=436');
	return false;
}

/**
 * Function that enables the user to share a link on nettby.no
 * Stolen from vg.no. I guess they don't mind.
 *
 * @param string title
 * @param string url
 * @param string description
 * @return boolean
 */
function nettby_link_share(title, url, description) {
    nettby_link_share_window = window.open('http://www.nettby.no/user/edit_link.php?name=' + escape(title) + '&url=' + escape(url) + '&description=' + escape(description), 'edit_link', 'scrollbars=no,width=450,height=430');

    return false;
}

/* do sitewide effects */
$(document).ready(function(){	
	$('.message').effect("highlight", {}, 4000).slideUp();
	
	$('p.error').effect("pulsate", { times:1 }, 500);

	$('.date').datepicker({dateFormat: 'dd/mm-yy', altFormat: 'yy-mm-dd'});

	// shade table
	/*
	if ($("table.program").length > 0){
		$("table.program tr th:first-child").addClass('first');
		$("table.program tr td:first-child").addClass('first');
		$("table.program tr:nth-child(even):visible").addClass('shade');
	}
	*/

	$().YFinterfaceTableZebraRowsInit();
});