var imgBase = "gfx/"
var largeImgBase = "portfoliogfx/ph-";
var largeImgBase = "portfolio/ph";
var largeImgBasePf = "portfoliogfx/pf-";
var largeImgBasePf2 = "portfolio/design/pf";

var saleImgBase = "gfx_prints/images/prints";

function loadSaleImg(imgnum)
{
	document.photo_large.src = saleImgBase + imgnum + ".jpg";
}

function loadLargeImg(imgname)
{
	document.photo_large.src = largeImgBase + imgname + ".jpg";
}

function loadLargeImg2(imgname)
{
	document.photo_large.src = largeImgBase + imgname + ".jpg";
}

function loadLargeImg3(imgname)
{
	document.photo_large.src = imgname + ".jpg";
}

function loadLargeImgPf(imgname)
{
	document.photo_large.src = largeImgBasePf + imgname + ".jpg";
	changeLink("#", "_self");
}

function loadLargeImgPf2(imgname)
{
	document.photo_large.src = largeImgBasePf2 + imgname + ".jpg";
	changeLink("#", "_self");
}

function loadLargeImgPfWithLink(imgname, thelink)
{
	document.photo_large.src = largeImgBasePf + imgname + ".jpg";
	changeLink(thelink, "_blank");
}

function loadLargeImgPfWithLink2(imgname, thelink)
{
	document.photo_large.src = largeImgBasePf2 + imgname + ".jpg";
	changeLink(thelink, "_blank");
}

function changeLink(thelink, linktarget)
{	
	for (i=0; i <document.links.length; i++) 
	{
		if(document.links[i].id == "piclink")
		{
			document.links[i].href = thelink;
			document.links[i].target = linktarget;
			break;
		}
	}
}

function loadRandomImg()
{
	var imagenumber = 8 ;  //  Change this number if the number of random header graphics changes
	var randomnumber = Math.random() ;
	var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ;
	var imgname = "maltese1";
	
	switch (rand1)
	{
		case 1:
			imgname = "feldman2";
			break;
		case 2:
			imgname = "ickis";
			break;
		case 3:
			imgname = "murphyscooter";
			break;
		case 4:
			imgname = "alexx";
			break;
		case 5:
			imgname = "murphy";
			break;
		case 6:
			imgname = "landry";
			break;
		case 7:
			imgname = "titania";
			break;
		case 8:
			imgname = "c_nutmeg";
			break;
	}
	
	loadLargeImg(imgname);
}

function loadPhoto(index)
	{
		if (document.images)
		{
			var picture = "alexx";
			switch (index)
			{
			case 0:
				picture = "alexx";
				break;
			case 1:
				picture = "baz";
				break;
			case 2:
				picture = "cordelia";
				break;
			case 3:
				picture = "gabarm";
				break;
			case 4:
				picture = "gabrielle";
				break;
			case 5:
				picture = "ickis";
				break;
			case 6:
				picture = "murphy";
				break;
			case 7:
				picture = "scoomurph";
				break;
			case 8:
				picture = "viola";
				break;
			case 9:
				picture = "claudia";
				break;
			case 10:
				picture = "lucky";
				break;
			case 11:
				picture = "armand";
				break;
			case 12:
				picture = "nhanbeach";
				break;
			case 13:
				picture = "scooterkim";
				break;
			case 14:
				picture = "scamper";
				break;
			case 15:
				picture = "floydandboys";
				break;
			case 16:
				picture = "tank";
				break;
			case 17:
				picture = "alexxandkristin";
				break;	
			case 18:
				picture = "dianeandboys";
				break;	
			case 19:
				picture = "walker1";
				break;	
			case 20:
				picture = "walker2";
				break;	
			case 21:
				picture = "maggie";
				break;	
			case 22:
				picture = "landrycats";
				break;	
			case 23:
				picture = "tasha";
				break;	
			case 24:
				picture = "tuppence";
				break;	
			case 25:
				picture = "tucker";
				break;		
			}
			
			document.slide.src = imgBase + "ph-" + picture + ".jpg"
		}
	}

function loadPortfolio(index)
	{
		if (document.images)
		{
			var picture = "bccard";
			var picturelink = "#";
			var linktarget = "_self";
			switch (index)
			{
			case 0:
				picture = "casinoflyer";
				break;
			case 1:
				picture = "cmcalendar";
				break;
			case 2:
				picture = "colachico";
				break;
			case 3:
				picture = "colachicoflyer";
				break;
			case 4:
				picture = "comprewards";
				break;
			case 5:
				picture = "epharma";
				break;
			case 6:
				picture = "recbrochure";
				break;
			case 7:
				picture = "sumouting";
				break;
			case 8:
				picture = "swanball";
				break;
			case 9:
				picture = "vaysburd";
				break;
			case 10:
				picture = "webcavy";
				break;
			case 11:
				picture = "swansite";
				picturelink = "http://www.swanstage.com";
				linktarget = "_blank";
				break;
			case 12:
				picture = "bccard";
				break;
			case 13:
				picture = "colabroch";
				break;
			case 14:
				picture = "wit";
				break;
			case 15:
				picture = "massstaffing";
				break;
			case 16:
				picture = "regentbrochure";
				break;
			case 17:
				picture = "guardupads";
				break;
			case 18:
				picture = "othello";
				break;
			case 19:
				picture = "chipostcard";
				break;
			case 20:
				picture = "maidprocard";
				break;
			case 21:
				picture = "saiya";
				break;
			case 22:
				picture = "maidprocal";
				break;
			case 23:
				picture = "cmsite";
				picturelink = "http://www.cavymadness.com";
				linktarget = "_blank";
				break;
			case 24:
				picture = "chisite";
				picturelink = "http://www.thecarriagehouseinn.com";
				linktarget = "_blank";
				break;
			case 25:
				picture = "citycatssite";
				picturelink = "http://www.city-cats.com";
				linktarget = "_blank";
				break;
			}
			
			document.slide.src = imgBase + "pf-" + picture + ".jpg";
			for (i=0; i <document.links.length; i++) 
			{
				if(document.links[i].id == "piclink")
				{
					document.links[i].href = picturelink;
					document.links[i].target = linktarget;
					break;
				}
			}
		}
   }