// JavaScript Document

var emname = "lauren";
var emhost = "laurenkerr.com";

//function to display a sample with tagline and link
function showSample (whichSample,whichFull) {
if (document.getElementById) {
	document.getElementById('placeholder').src = 'images/placeholder.gif';
	document.getElementById('placeholder').src = whichSample.href;
	document.getElementById('sampleLink').href = whichFull;
	if (whichSample.title) {
		document.getElementById('tagline').childNodes[0].nodeValue = whichSample.title;
	}
	else {
		document.getElementById('tagline').childNodes[0].nodeValue = whichSample.childNodes[0].nodeValue;
	}
	return false;
	}
	else {
		return true;
	}
}

//slideshow script
var picImages=new Array();
var picURL=new Array();
	picImages[0]="samples/collateral/REVOartofpersuasionFC.jpg";
	picURL[0]="revo.html";
	picImages[1]="samples/mail/destiny1.jpg";
	picURL[1]="destiny.html";
	picImages[2]="samples/ads/CRPhilanthropistAD.jpg";
	picURL[2]="crphilanthropy.html";
	picImages[3]="samples/copy/StyleConverseAD1.jpg";
	picURL[3]="style.html";

var thisPic = -1;
var imgCt = picImages.length;
var run;

//automatic slideshow, which is in the BODY onLoad
function autoRun() {
	if (document.images) {
		thisPic++;
		if (thisPic == imgCt) {
			thisPic = 0;
		}
	document.showpic.src=picImages[thisPic];
	run = setTimeout("autoRun()", 4000);
	}
}
function goThere() {
	document.location.href = picURL[thisPic];
}

//open up new window with whichFull in it
function openFull(whichFull){
	myWindow = window.open("", "_blank");
	myContent="<html><head><title>LaurenKerr: Portfolio Sample</title>"
	myContent+="<link rel='stylesheet' type='text/css' href='sheets/kerr2.css' media='screen'></head>"
	myContent +="<body onBlur='self.close()'>"
	myContent+="<img src='" +whichFull+"'>"
	myContent +="</body></html>"

	myWindow.document.write(myContent)
	myWindow.document.close() 
}