function collapse(div){
	var status = $("#"+div).is(":visible");
	if(status){
		//$("#"+div).slideUp('fast');
		$("#"+div).slideDown('slow');
	}else{
		$("#"+div).slideDown('fast');
	}
	placeNav(div);
	closeAllHome(div);
}

function closeAllHome(div){

	switch ( div ) {
		case "greenSlideContent":
			$("#yellowSlideContent").slideUp('fast');
			$("#greySlideContent").slideUp('fast');
			$("#navySlideContent").slideUp('fast');
			$("#powderSlideContent").slideUp('fast');
			$("#plusGreen").hide();
			$("#plusYellow").show();
			$("#plusGrey").show();
			$("#plusNavy").show();
			$("#plusPowder").show();
			$("#powderNav").hide();
			$("#navyNav").hide();
			$("#greyNav").hide();
			$("#yellowNav").hide();
			break;
		case "yellowSlideContent":
			$("#greenSlideContent").slideUp('fast');
			$("#greySlideContent").slideUp('fast');
			$("#navySlideContent").slideUp('fast');
			$("#powderSlideContent").slideUp('fast');
			$("#plusGreen").show();
			$("#plusYellow").hide();
			$("#plusGrey").show();
			$("#plusNavy").show();
			$("#plusPowder").show();
			$("#powderNav").hide();
			$("#navyNav").hide();
			$("#greyNav").hide();
			$("#greenNav").hide();
			break;
		case "greySlideContent":
			$("#greenSlideContent").slideUp('fast');
			$("#yellowSlideContent").slideUp('fast');
			$("#navySlideContent").slideUp('fast');
			$("#powderSlideContent").slideUp('fast');
			$("#plusGreen").show();
			$("#plusYellow").show();
			$("#plusGrey").hide();
			$("#plusNavy").show();
			$("#plusPowder").show();
			$("#powderNav").hide();
			$("#navyNav").hide();
			$("#yellowNav").hide();
			$("#greenNav").hide();
			break;
		case "navySlideContent":
			$("#greenSlideContent").slideUp('fast');
			$("#yellowSlideContent").slideUp('fast');
			$("#greySlideContent").slideUp('fast');
			$("#powderSlideContent").slideUp('fast');
			$("#plusGreen").show();
			$("#plusYellow").show();
			$("#plusGrey").show();
			$("#plusNavy").hide();
			$("#plusPowder").show();
			$("#powderNav").hide();
			$("#greyNav").hide();
			$("#yellowNav").hide();
			$("#greenNav").hide();
			break;
		
		default:
			$("#greenSlideContent").slideUp('fast');
			$("#yellowSlideContent").slideUp('fast');
			$("#greySlideContent").slideUp('fast');
			$("#navySlideContent").slideUp('fast');
			$("#plusGreen").show();
			$("#plusYellow").show();
			$("#plusGrey").show();
			$("#plusNavy").show();
			$("#plusPowder").hide();
			$("#navyNav").hide();
			$("#greyNav").hide();
			$("#yellowNav").hide();
			$("#greenNav").hide();
	}

}

function getPageContent(id, sec, div){
	$("#"+div).html("");
	
	if(id.length < 1){
		id=1;
	}
	
	if(sec.length < 1){
		sec=1;
	}

	$.post("page.lasso", { id: id, section: sec },
		function(html){
			$("#"+div).html(html);
	});

}

function getDefaultPageContent(id, sec, div){
	$("#"+div).hide();
	$("#"+div).html("");
	
	if(id.length < 1){
		id=1;
	}
	
	if(sec.length < 1){
		sec=1;
	}

	$.post("page.lasso", { id: id, section: sec },
		function(html){
			$("#"+div).html(html);
			$("#"+div).slideDown('fast');
	});

}

function restartSlider(){
	$('#stage0M').css('left', '0px');
	$('#stage1M').css('left', '106px');
	$('#stage2M').css('left', '212px');
	$('#stage3M').css('left', '318px');
	$('#stage4M').css('left', '424px');
	$('#stage5M').css('left', '-106px');
}

function placeNav(div){
	var sectionBold = $("#sectionID").val();
	switch ( div ) {
		case "greenSlideContent":
			var sec = 3;
			var place = "greenNav";
			break;
		case "yellowSlideContent":
			var sec = 4;
			var place = "yellowNav";
			break;
		case "greySlideContent":
			var sec = 5;
			var place = "greyNav";
			break;
		case "navySlideContent":
			var sec = 6;
			var place = "navyNav";
			break;
		default:
			var sec = 2;
			var place = "powderNav";
	}
	//alert(sec + " -- " + sectionBold);
	$.post("nav2.lasso", { section: sec, sectionBold: sectionBold },
		function(html){
			$("#"+place).html(html);
			$("#"+place).show();
	});
}

/*
function openSesame(obj){
	// set up file
	var source = obj.src;
	var s = source.split("/");
	var x = s.length - 1;
	var file = s[x];
	$('#portfolioIMG').attr('src', 'images/slider/portfolio/main/'+file.replace(".gif", ".jpg"));
	// set up window
	var height = $(document).height();
	var width = $(document).width();
	
	$('#windowBack').css("height", height);
	$('#windowBack').css("width", width);
	
	var height = $(window).height();
	var width = $(window).width();
	var half = width / 2;
	var qw = half - 200;
	var c = height / 2;
	var cs = c - 100;
	
	$('#portfolioIMG').vCenter();
	//$('#portfolioIMG').css('left', qw);
	
	//display window
	$("#windowBack").show();
}
*/

var p = -1;
function openSesame(obj, arr, num){
	$("#currentClick").val(num);
	//alert(awards[num]);
		if(arr == 'portfolioText'){
			var txt = portfolioText[num];
			buildSlices("portfolio", num);
		}else{
			var txt = awardsText[num];
			buildSlices("awards", num);
		}
		
		$("#portText").html(txt);
		var source = obj.src;
		var s = source.split("/");
		var x = s.length - 1;
		var file = s[x];
		var check = file.indexOf('a');
		p = check;
		var four = $('#portfolioIMG').attr('src', 'images/slider/portfolio/main/'+file.replace(".gif", ".jpg"));
		var imageWidth = getImgSize('images/slider/portfolio/main/'+file.replace(".gif", ".jpg"));
		//alert("3: "+imageWidth);
		$('#portfolio').css('width', parseInt(imageWidth)+"px");
		var three = $("#windowBack").show();
		var two = $("#portfolio").show();
		//alert('0');
		findCenter("windowBack","portfolio","N");
		animateStage("portfolioIMG");
}

function findCenter(outerdiv, innerdiv, scroll){

		// GET SIZE OF IMG
		var pic = $("#portfolioIMG");
		var pic_real_width = pic.width();
		var pic_real_height = pic.height();
		//alert(pic_real_width + " --- " + pic_real_height);
		
		//set width of inner div to the images size
		//$('#'+innerdiv).css('width', parseInt(pic_real_width)+"px");
		
		//get document height and width
		var height = $(document).height();
		var width = $(document).width();
		
		if(scroll == "Y"){
			height = height - 2;
			width = width - 2;
		}
		//set the size of the background (full size div)
		$('#'+outerdiv).css("height", height);
		$('#'+outerdiv).css("width", width);

		// get window width and height
		var height = $(window).height();
		var width = $(window).width();
		
		//get middle of window
		var half = width / 2;
		var topHalf = height / 2;
		
		// off set centers based on width of img
		var qw = parseInt(half) - parseInt(pic_real_width);
		var ww = topHalf - pic_real_height;
		//if(scroll == "Y"){
			//$('#'+innerdiv).vCenter();
		//}

		//$('#'+innerdiv).css('width', parseInt(W)+"px");
		//$("#testInfo").html(qw + " --- " + pic_real_height);
		
		// move inner div to horizontal center
		//$('#'+innerdiv).css('left', qw+"px");
		//$('#'+innerdiv).css('top', "50px");
		
		return pic_real_width;
		
}

