// JavaScript Document

$(document).ready(function() {
													 
	$('#tabs1a a').click(function(c){		
		switch_tabs($(this));
		c.preventDefault(); // this prevents the original href of the link from being opened
    	//c.stopPropigation();
	});

	$('#tabs2a a').click(function(c){		
		switch_tabs($(this));
		c.preventDefault(); // this prevents the original href of the link from being opened
	});

	$('#tabs3a a').click(function(c){		
		switch_tabs($(this));
		c.preventDefault(); // this prevents the original href of the link from being opened
	});

	$('#tabs4a a').click(function(c){		
		switch_tabs($(this));
		c.preventDefault(); // this prevents the original href of the link from being opened
	});

	switch_tabs($('.defaulttab'));
	$('#tabs0').show();
 
});
 


function switch_tabs(obj)
{
	var id = obj.attr("rel");
	$('.tab-content').hide();
	if(id == 'tabs1') {
	$('#tabs1a a').css("background-image","url(images/ascentive/tabs/tab1_alt.gif)");
	} else { $('#tabs1a a').css("background-image","url(images/ascentive/tabs/tab1.gif)"); }
	if(id == 'tabs2') {
	$('#tabs2a a').css("background-image","url(images/ascentive/tabs/tab2_alt.gif)");
	} else { $('#tabs2a a').css("background-image","url(images/ascentive/tabs/tab2.gif)"); }
	if(id == 'tabs3') {
	$('#tabs3a a').css("background-image","url(images/ascentive/tabs/tab3_alt.gif)"); 
	} else { $('#tabs3a a').css("background-image","url(images/ascentive/tabs/tab3.gif)"); }
	if(id == 'tabs4') {
	$('#tabs4a a').css("background-image","url(images/ascentive/tabs/tab4_alt.gif)"); 
	} else { $('#tabs4a a').css("background-image","url(images/ascentive/tabs/tab4.gif)"); }
	$('#'+id).show();
	
}

/*function switch_tabs2(obj)
{
	$('.tab-content').hide();
	$('#tabs1a a').css("background-image","url(images/ascentive/tabs/tab1_deselect.gif)");
	$('#tabs2a a').css("background-image","url(images/ascentive/tabs/tab2_select.gif)");
	$('#tabs3a a').css("background-image","url(images/ascentive/tabs/tab3_deselect.gif)");
	$('#tabs4a a').css("background-image","url(images/ascentive/tabs/tab4_deselect.gif)");	
	$('#tabs2').show();

}

function switch_tabs3(obj)
{
	$('.tab-content').hide();
	$('#tabs1a a').css("background-image","url(images/ascentive/tabs/tab1_deselect.gif)");
	$('#tabs2a a').css("background-image","url(images/ascentive/tabs/tab2_deselect.gif)");
	$('#tabs3a a').css("background-image","url(images/ascentive/tabs/tab3_select.gif)");
	$('#tabs4a a').css("background-image","url(images/ascentive/tabs/tab4_deselect.gif)");	
	$('#tabs3').show();

}

function switch_tabs4(obj)
{
	$('.tab-content').hide();
	$('#tabs1a a').css("background-image","url(images/ascentive/tabs/tab1_deselect.gif)");
	$('#tabs2a a').css("background-image","url(images/ascentive/tabs/tab2_deselect.gif)");
	$('#tabs3a a').css("background-image","url(images/ascentive/tabs/tab3_deselect.gif)");
	$('#tabs4a a').css("background-image","url(images/ascentive/tabs/tab4_select.gif)");	
	$('#tabs4').show();

}*/
