window.curSlide = "slide-0";
window.nextSlide = "slide-1";
window.isRotating = true; 

( function($) {
var imgData = new Array(6);

for (i = 0; i < imgData.length; ++ i)
{	imgData [i] = new Array(5);}

imgData[0]["x"] = 0;
imgData[0]["y"] = 0;
imgData[0]["h2"] = "Identify. Know. Track. Optimize.";
imgData[0]["p"] = "We're a team of experts helping companies become more efficient by harnessing the power of labeling, identification, data collection, tracking and service technologies.";
imgData[0]["url"] = "/about";

imgData[1]["x"] = -942;
imgData[1]["y"] = 0;
imgData[1]["h2"] = "Sticky Stuff that Means Business.";
imgData[1]["p"] = "The foundation of any data collection or tracking system consists of items that are properly and reliably identified.  We're your labeling and identification specialists.";
imgData[1]["url"] = "/services/labeling-identification";

imgData[2]["x"] = -1874;
imgData[2]["y"] = 0;
imgData[2]["h2"] = "Managed Print Choices From The Managed Print Experts.";
imgData[2]["p"] = "Our flexible and scalable end-to-end MPS solution provides a single direct go-to source for every aspect of your corporate printing needs.";
imgData[2]["url"] = "/services/equipment-service";

imgData[3]["x"] = -2806;
imgData[3]["y"] = 0;
imgData[3]["h2"] = "Everything Barcode, Start to Finish.";
imgData[3]["p"] = "We're the go-to experts for barcode identification, tracking and data collection - including printers, scanners, wireless infrastructure, RFID, and mobility systems.";
imgData[3]["url"] = "/services/barcode-data-collection-solutions";

imgData[4]["x"] = -3738;
imgData[4]["y"] = 0;
imgData[4]["h2"] = "Know What You Have, Where It Is and What It's Worth.";
imgData[4]["p"] = "Our fixed asset management solutions save companies thousands of dollars through accounting, tagging, tracking and maintenance management.";
imgData[4]["url"] = "/services/fixed-asset-management";

imgData[5]["x"] = -4670;
imgData[5]["y"] = 0;
imgData[5]["h2"] = "Our Business is Your Business.";
imgData[5]["p"] = "The PartnerZone is for General Data Channel Partners who provide labeling and identification solutions their customers can depend on.";
imgData[5]["url"] = "http://partnerzone.general-data.com";



function moveSlide(myID){
	$("#"+window.curSlide).removeClass("ui-tabs-selected");	
	$("#"+myID).addClass("ui-tabs-selected");	
	var num = myID.substring(6,7);
	
	var coordS = "'" + imgData[num]["x"] + "px " + imgData[num]["y"] + "px'";
	var lblBP = "backgroundPosition";
	var posLiteral = {};
	posLiteral[lblBP]=coordS;

	
	var lblDur = "duration";
	var valDur = 500;
	var durLiteral = {};
	durLiteral[lblDur]=valDur;
	
	//Just grabbing stuff from the array and passing it to the animations.

	$("#featured .info h2").replaceWith("<h2><a href=\"" + imgData[num]["url"] + "\">" + imgData[num]["h2"] + "</a></h2>"); //With a link
//	$("#featured .info h2").replaceWith("<h2>" + imgData[num]["h2"] + "</h2>"); //Without a link
	$("#featured .info p").replaceWith("<p>" + imgData[num]["p"] + "</p>");
	$("#featured #canvas a#read").attr("href",imgData[num]["url"]);
	
	$('#featured #canvas').stop().animate(posLiteral,durLiteral); //Stringing it up with .stop() lets you change course mid-animation.
	

	$("#" + window.curSlide).stop().animate({
	    bottom: "0px"

		   }, 500, function() {
		    // Animation complete.
	});


	window.curSlide = myID; //Set new current slide for other functions.
	
	$("#" + window.curSlide).stop().animate({
	    bottom: "4px"

		   }, 500, function() {
		    // Animation complete.
	});	
	
}


function nextSlide(){
	var lastNum;
	lastNum = window.curSlide.substring(6,7); //Grab the digit of the current slide
	lastNum = parseInt(lastNum); //Make it an integer
	switch(lastNum) //Figure out what the next slide is based on the current one
	{
	case 0: window.nextSlide="slide-1"; break;
	case 1: window.nextSlide="slide-2"; break;
	case 2: window.nextSlide="slide-3"; break;
	case 3: window.nextSlide="slide-4"; break;
	case 4: window.nextSlide="slide-5"; break;
	case 5: window.nextSlide="slide-0"; break;
	default: window.nextSlide="slide-0";
	}
	
	moveSlide(window.nextSlide); //Go to the next slide.
}

function gdcRotate(){
window.myInterval = window.setInterval(nextSlide, 7000 ); //The meat and potatoes of the rotation. Returns an object for stopping it.
window.isRotating = true;
}

function gdcNoRotate(){
	clearInterval(window.myInterval); //'Pausing' the rotation.
	window.isRotating = false;
}


$(document).ready(function(){ //All else is loaded, now I'll let you do stuff.
		jQuery.easing.def = "easeInBack";
		$("#bits ul.newsticker").newsticker();
		
        $(".front #trip-R #edit-submitted-last-name, .front #trip-R #edit-submitted-email1, .front #trip-R #edit-submitted-lead-source-description, .front #trip-R #edit-submitted-description-0").val("");
		$(".front #trip-R #edit-submitted-last-name, .front #trip-R #edit-submitted-email1, .front #trip-R #edit-submitted-lead-source-description, .front #trip-R #edit-submitted-description-0").focus(function(){
				$(this).css("background-position","-1000px -1000px");
			}
		);

		$(".front #trip-R #edit-submitted-last-name, .front #trip-R #edit-submitted-email1, .front #trip-R #edit-submitted-lead-source-description, .front #trip-R #edit-submitted-description-0").blur(function(){
				if($(this).val()==""){
					switch($(this).attr("name")){
						case "submitted[last_name]" : $(this).css("background-position","6px 7px"); break;
						case "submitted[email1]" : $(this).css("background-position","6px -21px"); break;
						case "submitted[lead_source_description]" : $(this).css("background-position","5px -54px"); break;
						case "submitted[description_0]" : $(this).css("background-position","-216px -128px"); break;																		
						default: ; //Let's pretend nothing's wrong.
					}
				}
			}
		);	

	$("#featured li.ui-tabs-nav-item").click( //Binding click events.
		function(){
			var myID = $(this).attr("id"); //Taking the ID of the clicked <li>. e.g. slide-0 
			moveSlide(myID); //Duh.
		
		}
	);//click
	
	
	$("#featured li.ui-tabs-nav-item").hover( //Binding hover events.
		function(){
		    $("p#tooltip").html($("#" + $(this).attr("id") + " span").html()); //Swapping out text with the guts of the spans.
			$(this).stop().animate({
			    bottom: "4px"

		   }, 100, function() {

		  });
		},

		
		function(){
		$("#" + $(this).attr("id") + " span");	
		if($(this).attr("id")!=window.curSlide){		
			$(this).stop().animate({
			    bottom: "0px"
		   }, 100, function() {
		    // Animation complete.
		  });}
		}		

	);//hover	
	
	
	if(window.isRotating){ //isRotating is set to true at the top of the script.
	gdcRotate();
	}

	$("#featured").hover( //Turning off/on the rotation based on mouse in and mouse out. jQuery allows us to do this with one binding.
	  function () {
		  
			if(window.isRotating){
				gdcNoRotate();
			}		
	  }, 
	  function () {
			if(!window.isRotating){
				gdcRotate();
			}
	  }
	);		


$("#featured ul.ui-tabs-nav").hover(function(){$("#featured p#tooltip").fadeIn('fast')},function(){$("#featured p#tooltip").fadeOut('slow')});

});//document ready


} ) ( jQuery );
;
/*
 *
 * Copyright (c) 2006/2007 Sam Collett (http://www.texotela.co.uk)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * Version 2.0
 * Demo: http://www.texotela.co.uk/code/jquery/newsticker/
 *
 * $LastChangedDate: 2007-05-29 11:31:36 +0100 (Tue, 29 May 2007) $
 * $Rev: 2005 $
 *
 */
 