function closeSesame(){
	$("#windowBack").hide();
	$('#portfolioIMG').attr('src', 'images/0spacer.gif');
}

function closePop(){
	$("#popupBack").hide();
	$('#popIMG').attr('src', 'images/0spacer.gif');
}

function closeTeam(){
	$("#teamBack").hide();
	$('#teamIMG').attr('src', 'images/0spacer.gif');
}

function backLink(url,div){
	switch ( div ) {
		case "greenSlideContent":
			var sec = 3;
			//collapse("greenSlideContent");
			//getPageContent(sec, sec, "greenSlideContent");
			break;
		case "yellowSlideContent":
			var sec = 4;
			//collapse("yellowSlideContent");
			//getPageContent(sec, sec, "yellowSlideContent");
			break;
		case "greySlideContent":
			var sec = 5;
			//collapse("greySlideContent");
			//getPageContent(sec, sec, "greySlideContent");
			break;
		case "navySlideContent":
			var sec = 6;
			//collapse("navySlideContent");
			//getPageContent(sec, sec, "navySlideContent");
			break;
		default:
			var sec = 2;
			//collapse("powderSlideContent");
			//getPageContent(sec, sec, "powderSlideContent");
	}
	
	$("#"+div).slideUp('fast');
	window.location = url;
}

var click = 0;
function portfolioPrev(arr){
	var nextClick = $("#currentClick").val();
	$("#teamPrev").hide();
	var sauce = $("#portfolioIMG").attr("src");
	var s = sauce.split("/");
	var x = s.length - 1;
	var sauce = s[x];
	hideImage("portfolioIMG");
	click = click - 1;
	nextClick = parseInt(nextClick) - 1;
	if( p < 0){
		var max = portfolio.length;
		max = max -0;
		if(nextClick >= max || nextClick < 0){
			nextClick = max -1;
		}
		var file = portfolio[nextClick];
		var txt = portfolioText[nextClick];
		buildSlices("portfolio", nextClick);
	}else{
		var max = awards.length;
		max = max -0;
		if(nextClick >= max || nextClick < 0){
			nextClick = max -1;
		}
		var file = awards[nextClick];
		var txt = awardsText[nextClick];
		buildSlices("awards", nextClick);
	}
	if(file == sauce.replace(".jpg", ".gif")){
		click = click - 1;
		if( p < 0){
			var max = portfolio.length;
			max = max -0;
			if(nextClick >= max || nextClick < 0){
				nextClick = max -1;
			}
			var file = portfolio[nextClick];
			var txt = portfolioText[nextClick];
		}else{
			var max = awards.length;
			max = max -0;
			if(nextClick >= max || nextClick < 0){
				nextClick = max -1;
			}
			var file = awards[nextClick];
			var txt = awardsText[nextClick];
		}
	}
	$("#currentClick").val(nextClick);
	setTimeout(function() {
		$("#portText").html(txt);
		$("#teamPrev").show();
	}, 1000 );
	//var test = $('#testInfo').html(click);
	setTimeout("putImg('"+file+"')",1000);
	setTimeout("bringImg('portfolioIMG')",1000);
}
function portfolioNext(){
	var nextClick = $("#currentClick").val();
	$("#teamNext").hide();
	var sauce = $("#portfolioIMG").attr("src");
	var s = sauce.split("/");
	var x = s.length - 1;
	var sauce = s[x];
	hideImage("portfolioIMG");
	click = click + 1;
	nextClick = parseInt(nextClick) +1;
	if( p < 0){
		var max = portfolio.length;
		max = max -0;
		if(nextClick >= max || nextClick < 0){
			nextClick = 0;
		}
		var file = portfolio[nextClick];
		var txt = portfolioText[nextClick];
		buildSlices("portfolio", nextClick);
	}else{
		var max = awards.length;
		max = max -0;
		if(nextClick >= max || nextClick < 0){
			nextClick = 0;
		}
		var file = awards[nextClick];
		var txt = awardsText[nextClick];
		buildSlices("awards", nextClick);
	}
	if(file == sauce.replace(".jpg", ".gif")){
		click = click + 1;
			if( p < 0){
				var max = portfolio.length;
				max = max -0;
				if(nextClick >= max || nextClick < 0){
					nextClick = 0;
				}
				var file = portfolio[nextClick];
				var txt = portfolioText[nextClick];
			}else{
				var max = awards.length;
				max = max -0;
				if(nextClick >= max || nextClick < 0){
					nextClick = 0;
				}
				var file = awards[nextClick];
				var txt = awardsText[nextClick];
			}
	}
	$("#currentClick").val(nextClick);
	setTimeout(function() {
		$("#portText").html(txt);
		$("#teamNext").show();
	}, 1000 );
	//var test = $('#testInfo').html(click);
	setTimeout("putImg('"+file+"')",1000);
	setTimeout("bringImg('portfolioIMG')",1500);
}
function putImg(file){
	$('#portfolioIMG').attr('src', 'images/slider/portfolio/main/'+file.replace(".gif", ".jpg"));
	var imageWidth = getImgSize('images/slider/portfolio/main/'+file.replace(".gif", ".jpg"));
	$('#portfolio').css('width', parseInt(imageWidth)+"px");
	$("#testInfo").html(imageWidth);
}
function animateStage(div){
	//$("#"+div).hide();
	findCenter("windowBack","portfolio","N");
	var t=setTimeout("bringStage('"+div+"')",100);
}
function bringStage(div){
	$("#"+div).show("fast");
	/*
	$("#"+div).animate({ 
		opacity: 1
	}, 1000 );
	*/
}
function hideImage(div){
	$("#"+div).animate({ 
		opacity: 0
	}, 1000 );
	$("#portfolio").animate({ 
		opacity: 0
	}, 1000 );
	
	// most effect types need no options passed by default
	var options = {};
	//options = { percent: 0 }; // for scale effect
	//$("#"+div).effect( "blind", options, 500, bringImg() );
	//$("#"+div).slideUp( "slow" );
}
function bringImg(div){
	findCenter("windowBack","portfolio","N");

	$("#"+div).animate({ 
		opacity: 1
	}, 1000 );
	$("#portfolio").animate({ 
		opacity: 1
	}, 900 );
	
	//$("#"+div).slideDown( "slow" );
}

// callback function to bring a hidden box back
function callback() {
	setTimeout(function() {
		$( "#effect" ).removeAttr( "style" ).hide().fadeIn();
	}, 1000 );
};

function getImgSize(imgSrc)
{
	var width = 0;
   	var one = $.ajax({
		type: "POST",
		url: 'plugins/imageWidth.lasso',
		data: "imgSrc="+imgSrc,
		async: false,
		success: function(data) {
			width = parseInt(data);
			//alert("1: "+width);
		}
	});
   	
   	if(parseInt(width) <= 0){
		width = 600;
	}
	//alert("2: "+width);
	return width;
	/*
	var newImg = new Image();
	newImg.src = imgSrc;
	var height = newImg.height;
	var width = newImg.width;
	*/
}

function getImgSize2(id){
	var pic = document.getElementById(id);
	var h = pic.offsetHeight;
	var w = pic.offsetWidth;
	alert ('The image size is '+w+'*'+h);
}

