		jQuery.noConflict();
		
	var blnwWidgetTimer = 0;
	checkBlnwWidget();
	
	function checkBlnwWidget(){
		var menu = jQuery('.blnw-menu');
		if(menu.height() > 0){
			clearTimeout(blnwWidgetTimer);
			initBlnwWidget();
		}else{
			blnwWidgetTimer = setTimeout(checkBlnwWidget, 10);
		}
	}
	
	function SearchSubmit(opennew) {
		var q = document.getElementById('q').value;
		
		if (q != '') {
			if (opennew == 'existing')
				window.location = "http://www.businesslinknw.co.uk/pages/search.aspx?q=" + q;
			else
				window.open("http://www.businesslinknw.co.uk/pages/search.aspx?q=" + q);
		}
		else
			alert('Please enter a search keyword before clicking Go');
	}

	
	function initBlnwWidget(){
		
		var menu = jQuery('.blnw-menu');
		var viewport = jQuery('.blnw-viewport');
		viewport.height(menu.height());
		var w = viewport.width();
		var h = viewport.height();
		var content;
		
		viewport.width(w);
		
		
		//change title image
		if(w > 220-17){
			jQuery('.blnw-header-middle img').attr('src', 'http://blnw-assets.uat.mandogroup.com/_common/img/logo-large.gif');
		}
		//change footer padding
		if(w > 250-17){
			jQuery('.blnw-footer-middle').css('padding-top', '8px');
		}
		
		jQuery('.blnw-container').width(w*2+10);
		jQuery('.blnw-menu, .blnw-content').width(w);
		
		jQuery.each(jQuery('.blnw-content'), function(){
			jQuery(this).css('left', w);
		});
		
		jQuery('.blnw-menu li a').click(function(e){
			e.preventDefault();
			content = jQuery('#'+jQuery(this).attr('rel'));
			content.css('display', 'block');
			jQuery('.blnw-container').animate({
				left: '-'+w+'px'
			}, 500, 'swing', function(){
				var ch = content.height();
				if(ch > h){
					viewport.animate({
						height: ch
					}, 500, 'swing');
				}
			});
		});
		jQuery('.blnw-content .blnw-back a').click(function(e){
			e.preventDefault();
			var delay = 0;
			if(content.height() > h){
				viewport.animate({
					height: h
				}, 500, 'swing');
				delay = 500;
			}
			setTimeout(function(){
				jQuery('.blnw-container').animate({
					left: '0px'
				}, 500, 'swing', function(){
					content.css('display', 'none');
				});
			}, delay);
		});
		
	};
