$('h1 img').hide();


function resizeContentMarketing(size, newText, activeTab) {
	if($(activeTab).hasClass("active")) {
		//do nothing!
	} else {
		var size = (size*1);
		var outerSize = (size+20);
		$(".services li").removeClass("active");
		$(activeTab).addClass("active");			
		if ($(".interior").width() !== size) {
			$(".current").fadeOut("50", function(){
				$("#content-mid").stop().animate({
					width:outerSize+"px"
				}, 100, function() {
					$(".interior").width(size);
					$(newText).fadeIn("50");
				});
			});
		} else {
			$(newText).hide();
			$(".current").fadeOut("50", function(){
				$(newText).fadeIn("50");
			});
		}
		$(".current").removeClass("current");
		$(newText).addClass("current");
	
	}
}


function resizeContentBrand(size, newText, activeTab) {
	if($(activeTab).hasClass("active")) {
		//do nothing!
	} else {
		var size = (size*1);
		var outerSize = (size+20);
		$(".services li").removeClass("active");
		$(activeTab).addClass("active");			
		if ($(".interior").width() !== size) {
			$(".current").fadeOut("50", function(){
				$("#content-mid").stop().animate({
					width:outerSize+"px"
				}, 100, function() {
					$(".interior").width(size);
					$(newText).fadeIn("50");
				});
			});
		} else {
			$(newText).hide();
			$(".current").fadeOut("50", function(){
				$(newText).fadeIn("50");
			});
		}
		$(".current").removeClass("current");
		$(newText).addClass("current");
	}
}

function shrinkContentGraphic(size, newText, activeTab) {
	if($(activeTab).hasClass("active")) {
		//do nothing!
	} else {
		var size = (size*1);
		var outerSize = (size+20);
		$(".services li").removeClass("active");
		$(activeTab).addClass("active");			
		if ($(".interior").width() !== size) {
			$(".current").fadeOut("50", function(){
				
				$("#content-left").stop().animate({
					marginLeft:"+=342px"
				}, 100);
				$("#content-mid").stop().animate({
					marginLeft:"+=322px",
					width:outerSize+"px"
				}, 100, function() {
					$(".interior").width(size);
					$(newText).fadeIn("50");
				});
			});
		} else {
			$(newText).hide();
			$(".current").fadeOut("50", function(){
				$(newText).fadeIn("50");
			});
		}
		$(".current").removeClass("current");
		$(newText).addClass("current");
	}
}
function expandContentGraphic(size, newText, activeTab) {
	if($(activeTab).hasClass("active")) {
		//do nothing!
	} else {
		var size = (size*1);
		var outerSize = (size+20);
		$(".services li").removeClass("active");
		$(activeTab).addClass("active");			
		if ($(".interior").width() !== size) {
			$(".current").fadeOut("50", function(){
				
				$("#content-left").stop().animate({
					marginLeft:"-=342px"
				}, 100);
				$("#content-mid").stop().animate({
					marginLeft:"-=322px",
					width:outerSize+"px"
				}, 100, function() {
					$(".interior").width(size);
					$(newText).fadeIn("50");
				});
			});
		} else {
			$(newText).hide();
			$(".current").fadeOut("50", function(){
				$(newText).fadeIn("50");
			});
		}
		$(".current").removeClass("current");
		$(newText).addClass("current");
	}
}