var branding = new Array(
	'pop2.jpg',
	'pop3.jpg',
	'pop1.jpg'
);
var brandingText = new Array(
	'<div id="popHeader">Citrucel Package Redesign</div><div id="popBody">Developed a new label for both variants (powder and caplets). To further differentiate Citrucel in an overcrowded category, we highlighted Citrucel\'s Number One brand claim by bringing it center-stage, emphasizing that we are the only brand that will not cause excess gas.</div>',
	'<div id="popHeader">Ecotrin Package Redesign</div><div id="popBody">Designed packaging highlighting Ecotrin\'s point of difference by showcasing Ecotrin\'s claim of being the #1 Cardiologist-recommended aspirin, so that consumers will be able to differentiate Ecotrin from its competitors. IN also added a new tag line, "The Aspirin Regimen That\'s Smart for Your Heart," to further emphasize the key product benefits.</div>',
	'<div id="popHeader">OsCal Relaunch</div><div id="popBody">Delivered brand in three ways: updated and improved look and feel at-shelf, more environmentally sustainable packaging, and savings in cost. The project delivered lower pricing and utilized market research to drive package redesign. The resulting packaging was preferred to current packaging 15 to 1 by consumers.</div>'
);

var digital = new Array(
	'digital1.jpg',
	'digital2.jpg',
	'digital3.jpg',
	'digital4.jpg'
);
var digitalText = new Array(
	'<div id="popHeader">2009 ShopRite Samplesaint Pilot Program</div><div id="popBody">Developed and managed a mobile couponing test, making Unilever the first CPG company to offer scannable coupons (with images and corresponding UPC barcodes) directly to the consumer via their mobile phone in an effort to trial new in-store marketing tactics. Partnered with ShopRite to create a promotional buzz in the marketplace and gain insight about consumers\' attitudes toward mobile coupons.</div>',
	'<div id="popHeader">2009 Target AXE/Xbox Program</div><div id="popBody">Made Target the destination for the AXE guy by partnering with Xbox and expanding our reach and driving awareness/trial of the AXE brand at Target. Each AXE special pack encouraged guests to text the unique on-pack code to kick off the process to redeem their 300 FREE Microsoft points. Guests also had the opportunity to text and win a trip for 4 to Vegas and 4 FREE Xbox console gaming units.</div>',
	'<div id="popHeader">2010 Dove Movement for Self-Esteem CVS.com</div><div id="popBody">Educated CVS consumers about the Dove Movement for Self-Esteem and Boys & Girls Clubs of America Partnership. Executed a 360-degree program including retail connections, in-store offers, and, most importantly, a cvs.com program. This media buy housed all the details of the movement, asking consumers to sign up to be a part of it, and also had a secondary focus on the Dove product benefits.</div>',
	'<div id="popHeader">2010 Sam\'s Club HBA Sampling Center</div><div id="popBody">Raised awareness of the HBA offerings that Sam\'s Club offered and allowed members the opportunity to try before committing to purchasing a large-size club pack. Helped drive trial and awareness on HBA items prior to the in-store merchandising.</div>'
);
var consumer = new Array(
	'consumer.jpg'
);
var consumerText = new Array(
	'<div id="popHeader">GSK Advantage Brands FSI</div><div id="popBody">Designed an anchor event that allowed retailer partners to plan strategic shopper marketing overlays while working to strengthen retailer alliances.</div>'
);

