
function addIdentifiers()
{
	$('ul').find('li:first').addClass('first');
	$('ul').find('li:last').addClass('last');
	
	$('tr').find('th:first').addClass('firstColumn');
	$('tr').find('th:last').addClass('lastColumn');
	
	$('tr').find('td:first').addClass('firstColumn');
	$('tr').find('td:last').addClass('lastColumn');
	
	$('table tr:even').addClass('even');
	$('table tr:odd').addClass('odd');
	
	$('table').find('tr:first').addClass('first');
	$('table').find('tr:last').addClass('last');
}

function iphoneTelBahavior()
{
	var agent=navigator.userAgent.toLowerCase();
	var is_iphone = (agent.indexOf('iphone')!=-1);
	if (is_iphone) { 
		$("a[rel='phone']").each(function(){ $(this).attr('href', $(this).attr('data')) });
	}
}

function initModalLogin()
{
	$('#modalLogin').jqm({onShow: function(inst){ inst.w.show();$('.jqmWindow h3').sifr({font:'FagoOfficeSerif.swf'}); }}); 
	$('#modalLogin').jqmAddTrigger('#login'); 
}

$(document).ready(function () {
	addIdentifiers();
	initModalLogin();
	
	$(".callout").hover(
      function () {
        $(this).find("img.on").css("display", "block");
		$(this).find("img.off").css("display", "none");
      }, 
      function () {
        $(this).find("img.on").css("display", "none");
		$(this).find("img.off").css("display", "block");
      }
    );

	
    $('span.truncate').truncate({ max_length: 300, more: '', less: '' });

	$(".blogAbstract a.more").each(
		function(){
			$(this).appendTo($(this).prev('span').find('p:last'));
		}
	);

    
});
