function setfocus(a_field_id) {
        $(a_field_id).focus()
    }
	
function LayerOn(whichLayer)	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style2 = document.getElementById(whichLayer).style;
	style2.display = style2.display? "":"block";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style2 = document.all[whichLayer].style;
	style2.display = style2.display? "":"block";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style2 = document.layers[whichLayer].style;
	style2.display = style2.display? "":"block";
	}
}

function LayerOff(whichLayer)	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style2 = document.getElementById(whichLayer).style;
	style2.display = style2.display? "":"none";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style2 = document.all[whichLayer].style;
	style2.display = style2.display? "":"none";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style2 = document.layers[whichLayer].style;
	style2.display = style2.display? "":"none";
	}
}

	function donothing() {
	
	}
		
	function hidesomething(layer_ref) {	
		var state = 'hidden';
		if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( 'document.all.' + layer_ref + '.style.visibility = state');
		}
		if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].visibility = state;
		}
		if (document.getElementById && !document.all) {
		maxwell_smart = document.getElementById(layer_ref);
		maxwell_smart.style.visibility = state;
		}
	}
	
	function showsomething(layer_ref) {	
		var state = 'visible';
		if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( 'document.all.' + layer_ref + '.style.visibility = state');
		}
		if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].visibility = state;
		}
		if (document.getElementById && !document.all) {
		maxwell_smart = document.getElementById(layer_ref);
		maxwell_smart.style.visibility = state;
		}
	}
	
	if (document.images)
	{
		pic1= new Image(20,20);
		pic1.src='images/headingsandlogos/divider-both.gif';
		pic2= new Image(20,20);
		pic2.src='images/headingsandlogos/divider-top.gif';
		pic3= new Image(20,20);
		pic3.src='images/headingsandlogos/divider-bottom.gif';
		pic4= new Image(20,20);
		pic4.src='images/headingsandlogos/divider-blank.gif';
		ButtonHomeon= new Image(61,25);
		ButtonHomeon.src='images/headingsandlogos/mainbutton-home2.gif';
		ButtonHomeoff= new Image(61,25);
		ButtonHomeoff.src='images/headingsandlogos/mainbutton-home.gif';
		ButtonBioon= new Image(50,50);
		ButtonBioon.src='images/headingsandlogos/mainbutton-biography2.gif';
		ButtonBiooff= new Image(50,50);
		ButtonBiooff.src='images/headingsandlogos/mainbutton-biography.gif';
		ButtonGallerieson= new Image(50,50);
		ButtonGallerieson.src='images/headingsandlogos/mainbutton-galleries2.gif';
		ButtonGalleriesoff= new Image(50,50);
		ButtonGalleriesoff.src='images/headingsandlogos/mainbutton-galleries.gif';
		ButtonPackageson= new Image(50,50);
		ButtonPackageson.src='images/headingsandlogos/mainbutton-weddingpackages2.gif';
		ButtonPackagesoff= new Image(50,50);
		ButtonPackagesoff.src='images/headingsandlogos/mainbutton-weddingpackages.gif';
		ButtonContacton= new Image(50,50);
		ButtonContacton.src='images/headingsandlogos/mainbutton-contact2.gif';
		ButtonContactoff= new Image(50,50);
		ButtonContactoff.src='images/headingsandlogos/mainbutton-contact.gif';
		
		WeddingPicon= new Image(50,50);
		WeddingPicon.src='images/gallerybuttons/gallerybutton-weddings-gray.gif';
		WeddingPicoff= new Image(50,50);
		WeddingPicoff.src='images/gallerybuttons/gallerybutton-weddings.gif';
		ChildrenPicon= new Image(50,50);
		ChildrenPicon.src='images/gallerybuttons/gallerybutton-children-gray.gif';
		ChildrenPicoff= new Image(50,50);
		ChildrenPicoff.src='images/gallerybuttons/gallerybutton-children.gif';
		PortraitPicon= new Image(50,50);
		PortraitPicon.src='images/gallerybuttons/gallerybutton-portraits-gray.gif';
		PortraitPicoff= new Image(50,50);
		PortraitPicoff.src='images/gallerybuttons/gallerybutton-portraits.gif';
		SceneryPicon= new Image(50,50);
		SceneryPicon.src='images/gallerybuttons/gallerybutton-scenery-gray.gif';
		SceneryPicoff= new Image(50,50);
		SceneryPicoff.src='images/gallerybuttons/gallerybutton-scenery.gif';
		ArtisticPicon= new Image(50,50);
		ArtisticPicon.src='images/gallerybuttons/gallerybutton-artistic-gray.gif';
		ArtisticPicoff= new Image(50,50);
		ArtisticPicoff.src='images/gallerybuttons/gallerybutton-artistic.gif';
		PetsPicon= new Image(50,50);
		PetsPicon.src='images/gallerybuttons/gallerybutton-pets-gray.gif';
		PetsPicoff= new Image(50,50);
		PetsPicoff.src='images/gallerybuttons/gallerybutton-pets.gif';
		RetouchingPicon= new Image(50,50);
		RetouchingPicon.src='images/gallerybuttons/gallerybutton-retouching-gray.gif';
		RetouchingPicoff= new Image(50,50);
		RetouchingPicoff.src='images/gallerybuttons/gallerybutton-retouching.gif';
		
		WeddingPic2on= new Image(50,50);
		WeddingPic2on.src='images/gallerybuttons/gallerybutton-weddings-gray.gif';
		WeddingPic2off= new Image(50,50);
		WeddingPic2off.src='images/gallerybuttons/gallerybutton-weddings.gif';
		ChildrenPic2on= new Image(50,50);
		ChildrenPic2on.src='images/gallerybuttons/gallerybutton-children-gray.gif';
		ChildrenPic2off= new Image(50,50);
		ChildrenPic2off.src='images/gallerybuttons/gallerybutton-children.gif';
		PortraitPic2on= new Image(50,50);
		PortraitPic2on.src='images/gallerybuttons/gallerybutton-portraits-gray.gif';
		PortraitPic2off= new Image(50,50);
		PortraitPic2off.src='images/gallerybuttons/gallerybutton-portraits.gif';
		SceneryPic2on= new Image(50,50);
		SceneryPic2on.src='images/gallerybuttons/gallerybutton-scenery-gray.gif';
		SceneryPic2off= new Image(50,50);
		SceneryPic2off.src='images/gallerybuttons/gallerybutton-scenery.gif';
		ArtisticPic2on= new Image(50,50);
		ArtisticPic2on.src='images/gallerybuttons/gallerybutton-artistic-gray.gif';
		ArtisticPic2off= new Image(50,50);
		ArtisticPic2off.src='images/gallerybuttons/gallerybutton-artistic.gif';
		PetsPic2on= new Image(50,50);
		PetsPic2on.src='images/gallerybuttons/gallerybutton-pets-gray.gif';
		PetsPic2off= new Image(50,50);
		PetsPic2off.src='images/gallerybuttons/gallerybutton-pets.gif';
		RetouchingPic2on= new Image(50,50);
		RetouchingPic2on.src='images/gallerybuttons/gallerybutton-retouching-gray.gif';
		RetouchingPic2off= new Image(50,50);
		RetouchingPic2off.src='images/gallerybuttons/gallerybutton-retouching.gif';
		
		weddingtitle= new Image(250,50);
		weddingtitle.src='images/gallerytitles/gallerytitle-weddings.gif';
		portraittitle= new Image(250,50);
		portraittitle.src='images/gallerytitles/gallerytitle-portraits.gif';
		artistictitle= new Image(250,50);
		artistictitle.src='images/gallerytitles/gallerytitle-artistic.gif';
		childrentitle= new Image(250,50);
		childrentitle.src='images/gallerytitles/gallerytitle-children.gif';
		momentstitle= new Image(250,50);
		momentstitle.src='images/gallerytitles/gallerytitle-moments.gif';
		petstitle= new Image(250,50);
		petstitle.src='images/gallerytitles/gallerytitle-pets.gif';
		retouchingtitle= new Image(250,50);
		retouchingtitle.src='images/gallerytitles/gallerytitle-retouching.gif';
		scenerytitle= new Image(250,50);
		scenerytitle.src='images/gallerytitles/gallerytitle-scenery.gif';
	}
	
	function changemainpic(imgName) 
	{
		document['picDisplay2'].src= imgName;
	}
	
	function GrayOut(imgName)
	{
		if (document.images)
		{
			imgOn=eval(imgName + 'on.src');
			document[imgName].src= imgOn;
			SwapTitle(imgName);
		}
	}
	
	function GrayOff(imgName)
	{
		if (document.images)
		{
			imgOff=eval(imgName + 'off.src');
			document[imgName].src= imgOff;
			ResetTitle(imgName);
		}
	}
	
	function SwapTitle(imgName)
	{
		if (document.images)
		{
			if (imgName=='WeddingPic') 
			{
				document.getElementById('Title').innerHTML = 'Wedding Gallery';
			}
			if (imgName=='ChildrenPic') 
			{
				document.getElementById('Title').innerHTML = 'Children Gallery';
			}
			if (imgName=='PortraitPic') 
			{
				document.getElementById('Title').innerHTML = 'Portrait Gallery';
			}
			if (imgName=='SceneryPic') 
			{
				document.getElementById('Title').innerHTML = 'Scenery Gallery';
			}
			if (imgName=='ArtisticPic') 
			{
				document.getElementById('Title').innerHTML = 'Artistic Gallery';
			}
			if (imgName=='PetsPic') 
			{
				document.getElementById('Title').innerHTML = 'Pets Gallery';
			}
			if (imgName=='RetouchingPic') 
			{
				document.getElementById('Title').innerHTML = 'Retouching Gallery';
			}
			if (imgName=="R1") 
			{	
				document["RightDisplay"].src="images/gallerypics-retouching/r1.jpg";	
			}
			if (imgName=="R1A") 
			{
				document["RightDisplay"].src="images/gallerypics-retouching/r1a.jpg";	
			}
			if (imgName=="R1B") 
			{
				document["RightDisplay"].src="images/gallerypics-retouching/r1b.jpg";	
			}
			if (imgName=="R2") 
			{
				document["RightDisplay"].src="images/gallerypics-retouching/r2.jpg";	
			}
			if (imgName=="R2A") 
			{
				document["RightDisplay"].src="images/gallerypics-retouching/r2a.jpg";	
			}
			if (imgName=="R3") 
			{
				document["RightDisplay"].src="images/gallerypics-retouching/r3.jpg";	
			}
			if (imgName=="R3A") 
			{
				document["RightDisplay"].src="images/gallerypics-retouching/r3a.jpg";	
			}
			if (imgName=="R4") 
			{
				document["LeftDisplay"].src="images/gallerypics-retouching/r4.jpg";	
			}
			if (imgName=="R4A") 
			{
				document["LeftDisplay"].src="images/gallerypics-retouching/r4a.jpg";	
			}
			if (imgName=="R5") 
			{
				document["LeftDisplay"].src="images/gallerypics-retouching/r5.jpg";	
			}
			if (imgName=="R5A") 
			{
				document["LeftDisplay"].src="images/gallerypics-retouching/r5a.jpg";	
			}
			if (imgName=="R6") 
			{
				document["LeftDisplay"].src="images/gallerypics-retouching/r6.jpg";	
			}
			if (imgName=="R6A") 
			{
				document["LeftDisplay"].src="images/gallerypics-retouching/r6a.jpg";	
			}
			if (imgName=="R7") 
			{
				document["LeftDisplay"].src="images/gallerypics-retouching/r7.jpg";	
			}
			if (imgName=="R7A") 
			{
				document["LeftDisplay"].src="images/gallerypics-retouching/r7a.jpg";	
			}
			if (imgName=="R8") 
			{
				document["LeftDisplay"].src="images/gallerypics-retouching/r8.jpg";	
			}
			if (imgName=="R8A") 
			{
				document["LeftDisplay"].src="images/gallerypics-retouching/r8a.jpg";	
			}
			if (imgName=="R9") 
			{
				document["RightDisplay"].src="images/gallerypics-retouching/r9.jpg";	
			}
			if (imgName=="R9A") 
			{
				document["RightDisplay"].src="images/gallerypics-retouching/r9a.jpg";	
			}
		}
	}
	
	function ResetTitle()
	{
		if (document.images)
		{
			document.getElementById('Title').innerHTML = 'Making Moments Last A Lifetime';
		}
	}
	
	function wopen(url, w, h)
	{
	    // Fudge factors for window decoration space.
		// In my tests these work well on all platforms & browsers.
	        w += 32;
	        h += 96;
		var win = window.open(url,
			'popup', 
			'width=' + w + ', height=' + h + ', ' +
			'location=no, menubar=no, ' +
			'status=no, toolbar=no, scrollbars=no, resizable=no');
		win.resizeTo(w, h);
		win.focus();
	}
	
	function changemainpic(imgName) 
	{
		document['picDisplay2'].src= imgName;
	}
	
	function changeeventpic(imgLoc) 
	{
		document['eventpic'].src= imgLoc;
		//document['eventpic'].src= "images/eventpics/Andy and Angie Russell/2.jpg";
	}