var custom = new Array(
	'cus1.jpg',
	'cus2.jpg',
	'cus3.jpg',
	'cus4.jpg'
);
var customText = new Array(
	'<div id="popHeader">Recipe Cards</div><div id="popBody">For 20 years, Integrated has been providing appetizing solutions for breakfast, lunch, dinner, entertaining, holidays and more. Consumers trust Integrated\'s recipes, which are all kitchen-tested by culinary professionals. Our professional culinary team will create customized recipes featuring your brand, chef or spokesperson.</div>',
	'<div id="popHeader">Newsletters and Brochures</div><div id="popBody">Our team delivers accurate and credible information on a variety of topics to be used in newsletters and brochures. Our portfolio covers a wide variety of subject matter. We can create any newsletter or brochure and customize it to your brand\'s needs.</div>',
	'<div id="popHeader">Lifestyle Publications</div><div id="popBody">At Integrated, we have the expertise to conceptualize and create unique lifestyle magazines and publications that cater to very specific audiences. Never a one-size-fits-all approach, these publications address topics of real interest to the targeted consumer, from fashion and fitness to finance or any other topic you\'d like.</div>',
	'<div id="popHeader">Cookbooks</div><div id="popBody">The Integrated team also specializes in customized cookbooks. We\'ve created a wide range of cookbooks spanning Asian, Euro-Mediterranean, Latino and Middle-Eastern cuisines. Our team of culinary experts can create any kind of cookbook to suit your specific needs.</div>'
);
var multicultural = new Array(
	'mult1.jpg',
	'mult2.jpg',
	'mult3.jpg',
	'mult4.jpg',
	'mult5.jpg',
	'mult6.jpg'
);
var multiculturalText = new Array(
	'<div id="popHeader">Case Study: Walmart Hispanic Heritage Month</div><div id="popBody">Partnered with Walmart through an online, PR, and in-store campaign where Walmart and select brands positioned themselves as leaders in championing education among Hispanic youth. Double- and triple-digit lifts for participating brands in program.</div>',
	'<div id="popHeader">Case Study: SONY Educational Demo at Best Buy</div><div id="popBody">Deployed bilingual SONY sales blitz teams in 200 Best Buy stores during the critical holiday shopping season. The reps utilized broad multi-category knowledge and training to cross- and up-sell holiday shoppers to complete customer solutions. Sales reps reached an average of 34 customers per event, assisting and cross-selling in multiple departments; 33% of all customer interactions were in Spanish and nearly 3,000 demos were given that weekend, resulting in 2,100 sales.</div>',
	'<div id="popHeader">Case Study: Nestl&eacute; and Fisher-Price Three Kings Day at Walmart.</div><div id="popBody">Partnering with Walmart, Nestl&eacute; and Fisher-Price, IN recruited and hired Hispanic female brand delegates to provide consumers with three Kings Day celebration suggestions, distribute samples of Nestl&eacute; ABUELITA Instant Hot Chocolate, and showcase targeted Fisher-Price toys.<br><br>Reached an average of 60,000 target consumers among 300 locations and experienced over 12% incremental sales lift among featured products, despite the previous holiday sales push. The Houston Chronicle also featured the event online.</div>',
	'<div id="popHeader">Case Study: Feria del Mercado event at Unified Grocers</div><div id="popBody">Activated a custom "Feria Del Mercado" event at a parking lot that gathered crowds with its festival-like atmosphere. Families enjoyed the afternoon together playing games and winning prizes, sampling recipes, trying product samples, listening to music, and dancing. Sales were $89k more than expected, and store traffic reached maximum capacity.</div>',
	'<div id="popHeader">Case Study: Custom Hispanic Publications</div><div id="popBody">Introduced a 12-month wall calendar as free "take-ones" to Hispanic shoppers, providing both authentic recipes and heartwarming personal stories of triumph. Drove shoppers to purchase items they had never tried before to make the recipes.</div>',
	'<div id="popHeader">Case Study: Direct Mail VIVIENDO with Walmart</div><div id="popBody">Created a bilingual, quarterly magazine authentically celebrating all aspects of Hispanic culture such as family, traditions and heritage, while showcasing Walmart departments and services. The Wall Street Journal recognized Walmart for its successes in marketing to the Hispanic community, and VIVIENDO was cited as an integral part of its initiatives.</div>'
);
var partner = new Array(
	'partner1.jpg',
	'partner2.jpg',
	'partner3.jpg',
	'partner4.jpg',
	'partner5.jpg'
);
var partnerText = new Array(
	'<div id="popHeader">GSK Advantage Brands, Fiber Choice and Beano:</div><div id="popBody">Partnered, for the first time, with two of GSK\'s Legacy OTC brands&ndash;&ndash;Fiber Choice and Beano&ndash;&ndash;for a GI event that included a 500,000-piece direct mail program and a dedicated website.</div>',
	'<div id="popHeader">Jewel-Osco and Borden:</div><div id="popBody">Program supported Borden\'s new product distribution, Campbell\'s soup and their own private label bread through strong value meal solutions messaging.</div>',
	'<div id="popHeader">Dove Go-Fresh and <i>People StyleWatch</i>:</div><div id="popBody">Created a Target Direct mailer joint offer and national print ad uniting Dove Go-Fresh and People StyleWatch magazine, resulting in both gaining valuable exposure and promotion.</div>',
	'<div id="popHeader">AXE and Microsoft/Xbox:</div><div id="popBody">Partnership between AXE and Microsoft/Xbox that raised awareness of Game-On campaign and drove brand awareness to help launch new AXE Hair.</div>',
	'<div id="popHeader">Hellman\'s and Starkist:</div><div id="popBody">Meal Solution partnership between Hellmann\'s Mayo and StarKist Tuna drove sales and brand awareness for both household name products.</div>'
);
var shopper = new Array(
	'shopper1.jpg',
	'shopper2.jpg',
	'shopper3.jpg',
	'shopper4.jpg',
	'shopper5.jpg'
);
var shopperText = new Array(
	'<div id="popHeader">Dove Men+Care:</div><div id="popBody">In January 2010, Dove introduced MEN+CARE, the brand\'s first-ever product collection created specifically for men.<br><br>Integrated developed a strategy across multiple channels and accounts, while leveraging the national look and feel.<br><br>The following pages showcase how our insights led to successful in-market plans at Grocery, Mass, and Drug retailers. </div>',
	'<div id="popHeader">Marzetti Caramel Apple Dip:</div><div id="popBody">Still going strong after five years of execution, the Marzetti "uDip Sweepstakes.com" provides consumers with instant savings and a variety of exciting usage occasions and recipes for Caramel Apple Dip. It\'s a great example of how custom programs for key retailers can produce excellent results.</div>',
	'<div id="popHeader">ICBINB:</div><div id="popBody">Integrated developed a campaign that not only garnered retailer support of I Can\'t Believe It\'s Not Butter! new baking sticks, but also convinced shoppers that the product was a superb "better for you" alternative for their baking needs.</div>',
	'<div id="popHeader">Bertolli:</div><div id="popBody">Consumers were feeling the impact of an uncertain economy.<br><br>That\'s why Integrated Marketing developed a solution that captured the excitement of the dining-out experience with an at-home meal at a price consumers could afford.<br><br>A partnership between Bertolli Frozen Dinners and Breyers Ice Cream gave shoppers a quick, one-stop-shop offer that brought a complete restaurant-quality meal (including dessert) to the comfort of their home.</div>',
	'<div id="popHeader">Johnsonville:</div><div id="popBody">Thanks to a recent program, Food Lion had the opportunity to attract a wider consumer base of pasta and sausage users by offering new meal solution opportunities. (They also hoped to bring lapsed users back into the category.)<br><br>We suggested that a multi-wave, 360-degree Shopper Marketing event would drive shoppers to Food Lion stores and generate incremental purchases of Johnsonville Italian Sausage by providing quality meal solutions, new usage suggestions and instant savings.</div>'
);
var strategic = new Array(
	'strategic_3.jpg',
	'strategic_2.jpg',
	'strategic_1.jpg'
);
var strategicText = new Array(
	'<div id="popHeader">"Keep It Farm Fresh" Midwest Dairy Association:</div><div id="popBody">This program was designed to generate long-term consumer demand for nutrient-rich dairy products, including milk, cheese and yogurt. Our fundamental strategy was to increase total basket ring with a turnkey purchase incentive program tied to environmentally-friendly behavior.<br><br>Giving shoppers a free insulated dairy bag proved to be crucial to the success of the program, which ran in 851 stores across nine major states.</div>',
	'<div id="popHeader">Nexxus Menu Marketing:</div><div id="popBody">Our salon hair care consumer spans across a wide range of age demographics and interests. Our research confirmed that she recognizes the Nexxus name.  While various tactics and methods of communication will reach her, flexible options are needed for specific retailers.<br><br>Working collaboratively with Nexxus Sales and Marketing, IN developed five strategic menu concepts for the top 30 grocery and drug retailers. IN helped manage the sell-in, execution and post-promotion analysis for programs.<br><br>Just one example of the program\'s success: Kmart delivered over 200% lift across Nexxus SKUs. Talk about beautiful results.</div>',
	'<div id="popHeader">Skippy Peanut Butter Defense Plan:</div><div id="popBody">Skippy needed to inform consumers that Skippy Peanut Butter was not part of the peanut recall in 2009. It was important to reassure shoppers regarding the safety and quality of Skippy products, and to ensure that Skippy maintained sales volume during the time of the recall.<br><br>We developed a PCS response plan that featured a national press release, email blasts, ROP newspaper campaign, ad tags at retail (in 2,312 stores), iPOPs signs (placed in 8,109 stores), 50,000 shelf danglers, 16,000 loose coupons and a national FSI.<br><br>The result? Skippy was able to gain market share during the recall while other manufacturers actually lost share.</div>'
);
var retailer = new Array(
	'retailer_1.jpg',
	'retailer_2.jpg',
	'retailer_3.jpg',
	'retailer_4.jpg',
	'retailer_5.jpg',
	'retailer_6.jpg'
);
var retailerText = new Array(
	'<div id="popHeader">Dormroom Recovery Project:</div><div id="popBody">We wanted to drive students into Target to purchase everything they need to be ready for college. The insight was simple enough: Guys aren\'t aware that their dorm room reflects a lot about them to their peers... and most agree that their room is "so not cool."<Br><br>Axe and Target were the perfect partners to help these guys out. An aggressive program featured high Web visibility and included custom T-shirts, as well as a "show us you have the filthiest dorm room" contest. This very popular promotion made sure guys got everything they needed to go back to school in style.</div>',
	'<div id="popHeader">Sports Illustrated and Miller Lite:</div><div id="popBody">Given the spike in beer sales around the Super Bowl, we knew we could capture our male shopper as he\'s getting his weekly tailgate beverage and latest football news.<br><br>We created an attention-grabbing program in 7-Eleven with a compelling display, instant savings and a premium giveaway.<br><br>Strong national support delivered heightened brand presence and incremental sales for both partners.</div>',
	'<div id="popHeader">Meal Solutions Event Program:</div><div id="popBody">As consumers continued to feel anxious about the economy, one of the ways they tried to save money was by eating out less. This program offered shoppers quick and easy meal solutions for a fraction of the cost of a restaurant meal.<br><br>We developed "Easy Meal Favorites" that translated into four seasonal platforms incorporating Unilever food brands and Private Label items that would keep consumers coming back.</div>',
	'<div id="popHeader">Safeway Living Well, Feeling Great:</div><div id="popBody">Safeway challenged Unilever to enhance their Living Well, Feeling Great platform with new tactical extensions to keep the program fresh and relevant.<br><br>We delivered a customized direct mail piece featuring 4 areas of content and delivered a clipless coupon. A circular ad and radio announcements supported the program for four consecutive weeks. In-store elements included a brochure with a shopping list, Catalina reward prints, bib tags, as well as secondary displays.</div>',
	'<div id="popHeader"><i>InStyle</i>/A Picture-Perfect Holiday:</div><div id="popBody"><i>InStyle</i> magazine delivered a national Shopper Marketing program that leveraged four advertiser partner brands to support the November Holiday issue. Out-of-home and in-store efforts supported Walgreens preferred tactics to generate traffic to store and multiple points of engagement in-store. The outstanding results were a gift to everyone involved.</div>',
	'<div id="popHeader">Suave/Walmart "Save Even More" Campaign:</div><div id="popBody">Mom faces an internal struggle between taking care of others and taking care of herself.  She has let herself go because she ultimately feels guilty about putting beauty back on her to-do list, and feels it comes at the expense of things she should be doing for her family.<br><br>That led us to a hugely successful 360-degree program that leveraged Suave\'s "Say Yes to Beautiful without Paying the Price" brand message and Walmart\'s "Save Money. Live Better." positioning.</div>'
);
function popPrev(arr){
	$("#teamPrev").hide();
	// arr signifies which array to use
	switch ( arr ) {
		case 'branding':
			var arrSize = branding.length -1;
			break;
		case 'digital':
			var arrSize = digital.length -1;
			break;
		case 'consumer':
			var arrSize = consumer.length -1;
			break;
		case 'custom':
			var arrSize = custom.length -1;
			break;
		case 'multicultural':
			var arrSize = multicultural.length -1;
			break;
		case 'partner':
			var arrSize = partner.length -1;
			break;
		case 'shopper':
			var arrSize = shopper.length -1;
			break;
		case 'strategic':
			var arrSize = strategic.length -1;
			break;
		case 'retailer':
			var arrSize = retailer.length -1;
			break;
		default:
			var arrSize = branding.length -1;
	}
	// get the current position
	var pos = $('#currentPop').val();
	// set the next position
	var nextPos = parseInt(pos) - 1;
	if(nextPos < 0){
		nextPos = arrSize;
	}
	// set the next image and next text
	switch ( arr ) {
		case 'branding':
			var nextImg = branding[nextPos];
			var nextTxt = brandingText[nextPos];
			buildSlices("branding", nextPos);
			break;
		case 'digital':
			var nextImg = digital[nextPos];
			var nextTxt = digitalText[nextPos];
			buildSlices("digital", nextPos);
			break;
		case 'consumer':
			var nextImg = consumer[nextPos];
			var nextTxt = consumerText[nextPos];
			buildSlices("consumer", nextPos);
			break;
		case 'custom':
			var nextImg = custom[nextPos];
			var nextTxt = customText[nextPos];
			buildSlices("custom", nextPos);
			break;
		case 'multicultural':
			var nextImg = multicultural[nextPos];
			var nextTxt = multiculturalText[nextPos];
			buildSlices("multicultural", nextPos);
			break;
		case 'partner':
			var nextImg = partner[nextPos];
			var nextTxt = partnerText[nextPos];
			buildSlices("partner", nextPos);
			break;
		case 'shopper':
			var nextImg = shopper[nextPos];
			var nextTxt = shopperText[nextPos];
			buildSlices("shopper", nextPos);
			break;
		case 'strategic':
			var nextImg = strategic[nextPos];
			var nextTxt = strategicText[nextPos];
			buildSlices("strategic", nextPos);
			break;
		case 'retailer':
			var nextImg = retailer[nextPos];
			var nextTxt = retailerText[nextPos];
			buildSlices("retailer", nextPos);
			break;
		default:
			var nextImg = branding[nextPos];
			var nextTxt = brandingText[nextPos];
			buildSlices("branding", nextPos);
			break;
	}
	// animate the image (fade out)
	var one = $("#popIMG").animate({ 
		opacity: 0
	}, 1000 );
	// animate the text (fade out)
	var two = $("#popText").animate({ 
		opacity: 0
	}, 1000 );
	// populate the next img and text and set the new current position
	// and animate the stage width
	setTimeout(function() {
		$('#currentPop').val(nextPos);
		$('#popText').html(nextTxt);
		$('#popIMG').attr('src', 'images/slider/pop_up/'+nextImg);
		var imageWidth = getImgSize('images/slider/pop_up/'+nextImg);
		stageWidth = parseInt(imageWidth) + 10;
		//animate the stage size
		var three = $("#popUp").animate({ 
			width: parseInt(stageWidth)+"px"
		}, 1000 );
	}, 1000 );
	// Bring in the new img and text
	setTimeout(function() {
		var one = $("#popIMG").animate({ 
			opacity: 1
		}, 1000 );
		// animate the text (fade out)
		var two = $("#popText").animate({ 
			opacity: 1
		}, 1000 );
		$("#teamPrev").show();
	}, 2500 );
	
}

