///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//   H O M E P A G E   S L I D E R         S C R I P T   //
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////

var translideshow1=new translideshow({
	wrapperid: "rotator", //ID of blank DIV on page to house Slideshow
	dimensions: [890, 300], //width/height of gallery in pixels. Should reflect dimensions of largest image
	imagearray: [
		["./img/slides/socialnetworking.png", "javascript:go('services')"], //["image_path", "optional_link", "optional_target"]
		["./img/slides/portfolio.png", "javascript:go('portfolio')"],
		["./img/slides/crossbrowser.png", "javascript:go('services')"],
		["./img/slides/services.png", "javascript:go('services')"],
		["./img/slides/seo.png", "javascript:go('services')"],
		["./img/slides/about.png", "javascript:go('about')"],
		["./img/slides/contact.png", "javascript:go('contact')"],
		["./img/slides/rates.png", "javascript:go('rates')"],
		["./img/slides/testimonials.png", "javascript:go('testimonials')"] //<--no trailing comma after very last image element!
	],
	displaymode: {type:'auto', pause:5500, cycles:0, pauseonmouseover:false},
	orientation: "h", //Valid values: "h" or "v"
	persist: false, //remember last viewed slide and recall within same session?
	slideduration: 1200 //transition duration (milliseconds)
})


function navLinks(which) {
	var link = document.getElementById("navbar");
	if (which === "navHome") {
		link.style.backgroundPosition="0px -150px";
	} else {
		link.style.backgroundPosition="0px 0px";
	}

}
function testimonialsHover(mouseDir) {
	if (mouseDir === "in") {
		document.getElementById("testimonialsLink").style.backgroundPosition="0px -150px";
	} else if (mouseDir === "out") {
		document.getElementById("testimonialsLink").style.backgroundPosition="0px 0px";
	}
}



///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//   T E S T I M O N I A L   S L I D E R   S C R I P T   //
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
var tParent = document.getElementById("testimonialSlider");
var tLink = document.getElementById("testimonialsLink");
var tText = document.getElementById("testimonialsLinkText");
var tSig = document.getElementById("testimonialsSig");

var testimonialNames = new Array();
var testimonialOrganizations = new Array();
var testimonialLinks = new Array();
var testimonialTexts = new Array();

//	KUDDLES THE CLOWN
testimonialNames[0] = "Daphne Tembelis";
testimonialOrganizations[0] = "Kuddles the Clown";
testimonialLinks[0] = "http://www.kuddlestheclown.com";
testimonialTexts[0] = "This was my first website, so I didn’t know what to expect. Stratus walked me through the process and was quick to respond to the many, many questions I asked.\n\nOur designer Chris was helpful with the broad design as well as many of the tiny details. Chris’s help with the theme of our site as well as the user friendly quality it offers our clients was invaluable.\n\nIt is a no brainer that I would recommend the services to anyone.";

//	EMPIRE MUSCLE CARS - JACKIE
testimonialNames[1] = "Jackie Deluca";
testimonialOrganizations[1] = "Empire Muscle Cars";
testimonialLinks[1] = "http://www.empiremusclecars.com";
testimonialTexts[1] = "I have dealt with Stratus Design Studios since May of 2011, during which time they have provided my business with excellent support in the areas of website engineering, site optimisation, search engine analysis and site submission. Their work has been a major factor in our website's success, helping it to become one of the most visited resources of its kind in the New York State area. I can confidently recommend Stratus Design Studios as a solid and reliable supplier, and experts in their field. ";

//	EMPIRE MUSCLE CARS - VICTOR
testimonialNames[2] = "Victor Doto";
testimonialOrganizations[2] = "Empire Muscle Cars";
testimonialLinks[2] = "http://www.empiremusclecars.com";
testimonialTexts[2] = "Mr.Galligan and Stratus Studios designed our online forum \"empiremusclecars.com.\"; Very knowledgeable. without him ,it wouldnt be possible.";

