﻿// Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

hs.graphicsDir = 'highslide/graphics/';
hs.outlineType = 'rounded-white';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.outlineType = 'rounded-white';
hs.fadeInOut = true;
//hs.dimmingOpacity = 0.75;

// Add the controlbar
hs.addSlideshow
(
	{
		//slideshowGroup: 'group1',
		interval: 5000,
		repeat: false,
		useControls: true,
		fixedControls: 'fit',
		overlayOptions: 
		{
			opacity: .75,
			position: 'bottom center',
			hideOnMouseOut: true
		}
	}
);

function drawProgressBar(color, width, percent)  
{  
	var pixels = width * (percent / 100);  

	document.write('<div class="smallish-progress-wrapper" style="width: ' + width + 'px">');  
	document.write('<div class="smallish-progress-bar" style="width: ' + pixels + 'px; background-color: ' + color + ';"></div>');  
	document.write('<div class="smallish-progress-text" style="width: ' + width + 'px">' + percent + '%</div>');  
	document.write('</div>');  
}  

function menuOver(obj)
{
	obj.oldClass = obj.className;
	if (obj.className.indexOf('_over') < 0)
	{
		obj.className = obj.className + '_over';
	}
}

function menuOut(obj)
{
	if (obj.oldClass)
	{
		obj.className = obj.oldClass;
	}
}

function showProjectImage(project_id, id)
{
	var isFoundImage = true;
	var n = 1;
	
	while(isFoundImage)
	{
		obj = document.getElementById('project_image_' + project_id + '_' + n);
		obj_page = document.getElementById('project_image_page_' + project_id + '_' + n);
		if (obj)
		{
			if (parseInt(n) == parseInt(id))
			{
				obj.style.display = "block";
				obj_page.className = "page-num selected";
			}
			else
			{
				obj.style.display = "none";
				obj_page.className = "page-num";
			}
		}
		else
		{
			isFoundImage = false;
		}
		n++;
	}
}

function showFundsImage(id)
{
	var isFoundImage = true;
	var n = 1;
	
	while(isFoundImage)
	{
		obj = document.getElementById('funds_image_' + n);
		obj_page = document.getElementById('funds_image_page_' + n);
		if (obj)
		{
			if (parseInt(n) == parseInt(id))
			{
				obj.style.display = "block";
				obj_page.className = "page-num selected";
				document.getElementById('funds_image_name').innerHTML = document.getElementById('funds_image_name_' + n).innerHTML;
			}
			else
			{
				obj.style.display = "none";
				obj_page.className = "page-num";
			}
		}
		else
		{
			isFoundImage = false;
		}
		n++;
	}
}
