// slide show script for GregoryVistica.com
// global variables
var slideLayWidth = 400;
var slideLayHeight;
var currentSlide = 0;
var zIndex = 1;
var isVisible = false;
// set default slide position
var slideLeftPosition = 15;
var slideTopPosition = 80;
// feature sensing to use correct CSS value for show and hide layers
var hideName = (isNN4 ? 'hide' : 'hidden');
var showName = (isNN4 ? 'show' : 'visible');
// path of images on server
var imgPath = "media/";

// function to generate the layers
function createLayer(slideName,slideLeft,slideTop,slideWdh,slideVis,slideContent)
{
	if (isNN4) 
	{
		document.writeln('<layer name="' + slideName + '" left=' + slideLeft + ' top=' + slideTop + ' width=' + slideWdh + ' visibility=' + slideVis + ' "' + ' z-index=' + (++zIndex) + '>' + slideContent + '</layer>');
	}
	else
	{
		document.writeln('<div id="' + slideName + '" style="position:absolute;overflow:none;left:' + slideLeft + 'px;top:' + slideTop + 'px;width:' + slideWdh + ' px;visibility:' + slideVis + ';z-Index=' + (++zIndex) + '">' + slideContent + '</div>');
	}
}

// function to create the slides
function createSlide(slideName,content)
{
	this.name = slideName;
	this.content = content;
	this.structure = '<table width="525" cellpadding="5"><tr valign="top"><td align="center">' + '<img src="' + imgPath + slideName + '.jpg"></td></tr>' + '<tr valign="top"><td>' + '<p style="margin-left\:30px\;">' + content + '</p>' + '</td></tr></table>';
	return this;
}

// function to write information to the page
 function createPage()
 {
	var i;
	for (i = 0;i<slideShow.length;i++)
	{
		createLayer('photo' + i,slideLeftPosition,slideTopPosition,slideLayWidth, (i == 0 ? showName : hideName),slideShow[i].structure);
	}
	createLayer('buttons',0,40,400,true,'<table width="500" border="0" cellpadding="0" cellspacing="0"><tr><td align="center"><a href="javascript:firstSlide();" onmouseover="swapImage(first,13);" onmouseout="swapImage(first,12);">' + '<img src="' + imgPath + 'first_off.gif" border="0" alt="First Slide" width="46" height="20" name="first"></a>' + '\&nbsp\;' + '<a href="javascript:changeSlide(-1);" onmouseover="swapImage(back,15);" onmouseout="swapImage(back,14);">' + '<img src="' + imgPath + 'back_off.gif" border="0" alt="Back" width="58" height="20" name="back"></a>' + '\&nbsp\;' + '<a href="javascript:changeSlide(1);" onmouseover="swapImage(next,17);" onmouseout="swapImage(next,16);">' + '<img src="' + imgPath + 'next_off.gif" border="0" alt="Next" width="58" height="20" name="next"></a>' + '<a href="javascript:lastSlide();" onmouseover="swapImage(last,19);" onmouseout="swapImage(last,18);">' + '<img src="' + imgPath + 'last_off.gif" border="0" alt="Last Slide" width="46" height="20" name="last"></a></td></tr></table>');
 }

// functions to get correct slide reference for specific functions (using cross_DOM script)
function hideSlide(name)
{
	getObject(name,1).visibility = hideName;
}
function showSlide(name)
{
	getObject(name,1).visibility = showName;
}
function changeSlide(offset)
{
	hideSlide('photo'+ currentSlide);
	currentSlide = (currentSlide + offset < 0 ? slideShow.length - 1 : (currentSlide + offset == slideShow.length ? 0 : currentSlide + offset));
	showSlide('photo' + currentSlide);
}
function firstSlide()
{
	hideSlide('photo' + currentSlide);
	currentSlide = 0;
	showSlide('photo' + currentSlide);
}
function lastSlide()
{
	hideSlide('photo' + currentSlide);
	currentSlide = 28;
	showSlide('photo' + currentSlide);
}