//	CFGART - DAD
testimonialNames[3] = "Charles F. Galligan";
testimonialOrganizations[3] = "Artist";
testimonialLinks[3] = "http://www.cfgart.com";
testimonialTexts[3] = "When I had the idea for this site I researched web designers for a few weeks. The work involved in setting up a new gallery can be a daunting task and I can say now with certainty that going with Stratus was the BEST decision I could’ve made. The attention paid to detail was second to none, and the creative ideas offered helped with the evolution of the site. In fact we ended up using the  logo they designed without making ANY changes of our own.";

/*
//	DEAD BY CHOICE - NINO
testimonialNames[4] = "Nino Valenti";
testimonialOrganizations[4] = "Dead by Choice";
testimonialLinks[4] = "http://www.deadbychoice.com";
testimonialTexts[4] = "Testimonial testimonial Testimonial testimonial Testimonial testimonial Testimonial testimonial Testimonial testimonial ";

//	DEAD BY CHOICE - JOHN
testimonialNames[3] = "John Galligan";
testimonialOrganizations[3] = "Dead by Choice";
testimonialLinks[3] = "http://www.deadbychoice.com";
testimonialTexts[3] = "";

//	DEAD BY CHOICE - CARL
testimonialNames[2] = "Carlucci Weyant";
testimonialOrganizations[2] = "Dead by Choice";
testimonialLinks[2] = "http://www.deadbychoice.com";
testimonialTexts[2] = "Testimonial testimonial Testimonial testimonial Testimonial testimonial Testimonial testimonial Testimonial testimonial ";


//	VALENTI BASSES - NINO
testimonialNames[0] = "Nino Valenti";
testimonialOrganizations[0] = "Valenti Basses";
testimonialLinks[0] = "http://www.valentibasses.com";
testimonialTexts[0] = "Testimonial testimonial Testimonial testimonial Testimonial testimonial Testimonial testimonial Testimonial testimonial ";

//	N.Y.A.V. CREW
testimonialNames[8] = "Matt DeCanio";
testimonialOrganizations[8] = "N.Y.A.V. Crew";
testimonialLinks[8] = "http://www.nyavcrew.com";
testimonialTexts[8] = "Testimonial testimonial Testimonial testimonial Testimonial testimonial Testimonial testimonial Testimonial testimonial ";
*/


testimonialNames.reverse();
testimonialOrganizations.reverse();
testimonialLinks.reverse();
testimonialTexts.reverse();


//holder for the testonials number, and starting point for testimonials
var tNum=0;

//holders for timeout functions
var t;
var t2;
var t3;


//slide the testimonial back into place
var slideIn = function() {
}

//slide the text areas out, then replace the text within
var slideOut = function () {

	$('#testimonialsLinkText').animate({left: '800'}, 1000, function() {
		var tlt = testimonialTexts[tNum];
		$('#testimonialsLinkText').empty();
		$(tlt).appendTo("#testimonialsLinkText");
		
		var tsg = testimonialNames[tNum] + ", " + testimonialOrganizations[tNum];
		$('#testimonialsSig').empty();
		$(tsg).appendTo("#testimonialsSig");
	
		//prepare the next testimonial for the upcoming pass
		//if we are at the last testimonial, then...
		if (tNum == (testimonialTexts.length-1)) {
		
			//...start over
			tNum=0;
			
		//if we aren't...
		} else {
		
			//go to the next one
			tNum++;
		}
	});

	$('#testimonialsSig').animate({left: '800'}, 1000, "slideIn");

}

//cycle the testimonials every 5 seconds
function timedSlide() {
/*
	//Clear the previous timed functions, just in case
	clearTimeout("t2");
	clearTimeout("t3");

	//first, slide out the text areas
	slideOut();
	
	//then, set this function up to be called again in 7 seconds
*/

	$('#testimonialsLinkText').animate({left: '800'}, 1000, function() {
			document.getElementById("testimonialsLinkText").innerHTML = testimonialTexts[tNum];
		});
	$('#testimonialsLinkText').animate({left: '0'}, 1000);
	$('#testimonialsSig').animate({left: '800'}, 1000, function() {
			document.getElementById("testimonialsSig").innerHTML = testimonialNames[tNum] + ", " + testimonialOrganizations[tNum];
			
			//prepare the next testimonial for the upcoming pass
			//if we are at the last testimonial, then...
			if (tNum == (testimonialTexts.length-1)) {
			
				//...start over
				tNum=0;
				
			//if we aren't...
			} else {
			
				//go to the next one
				tNum++;
			}
		});
	$('#testimonialsSig').animate({left: '0'}, 1000);

	/*
	$('#testimonialsSig').animate({left: '800'}, 1000, function() {

			
					
					
		});
				*/	
		
	t=setTimeout("timedSlide()", 7000);
}

