// Graphic rollovers
var rslt;
var loaded = false; // Declares that images have not been loaded.

function newImg(img_src){ // Creates new image objects and loads the urls imto the browser's memory cache. Called by the loadImg function.
	if (document.images){ // Checks for the existence of the images[] array (JavaScript 1.1 and higher).
		rslt = new Image(); // Creates the image object.
		rslt.src = img_src; // Assigns the image source url to the new image object.
		return rslt; // Returns the result to the loadImg funtion.
	}
}

function loadImg(){ // Passes the urls to the newImg function. Called from the <BODY> tag: <BODY ONLOAD="loadImg();">
	if (document.images){ // Checks for the existence of the images[] array (JavaScript 1.1 and higher).

		// Begin Images Sources
		var img1 = newImg("images/nav_home_o.gif");
		var img2 = newImg("images/nav_about_o.gif");
		var img3 = newImg("images/nav_clients_o.gif");
		var img4 = newImg("images/nav_newsroom_o.gif");
		var img5 = newImg("images/nav_contact_o.gif");
		var img6 = newImg("images/nav_sub_about_expertise_o.gif");
		var img7 = newImg("images/nav_sub_about_background_o.gif");
		var img8 = newImg("images/nav_sub_clients_list_o.gif");
		var img9 = newImg("images/nav_sub_clients_portfolio_o.gif");
		var img10 = newImg("images/nav_sub_clients_area_o.gif");
		// End Images Sources

		loaded = true; // Lets the swapImg funtion know the images are loaded.
	}
}

// Swap images
var swapped = false; // Declares that no images are currently swapped.
var active_extension = "_o"; // Sets the filename extension for image active states.
var restore_info = new Array(); // Holds the image object names and urls for swapped images.
function swapImg(){ // Swaps and restores single or multiple images. Called by any event handler, usually onMouseOver.
	if (document.images && loaded == true && swapped == false){ // Performs if the images[] array (JavaScript 1.1 and higher) exists and if the loadImg function has completed.
		for (var i = 0; i < swapImg.arguments.length; i++){ // Loops for each set of two arguments (image name and url) passed by the event handler.
			restore_info[i * 2] = swapImg.arguments[i]; // Assigns the image name to the restore_info[] array.
			restore_info[i * 2 + 1] = document[swapImg.arguments[i]].src; // Assigns the original url to the restore_info[] array.
			document[swapImg.arguments[i]].src = document[swapImg.arguments[i]].src.substring(0, document[swapImg.arguments[i]].src.lastIndexOf('\.')) + active_extension + document[swapImg.arguments[i]].src.substring(document[swapImg.arguments[i]].src.lastIndexOf('\.')); // Assigns the new url to the image object.
		}
	} else if (document.images && loaded == true && swapped == true){ // Restores all swapped but non-locked images to their original urls. Called by any event handler, usually onMouseOut.
		for (var i = 0; i < restore_info.length; i += 2) document[restore_info[i]].src = restore_info[i + 1]; // Assigns the original url to the image object.
		restore_info = new Array(); // Resets the saved restore information.
	}
	swapped = !swapped; // Flips the swapped flag between swap and restore functionality.
}

// Rotate image - homepage - feature
var rotateFeature = new Array(); // Enter all homepage feature rotating images here

rotateFeature[0] = 'images/rotate_home_feature_1.gif';
rotateFeature[1] = 'images/rotate_home_feature_2.gif';
rotateFeature[2] = 'images/rotate_home_feature_3.gif';
rotateFeature[3] = 'images/rotate_home_feature_4.gif';

var j = 0;
var p = rotateFeature.length;
var rotateFeatureBuffer = new Array();

for (i = 0; i < p; i++){
   rotateFeatureBuffer[i] = new Image();
   rotateFeatureBuffer[i].src = rotateFeature[i];
}

var rotateFeatureNumber = Math.round(Math.random()*(p-1));

function showFeature() {
	document.write('<a href="javascript:newWindow(\'dse_life.html\', \'popup\', \'width=500,height=376,scrollbars=no,resizable=yes,status=yes\');"><img src="' + rotateFeature[rotateFeatureNumber] + '" alt="VIEW \'THE LIFE OF DSE\' VIDEO PRESENTATION" width="196" height="151" border="0" /></a>');
}

// Rotate image - subpages - sidebar
var rotateSidebar = new Array(); // Enter all sidebar testimonial rotating images here

