/***********************************************
* Ultimate Fade-In Slideshow (v1.51): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
 
var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages[0]=["photo1.jpg", "", ""] //plain image syntax
fadeimages[1]=["photo2.jpg", "", ""] //image with link syntax
fadeimages[2]=["photo3.jpg", "", "_new"] //image with link and target syntax
 
var fadeimages2=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages2[0]=["http://www.jwbcomms.com/images/paris.jpg", "", ""] //plain image syntax
fadeimages2[1]=["http://www.jwbcomms.com/images/edin.jpg", "", ""] //image with link syntax
fadeimages2[2]=["http://www.jwbcomms.com/images/london.jpg", "", ""] //image with link and target syntax
fadeimages2[3]=["http://www.jwbcomms.com/images/atlanta.jpg", "", ""] //image with link and target syntax
fadeimages2[4]=["http://www.jwbcomms.com/images/venice.jpg", "", ""] //image with link and target syntax
var fadebgcolor="white"

////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}

/***********************************************
* Image w/ description tooltip- By Dynamic Web Coding (www.dyn-web.com)
* Copyright 2002-2007 by Sharon Paine
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* IMPORTANT: Put script after tooltip div or 
	 put tooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = (!document.all && dom || window.opera) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ie4 && !ie5 && !dom) ? true : false;

var origWidth, origHeight;

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

///////////////////////  CUSTOMIZE HERE   ////////////////////
// settings for tooltip 
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;	
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 590;
var offX= 20;	// how far from mouse to show tip
var offY= 12; 
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000";
var tipBgColor= "#DDECFF"; 
var tipBorderColor= "#000080";
var tipBorderWidth= 3;
var tipBorderStyle= "ridge";
var tipPadding= 4;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)
var messages = new Array();
// multi-dimensional arrays containing: 
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip

//var jimmyBio = "<div style='text-align:left;'><BR><BR>" +
//"Jimmy comes from Liverpool in the UK. Having completed his education in England at Shrewsbury School and with a degree in French with Italian from Durham University, he lived and worked in France and Italy. On returning to the UK he became a Member of the London Stock Exchange and moved to Edinburgh, Scotland in 1990 where he became a partner at Stewart Ivory & Co. As the head of the Continental European equity team, Jimmy was able to combine his talent for languages with analysis of Europe's most successful companies. Jimmy won numerous awards for being one of Europe's most successful equity managers.<BR> <BR>" +
//"Jimmy became one of the Managing Directors of Babson Stewart Ivory International, a joint venture partnership co-based in Boston, Massachusetts and Scotland. Thanks to his ability as a presenter, Jimmy was a frequent visitor to the US to pitch. Assets under management grew rapidly to over $1bn and successful presentations were made to Boeing, Dominion Resources and Towers Perrin amongst others. Foreign language presentations were given to the likes of La Bourse de Paris and Hannover Re. In 2004 Jimmy was approached by Germany's oldest private bank, Berenberg Bank, to open a representative office in Scotland. When the decision was made to repatriate funds, Jimmy was offered the chance of moving to Hamburg which he declined.<BR><BR>"+ 
//"With many friends in the Atlanta area and firmly believing that his skill set could be of great service to both US and European businesses, Jimmy founded JWB Communication Services in 2009. "+
//"Jimmy has kept up his schoolboy love of all sports. Once an accomplished soccer player and athlete, he now tries to keep as fit as possible in his spare time in Atlanta. He has retained his membership of Royal Birkdale and Royal Dornoch golf clubs in the UK. Music is another great interest. His love for discovering 'new' bands has both intrigued and infuriated his friends for many years. </div>";

var jimmyB = "<div style='text-align:left;align:top;font-size:11px;color:#01009A;'><table><tr><td><img src='http://www.jwbcomms.com/images/jimmyabout.jpg' width='180'  /><td>"+
"<td>Jimmy Burns - <B>Managing Director</B><BR><BR>Jimmy comes from Liverpool in the UK. Having completed his education at Shrewsbury School and with a degree in French with Italian from Durham University, he worked in France and Italy. He became a Member of the London Stock Exchange and moved to Edinburgh, Scotland in 1990 to join Stewart Ivory & Co. As the head of the European equity team, Jimmy was able to combine his talent for languages with analysis of Europe's most successful companies. Jimmy won numerous European equity awards.<BR><BR> </td></tr></table>"+
"Jimmy became the Managing Director of Babson Stewart Ivory International, a j-v based in Boston, Massachusetts and Scotland. Jimmy was a frequent visitor to the US to present. Assets grew rapidly to over $1bn and successful presentations were made to Boeing, Dominion Resources and Towers Perrin amongst others. Foreign language presentations were given to the likes of La Bourse de Paris and Hannover Re. In 2004 Jimmy was asked by Germany's oldest bank, Berenberg Bank, to open an office in Scotland. When the funds were repatriated, Jimmy was offered the chance of moving to Hamburg which he declined.<BR><BR>"+ 
"With many contacts in the Atlanta area and firmly believing that his skill set could be of great service to both US and European businesses, Jimmy founded JWB Communication Services, LLC in 2009."+

"<BR><BR>Jimmy has kept up his love of all sports. Once an accomplished soccer player and athlete, he now tries to keep as fit in his spare time in Atlanta. He remains a member of Royal Birkdale and Royal Dornoch golf clubs in the UK. Music is another"+ "passion. His love for discovering 'new' bands has both intrigued and infuriated his friends for many years. </div>";








var jimmyBio = "<div style='text-align:left;align:top;font-size:11px;color:#01009A;'><table><tr><td><img src='http://www.jwbcomms.com/images/jimmyabout.jpg' width='180'  /><td>"+
"<td>Jimmy comes from Liverpool in the UK. After Shrewsbury School, he graduated from Durham University with a degree in French and Italian before working in France and Italy. He became a Member of the London Stock Exchange and moved to Edinburgh in 1990 to "+
"join Stewart Ivory & Co. As the head of the European equity team, Jimmy combined his talent for languages with analysis of Europe’s most successful companies.</td></tr></table>"+

"Jimmy became the Managing Director of Babson Stewart Ivory International, a j-v based in Boston, Massachusetts and Scotland. Jimmy was a frequent visitor to the US as assets grew to over $1bn. He made successful presentations to Boeing, Dominion Resources,"+
"Towers Perrin, La Bourse de Paris (in French) and Hannover Re (in German) amongst others. In 2004 Jimmy was asked by Germany's oldest bank, Berenberg Bank, to open a Scottish office. When the funds were repatriated, Jimmy declined the offer of moving to "+ "Hamburg.<BR><BR>"+ 

"With many contacts in the Atlanta area and believing that his skills could serve both US and European businesses, Jimmy founded JWB Communication Services in 2009. <BR>"+

"Jimmy has kept up his love of sports. Once an accomplished soccer player and athlete, he now keeps fit in his spare time in Atlanta. He is a member of Royal Birkdale and Royal Dornoch golf clubs. Music is another passion. His love for discovering 'new' bands has intrigued and infuriated his friends for years.";




var jenniferBio = "<div style='text-align:left;color:#01009A;'>Jennifer Ladds - <B>Marketing Manager</B><BR><BR>"+
"Jennifer has over 20 years experience working for international advertising agencies, based both here in the US and overseas. She has partnered with clients such as Unilever, Johnson&Johnson, Nestl&eacute;, Campbell Soup Company, Proctor and Gamble, United Distillers Group, and Philip Morris International.  For much of her career she has lived and worked abroad.<BR><BR>"+
"Jennifer has extensive experience managing global brands with proven success in developing and articulating global communication plans tailored for use in local markets. Her specialty is consumer insights, understanding the needs and motivations of various target audiences in markets around the world, including Europe."+ 
"<BR><BR>In her spare time, Jennifer is an avid food and wine lover. She also enjoys golfing with her husband Mike, and doting on her animals Bella and Tristan. Jennifer volunteers at the Southeast Greyhound Association and Girls Inc. in Atlanta.";


//Jennifer Ladds has joined the company as Marketing Manager. <BR>Jennifer has over 20 years experience with the multinational advertising agencies and lived and worked abroad for much of that time";

messages[0] = new Array('http://www.jwbcomms.com/images/nothing.jpg',jimmyBio,"#FFFFFF");  // Jimmy
messages[1] = new Array('http://media.linkedin.com/mpr/mpr/shrink_80_80/p/2/000/037/2f2/193424c.jpg',jenniferBio,"#FFF");  // Jennifer
messages[2] = new Array('test.gif','Test description','black','white');

////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

// preload images that are to appear in tooltip
// from arrays above
if (document.images) {
	var theImgs = new Array();
	for (var i=0; i<messages.length; i++) {
  	theImgs[i] = new Image();
		theImgs[i].src = messages[i][0];
  }
}

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
//  initTip	- initialization for tooltip.
//		Global variables for tooltip. 
//		Set styles
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = tooltip.style;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		document.onmousemove = trackMouse;
	}
}

window.onload = initTip;

/////////////////////////////////////////////////
//  doTooltip function
//			Assembles content for tooltip and writes 
//			it to tipDiv
/////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,num) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	if (messages[num][2])	var curBgColor = messages[num][2];
	else curBgColor = tipBgColor;
	if (messages[num][3])	var curFontColor = messages[num][3];
	else curFontColor = tipFontColor;
	if (ie4||ie5||ns5) {
		var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
	standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
	mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
	mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
//  positionTip function
//		If tipFollowMouse set false, so trackMouse function
//		not being used, get position of mouseover event.
//		Calculations use mouseover event position, 
//		offset amounts and tooltip width to position
//		tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
	if (!tipFollowMouse) {
		standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
		mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
		mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	}
	// tooltip width and height
	var tpWd = (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
	var winHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = mouseX-(tpWd+offX)+"px";
	else tipcss.left = mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = winHt-(tpHt+offY)+"px";
	else tipcss.top = mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

document.write('<div id="tipDiv" style="position:absolute; visibility:hidden; z-index:100"></div>')