function popNext(arr){
	$("#teamNext").hide();
	// arr signifies which array to use
	switch ( arr ) {
		case 'branding':
			var arrSize = branding.length -1;
			break;
		case 'digital':
			var arrSize = digital.length -1;
			break;
		case 'consumer':
			var arrSize = consumer.length -1;
			break;
		case 'custom':
			var arrSize = custom.length -1;
			break;
		case 'multicultural':
			var arrSize = multicultural.length -1;
			break;
		case 'partner':
			var arrSize = partner.length -1;
			break;
		case 'shopper':
			var arrSize = shopper.length -1;
			break;
		case 'strategic':
			var arrSize = strategic.length -1;
			break;
		case 'retailer':
			var arrSize = retailer.length -1;
			break;
		default:
			var arrSize = branding.length -1;
	}
	// get the current position
	var pos = $('#currentPop').val();
	// set the next position
	var nextPos = parseInt(pos) + 1;
	if(nextPos > arrSize){
		nextPos = 0;
	}
	// set the next image and next text
	switch ( arr ) {
		case 'branding':
			var nextImg = branding[nextPos];
			var nextTxt = brandingText[nextPos];
			buildSlices("branding", nextPos);
			break;
		case 'digital':
			var nextImg = digital[nextPos];
			var nextTxt = digitalText[nextPos];
			buildSlices("digital", nextPos);
			break;
		case 'consumer':
			var nextImg = consumer[nextPos];
			var nextTxt = consumerText[nextPos];
			buildSlices("consumer", nextPos);
			break;
		case 'custom':
			var nextImg = custom[nextPos];
			var nextTxt = customText[nextPos];
			buildSlices("custom", nextPos);
			break;
		case 'multicultural':
			var nextImg = multicultural[nextPos];
			var nextTxt = multiculturalText[nextPos];
			buildSlices("multicultural", nextPos);
			break;
		case 'partner':
			var nextImg = partner[nextPos];
			var nextTxt = partnerText[nextPos];
			buildSlices("partner", nextPos);
			break;
		case 'shopper':
			var nextImg = shopper[nextPos];
			var nextTxt = shopperText[nextPos];
			buildSlices("shopper", nextPos);
			break;
		case 'strategic':
			var nextImg = strategic[nextPos];
			var nextTxt = strategicText[nextPos];
			buildSlices("strategic", nextPos);
			break;
		case 'retailer':
			var nextImg = retailer[nextPos];
			var nextTxt = retailerText[nextPos];
			buildSlices("retailer", nextPos);
			break;
		default:
			var nextImg = branding[nextPos];
			var nextTxt = brandingText[nextPos];
			buildSlices("branding", nextPos);
			break;
	}
	// animate the image (fade out)
	var one = $("#popIMG").animate({ 
		opacity: 0
	}, 1000 );
	// animate the text (fade out)
	var two = $("#popText").animate({ 
		opacity: 0
	}, 1000 );
	// populate the next img and text and set the new current position
	// and animate the stage width
	setTimeout(function() {
		$('#currentPop').val(nextPos);
		$('#popText').html(nextTxt);
		$('#popIMG').attr('src', 'images/slider/pop_up/'+nextImg);
		var imageWidth = getImgSize('images/slider/pop_up/'+nextImg);
		stageWidth = parseInt(imageWidth) + 10;
		//animate the stage size
		var three = $("#popUp").animate({ 
			width: parseInt(stageWidth)+"px"
		}, 1000 );
	}, 1000 );
	// Bring in the new img and text
	setTimeout(function() {
		var one = $("#popIMG").animate({ 
			opacity: 1
		}, 1000 );
		// animate the text (fade out)
		var two = $("#popText").animate({ 
			opacity: 1
		}, 1000 );
		$("#teamNext").show();
	}, 2500 );
	
}