$("document").ready(function() {
	//begin the testimonials slide sequence
	timedSlide();
});
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
//   T E S T I M O N I A L   S L I D E R   E N D   //
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////





/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
//   T E S T I M O N I A L S   P A G E             //
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////

//Reference:
//var testimonialNames = new Array();
//var testimonialOrganizations = new Array();
//var testimonialLinks = new Array();
//var testimonialTexts = new Array();
for (i=0; i<testimonialNames.length; i++) {
	document.getElementById('testimonials').innerHTML = document.getElementById('testimonials').innerHTML + "<div class=\"testimonialContainer\"><div class=\"testimonialPageDescription\">" + testimonialTexts[i] + "</div><div class=\"testimonialPageName\">" + testimonialNames[i] + "</div><div class=\"testimonialPageOrganization\">" + testimonialOrganizations[i] + "</div><a class=\"testimonialPageLink\" href=\"" + testimonialLinks[i] + "\">" + testimonialLinks[i] + "</a></div>";
}





/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
//   T E S T I M O N I A L S   P A G E     E N D   //
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////






/////////////////////////////////////////
/////////////////////////////////////////
//   P O R T F O L I O   S C R I P T   //
/////////////////////////////////////////
/////////////////////////////////////////
var portfolioNames = new Array();
var portfolioWebsites = new Array();
var portfolioServices = new Array();
var portfolioDescriptions = new Array();
var portfolioIdentifiers = new Array();
var portfolioUids = new Array();
var portfolioVideoURLs = new Array();

//   C F G A R T 
portfolioNames[0] = "CFG Art";
portfolioWebsites[0] = "http://www.cfgart.com";
portfolioServices[0] = new Array();
	portfolioServices[0][0] = "";
	portfolioServices[0][1] = "";
	portfolioServices[0][2] = "";
	portfolioServices[0][3] = "";
	portfolioServices[0][4] = "";
portfolioDescriptions[0] = "";
portfolioIdentifiers[0] = "cfgart";
portfolioUids[0] = "1";
portfolioVideoURLs[0] = "";

//   S T R A T U S   D E S I G N   S T U D I O S 
portfolioNames[1] = "Stratus Design Studios";
portfolioWebsites[1] = "http://www.stratusstudios.com";
portfolioServices[1] = new Array();
	portfolioServices[1][0] = "";
	portfolioServices[1][1] = "";
	portfolioServices[1][2] = "";
	portfolioServices[1][3] = "";
	portfolioServices[1][4] = "";
portfolioDescriptions[1] = "";
portfolioIdentifiers[1] = "stratusdesignstudios";
portfolioUids[1] = "2";
portfolioVideoURLs[1] = "";

//   D E A D   B Y   C H O I C E 
portfolioNames[2] = "Dead  by Choice";
portfolioWebsites[2] = "http://www.deadbychoice.com";
portfolioServices[2] = new Array();
	portfolioServices[2][0] = "";
	portfolioServices[2][1] = "";
	portfolioServices[2][2] = "";
	portfolioServices[2][3] = "";
	portfolioServices[2][4] = "";
portfolioDescriptions[2] = "";
portfolioIdentifiers[2] = "deadbychoice";
portfolioUids[2] = "3";
portfolioVideoURLs[2] = "";

//   E M P I R E   M U S C L E   C A R S 
portfolioNames[3] = "Empire Muscle Cars";
portfolioWebsites[3] = "http://www.empiremusclecars.com";
portfolioServices[3] = new Array();
	portfolioServices[3][0] = "";
	portfolioServices[3][1] = "";
	portfolioServices[3][2] = "";
	portfolioServices[3][3] = "";
	portfolioServices[3][4] = "";
portfolioDescriptions[3] = "";
portfolioIdentifiers[3] = "empiremusclecars";
portfolioUids[3] = "4";
portfolioVideoURLs[3] = "";

