$.fn.mamba = function() {
	var $this = $(this);
	$this.css('visibility','hidden');
	$this.each(function(i) {
		var mlA = 0, mlB = 10; //margin-left
		var mtA = -1, mtB = 100; //margin-top
		var wA = 150, wB = 300; //width
		var fsA = 14, fsB = 36; //font-size
		$(this)
			.css('float', i%2 == 1 ? 'left' : '')
			.css('marginLeft', (mlB-mlA)*Math.random()+mlA + '%')
			.css('marginTop',(mtB-mtA)*Math.random()+mtA + 'px')
			.css('width',(wB-wA)*Math.random()+wA + 'px')
			.css('textAlign', i%2 == 1 ? 'left' : 'right');
		$('a', this)
			.css('fontSize', (fsB-fsA)*Math.random()+fsA + 'px');
	});
	return this;
}
$(function() {
	if($.browser.msie) {
		$('.png').ifixpng();
	}
	$doc = $(document).width();
	var v = 0,
	r1 = $('.blood-mamba').size();
	do {
		v++;
		$('.blood-mamba').mamba();
	} while(v < 100 || $(document).width() != $doc || parseInt($('#mamba-top').height()) > 400 + 8*r1 || parseInt($('.mamba-hidden').height()) > 700 + 8*r1);
	$('.blood-mamba').css('visibility','visible');
	$('.mamba-hidden').hide();
	
	$('.yellow-pages-inner-menu a').click(function() {
		$('.yellow-pages-inner-menu a').removeClass('current');
		var $id = $(this).addClass('current').attr('id');
		$id = $id.split('_');
		$id = $id[1];
		$('.item').hide();
		$('#txt-'+$id).show();
		
	});
});
