/*
 *	Module general site / helper functions
 *
 *-------------------------------------------------------------
 * d1	08-Dec-2005		Matt Stevenson		Created
 * d2	21-Dec-2005		Matt Stevenson		Added openPicture function
 * d3	29-Dec-2005		Matt Stevenson		Copied in checkbox method from
 *											old helpers file
 * d4	16-Jan-2006		Matt Stevenson		Fixed problem with openpicture
 *-------------------------------------------------------------
 */



function clear_value(item)
{
	item.value = '';
	item.style.color = '#000000';
}

function openPicture (sport)
{
	if (sport)
	{
		var filename = "images/engraving/"+sport+".gif";
        window.open(filename,'detail', 'width=470,height=450,scrollbars=No,resizable=NO');
	}
	else
	{
		//request to open the inscription email
		var filename = "images/bits/inscriptionrequest.jpg"; 
        window.open(filename,'detail', 'width=550,height=410,scrollbars=No,resizable=NO');
	}
}


function toggleCheckboxes (checkbox, sSuffix)
{
	//hide all the divs...
	var spans = document.getElementsByTagName("span");

	if (spans)
	{
		for (var i=0; i<spans.length; i++)
		{
			if ((spans[i].id.indexOf("lidspan") >= 0) || 
				(spans[i].id.indexOf("pbspan") >= 0))
			{
				spans[i].style.display = "none";
			}
		}
	}

	//uncheck all the check boxes...
	for (var i=0; i<document.forms[0].elements.length; i++)
	{
		if ((document.forms[0].elements[i].name.indexOf("lidprice") >= 0) ||
			(document.forms[0].elements[i].name.indexOf("bandprice") >= 0))
		{
			document.forms[0].elements[i].checked = false;
		}
	}

	//update the global variables (in product.html!)
	lidextra = "";
	bandextra = "";

	//show the relevant ones...
	document.getElementById("lidspan"+sSuffix).style.display = 'block';
	document.getElementById("pbspan"+sSuffix).style.display = 'block';
}


function mailForm(){
        parent.location="mailto:sales@goldenawards.co.uk?subject=INSCRIPTION DETAILS : <Enter Name Here>";
}