
function displayImage(image)
{
	var img = new Image();
	img.src = document.getElementById(image).src;
	var w = img.width;
	var h = img.height;
	//window.open(img.src, 'Photo Gallery', 'status=1,width='+w+',height='+h);
	window.open(img.src, "", "toolbar=0, scrollbars=0, resizable=0, width="+w+", height="+h+", left=0, top=0");
	//alert('width: ' + w + 'height: ' + h);
}

function displayProduct(image)
{
	var img = new Image();
	img.src = image;
	var w = img.width;
}

function toggle_menu(menu)
{
	if (document.getElementById(menu + '_menu').style.display == 'none' || document.getElementById(menu + '_menu').style.display == '' )
	{
		document.getElementById(menu + '_menu').style.display = 'block';
		document.getElementById(menu + '_arrow').src = 'images/downarrow.jpg';
	}
	else 
	{
		document.getElementById(menu + '_menu').style.display = 'none';
		document.getElementById(menu + '_arrow').src = 'images/arrow.jpg';
	}
			
}

function showSubMenu(menu, status)
{
	if (status == "show")
		document.getElementById('sub-' + menu).style.display = 'block';
	else
		document.getElementById('sub-' + menu).style.display = 'none';
}

function adjustHeight()
{
	var divH = document.getElementById('internal_wrapper').offsetHeight;
	document.getElementById('internal_right').style.height = divH + "px";
}

function adjustHeightMain()
{
	var divH = document.getElementById('main_left').offsetHeight;
	document.getElementById('main_right').style.height = divH + "px";
}

function slidePreLoad(page)
{
	if (page == "lane_memorial_gardens")
	{
		var max = 11;
		document.getElementById('max').innerHTML = max;
	}
	else if (page == "musgrove_family_mortuary")
	{
		var max = 4;
		document.getElementById('max').innerHTML = max;
	}
	else if (page == "west_lawn")
	{
		var max = 10;
		document.getElementById('max').innerHTML = max;
	}	
	else if (page == "springfield_memorial_gardens")
	{
		var max = 16;
		document.getElementById('max').innerHTML = max;
	}
	else if (page == "mt_calvary")
	{
		var max = 14;
		document.getElementById('max').innerHTML = max;
	}
	var i = 0;
	tempImage = new Image();
	for (i=0; i < max; i++)
	{
		tempImage.src = "images/" + page + i + ".jpg";
	}
	

}

var status = 1;

