
var j = jQuery.noConflict();
j(document).ready(function($){
	
	// Clickable Logo
    $('body').addClickableLogo({
		name: 'Surveying and Mapping Society of Georgia',
		url: 'http://www.samsog.org'
	});


/* Sponsor Boxes */
	
	// Create New Lists
	var boxes = 3;
	for (var s=1; s<=boxes; s++) {
		$('#sponsors').before('<ul id="sponsors'+s+'"></ul>');
	}
	
	// Move List Items Evenly
	var s = 1;
	$('#sponsors li').each(function(){
		$('#sponsors'+s).append($(this));
		s++;
		if (s > boxes) {
			s = 1;
		}
	});
    
	// Start Sponsor Boxes
	for (var s=1; s<=boxes; s++) {
		$('#sponsors'+s).addClass('sponsors');
		$().sponsorBox('sponsors'+s);
	}
	
	// Remove Original List
	$('#sponsors').remove();
	
	
/* Chapter Map */

	$('#m_chaptermap').bind('mouseout',function(){
		$('.popup').stop(true,true).hide();
		$('#chaptermap').attr('src','/global/imgs/trans1.gif');
	}).children('area').bind('mouseover',function(){
		var id = $(this).attr('alt');
		$('.popup').stop(true,true).hide();
		$('body:not(.ie) #'+id).stop(true,true).delay(250).fadeIn();
		$('body.ie #'+id).stop(true,true).show();
		$('#chaptermap').attr('src','/associations/905/imgs/map/'+id+'.png');
	});
	$('.popup').each(function(){
		$(this).append('<span class="tail"></span>');
	}).hover(function(){
		var id = $(this).attr('id');
		$(this).show();
		$('#chaptermap').attr('src','/associations/905/imgs/map/'+id+'.png');
	},function(){
		$(this).stop(true,true).hide();
		$('#chaptermap').attr('src','/global/imgs/trans1.gif');
	});

});