function resizeContentWeb(size, newText, activeTab) {
	if($(activeTab).hasClass("active")) {
		//do nothing!
	} else {
		var size = (size*1);
		var outerSize = (size+20);
		$(".services li").removeClass("active");
		$(activeTab).addClass("active");			
		if ($(".interior").width() !== size) {
			$(".current").fadeOut("50", function(){
				$("#content-mid").stop().animate({
					width:outerSize+"px"
				}, 100, function() {
					$(".interior").width(size);
					$(newText).fadeIn("50");
				});
			});
		} else {
			$(newText).hide();
			$(".current").fadeOut("50", function(){
				$(newText).fadeIn("50");
			});
		}
		$(".current").removeClass("current");
		$(newText).addClass("current");
	}
}
function shrinkContentInternet(size, newText, activeTab) {
	if($(activeTab).hasClass("active")) {
		//do nothing!
	} else {
		var size = (size*1);
		var outerSize = (size+20);
		$(".services li").removeClass("active");
		$(activeTab).addClass("active");			
		if ($(".interior").width() !== size) {
			$(".current").fadeOut("50", function(){
				
				$("#content-left").stop().animate({
					marginLeft:"+=342px"
				}, 100);
				$("#content-mid").stop().animate({
					marginLeft:"+=322px",
					width:outerSize+"px"
				}, 100, function() {
					$(".interior").width(size);
					$(newText).fadeIn("50");
					$("h1").fadeIn("50");
					$(".headline").fadeOut("50");
				});
			});
		} else {
			$(newText).hide();
			$(".current").fadeOut("50", function(){
				$(newText).fadeIn("50");
			});
		}
		$(".current").removeClass("current");
		$(newText).addClass("current");
	}
}
function expandContentInternet(size, newText, activeTab) {
	if($(activeTab).hasClass("active")) {
		//do nothing!
	} else {
		var size = (size*1);
		var outerSize = (size+20);
		$(".services li").removeClass("active");
		$(activeTab).addClass("active");			
		if ($(".interior").width() !== size) {
			$("h1").fadeOut("50");
			$(".headline").fadeIn("50");
			$(".current").fadeOut("50", function(){
				
				$("#content-left").stop().animate({
					marginLeft:"-=342px"
				}, 100);
				$("#content-mid").stop().animate({
					marginLeft:"-=322px",
					width:outerSize+"px"
				}, 100, function() {
					$(".interior").width(size);
					$(newText).fadeIn("50");
				});
			});
		} else {
			$(newText).hide();
			$(".current").fadeOut("50", function(){
				$(newText).fadeIn("50");
			});
		}
		$(".current").removeClass("current");
		$(newText).addClass("current");
	}
}
function shrinkContentAdvertising(size, newText, activeTab) {
	if($(activeTab).hasClass("active")) {
		//do nothing!
	} else {
		var size = (size*1);
		var outerSize = (size+20);
		$(".services li").removeClass("active");
		$(activeTab).addClass("active");			
		if ($(".interior").width() !== size) {
			
			$(".current").fadeOut("50", function(){
				$("h1").stop().animate({
					right:"-=20px"
				}, 100);
				$("#content-left").stop().animate({
					marginLeft:"+=322px"
				}, 100);
				$("#content-mid").stop().animate({
					marginLeft:"+=302px",
					width:outerSize+"px"
				}, 100, function() {
					$(".interior").width(size);
					$(newText).fadeIn("50");

				});
				$(".advertising-banner").fadeIn("50");
			});
		} else {
			$(newText).hide();
			$(".current").fadeOut("50", function(){
				$(newText).fadeIn("50");
			});
		}
		$(".current").removeClass("current");
		$(newText).addClass("current");
	}
}
function expandContentAdvertising(size, newText, activeTab) {
	if($(activeTab).hasClass("active")) {
		//do nothing!
	} else {
		var size = (size*1);
		var outerSize = (size+20);
		$(".services li").removeClass("active");
		$(activeTab).addClass("active");			
		if ($(".interior").width() !== size) {
			$(".advertising-banner").fadeOut("50");
			$(".current").fadeOut("50", function(){
				$("h1").stop().animate({
					right:"+=20px"
				}, 100);
				$("#content-left").stop().animate({
					marginLeft:"-=322px"
				}, 100);
				$("#content-mid").stop().animate({
					marginLeft:"-=302px",
					width:outerSize+"px"
				}, 100, function() {
					$(".interior").width(size);
					$(newText).fadeIn("50");
				});
			});
		} else {
			$(newText).hide();
			$(".current").fadeOut("50", function(){
				$(newText).fadeIn("50");
			});
		}
		$(".current").removeClass("current");
		$(newText).addClass("current");
	}
}

