
var currentImage = 1;
var slideShowCount = 1;//images in the slide show.
var min = new Array();
var max = new Array();
var pricing = new Array();
/**
 * Function displays the different software products in the products page.
 */
function services_menu_onclick(tag)
{
	var links = new Array("accounts_payable", "purchase_orders", "human_resources",
	"payroll", "time_trax", "utility_billing", "scheduling", "capital_assets", "inventory",
	"point_of_sale", "cemetery", "data_conversion", "training", "supportp", "installation", "tools", 
	"permits_and_license_management");

	for(var i = 0; i < 17; i++)
	{
		document.getElementById(links[i] + '_link').style.textDecoration = 'none';
		document.getElementById(links[i]).style.display = 'none';
	}

	document.getElementById(tag).style.display = 'block';
	document.getElementById(tag + '_link').style.textDecoration = 'underline';
}

/**
 * Function redirects the user.
 */
function display_redirect(input)
{
	window.location.assign(input);
	//window.location.assign('/dev/compuTrain/www/compuTrain/php/' + input);
}

function Redirect(input)
{
	window.location.assign(input);
}

/**
 * Function displays the packaging div.
 */
function display_packaging()
{
	document.getElementById('packaging_div').style.display = 'block';
}

/**
 * Function hides packaging.
 */
function hide_packaging()
{
	//HIDE THE PACKAGING
	document.getElementById('packaging_div').style.display = 'none';
}

/**
 * Function sets the packaging id's and closes the div.
 */
function set_packaging(packaging_id, packaging)
{
	//SET THE PACKAGING SPAN AND THE INK COLOR HIDDEN.
	document.getElementById('PACKAGING').value = packaging_id;
	document.getElementById('PACKAGING_SPAN').innerHTML = packaging;

	//HIDE THE DIV.
	hide_packaging();
}

/**
 * Function displays the ink color div.
 */
function display_ink_color()
{
	//DISPLAY THE COLOR DIV.
	document.getElementById('ink_color_div').style.display = 'block';
}

/**
 * Function hides the ink color div.
 */
function hide_ink_color()
{
	//HIDE THE COLOR DIV.
	document.getElementById('ink_color_div').style.display = 'none';
}

/**
 * Function sets the ink color id's and closes the div.
 */
function set_ink_color(color_id, color)
{
	//SET THE INK COLOR SPAN AND THE INK COLOR HIDDEN.
	document.getElementById('INK_COLOR').value = color_id;
	document.getElementById('INK_COLOR_SPAN').innerHTML = color;

	//HIDE THE COLOR DIV.
	hide_ink_color();
}

/**
 * SHOW ITEM IMAGE.
 */
function showItemImage()
{
	document.getElementById('ITEM_IMAGE').style.display = 'block';
	document.getElementById('ITEM_IMAGE').style.top = 25 + '%';
	document.getElementById('ITEM_IMAGE').style.left = 40 + '%';
}

/**
 * HIDE ITEM IMAGE.
 */
function hideItemImage()
{
	document.getElementById('ITEM_IMAGE').style.display = 'none';
}

/**
 * ///////////////////////////////////////////////////////HOME PAGE IMAGES.
 */
/**
 * SHOW REQUESTED IMAGE.
 */
function showHomeImage(tag)
{
	document.getElementById('img').src = 'images/banner/img_' + tag + '.jpg';

	currentImage = parseInt(tag);
}

/**
 * SLIDESHOW.
 */
function slideShow()
{
	//INCREMENT THE CURRENT IMAGE.
	if(currentImage >= slideShowCount)
	{
		currentImage = 1;
	}
	else
	{
		currentImage++;
	}

	//DISPLAY THE NEW IMAGE.
	document.getElementById(currentImage + '_img').style.display = 'block';
}

/**
 * CALCULATE PRICE FOR EQUIPMENT BOUGHT.
 */
function calculatePrice(qty)
{
	//Variables.
	var price = 0;
	var i = 0;

	for(i = 0; i < (pricing.length); i++)
	{
		if((min[i] <= qty) && (qty <= max[i]))
		{
			price = ((qty / min[i]) * pricing[i]);
			break;
		}
	}
	
	document.getElementById('pricing').innerHTML = '$ ' + price.toFixed(2);
	document.getElementById('TOTAL').value = price.toFixed(2);
}

/**
 * 
 */
function showEditPassword(display)
{
	if(display)
	{
		document.getElementById('').style.display = 'none';
	}
	else
	{
		document.getElementById('').style.display = 'table-row';
	}
}

function confirmEventRemoveUser(link)
{
	if(confirm('Are You Sure You Want To Remove User From Event?'))
	{
		display_redirect(link);
	}
}

