// JavaScript Document


// random splash generator

function randomSplash()

{
var splashImage=new Array()

// location of images in this array
splashImage[1]="images/print_01.jpg";
splashImage[2]="images/print_02.jpg";
splashImage[3]="images/print_03.jpg";
splashImage[4]="images/print_04.jpg";
splashImage[5]="images/print_05.jpg";
splashImage[6]="images/logo_01.jpg";
splashImage[7]="images/logo_02.jpg";
splashImage[8]="images/logo_03.jpg";
splashImage[9]="images/logo_04.jpg";
splashImage[10]="images/logo_05.jpg";

var splashCaption=new Array()

// captions
splashCaption[1]="<a href=\"http:\/\/www.overcominggoingunder.com\" target=\"_blank\">Overcoming Going Under<\/a> Poster";
splashCaption[2]="Age Of Kali Poster";
splashCaption[3]="The Dance of Angels Poster";
splashCaption[4]="AWEA Stationary System";
splashCaption[5]="Batterhead Down CD";
splashCaption[6]="The Free Project Logo System";
splashCaption[7]="Kindred Spirits Logo";
splashCaption[8]="Entertainment Team Logo";
splashCaption[9]="American Wind Energy Association Logo";
splashCaption[10]="Monkeyduck.com Logo";

var getRan=Math.floor(Math.random()*splashImage.length)
if (getRan==0)
getRan=1

document.write('<p><img src=\"'+splashImage[getRan]+'\" alt=\"Anthony Garcia\" title=\"Anthony Garcia\" width=\"400\" \/>');

document.write('<p>'+splashCaption[getRan]+'<br \/>');
document.write('View more images in <a href=\"what.html\">what<\/a><\/p>');
}

function randomSplash2()

{
var splashImage=new Array()

// location of images in this array
splashImage[1]="images/ant_01.jpg";
splashImage[2]="images/ant_02.jpg";
splashImage[3]="images/ant_03.jpg";
splashImage[4]="images/ant_04.jpg";
splashImage[5]="images/ant_05.jpg";
splashImage[6]="images/ant_06.jpg";
splashImage[7]="images/ant_07.jpg";
splashImage[8]="images/ant_08.jpg";
splashImage[9]="images/ant_09.jpg";


var splashCaption=new Array()

// captions
splashCaption[1]="that's me";
splashCaption[2]="me again";
splashCaption[3]="boo";
splashCaption[4]="yep, you guessed it";
splashCaption[5]="uh huh";
splashCaption[6]="ello";
splashCaption[7]="hi der";
splashCaption[8]="...and again";
splashCaption[9]="me taking a picture of me...";

var getRan=Math.floor(Math.random()*splashImage.length)
if (getRan==0)
getRan=1

document.write('<p><img src=\"'+splashImage[getRan]+'\" alt=\"Anthony Garcia\" title=\"Anthony Garcia\" width=\"400\" \/>');

document.write('<p>'+splashCaption[getRan]+'<br \/>');
}

function randomSplash3()

{
var splashImage=new Array()

// location of images in this array
splashImage[1]="images/amg_banner_01.jpg";
splashImage[2]="images/amg_banner_02.jpg";
splashImage[3]="images/amg_banner_03.jpg";
splashImage[4]="images/amg_banner_04.jpg";
splashImage[5]="images/amg_banner_05.jpg";
splashImage[6]="images/amg_banner_06.jpg";
splashImage[7]="images/amg_banner_07.jpg";
splashImage[8]="images/amg_banner_08.jpg";
splashImage[9]="images/amg_banner_09.jpg";
splashImage[10]="images/amg_banner_10.jpg";
splashImage[11]="images/amg_banner_11.jpg";
splashImage[12]="images/amg_banner_12.jpg";


var getRan=Math.floor(Math.random()*splashImage.length)
if (getRan==0)
getRan=1

document.write('<p><img src=\"'+splashImage[getRan]+'\" alt=\"amgleft.com\" title=\"amgleft.com\" width=\"780\" \/>');

}


// NEW swap image and caption. Written by Micah Rich

   function swapPhoto(photoSRC,theCaption,theLink) {
     
    var displayedImage = document.getElementById("thephoto");
    var displayedCaption = document.getElementById("caption");
    
// to make the link go to a new window, i just added 'target="_blank"' to both links below. 
// target is just an attribute of the a tag in html
//
// however, i added a conditional to the image & link replacers. 
// it says that if there is no third variable, there won't be any links. it's written as follows:
// variableX=(variableY==null)? 'option1' : 'option2'
// which, in english, reads as:
// if variableY is null (i.e. there is no variableY), then put option1. otherwise, put option2.
// make sense?

   	displayedImage.innerHTML=(theLink==null)?('<img width="400" border="0" alt="' + theCaption + '" src="'+ "images/" + photoSRC + '"/>') : ('<a href="' + theLink + '"target="_blank"><img width="400" border="0" alt="' + theCaption + '" src= "'+ "images/" + photoSRC + '"/></a>');
   	displayedCaption.firstChild.nodeValue = theCaption;
// we can get rid of the extra link section, if we're gonna combine the caption & the URL into one.
// so below i'm using theLink inside the href attribute, same as before, but theCaption inside.
// before it was <a href="theLink">theLink</a>
// and now it's     <a href="theLink">theCaption</a>
// dig?
   	displayedCaption.innerHTML=(theLink==null)? ('<p>' + theCaption + '</p>'): ('<a href="' + theLink + '" target="_blank">' + theCaption + '</a>');
	 
}

// OLD swap image and caption 

/*function swapPhoto(photoSRC,theCaption,thePrice) {

	var displayedCaption = document.getElementById("caption");
	
	displayedCaption.firstChild.nodeValue = theCaption;

    document.images.imgPhoto.src = "images/" + photoSRC;
}*/