function openPop(img, arr, pos){
	switch ( arr ) {
		case 'brandingText':
			var text = brandingText[pos];
			buildSlices("branding", pos);
			break;
		case 'digitalText':
			var text = digitalText[pos];
			buildSlices("digital", pos);
			break;
		case 'consumerText':
			var text = consumerText[pos];
			buildSlices("consumer", pos);
			break;
		case 'customText':
			var text = customText[pos];
			buildSlices("custom", pos);
			break;
		case 'multiculturalText':
			var text = multiculturalText[pos];
			buildSlices("multicultural", pos);
			break;
		case 'partnerText':
			var text = partnerText[pos];
			buildSlices("partner", pos);
			break;
		case 'shopperText':
			var text = shopperText[pos];
			buildSlices("shopper", pos);
			break;
		case 'strategicText':
			var text = strategicText[pos];
			buildSlices("strategic", pos);
			break;
		case 'retailerText':
			var text = retailerText[pos];
			buildSlices("retailer", pos);
			break;
		default:
			var text = brandingText[pos];
			buildSlices("branding", pos);
	}
	$('#currentPop').val(pos);
	$('#popText').html(text);
	$('#popIMG').attr('src', 'images/0spacer.gif');
	var imageWidth = getImgSize('images/slider/pop_up/'+img);
	$('#popUp').css('width', parseInt(imageWidth)+"px");
	$('#popIMG').attr('src', 'images/slider/pop_up/'+img);
	$("#popupBack").show();
}
var team = new Array(
	'team1.jpg',
	'team2.jpg',
	//'team3.jpg',
	'team4.jpg',
	'team5.jpg',
	'team6.jpg',
	'team7.jpg',
	'team8.jpg',
	'team9.jpg',
	'team10.jpg',
	'team11.jpg',
	'team12.jpg'
);
var teamText = new Array(
	'<div id="teamHeader">Gary Wagner <div id="teamTitle">President</div></div><div id="teamBody"><img src="images/slider/pop_up/team1.jpg" id="teamIMG" name="teamIMG" border="0" align="left">Gary joined Advantage Sales and Marketing in 1999 and soon became one of the founding members of Integrated Marketing. He was appointed EVP of Client Services in 2003, and has served as President since 2007. Gary\'s career started at the Campbells Soup Company, where he worked for eight years, achieving success in category management and customer-specific marketing roles. Prior to ASM, Gary managed Northeast retailers for Catalina Marketing and was named director of pharmaceutical applications.</div>',
	'<div id="teamHeader">Jill Griffin <div id="teamTitle">President</div></div><div id="teamBody"><img src="images/slider/pop_up/team1.jpg" id="teamIMG" name="teamIMG" border="0" align="left">Jill joined Integrated in 2008 and currently leads the Experiential Division, delivering one-to-one interactions on behalf of our clients and retailers.  Jill has 14 years of senior management experience in sales, marketing, business development, software development, licensing, publishing and retail.  She previously served as president of Encore Software, a division of Navarre Corporation, and was in business development and client services at TMP Worldwide.</div>',
	//'<div id="teamHeader">Sheree Winslow <div id="teamTitle">EVP</div></div><div id="teamBody"><img src="images/slider/pop_up/team1.jpg" id="teamIMG" name="teamIMG" border="0" align="left">Sheree leads our field marketing service division, which specializes in executing unique events that bridge the gap between sales and brand objectives. Sheree has over 18 years of experience in everything from advertising to public relations to shopper marketing. Prior to leading our event marketing business, she oversaw more than 2,000 customer marketing promotions. She previously worked at Nestl&eacute;, where she was a three-time winner of the Nestl&eacute; Spirit Award.</div>',
	'<div id="teamHeader">Allison Welker <div id="teamTitle">EVP, Client Services</div></div><div id="teamBody"><img src="images/slider/pop_up/team1.jpg" id="teamIMG" name="teamIMG" border="0" align="left">Allison started her career as an account manager with Gage Marketing, developing promotional programs for brands in the CPG, Office Product, Automotive and Home Improvement industries. In her eight years with Integrated, Allison has excelled in a variety of roles ranging from field expert to brand liaison. Her current responsibilities include leading the Client Service Department for our entire client base. Allison\'s a proud recipient of the 2008 Advantage Sales and Marketing Marketer of the Year Award.</div>',
	'<div id="teamHeader">Melissa Oesterreich <div id="teamTitle">EVP, Operations</div></div><div id="teamBody"><img src="images/slider/pop_up/team1.jpg" id="teamIMG" name="teamIMG" border="0" align="left">Melissa came to Integrated after managing the Nestl&eacute; USA account for ActMedia and, subsequently, News America Marketing, where she was responsible for Nestl&eacute;\'s national consumer promotion efforts. During the course of her nine-year career with Integrated, Melissa has managed overall business operations, developed and implemented financial P&L and best practices, and has assembled top-notch teams that have delivered award-winning shopper marketing programs on behalf of our clients.</div>',
	'<div id="teamHeader">Mike Schmidt <div id="teamTitle">VP, Client Development</div></div><div id="teamBody"><img src="images/slider/pop_up/team1.jpg" id="teamIMG" name="teamIMG" border="0" align="left">Mike Schmidt joined ASM in January 2008, and oversees the former Try-Foods International\'s business for both sales and operations.  He brings to the company close to 30 years experience in the CPG arena. He also has experience calling on and managing all of the major retailers nationally in the food, drug, and mass merchandiser classes of trade. Prior to coming to ASM, Mike served as president of Sun and Skin Care Research, Inc.</div>',
	'<div id="teamHeader">Liz Fogerty <div id="teamTitle">VP, Customer Planning</div></div><div id="teamBody"><img src="images/slider/pop_up/team1.jpg" id="teamIMG" name="teamIMG" border="0" align="left">Liz came to Integrated with a versatile background that spanned general advertising, consumer promotions and shopper marketing. As a director of client services, she managed account teams for a diverse roster of clients including American Express, Bank of America and HBO. Since joining Integrated, Liz has been instrumental in growing our Planning and Insight Department, and now heads a team dedicated to building effective strategies and delivering outstanding conceptual platforms.</div>',
	'<div id="teamHeader">T Gavel <div id="teamTitle">VP, Creative</div></div><div id="teamBody"><img src="images/slider/pop_up/team1.jpg" id="teamIMG" name="teamIMG" border="0" align="left">During his nine years at Integrated, T has helped shape the creative/production department, eventually overseeing the output of over 60 talented associates. T is committed to maintaining a unique culture that encourages teamwork and fosters creative excellence. He previously served as a creative director at Marketing Drive Worldwide. His background also includes being founder and creative director of TKO Media, a multimedia design firm that fused cutting-edge technology with innovative designs.</div>',
	'<div id="teamHeader">Jeffrey Metz <div id="teamTitle">VP, Client Team</div></div><div id="teamBody"><img src="images/slider/pop_up/team1.jpg" id="teamIMG" name="teamIMG" border="0" align="left">Jeff joined Integrated in 2007, and manages the Epson business, one of the industry\'s premier retail field marketing programs. Jeff came to Campaigners from Advantage Sales and Marketing, Campaigners\' parent company, where he was a National Client Team Leader. In this role, Jeff was the proud recipient of the coveted &ldquo;Broker of the Year&rdquo; award for excellence in managing client business. Prior to joining ASM, Jeff spent 10+ years with the Colgate-Palmolive company in increasing roles of responsibility. Jeff possesses over 20 years experience in general management, sales, marketing, and buying and merchandising.</div>',
	'<div id="teamHeader">Tim Camden <div id="teamTitle">VP, Operations</div></div><div id="teamBody"><img src="images/slider/pop_up/team1.jpg" id="teamIMG" name="teamIMG" border="0" align="left">Tim Camden joined Advantage Sales and Marketing in 2000 and oversees a team of more than 5,000 for the Event Execution Division. Tim brings over 30 years of experience in building and managing retail operations teams across the CPG industry in the small format, grocery, mass and drugstore classes of trade. Prior to joining Advantage Sales and Marketing, Tim served as vice president of retail operations for a national sales and marketing agency, account manager for QTG, Unilever and store director for multiple Piggly Wiggly Southern Inc. stores.</div>',
	'<div id="teamHeader">Gina Kano Smith <div id="teamTitle">VP</div></div><div id="teamBody"><img src="images/slider/pop_up/team1.jpg" id="teamIMG" name="teamIMG" border="0" align="left">Gina is a senior marketing and retail professional with experience in merchandising and product development, direct mail marketing, call center management and general management. She has been in the field marketing arena for Integrated since 2003. She began her career in retail, where she was a buyer for cosmetics, shoes and apparel.  She also has worked as the director of a call center for Viking Office Products/Office Depot.</div>',
	'<div id="teamHeader">Andrea Young <div id="teamTitle">SVP</div></div><div id="teamBody"><img src="images/slider/pop_up/team1.jpg" id="teamIMG" name="teamIMG" border="0" align="left">Andrea joined Integrated in mid 2011, bringing with her over 15 years of experience in the delivery of integrated marketing campaigns. Andrea oversees the marketing, sales and client services teams of the experiential division and is responsible for the complete synthesis of three internal business units into a single brand agency. Prior to joining Integrated, Andrea was responsible for developing and delivering extensive experiential campaigns for various Fortune 100 Brands including AT&T, Cisco, Anheuser-Busch, Sam&#39;s Club and MTV Network.'

);
function teamPrev(arr){
	$("#teamPrev").unbind('click');
	// arr signifies which array to use
	switch ( arr ) {
		case 'branding':
			var arrSize = branding.length -1;
			break;
		case 'team':
			var arrSize = team.length -1;
			break;
		default:
			var arrSize = team.length -1;
	}
	// get the current position
	var pos = $('#currentTeam').val();
	// set the next position
	var nextPos = parseInt(pos) - 1;
	if(nextPos < 0){
		nextPos = arrSize;
	}
	// set the next image and next text
	switch ( arr ) {
		case 'branding':
			var nextImg = branding[nextPos];
			var nextTxt = brandingText[nextPos];
			break;
		case 'team':
			var nextImg = team[nextPos];
			var nextTxt = teamText[nextPos];
			break;
		default:
			var nextImg = team[nextPos];
			var nextTxt = teamText[nextPos];
	}
	// animate the image (fade out)
	var one = $("#teamIMG").animate({ 
		opacity: 0
	}, 500 );
	// animate the text (fade out)
	var two = $("#teamText").animate({ 
		opacity: 0
	}, 500 );
	buildSlices("team", nextPos);
	// teamulate the next img and text and set the new current position
	// and animate the stage width
	setTimeout(function() {
		$('#currentTeam').val(nextPos);
		$('#teamText').html(nextTxt);
		$('#teamIMG').attr('src', 'images/slider/pop_up/'+nextImg);
	}, 500 );
	// Bring in the new img and text
	setTimeout(function() {
		var one = $("#teamIMG").animate({ 
			opacity: 1
		}, 500 );
		// animate the text (fade out)
		var two = $("#teamText").animate({ 
			opacity: 1
		}, 500 );
	}, 1000 );
	setTimeout(function() {
		$("#teamPrev").click(function() {teamPrev('team');});
	}, 2000 );
	
}