// slide array using slide object constructor in slide function
var slideShow = new Array(
	new createSlide ('photo0','After graduating from the University of Nebraska, Kerrey had no interest in joining the military or in Vietnam until he was drafted. He went to Officer Candidate School to become a naval aviator but ended up in Underwater Demolition Team training and the SEALs, where he struggled to make the cut. \"He used to come in last in the swims,\" his younger brother, Bill, said. \"But he kept at it.\"'),
	new createSlide ('photo1','During training in Coronado, California, prospective SEALs spent hours in mud that had the smell and feel of raw sewage. They carried telephone polls in it, did push-ups and sit-ups in it, dove into it, and ate their lunches in it.'),
	new createSlide ('photo2','Kerrey (left, standing) with Gerhard Klann (right, sitting). Kerrey had his own fears and doubts about the war. "I remember sitting in the audience and listening to Joan Baez say, \‘Say yes to the boys who say no.\’ That\’s a terrifying thought, that I was gonna get excluded here somehow." Years later, a media-savvy Kerrey relished his commando role: "I was ready to go at Hanoi with a knife in my teeth."'),
	new createSlide ('photo3','Kerrey handpicked Tucker, Klann, and Ambrose for his team. Tucker, a pro-baseball prospect before Vietnam, called Ambrose "The Mouth" for his cockiness. "I had a lot of ego at that time," Ambrose said. Tucker wore rose-colored glasses and blasted "Purple Haze" during training. Leaving Thanh Phong, he told Kerrey, "I don\’t like this stuff." Kerrey replied, "I don’t like it either." Ambrose said, "People were killed for senseless reasons. I cried pretty hard."'),
	new createSlide ('photo4','Tucker and Klann shared duties carrying the Stoner machine gun.'),
	new createSlide ('photo5','The most experienced of the Raiders, Klann was later handpicked for SEAL Team Six, a super-secret counterterrorism unit. In 1980, he surreptitiously slipped across the border into Iran to assess defenses for a second planned mission to free American hostages.'),
	new createSlide ('photo6','His team leader, Ted Macklin, \(back row, second from left, and next to Klann\) put him in for the Medal of Honor.'),
	new createSlide ('photo7','Captain Roy "Latch" Hoffmann \(center\), Kerrey’s swaggering commanding officer in Cam Ranh Bay, was all-Navy and no-nonsense. He carried his own M-16 into the field, along with a silver-handled revolver. "I damn well expect action," he intoned. If no enemy were captured or killed, he said: "You\’d hear from me." Kerrey said he was out of Apocalypse Now. "He was the classic body-count guy," he said.'),
	new createSlide ('photo8','Lieutenant William Garlow\’s Swift boat, PCF 102, \(third from left\) transported Kerrey\’s Raiders to Thanh Phong. After the raid, crewman William O\’Mara sensed something went terribly wrong. "I knew something was up. They were really quiet. It was eerie.\"'),
	new createSlide ('photo9','Thanh Phong is located in the Mekong Delta about seventy-five miles south of Saigon and about fifteen kilometers from the county seat of Thanh Phu.'),
	new createSlide ('photo10','Remote and desperately poor, the tiny hamlet of Thanh Phong was, for the most part, untouched by either war or progress.'),
	new createSlide ('photo11','There was no school and no young men of fighting age in Thanh Phong, only older men, women, and children.'),
	new createSlide ('photo12','On the night of the raid, the SEALs walked on paths by the canals that led into the village of Thanh Phong.'),
	new createSlide ('photo13','Kerrey’s Raiders came ashore here, on the outskirts of Thanh Phong. It was their first big operation.'),
	new createSlide ('photo14','A Vietnamese man points to the site where he says the Navy SEALs massacred his relatives around midnight on February 25, 1969.'),
	new createSlide ('photo15','Pham Tri Lanh was thirty and the wife of a Vietcong fighter when, she says, she witnessed the killings of unarmed women and children. At one site, Lanh said, "After they cut the throat of the old man, they went out and stabbed the three children." At the next site, Lanh said, "They lined them up and shot all of them." Approximately twenty-five women and children were killed that night.'),
	new createSlide ('photo16','The two large tombs are marked with the names of Bui Van Vat and his wife, Luu Thi Canh. Two other graveyards contain the remains of victims whom villagers say died at the hands of the SEALs.'),
	new createSlide ('photo17','Beside the graves of Bui Van Vat and his wife, lay three small, unmarked mounds of cement painted white. They are the apparent resting place for three small children: a boy not yet nine; his sister, about a year older; and the eldest girl, who was approaching thirteen—the grandchildren, Klann said, who were killed in the first hooch.'),
	new createSlide ('photo18','Bui Thi Luom was twelve when she barely escaped the massacre that killed at least fifteen of her relatives at Thanh Phong. Showing her wound to foreign correspondents, she said, \"If I could get revenge, I would.\" Her story substantiated accounts given by eye witnesses and Gerhard Klann. Ngoc Danh'),
	new createSlide ('photo19','Kerrey\'s Medal of Honor misson took place on Hon Tam Island, which sat off the mainland coast in the Bay of Nha Trang. His Raiders were after a team of Vietcong sappers encamped there. To maintain surprise, the SEALs scaled a 350-foot rock cliff in pitch darkness and total silence. If one of the men at the top had fallen, it\'s likely they all would have plunged to their deaths.'),
	new createSlide ('photo20','The mission was a catastrophe. Kerrey, Klann, and Lloyd \"Doc\" Schrier unexpectedly encountered four Vietcong. An exploding grenade injured Kerrey and Schrier. According to documents, Klann, using a Stoner machine gun, \"was instrumental in keeping the sappers from overrunning his element\’s position and in quickly suppressing the hostile fire.\" In layman\’s words, he saved his two teammates\’ lives.'),
	new createSlide ('photo21','Richard Nixon was the man Kerrey \"hated most on earth.\" Kerrey contemplated using the Medal of Honor ceremony to take a public stand against the war\: \"I didn’t want the damn medal.\" Privately, he adored it. At a celebration party, his friend Lewis Puller noticed Kerrey \"did not allow the medal and its silk-lined box out of his sight for the entire night.\"'),
	new createSlide ('photo22','Plagued by nightmares, Kerrey would rise early and run to the Vietnam Memorial. "You have to be steely-eyed," he said of his visits there, "if you really want to avoid sobbing like a baby." On one trip, he stenciled the name of James Gore, a member of Kerrey\’s sister squad, Fire Team Alpha, who died in a helicopter crash in Vietnam on June 23, 1970.'),
	new createSlide ('photo23','A smitten Governor Kerrey sent Hollywood film star Debra Winger a "quite affectionate" note when she came to Nebraska to film Terms of Endearment. Kerrey nicknamed her \"Wing.\" Opinion polls were positive\: Few Nebraskans cared that the divorced Kerrey was living with a single woman in the governor\’s mansion. \"We fell head over heels in love.\" Kerrey said.'),
	new createSlide ('photo24','Bill Clinton and Bob Kerrey shared a complicated relationship, a combustible mixture of rivalry, mutual respect, envy, mistrust, and loathing. The two dynamic baby-boomer politicians had known each other since their days as governors but had never become close. Kerrey called Clinton an "unusually good liar" but said "it would have been difficult not to say yes" when Clinton was considering him for vice president. Kerrey believed that Hillary nixed the idea.'),
	new createSlide ('photo25','Kerrey carried his secret through three decades of what was, by all appearances, a storybook existence: war hero, self-made millionaire businessman, governor, and a United States senator. His final conquest was a run for the 1992 Democratic nomination for president. He started with promise and excitement, but after a few months, he looked like anything but a potential president. He was deeply ambivalent about his military record. Some days he would scarcely mention that he served, on others it was all he would talk about. He won South Dakota but floundered elsewhere, eventually dropping out early.'),
	new createSlide ('photo26','After leaving the Senate in 2002, Kerrey agreed to interviews with <i>The New York Times</i> and <i>60 Minutes II</i> for a joint reporting project on the Thanh Phong raid. Dan Rather was determined that the <i>60 Minutes II</i> segment would be fair and show Kerrey every courtesy. \"The truth of the matter is I came to this interview saying it’s the stupidest thing I ever did in my life,\" Kerrey said.'),
	new createSlide ('photo27','Veteran newsman and <i>60 Minutes II</i> producer Tom Anderson interviewed Pham Tri Lanh. Her story matched up with Klann\’s in critical details. When told about Lanh, Kerrey became visibly shaken and later accused both media organizations of collaborating with the Communist Vietnamese government.'),
	new createSlide ('photo28','After his first interview with Rather, Kerrey came back a second time to rebut Pham Tri Lanh’s story. In doing so, he acknowledged committing an "atrocity." Kerrey leaked his version of the story four days before <i>The New York Times</i> article was to be published. He wanted to undermine the Times and CBS.')
);
