$( function()
{

	$("#rightcolumn a:empty").remove();


	var jval = $(".jml").val();
	jval = jval.replace(/^\s+|\s+$/, '')
	$(".jml").val( jval )

	$(".jml").css( "width", Math.ceil(jval.length * 6) + "px" );

	var title = $("#pagetitle").text();

	if( title.length > 0 )
	{
		document.title = title;
	}
	else
	{
		title = []
		title[0] = "Kristensen International";
		$("#bread li:gt(0)").each( function()
		{
			title[ title.length ] = $(this).text();
		})
		document.title = title.join(" ");
	}

	$("#bread li").each( function() {
		var sel = $(this).children("a");
		if( sel.length == 0 ) sel = $(this)
		sel.html( $(this).text() )
	})


	$("#lightboximages a").lightBox()
	
	$("a.popup").click( function()
	{
		w = $(this).attr("width") !== undefined ? $(this).attr("width") : 800;
		h = $(this).attr("height") !== undefined ? $(this).attr("height") : 700;
		u = $(this).attr("href");
	
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	
		settings = 'width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
		

		win = window.open(u, 'mywin', settings);
	
		return false;

	})
})