rotateSidebar[0] = 'images/rotate_sidebar_1.gif';
rotateSidebar[1] = 'images/rotate_sidebar_2.gif';
rotateSidebar[2] = 'images/rotate_sidebar_3.gif';
rotateSidebar[3] = 'images/rotate_sidebar_4.gif';
rotateSidebar[4] = 'images/rotate_sidebar_5.gif';
rotateSidebar[5] = 'images/rotate_sidebar_6.gif';
rotateSidebar[6] = 'images/rotate_sidebar_7.gif';
rotateSidebar[7] = 'images/rotate_sidebar_8.gif';
rotateSidebar[8] = 'images/rotate_sidebar_9.gif';
rotateSidebar[9] = 'images/rotate_sidebar_10.gif';
rotateSidebar[10] = 'images/rotate_sidebar_11.gif';
rotateSidebar[11] = 'images/rotate_sidebar_12.gif';
rotateSidebar[12] = 'images/rotate_sidebar_13.gif';


var rotateSidebarAlt = new Array();  // Enter all sidebar testimonial ALT tags here

rotateSidebarAlt[0] = 'Trapp Family - Dave, I love that you were able to take what was in my mind and put it so elegantly onto video.  Your work is fantastic! - Annie Von Trapp, Von Trapp Children, Von Trapp Family';
rotateSidebarAlt[1] = 'Wilbur Smith Associates - DSE\'s presentation was instrumental in our receiving the bid.  Dave and his organization are outstanding.  He has a positive, can-do attitude.  It\'s a refreshing approach to business. - Harry Strate, Senior Vice President of the Southeastern Region, Wilbur Smith Associates';
rotateSidebarAlt[2] = 'Colonial Pipeline Company - The effect on the participants (at Johnson Space Center) was great.  The video added a certain luster and interest to the meeting.  Dave understood the nuances of the companies and the nature of the business, and created a video that communicated that beautifully.  Dave has a blend of creativity and business skills that is a great combination.  I wish I had that! - Steve Baker, Public Relations Director, Colonial Pipeline';
rotateSidebarAlt[3] = 'Cives Steel Company - The sales CD is a quality product that allows me, and my sales staff, to make presentations to larger audiences, saving my department both time and money.  The format shows the entire depth of our capabilities and the wide range of our experience.  It also provides me with a product I can leave behind with my customers that is easy for them to navigate.  This may sound like a lot of \'fluff\' but the reality is that it has helped my sales and recruiting efforts tremendously. - Rory Guma, Vice President, Sales and Marketing, Cives Steel Company';
rotateSidebarAlt[4] = 'Southface - In preparation for our capital campaign, we needed a visual tool to engage potential funders of our work.  Dave Shapiro and Kenny Blank were able to take our words and images and tell our story in a way we had never done before.  The final product is a tool we will use well beyond the campaign to demonstrate our credibility and polish as a nonprofit organization. - Marci B. Reed, Director of Development and Communications, SOUTHFACE';
rotateSidebarAlt[5] = 'The Facility Group - DSE has completed several video projects for The Facility Group and I have been pleased with each and every one.  It\'s such a pleasure to work with Dave because he knows how to translate our story...into an exciting video that communicates our message.  Dave listens, researches, asks the right questions, and makes valuable suggestions to ensure that our video projects are \'on target\'.  He makes the process easy and enjoyable. - Donya G. Elder, Executive Vice President of Marketing, The Facility Group';
rotateSidebarAlt[6] = 'DSE executed wonderfully.  Truthfully, I was unsure that anyone would be able to capture the essence of our business, our talents and work ethic on video.  Well, DSE pulled it off in grand fashion and we are extremely pleased with their work. - James Harris, Chief Storyteller, Elemental Interactive';
rotateSidebarAlt[7] = 'Look South is proud to have provided the images for DSE\'s presentation of Atlanta for the Metro Atlanta Chamber of Commerce, effectively creating a beautiful story about our city.  This project\'s Telly Award is proper recognition for the quality of the photography and the creativity of its implementation by DSE... - Anna Fey, President, Look South, LLC';
rotateSidebarAlt[8] = 'DSE provides a combination of creativity, introspection and visualization that is hard to find in Atlanta.  I have enjoyed every collaborative project between Emory and DSE. - Beth Grubb, Senior Graphic Designer, Emory University Human Resources';
rotateSidebarAlt[9] = 'Dave is about genuine client collaboration.  He listens.  He offers candid observations.  He sparks creative synergy in unexpected ways.  Those looking for a genuine partner with practical multimedia solutions need look no further than Dave Shapiro. - Kenny Blank, Producer';
rotateSidebarAlt[10] = 'DSE won Acuity Brands business due to the quality, value and creative talent they offered.  Dave\'s guidance and consulting was crucial to producing a shootable script.  During the shoot and edit phase, Dave\'s expertise, attention to details and guidance of our actor\'s performances made the production come to life.  Dave and Ilene were great to work with and helped us exceed the expectations of our CEO.  DSE became a true business partner and our vendor of choice for future projects. - Steve Santora, Senior Program Manager, Organization Development, Acuity Brands';
rotateSidebarAlt[11] = 'We\'ve worked with DSE on several projects including consumer instructional videos and interactive DVDs.  Each project was completed on time and on budget and we were always impressed with the quality and attention to detail.  DSE is first on our list for video production! - Michael Moore, Vice President, Marketing, Advantis Technologies, Inc.';
rotateSidebarAlt[12] = 'Thank you for the DVD you produced for the Atlanta Champter of Hadassah.  We have used it repeatedly and had requests for copies from Hadasssah groups in other cities.  It surpassed any hopes we had for a product that would capture the essence of our organization.  We appreciate that you put so much thought and personal attention into the production and met our tight deadlines. - Rachael Schonberger, M.D., President, Greater Atlanta Hadassah';

