$(document).ready(function(){

	// table sorting
	/* 081203 removing the table sorting
	try{
		if($('#tableSortByDate')[0]){
			$('#tableSortByDate').tablesorter({sortList: [[1,1]]});
			}
		}catch(err)
		{}
	try{
		if($('#tableSortBySecondDate')[0]){
			$('#tableSortBySecondDate').tablesorter({sortList: [[2,1]]});
			}
		}catch(err)
		{}
	try{
		if($('#tableSortByUnpublish')[0]){
			$('#tableSortByUnpublish').tablesorter({sortList: [[2,0]]});
			}
		}catch(err)
		{}	
	try{		
		if($('#tableSortByAdress')[0]){
			$('#tableSortByAdress').tablesorter({sortList: [[1,0]]});
			}	
		}catch(err)
		{}
	try{
		if($('#tableSortByTitle')[0]){
			$('#tableSortByTitle').tablesorter({sortList: [[0,0]]});
			}
		}catch(err)
		{}	
*/		

    if($('.bubble').length > 0){
      if($('.articleText').length > 0)      $('.articleText').css({'width':'380px'});
      if($('.abstract').length > 0)         $('.abstract').css({'width':'380px'});
      if($('.contentListType1').length > 0) $('.contentListType1').css({'width':'380px'});
      if($('.lastUpdate').length > 0)       $('.lastUpdate').css({'width':'380px'});
    }else{
      if($('.articleText').length > 0)      $('.articleText').css({'width':'100%'});
      if($('.abstract').length > 0)         $('.abstract').css({'width':'100%'});
      if($('.contentListType1').length > 0) $('.contentListType1').css({'width':'100%'});
      if($('.lastUpdate').length > 0)       $('.lastUpdate').css({'width':'100%'});
    }

  
  if($('#content').length > 0 && $('#content').height() < 450)
    $('.lastUpdate').css({'top': '440px'});


	$('#menuContainer ul li:last').css({'margin-right':'0'});
	//$('#headerMenu ul li:last').css({'background-image':'none'});
	$('.forside .frontColumn1 .frontBox:last, .forside .frontColumn2 .frontBox:last').css({'margin-bottom':'0'});
	//var myDate=makeADateFromString('30-12-2007 12:00:00')
	//myDate.setDate(myDate.getDate());
	//alert(myDate);

    //$('#headerMenu ul li:first').css({'background-image':'none'});
	//$('.PhoneBookItemTable tr:odd').addClass('grey');
	//$('.PhoneBookItemTable tr:last').removeClass();
/*
/* SUBPAGE
** adjusting the heigth of the leftmenu and content


	//if the left menus height is bigger than the contents height then resize and make the content hight bigger
	//$('#leftContainer').css({'min-height':254});	
	var leftMenuHeight = $('#leftContainer').height();
	var contentHeight = $('#content').height();
	
	//if you are on first page there is no id=content so in this case  "contentHeight2" is set to a minimum value of 254px

	if (contentHeight == null ){
		contentHeight = 254;
		alert( "contentHeight === " + contentHeight);
		$('#leftContainer').css({'min-height':contentHeight - 13});
	}	

	// set the content as high as theleft menu
	//	alert( "leftMenuHeight " + leftMenuHeight);
	//	alert( "contentContainer " + contentHeight);
	//alert( "leftMenuHeight < contentHeight " + leftMenuHeight + " < " +contentHeight );
	if (leftMenuHeight > contentHeight){
		$('#content').css({'min-height':leftMenuHeight + 28});
	//	alert("left menu bigger ");
	
	}else{
		$('#leftContainer').css({'min-height':contentHeight});
	//	alert("content  bigger ");
	}
	//alert( "leftMenuHeight < contentHeight " + leftMenuHeight + " < " +contentHeight );
*/


/* FRONTPAGE
** adjusting the heigth of the leftmenu and content
*//*

	var frontColumnHeight = $('.forside .frontColumn1').height();
	var frontLeftMenuHeight = $('.forside #leftContainer').height();

	//$('.forside #leftContainer').css({'min-height':frontcolumnHeight - 44});
	//if the left menu is smaller than 254px that it will be resized
	if (frontColumnHeight < 254){	
		$('.forside #leftContainer').css({'min-height':254});
	}else{
		$('.forside #leftContainer').css({'min-height':frontColumnHeight - 44});
	}
	
	//if the left menu and content for the frontpage will have the same size
	if (frontColumnHeight < frontLeftMenuHeight){	
		$('.forside .frontColumn1').css({'min-height':frontLeftMenuHeight});
	}else{
		$('.forside #leftContainer').css({'min-height':frontColumnHeight - 44});
	}

	
	if ($('#content')[0]){
		var contentHeight = $('#content').height();
		if (contentHeight > 269){
			$('#leftContainer').css({'min-height':contentHeight - 28});
		}
	}	
	
	
*/


	
});