function teamNext(arr){
	$("#teamNext").unbind('click');
	// arr signifies which array to use
	switch ( arr ) {
		case 'branding':
			var arrSize = branding.length -1;
			break;
		case 'team':
			var arrSize = team.length -1;
			break;
		default:
			var arrSize = team.length -1;
	}
	// get the current position
	var pos = $('#currentTeam').val();
	// set the next position
	var nextPos = parseInt(pos) + 1;
	if(nextPos > arrSize){
		nextPos = 0;
	}
	// set the next image and next text
	switch ( arr ) {
		case 'branding':
			var nextImg = branding[nextPos];
			var nextTxt = brandingText[nextPos];
			break;
		case 'team':
			var nextImg = team[nextPos];
			var nextTxt = teamText[nextPos];
			break;
		default:
			var nextImg = team[nextPos];
			var nextTxt = teamText[nextPos];
	}
	// animate the image (fade out)
	var one = $("#teamIMG").animate({ 
		opacity: 0
	}, 500 );
	// animate the text (fade out)
	var two = $("#teamText").animate({ 
		opacity: 0
	}, 500 );
	buildSlices("team", nextPos);
	// teamulate the next img and text and set the new current position
	// and animate the stage width
	setTimeout(function() {
		$('#currentTeam').val(nextPos);
		$('#teamText').html(nextTxt);
		$('#teamIMG').attr('src', 'images/slider/pop_up/'+nextImg);
	}, 500 );
	// Bring in the new img and text
	setTimeout(function() {
		var one = $("#teamIMG").animate({ 
			opacity: 1
		}, 500 );
		// animate the text (fade out)
		var two = $("#teamText").animate({ 
			opacity: 1
		}, 500 );
	}, 1000 );
	setTimeout(function() {
		$("#teamNext").click(function() {teamNext('team');});
	}, 2000 );
}

function openteam(img, arr, pos){
	$('#teamIMG').attr('src', 'images/0spacer.gif');
	var wh = $(window).height();
	var ww = $(window).width();
	var half = ww / 2;
	var qw = half - 250;
	var halfH = wh / 2;
	var wh = halfH - 200;
	var top = document.body.scrollTop;
	var wh = wh + top;
	switch ( arr ) {
		case 'brandingText':
			var text = brandingText[pos];
			break;
		case 'teamText':
			var text = teamText[pos];
			break;
		default:
			var text = teamText[pos];
	}
	buildSlices("team", pos);
	$('#currentTeam').val(pos);
	$('#teamText').html(text);
	$('#team').css('width', "500px");
	$('#team').css('left', qw+"px");
	$('#team').css('top', wh+"px");
	//$('#team').center();
	$('#teamIMG').attr('src', 'images/slider/pop_up/'+img);
	$("#teamBack").show();
}

function openClients(){
	$('#clientLogos').css('width', "700px");
	$('#clientLogo').attr('src', 'images/slider/clients/logos.jpg');
	// Bring in the new img
	setTimeout(function() {
		var one = $("#clientLogo").animate({ 
			opacity: 1
		}, 2000 );
	}, 250 );
	$("#clientBack").show();
}

function clientClose(){
	var one = $("#clientLogo").animate({ 
		opacity: 0
	}, 500 );
	setTimeout(function() {
		$("#clientBack").hide();
	}, 500 );
}