//   K U D D L E S   T H E   C L O W N 
portfolioNames[4] = "Kuddles the Clown";
portfolioWebsites[4] = "http://www.kuddlestheclown.com";
portfolioServices[4] = new Array();
	portfolioServices[4][0] = "";
	portfolioServices[4][1] = "";
	portfolioServices[4][2] = "";
	portfolioServices[4][3] = "";
	portfolioServices[4][4] = "";
portfolioDescriptions[4] = "";
portfolioIdentifiers[4] = "kuddlestheclown";
portfolioUids[4] = "5";
portfolioVideoURLs[4] = "";

//   N Y A V   C R E W
portfolioNames[5] = "N.Y.A.V. Crew";
portfolioWebsites[5] = "http://www.nyavcrew.com";
portfolioServices[5] = new Array();
	portfolioServices[5][0] = "";
	portfolioServices[5][1] = "";
	portfolioServices[5][2] = "";
	portfolioServices[5][3] = "";
	portfolioServices[5][4] = "";
portfolioDescriptions[5] = "";
portfolioIdentifiers[5] = "nyavcrew";
portfolioUids[5] = "6";
portfolioVideoURLs[5] = "";

portfolioNames.reverse();
portfolioWebsites.reverse();
portfolioServices.reverse();
portfolioDescriptions.reverse();
portfolioIdentifiers.reverse();
portfolioUids.reverse();
portfolioVideoURLs.reverse();

function showPortfolio(x) {
	//window.location.hash="thePortfolio";
	var portfolioDisplayDiv = document.getElementById("portfolioDisplayDiv");
	var nameDiv = document.getElementById("nameDiv");
	var websiteDiv = document.getElementById("websiteDiv");
	var serviceDiv = document.getElementById("serviceDiv");
	var identifierDiv = document.getElementById("identifierDiv");
	var descriptionDiv = document.getElementById("descriptionDiv");
	var uidDiv = document.getElementById("uidDiv");
	var videoSpot = document.getElementById("videoSpot");
	
	var bt = document.body.scrollTop;
	var et = document.documentElement ?
			document.documentElement.scrollTop :
			null;
	portfolioDisplayDiv.style.top = (bt || et) + "px";
	portfolioDisplayDiv.style.display = "block";
	
	document.body.style.overflow="hidden";
	
	if(portfolioNames[x]) {
		nameDiv.innerHTML = portfolioNames[x];
	} else {
		nameDiv.innerHTML = "";
	}
	if(portfolioWebsites[x]) {
		websiteDiv.innerHTML = "<a class=\"portfolioItemWebsite\" href=\"" + portfolioWebsites[x] + "\">" + portfolioWebsites[x] + "</a>";
	} else {
		websiteDiv.innerHTML = "";
	}
	if(portfolioIdentifiers[x]) {
		identifierDiv.innerHTML = portfolioIdentifiers[x];
	} else {
		identifierDiv.innerHTML = "";
	}
	if(portfolioDescriptions[x]) {
		descriptionDiv.innerHTML = portfolioDescriptions[x];
	} else {
		descriptionDiv.innerHTML = "";
	}
	if(portfolioUids[x]) {
		uidDiv.innerHTML = portfolioUids[x];
	} else {
		uidDiv.innerHTML = "";
	}
	if(portfolioVideoURLs[x]) {
		videoSpot.innerHTML = "<iframe width=\"420\" height=\"345\" src=\"" + portfolioVideoURLs[x] + "\" frameborder=\"0\" allowfullscreen></iframe>";
	} else {
		videoSpot.innerHTML = "";
	}
	
	if(portfolioServices[x]) {
		var servicesString = "<h1 class=\"servicesH1\">Services Used:</h1><ul class=\"servicesList\">";
		
		for (i=0; i<portfolioServices[x].length; i++) {
			servicesString = servicesString + "<li>" + portfolioServices[x][i] + "</li>";
		}
		
		servicesString = servicesString + "</ul>";
		serviceDiv.innerHTML = servicesString;
	} else {
		serviceDiv.innerHTML = "";
	}
}

