function checkNetworkKey()
{
	var key = $("#key").val();
	if(key.length < 1)
	{
		alert('Missing Key');
		return;
	}
	$.ajax( {
		type : "POST",
		dataType : "json",
		url : "/group/",
		data : "key=" + key,
		success : function(msg) {
			if (msg.status == 'ok') {
				window.location.reload();
			} else {
				alert(msg.message);
			}
		}
	});	
}

function profileChangeTab(tab,x)
{
	$(".tab").removeClass('canvas current_tab');
	$(".tab").addClass('dijon');
	
	$("#"+x.id).addClass('canvas current_tab').removeClass('dijon');
	
	$(".tabBlocks").hide();
	$("#tabBlock"+tab).show();
}

$(function() {	
	var myDomain = document.domain;
	
	// Complete Tabs
	$('#site_top_nav a').append('<img src="/images/spacer.gif" class="divider" />');
	$('#site_top_nav a:first').addClass('first');
	$('#site_top_nav a:last').addClass('last');
	$('#site_top_nav .last .divider').hide();
	
	// Setup site navigational page markers
	var section = $('body').attr('id');
	
	if(!section || section.length < 1) { return; }
	
	$('a.'+section+',.'+section+' .divider').addClass('current_page'); 
	$('.divider.current_page').show();
	
	// Hide From IE6
	if(($.browser.msie && $.browser.version > 6) || $.support.opacity) { 
		// Add curves
		$('.curve,.curve_top,.curve_btm').each(function(){
			if($(this).css('position') != 'relative' || $(this).css('position') != 'absolute'){ $(this).css({position:'relative'}); }
		});
		$('.curve').each(function(){
			$(this).append('<img src="/images/spacer.gif" class="crv top_rgt" /><img src="/images/spacer.gif" class="crv top_lft" />');
			$(this).append('<img src="/images/spacer.gif" class="crv btm_rgt" /><img src="/images/spacer.gif" class="crv btm_lft" />');
		});
		$('.curve_top').each(function(){
			$(this).append('<img src="/images/spacer.gif" class="crv top_rgt" /><img src="/images/spacer.gif" class="crv top_lft" />');
		});
		$('.curve_btm').each(function(){
			$(this).append('<img src="/images/spacer.gif" class="crv btm_rgt" /><img src="/images/spacer.gif" class="crv btm_lft" />');
		});
		
		// Add drop shadow
		$('.shadow').each(function(){
			if($(this).css('position') != 'relative' || $(this).css('position') != 'absolute'){ $(this).css({position:'relative'}); }
			$width = $(this).outerWidth();
			$width = $width + 8;
			$(this).append('<div class="drop_shadow" style="width:'+$width+'px;"><img src="/images/spacer.gif" class="drop_shadow" /></div>');
		});
	}
});
