// JavaScript Document

window.onload = initAll;


var currImg = 0;



var captionText = new Array(
	"Personalized direct mail with a web-based response mechanism can drive increased response rates and higher ROI. Ask Kelmscott how PURLs can be integrated into your marketing efforts.",
	"Get your customers attention with a 3-D print project. Kelmscott can design, print, die cut and perform all mailing services for your next project.",
	"Design a marketing kit to help break through the clutter. Kelmscott\'s unique designs and executions will help drive higher response rates on your next marketing project.",
	"Drive business through direct mail. Use traditional business reply mailings or combine with cross media technology to offer personalized offers and web-based business reply. ",
	"Personalized direct mail can more precisely target your audience and boost returns! Printed on 100# gloss cover; variable imprint of roulette number on card used for Spin and Win promotion at tradeshow. The promotion resulted in huge attendance at client booth.",
	"Make your association event stand out with custom invitations and envelopes. Kelmscott can design, print, and mail your invites, helping you increase your meeting attendance. This piece was created by our design team and printed on 100 lb. cover, channel scored, folded, and mailed in matching custom envelopes."
	
	
	
)
var captionTitle = new Array(
	"1:1 Direct Marketing",
	"3-D Invitaions",
	"Custom Direct Marketing",
	"Direct Mail",
	"Variable-Data Solutions",
	"Custom Event Invitation"
	
	
	
)

//JY----------------------

function initAll(myIndex) {
	if (myIndex != null)
	window.location.href="work_direct.php?pid=" + myIndex + "#slideshow";
	if (myIndex == "" || myIndex == null || myIndex < 0)
		myIndex = 0;
		
	document.getElementById("slideshow").src = "images/gallery3img/directImg" + myIndex + ".jpg";
	document.getElementById("imgTitle").innerHTML = captionTitle[myIndex];
	document.getElementById("imgText").innerHTML = captionText[myIndex];
	document.getElementById("prevLink").onclick = processPrevious;
	document.getElementById("nextLink").onclick = processNext;
	if (myIndex != currImg)
	currImg = myIndex;
}


//------------------------





//function initAll() {
//	document.getElementById("imgTitle").innerHTML = captionTitle[0];
//	document.getElementById("imgText").innerHTML = captionText[0];
//	document.getElementById("prevLink").onclick = processPrevious;
//	document.getElementById("nextLink").onclick = processNext;
//}

		

function processPrevious() {
	newSlide(-1);
}

function processNext() {
	newSlide(1);
}

function newSlide(direction) {
	var imgCt = captionText.length;
	
	currImg = currImg + direction;
	if (currImg < 0) {
		currImg = imgCt-1;
	}
	if (currImg == imgCt) {
		currImg = 0;
	}
	document.getElementById("slideshow").src = "images/gallery3img/directImg" + currImg + ".jpg";
	document.getElementById("imgText").innerHTML = captionText[currImg];
	document.getElementById("imgTitle").innerHTML = captionTitle[currImg];
}