(function($) {
/*
 * A basic news ticker.
 *
 * @name     newsticker (or newsTicker)
 * @param    delay      Delay (in milliseconds) between iterations. Default 4 seconds (4000ms)
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @example  $("#news").newsticker(); // or $("#news").newsTicker(5000);
 *
 */
$.fn.newsTicker = $.fn.newsticker = function(delay)
{
	delay = delay || 4000;
	initTicker = function(el)
	{
		stopTicker(el);
		el.items = $("li", el);
		// hide all items (except first one)
		el.items.not(":eq(0)").hide().end();
		// current item
		el.currentitem = 0;
		startTicker(el);
	};
	startTicker = function(el)
	{
		el.tickfn = setInterval(function() { doTick(el) }, delay)
	};
	stopTicker = function(el)
	{
		clearInterval(el.tickfn);
	};
	pauseTicker = function(el)
	{
		el.pause = true;
	};
	resumeTicker = function(el)
	{
		el.pause = false;
	};
	doTick = function(el)
	{
		// don't run if paused
		if(el.pause) return;
		// pause until animation has finished
		el.pause = true;
		// hide current item
		$(el.items[el.currentitem]).fadeOut("slow",
			function()
			{
				$(this).hide();
				// move to next item and show
				el.currentitem = ++el.currentitem % (el.items.size());
				$(el.items[el.currentitem]).fadeIn("slow",
					function()
					{
						el.pause = false;
					}
				);
			}
		);
	};
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase()!= "ul") return;
			initTicker(this);
		}
	)
	.addClass("newsticker")
	.hover(
		function()
		{
			// pause if hovered over
			pauseTicker(this);
		},
		function()
		{
			// resume when not hovered over
			resumeTicker(this);
		}
	);
	return this;
};

})(jQuery);;
/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright Â© 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright Â© 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */;
/**
 * @author Alexander Farkas
 * v. 1.22
 */