function locationSlide(page, direction) {
	if (page == "lane_memorial_gardens")
	{
		var max = 11;
		captions = new Array();
		captions[0] = "Christus Garden";
		captions[1] = "Apostles Garden";
		captions[2] = "Faithful Friends Family &amp; Pet Cemetery";
		captions[3] = "Good Sheppard Garden";
		captions[4] = "Cherry Blossoms";
		captions[5] = "Meditation Garden";
		captions[6] = "Reflection Pond";
		captions[7] = "Apostles Garden";
		captions[8] = "Funeral Home Fireside Room";
		captions[9] = "Outdoor Mausoleum";
		captions[10] = "Reflecting Pond Mausoleum";
		
		
	}
	else if (page == "musgrove_family_mortuary")
	{
		var max = 4;
		captions = new Array();
		captions[0] = "Musgrove Family Mortuary and Family Center";
		captions[1] = "Celebration of Life Service at Family Center";
		captions[2] = "Traditional Service at Family Center";
		captions[3] = "Memorial Service with Reception at Family Center";
		
	}
	else if (page == "west_lawn")
	{
		var max = 10;
		captions = new Array();
		captions[0] = "";
		captions[1] = "Abraham Garden";
		captions[2] = "Historic Monuments";
		captions[3] = "Whispering Waters Cremation Garden";
		captions[4] = "Gazebo and Waterfall in Whispering Waters Cremation Garden";
		captions[5] = "Glass Front Niches";
		captions[6] = "Basalt Columns Memorials";
		captions[7] = "Cored Cremation Monuments";
		captions[8] = "Whispering Waters Niches";
		captions[9] = "Granite Columns";			
		
	}
	else if (page == "mt_calvary")
	{
		var max = 14;
		captions = new Array();
		captions[0] = "";
		captions[1] = "";
		captions[2] = "";
		captions[3] = "";
		captions[4] = "";
		captions[5] = "Northward view of Section C";
		captions[6] = "The Chapel";
		captions[7] = "Statuary in Section D";
		captions[8] = "Cemetery Entrance";
		captions[9] = "Section F";
		captions[10] = "Infant Memorial";
		captions[11] = "Niches for Urns";
		captions[12] = "Southerly view to Spencer's Butte";
		captions[13] = "Section C";		
		
		
	}
	else if (page == "springfield_memorial_gardens")
	{
		var max = 16;
		captions = new Array();
		captions[0] = "";
		captions[1] = "Pines Garden";
		captions[2] = "Oaks Garden";
		captions[3] = "Extended Oaks Garden";
		captions[4] = "Springfield Memorial Funeral Home and Upper Mausoleum";		
		captions[5] = "Extended Pines Garden";
		captions[6] = "Extended Oaks Garden";
		captions[7] = "Lower Mausoleum";
		captions[8] = "Sunrise Stain Glass in Lower Mausoleum";
		captions[9] = "Upper Mausoleum and Springfield Memorial Funeral Home";
		captions[10] = "Springfield Memorial Chapel";
		captions[11] = "Veteran's Memorial";
		captions[12] = "Valley View Columbarium";
		captions[13] = "Valley View Columbarium";
		captions[14] = "Valley View Columbarium";
		captions[15] = "Valley View Columbarium - Loving Companions Niches";
		


	}

	if(direction == "next")
	{
		if (status == max)
		{
			status = 1;
		}
		else
		{	
			status++;
		}
		
			
	}
	else if (direction == "prev")
	{
		if (status == 1)
		{
			status = max;
		}
		else
		{	
			status--;
		}		
	
	}
	document.getElementById('location_image').src = 'images/locations/' + page + status + '.jpg';
	document.getElementById('loc_caption').innerHTML = captions[status -1];
	document.getElementById('current').innerHTML = status;

}

var nextPreviousEmployerCount = 2;
var nextCollegeTechnicalSchoolCount = 2;
var nextReferenceCount = 2;

function nextPreviousEmployer(num) {
	if (nextPreviousEmployerCount <= num) {
		document.getElementById('ROE' + nextPreviousEmployerCount).style.display = "block";
		document.getElementById('ROE' + nextPreviousEmployerCount + 'Hidden').value = "true";
		
		nextPreviousEmployerCount++;
		
		if (nextPreviousEmployerCount > num) {
			document.getElementById('nextPreviousEmployer').style.display = "none";
		}
	}
}

function nextCollegeTechnicalSchool(num) {
	if (nextCollegeTechnicalSchoolCount <= num) {
		document.getElementById('E' + nextCollegeTechnicalSchoolCount).style.display = "block";
		document.getElementById('E' + nextCollegeTechnicalSchoolCount + 'Hidden').value = "true";
		
		nextCollegeTechnicalSchoolCount++;
		
		if (nextCollegeTechnicalSchoolCount > num) {
			document.getElementById('nextCollegeTechnicalSchool').style.display = "none";
		}
	}
}

function nextReference(num) {
	if (nextReferenceCount <= num) {
		document.getElementById('R' + nextReferenceCount).style.display = "block";
		document.getElementById('R' + nextReferenceCount + 'Hidden').value = "true";
		
		nextReferenceCount++;
		
		if (nextReferenceCount > num) {
			document.getElementById('nextReference').style.display = "none";
		}
	}
}

function displayFlash() {
	document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="320" height="282" id="video" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="flash/video.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="flash/video.swf" quality="high" bgcolor="#ffffff" width="320" height="282" name="video" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}