function openRetailers(){
	$('#clientLogos').css('width', "700px");
	$('#clientLogo').attr('src', 'images/slider/logos/retailer_logos.jpg');
	// Bring in the new img
	setTimeout(function() {
		var one = $("#clientLogo").animate({ 
			opacity: 1
		}, 2000 );
	}, 250 );
	$("#clientBack").show();
}

function openConsumer(){
	$('#clientLogos').css('width', "550px");
	$('#clientLogo').attr('src', 'images/slider/pop_up/consumer.jpg');
	// Bring in the new img
	setTimeout(function() {
		var one = $("#clientLogo").animate({ 
			opacity: 1
		}, 2000 );
	}, 250 );
	$("#clientBack").show();
}

function buildSlices(arr, pos){
	switch ( arr ) {
		case 'branding':
			var arrSize = branding.length -1;
			var e = 'pop_upS2';
			break;
		case 'team':
			var arrSize = team.length -1;
			var e = 'pop_upS3';
			break;
		case 'awards':
			var arrSize = awards.length -1;
			var e = 'pop_upS1';
			break;
		case 'portfolio':
			var arrSize = portfolio.length -1;
			var e = 'pop_upS1';
			break;
		case 'digital':
			var arrSize = digital.length -1;
			var e = 'pop_upS2';
			break;
		case 'consumer':
			var arrSize = consumer.length -1;
			var e = 'pop_upS2';
			break;
		case 'custom':
			var arrSize = custom.length -1;
			var e = 'pop_upS2';
			break;
		case 'multicultural':
			var arrSize = multicultural.length -1;
			var e = 'pop_upS2';
			break;
		case 'partner':
			var arrSize = partner.length -1;
			var e = 'pop_upS2';
			break;
		case 'shopper':
			var arrSize = shopper.length -1;
			var e = 'pop_upSS';
			break;
		case 'strategic':
			var arrSize = strategic.length -1;
			var e = 'pop_upS2';
			break;
		case 'retailer':
			var arrSize = retailer.length -1;
			var e = 'pop_upS2';
			break;
		default:
			var arrSize = team.length -1;
	}
	//Build Nav slices
	var i=0;
	var html = '';
	for (i=0;i<=arrSize;i++)
	{
		if(i == pos){
			html += '<img src="images/slider/pop_up/arrow_sliverON.gif" width="10" height="24" border="0">';
		}else{
			html += '<img src="images/slider/pop_up/arrow_sliver.gif" width="10" height="24" border="0">';
		}
	}
	$('#'+e).html(html);
}

function shopPrev(arr){
	$("#teamPrev").hide();
	// arr signifies which array to use
	switch ( arr ) {
		case 'shopper':
			var arrSize = shopper.length -1;
			break;
		default:
			var arrSize = shopper.length -1;
	}
	// get the current position
	var pos = $('#currentPop').val();
	// set the next position
	var nextPos = parseInt(pos) - 1;
	if(nextPos < 0){
		nextPos = arrSize;
	}
	// set the next image and next text
	switch ( arr ) {
		case 'shopper':
			var nextImg = shopper[nextPos];
			var nextTxt = shopperText[nextPos];
			buildSlices("shopper", nextPos);
			break;
		default:
			var nextImg = shopper[nextPos];
			var nextTxt = shopperText[nextPos];
			buildSlices("shopper", nextPos);
			break;
	}
	// animate the image (fade out)
	var one = $("#shopIMG").animate({ 
		opacity: 0
	}, 1000 );
	// animate the text (fade out)
	var two = $("#shopText").animate({ 
		opacity: 0
	}, 1000 );
	// populate the next img and text and set the new current position
	// and animate the stage width
	setTimeout(function() {
		$('#currentPop').val(nextPos);
		$('#shopText').html(nextTxt);
		$('#shopIMG').attr('src', 'images/slider/pop_up/'+nextImg);
		var imageWidth = getImgSize('images/slider/pop_up/'+nextImg);
		stageWidth = parseInt(imageWidth) + 10;
		//animate the stage size
		var three = $("#shopUp").animate({ 
			width: parseInt(stageWidth)+"px"
		}, 1000 );
	}, 1000 );
	// Bring in the new img and text
	setTimeout(function() {
		var one = $("#shopIMG").animate({ 
			opacity: 1
		}, 1000 );
		// animate the text (fade out)
		var two = $("#shopText").animate({ 
			opacity: 1
		}, 1000 );
		$("#teamPrev").show();
	}, 2500 );
	
}

function shopNext(arr){
	$("#teamNext").hide();
	// arr signifies which array to use
	switch ( arr ) {
		case 'shopper':
			var arrSize = shopper.length -1;
			break;
		default:
			var arrSize = shopper.length -1;
	}
	// get the current position
	var pos = $('#currentPop').val();
	// set the next position
	var nextPos = parseInt(pos) + 1;
	if(nextPos > arrSize){
		nextPos = 0;
	}
	// set the next image and next text
	switch ( arr ) {
		case 'shopper':
			var nextImg = shopper[nextPos];
			var nextTxt = shopperText[nextPos];
			buildSlices("shopper", nextPos);
			break;
		default:
			var nextImg = shopper[nextPos];
			var nextTxt = shopperText[nextPos];
			buildSlices("shopper", nextPos);
			break;
	}
	// animate the image (fade out)
	var one = $("#shopIMG").animate({ 
		opacity: 0
	}, 1000 );
	// animate the text (fade out)
	var two = $("#shopText").animate({ 
		opacity: 0
	}, 1000 );
	// populate the next img and text and set the new current position
	// and animate the stage width
	setTimeout(function() {
		$('#currentPop').val(nextPos);
		$('#shopText').html(nextTxt);
		$('#shopIMG').attr('src', 'images/slider/pop_up/'+nextImg);
		var imageWidth = getImgSize('images/slider/pop_up/'+nextImg);
		stageWidth = parseInt(imageWidth) + 10;
		//animate the stage size
		var three = $("#popUp").animate({ 
			width: parseInt(stageWidth)+"px"
		}, 1000 );
	}, 1000 );
	// Bring in the new img and text
	setTimeout(function() {
		var one = $("#shopIMG").animate({ 
			opacity: 1
		}, 1000 );
		// animate the text (fade out)
		var two = $("#shopText").animate({ 
			opacity: 1
		}, 1000 );
		$("#teamNext").show();
	}, 2500 );
	
}

function openShop(img, arr, pos){
	//alert(img+"::::"+arr);
	switch ( arr ) {
		case 'brandingText':
			var text = brandingText[pos];
			buildSlices("branding", pos);
			break;
		case 'digitalText':
			var text = digitalText[pos];
			buildSlices("digital", pos);
			break;
		case 'consumerText':
			var text = consumerText[pos];
			buildSlices("consumer", pos);
			break;
		case 'customText':
			var text = customText[pos];
			buildSlices("custom", pos);
			break;
		case 'multiculturalText':
			var text = multiculturalText[pos];
			buildSlices("multicultural", pos);
			break;
		case 'partnerText':
			var text = partnerText[pos];
			buildSlices("partner", pos);
			break;
		case 'shopperText':
			var text = shopperText[pos];
			buildSlices("shopper", pos);
			break;
		default:
			var text = brandingText[pos];
			buildSlices("branding", pos);
	}
	$('#currentPop').val(pos);
	$('#shopText').html(text);
	$('#shopIMG').attr('src', 'images/0spacer.gif');
	var imageWidth = getImgSize('images/slider/pop_up/'+img);
	$('#shopUp').css('width', parseInt(imageWidth)+"px");
	$('#shopIMG').attr('src', 'images/slider/pop_up/'+img);
	$("#shopBack").show();
}

function closeShop(){
	$("#shopBack").hide();
	$('#popIMG').attr('src', 'images/0spacer.gif');
}