function hidePortfolio() {
	document.getElementById("portfolioDisplayDiv").style.display="none";
	document.body.style.overflow="scroll";
}

function portfolioMouse(dir, pfid) {
	if (dir === 'over') {
		document.getElementById(pfid).style.backgroundPosition="0px -175px";
	} else if (dir === 'out') {
		document.getElementById(pfid).style.backgroundPosition="0px 0px";
	}
}

var portfolio = document.getElementById("portfolio");

for (i=0; i<portfolioUids.length; i++) {
	//var portfolioItem = "<a class=\"portfolioItem\" id=\"portfolioThumb" + portfolioIdentifiers[i] + "\" href=\"javascript:showPortfolio('" + i + "');\" style=\"background-image:url(\'./img/thumbnails/" + portfolioIdentifiers[i] + ".png\');\" onmouseover=\"portfolioMouse('over', 'portfolioThumb" + portfolioIdentifiers[i] + "');\" onmouseout=\"portfolioMouse('out', 'portfolioThumb" + portfolioIdentifiers[i] + "');\">&nbsp;</a>";
	var portfolioItem = "<a class=\"portfolioItem\" id=\"portfolioThumb" + portfolioIdentifiers[i] + "\" href=\"" + portfolioWebsites[i] + "\" style=\"background-image:url(\'./img/thumbnails/" + portfolioIdentifiers[i] + ".png\');\" onmouseover=\"portfolioMouse('over', 'portfolioThumb" + portfolioIdentifiers[i] + "');\" onmouseout=\"portfolioMouse('out', 'portfolioThumb" + portfolioIdentifiers[i] + "');\">&nbsp;</a>";
	portfolio.innerHTML = portfolio.innerHTML + portfolioItem;
}
///////////////////////////////////
///////////////////////////////////
//   P O R T F O L I O   E N D   //
///////////////////////////////////
///////////////////////////////////






/////////////////////////////////////////
/////////////////////////////////////////
//   S E R V I C E S   O V E R L A Y   //
/////////////////////////////////////////
/////////////////////////////////////////
function displayService(service) {
	var servicesOverlay = document.getElementById("servicesOverlay");
	var leftArea=document.getElementById("servicesLeftColumn");
	
	document.getElementById("webDesign").style.display="none";
	document.getElementById("graphicDesign").style.display="none";
	document.getElementById("webHosting").style.display="none";
	document.getElementById("layoutDesign").style.display="none";
	document.getElementById("customWidgets").style.display="none";
	document.getElementById("SEO").style.display="none";

	document.getElementById(service).style.display="block";
	document.getElementById('servicesDisplayImage').style.marginLeft="auto";
	document.getElementById('servicesDisplayImage').style.marginRight="auto";
	document.getElementById('servicesDisplayImage').style.backgroundImage="url('./img/services/" + service + ".png')";
	document.getElementById('servicesDisplayImage').style.backgroundRepeat="no-repeat";
	document.getElementById('servicesDisplayImage').style.height="160px";
	document.getElementById('servicesDisplayImage').style.width="160px";
	document.getElementById('servicesDisplayImage').style.display="block";

	var bt = document.body.scrollTop;
	var et = document.documentElement ?
			document.documentElement.scrollTop :
			null;
	servicesOverlay.style.top = (bt || et) + "px";
	servicesOverlay.style.display = "block";
	document.body.style.overflow="hidden";
	
}
function hideServices() {
	document.getElementById("servicesOverlay").style.display="none";
	document.body.style.overflow="scroll";
}





///////////////////////////////////////////////
///////////////////////////////////////////////
//   P A G E   L O A D   F U N C T I O N S   //
///////////////////////////////////////////////
///////////////////////////////////////////////

//   W I N D O W   H E I G H T 
var viewportwidth;
var viewportheight;
  
// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
if (typeof window.innerWidth != 'undefined') {
	viewportwidth = window.innerWidth,
	viewportheight = window.innerHeight
}
  
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
	viewportwidth = document.documentElement.clientWidth,
	viewportheight = document.documentElement.clientHeight
}
  
// older versions of IE
else {
	viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
	viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }
document.getElementById("pages").style.height = viewportheight - (92 + 140);
go('home');
