

function on_load()
{
	var new_height = $('margin_block').offsetHeight - 105;
	if( $('main_content').offsetHeight < new_height)
	{
		$('main_content').style.height = new_height +'px';	
		//alert ($('margin_block').offsetHeight);
		
		//initLightbox();
	
	}	
}

function on_load_checkout()
{
	var new_height = $('margin_block').offsetHeight;
	if( $('main_content').offsetHeight < new_height)
	{
		$('main_content').style.height = new_height +'px';	
		//alert ($('margin_block').offsetHeight);
		
		//initLightbox();
	
	}	
}

	function top5_submit()
	{
		//this will stop the block going funny diring the transision.
		var new_height = $('top5_inner_block').offsetHeight + 35;
		
		$('top5_block').style.height = new_height +'px';
		
		var url = 'top5.php';
		var pars = 'category_id='+$F('top5_category_id');
		
		var myAjax = new Ajax.Request(
			url, 
			{
				method: 'post', 
				parameters: pars, 
				onComplete: reload_content
			});
	}
	
	function reload_content(ajax)
	{
		new Effect.BlindUp('top5_inner_block',{queue:'front'});
		new Effect.Updater('top5_inner_block',{newContent:ajax.responseText,queue:'end'});
	  	new Effect.BlindDown('top5_inner_block',{queue:'end'});
	}
	
	function latest_products(position)
	{	
		//this will stop the block going funny diring the transision.
		$('latest_products_block').style.height = $('latest_products_inner_block').offsetHeight +'px';
		
		var url = 'latest_products.php';
		var pars = 'position='+position;
		
		var myAjax = new Ajax.Request(
			url, 
			{
				method: 'post', 
				parameters: pars, 
				onComplete: reload_content2
			});
	
	}
	
	function reload_content2(ajax)
	{
		new Effect.Fade('latest_products_inner_block',{queue:'front'});
		new Effect.Updater('latest_products_inner_block',{newContent:ajax.responseText,queue:'end'});
	  	new Effect.Appear('latest_products_inner_block',{queue:'end'});
	}