var j = 0;
var p = rotateSidebar.length;
var rotateSidebarBuffer = new Array();

for (i = 0; i < p; i++){
   rotateSidebarBuffer[i] = new Image();
   rotateSidebarBuffer[i].src = rotateSidebar[i];
}

var rotateSidebarNumber = Math.round(Math.random()*(p-1));

function showSidebar() {
	document.write('<img src="'+rotateSidebar[rotateSidebarNumber]+'" width="257" alt="' + rotateSidebarAlt[rotateSidebarNumber] + '" border="0">');
}

// Rotate image - subpage - bottom
var rotateBottom = new Array();

rotateBottom[0] = 'images/rotate_bottom_1.gif';
rotateBottom[1] = 'images/rotate_bottom_2.gif';
rotateBottom[2] = 'images/rotate_bottom_3.gif';
rotateBottom[3] = 'images/rotate_bottom_4.gif';

var rotateBottomAlt = new Array();

rotateBottomAlt[0] = 'THE DIVERSITY OF OUR EXPERTISE IS REVEALED VIA THE DSE CLIENT LIST.';
rotateBottomAlt[1] = 'PREVIEWS OF OUR PROFICIENCIES CAN BE SCREENED ON THE DSE PORTFOLIO PAGE.';
rotateBottomAlt[2] = 'EXPERIENCE HAS REVEALED: \'THERE\'S GENIUS IN PASSION.\'';
rotateBottomAlt[3] = 'THE AFFIRMATIONS OF OUR PROJECTS ARE FROM THE UPBEAT REACTIONS OF THEIR AUDIENCES.';

var rotateBottomUrl = new Array();

rotateBottomUrl[0] = 'clients_list.html';
rotateBottomUrl[1] = 'clients_portfolio.html';
rotateBottomUrl[2] = '';
rotateBottomUrl[3] = '';

var j = 0;
var p = rotateBottom.length;
var rotateBottomBuffer = new Array();

for (i = 0; i < p; i++){
   rotateBottomBuffer[i] = new Image();
   rotateBottomBuffer[i].src = rotateBottom[i];
}

var rotateBottomNumber = Math.round(Math.random()*(p-1));

function showBottom() {
	if (rotateBottomUrl[rotateBottomNumber].length > 0) {
		document.write('<a href="' + rotateBottomUrl[rotateBottomNumber] + '"><img src="' + rotateBottom[rotateBottomNumber] + '" alt="' + rotateBottomAlt[rotateBottomNumber] + '" width="501" height="27" border="0" /></a>');
	} else {
		document.write('<img src="' + rotateBottom[rotateBottomNumber] + '" alt="' + rotateBottomAlt[rotateBottomNumber] + '" width="501" height="27" border="0" />');
	}
}

// Flash 6 detection
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

// Open pop-up window with specified parameters
function newWindow(filePath, winName, winProperties){
	var newWin = window.open(filePath, winName, winProperties); newWin.focus()
}