(function($) {
	if(!document.defaultView || !document.defaultView.getComputedStyle){ // IE6-IE8
		var oldCurCSS = $.curCSS;
		$.curCSS = function(elem, name, force){
			if(name === 'background-position'){
				name = 'backgroundPosition';
			}
			if(name !== 'backgroundPosition' || !elem.currentStyle || elem.currentStyle[ name ]){
				return oldCurCSS.apply(this, arguments);
			}
			var style = elem.style;
			if ( !force && style && style[ name ] ){
				return style[ name ];
			}
			return oldCurCSS(elem, 'backgroundPositionX', force) +' '+ oldCurCSS(elem, 'backgroundPositionY', force);
		};
	}
	
	var oldAnim = $.fn.animate;
	$.fn.animate = function(prop){
		if('background-position' in prop){
			prop.backgroundPosition = prop['background-position'];
			delete prop['background-position'];
		}
		if('backgroundPosition' in prop){
			prop.backgroundPosition = '('+ prop.backgroundPosition;
		}
		return oldAnim.apply(this, arguments);
	};
	
	function toArray(strg){
		strg = strg.replace(/left|top/g,'0px');
		strg = strg.replace(/right|bottom/g,'100%');
		strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");
		var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
		return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
	}
	
	$.fx.step. backgroundPosition = function(fx) {
		if (!fx.bgPosReady) {
			var start = $.curCSS(fx.elem,'backgroundPosition');
			if(!start){//FF2 no inline-style fallback
				start = '0px 0px';
			}
			
			start = toArray(start);
			fx.start = [start[0],start[2]];
			var end = toArray(fx.end);
			fx.end = [end[0],end[2]];
			
			fx.unit = [end[1],end[3]];
			fx.bgPosReady = true;
		}
		//return;
		var nowPosX = [];
		nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
		nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];           
		fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1];

	};
})(jQuery);;

