function autoOpenProfileBox (memberID) {
 
 		//get the box id of the box which contains the previously clicked member id
 		var whichBox = $('a#blogLink' + (memberID)).parent().parent().attr('id');

	  	//set up a variable that identifies the box clicked on
	  	var thisBox = (whichBox); //(this.id);


	  	//enlarge the box to fullsize  	
	  	var screenHeight = ($(window).height());
	  	
		if (screenHeight > 750) {
		
			$('.box#' + thisBox).animate( { width:"580px", height: "580px"}, 1 );

		} else {
		
			$('.box#' + thisBox).animate( { width:"580px", height: "580px"}, 1 );
			
		}

// call rearrangeBoxes
rearrangeBoxes(thisBox);

		//add class 'showButton' to the div 'closeButton' with the box...this makes it visible
	    $('.box#' + thisBox + ' .closeButton').show();
	    $('.box#' + thisBox + ' .topBanner').hide();
	         	     
//show contentPreview by removing hide class again
$('.box#' + thisBox + ' .profileBannerUser').show();	

	    //hide contentPreview
	   	$('.box#' + thisBox + ' .contentPreview').hide();
	   	
	   	//show content
	   	$('.box#' + thisBox + ' .content').show();
	   	
	    //enlarge content to fit new size;
		if (screenHeight > 750) {
	   	
	   		$('.box#' + thisBox + ' .content').css({'height': '400px'});
	  
		} else {
		
	   		$('.box#' + thisBox + ' .content').css({'height': '400px'});
		
		}		

		
	   	//load in external file into content div
		
		//get link to full article (which is hidden)
		var urlLoad = $('.box#' + thisBox + ' a').attr("href"); 

		//alert(urlLoad);
	    
	    //load into now visible content div
	    $('.box#' + thisBox + ' .content').load(urlLoad);


var pos = $('.box#' + thisBox).position();
//alert("POSITION: \nLeft: "+pos.left + "\nTop: " + pos.top);

$.scrollTo('.box#' + thisBox, 1800);

} // end function




$(document).ready(function() { 

	// if the pagination segment of url DOES NOT exist then call our auto open cuz it will only be on the first page of blog boxes
	if  (! (jQuery.url.segment(3)) ) {
	
		// get cookie value and assign to variable
		var memberEntryExist = $.cookie('autoOpenMemberCookie');  // get cookie value
		
		//alert ('member id: ' + memberEntryExist);
		
		//if variable is NOT null ie cookie exists
		if (memberEntryExist) {
			//delete cookie so we don't continually open
			//$.cookie('autoOpenMemberCookie', '', { expires: -1 }); // delete cookie
	$.cookie('autoOpenMemberCookie', null, {expires: -1, path: '/', domain: 'cibcommunications.co.uk'} ); // set cookie
			
			
			//alert ('in if deleted?: ' + memberEntryExist);
	
			
			//autoOpen appropriate box
			autoOpenProfileBox(memberEntryExist);
		}// end cookie test
	
	} //end segment test
	
		
});