function shrinkContentCopywriting(size, newText, activeTab) {
	if($(activeTab).hasClass("active")) {
		//do nothing!
	} else {
		var size = (size*1);
		var outerSize = (size+20);
		$(".services li").removeClass("active");
		$(activeTab).addClass("active");			
		if ($(".interior").width() !== size) {
			$(".current").fadeOut("50", function(){
				$("h1").stop().animate({
					right:"-=142px"
				}, 100);
				$("#content-left").stop().animate({
					marginLeft:"+=200px"
				}, 100);
				$("#content-mid").stop().animate({
					marginLeft:"+=180px",
					width:outerSize+"px"
				}, 100, function() {
					$(".interior").width(size);
					$(newText).fadeIn("50");
				});
			});
		} else {
			$(newText).hide();
			$(".current").fadeOut("50", function(){
				$(newText).fadeIn("50");
			});
		}
		$(".current").removeClass("current");
		$(newText).addClass("current");
	}
}
function expandContentCopywriting(size, newText, activeTab) {
	if($(activeTab).hasClass("active")) {
		//do nothing!
	} else {
		var size = (size*1);
		var outerSize = (size+20);
		$(".services li").removeClass("active");
		$(activeTab).addClass("active");			
		if ($(".interior").width() !== size) {
			$(".current").fadeOut("50", function(){
				$("h1").stop().animate({
					right:"+=142px"
				}, 100);
				$("#content-left").stop().animate({
					marginLeft:"-=200px"
				}, 100);
				$("#content-mid").stop().animate({
					marginLeft:"-=180px",
					width:outerSize+"px"
				}, 100, function() {
					$(".interior").width(size);
					$(newText).fadeIn("50");
				});
			});
		} else {
			$(newText).hide();
			$(".current").fadeOut("50", function(){
				$(newText).fadeIn("50");
			});
		}
		$(".current").removeClass("current");
		$(newText).addClass("current");
	}
}
$(document).ready(function(){
function pageLoad (page, scripts) {
	$("<div></div>").attr("id","newDiv").css("position","absolute").css("zIndex","9999").insertBefore("#ajax-wrapper");
	$("#ajax-wrapper .Page").clone().appendTo("#newDiv");
	$("#ajax-wrapper").load(page+" .Page",'',function(){
		$.getScript(scripts, function(){
			$("#newDiv").fadeOut("1000", function() {
				$("#newDiv").empty().remove();								  
			});	
		});
	});
}

						   
	$('.obfuscate').nospam({ filterLevel: 'low' });
	
	$('.scroll_pane').jScrollPane({scrollbarWidth:27});
		
	$('ul#Primary').superfish();
		
	$("#SignLinks #creativeservices").click(function(){
		pageLoad("creative-services.php","js/custom_services.js");																  
	});
	
	$("#SignLinks #marketingstrategy").click(function(){
		pageLoad("marketing-strategy-services.php","js/custom_marketing.js");																	  
	});
	
	$("#SignLinks #brandidentity").click(function(){
		pageLoad("branding-services.php","js/custom_brand.js");																	  
	});
	
	$("#SignLinks #graphicdesign").click(function(){
		pageLoad("graphic-design-services.php","http://www.adventuresdesign.com/js/custom_graphic.js");																  
	});
	
	$("#SignLinks #websitedesign").click(function(){
		pageLoad("web-design-services.php","js/custom_web.js");																  
	});
	 
	$("#SignLinks #internetmarketing").click(function(){
		pageLoad("seo-internet-marketing-services.php","js/custom_internet.js");	
	});
	
	$("#SignLinks #advertising").click(function(){
		pageLoad("advertising-services.php","js/custom_advertising.js");
	});
	 
	$("#SignLinks #copywriting").click(function(){
		pageLoad("website-copywriting-services.php","js/custom_copywriting.js")	;
	}); 
	
	$("#SignLinks a").append("<img src='site/clear.gif' alt='' class='invisible' />");
	
	$("#SignLinks a").each(function() {
		$(this).click(function(){
			if ($(this).hasClass("Active")) {
				return true;
			} else {
				$("#SignLinks a").removeClass("Active");		   
				$(this).addClass("Active");
				if(jQuery.browser.version != 7.0) {
					return false;
				} else {
					return true;	
				}
			}
		});
	});
	
	$.preloadCssImages();

	

	$('h1 img').show();
});
