var price = "1"
var pricestring = "1"
var pricestringfixed = "1"

function pricetotal(a,b,c)
{
	price = (a * b * c);
	pricestring = price.toString();

	if (pricestring.length == 1)
	{
		pricestringfixed = pricestring + ".00";
	}

	if (pricestring.length == 2)
	{
		pricestringfixed = pricestring + ".00";
	}

	if (pricestring.length == 3)
	{
		if (pricestring.indexOf('.') == 1)
		{
			pricestringfixed = pricestring + "0";
		}
		if (pricestring.indexOf('.') == -1)
		{
			pricestringfixed = pricestring + ".00";
		}
	}

	if (pricestring.length == 4)
	{
		if (pricestring.indexOf('.') == 1)
		{
			pricestringfixed = pricestring;
		}
		if (pricestring.indexOf('.') == 2)
		{
			pricestringfixed = pricestring + "0";
		}
	}

	if (pricestring.length == 5)
	{
		if (pricestring.indexOf('.') == 2)
		{
			pricestringfixed = pricestring;
		}
		if (pricestring.indexOf('.') == 3)
		{
			pricestringfixed = pricestring + "0";
		}
	}

	if (pricestring.length == 6)
	{
		pricestringfixed = pricestring;
	}

	document.getElementById("totalcost").innerHTML = "<br />Total = £" + pricestringfixed;
}

function jewelpricetotal(a,b)
{
	price = a + b;
	pricestring = price.toString();

	if (pricestring.length == 1)
	{
		pricestringfixed = pricestring + ".00";
	}

	if (pricestring.length == 2)
	{
		pricestringfixed = pricestring + ".00";
	}

	if (pricestring.length == 3)
	{
		if (pricestring.indexOf('.') == 1)
		{
			pricestringfixed = pricestring + "0";
		}
		if (pricestring.indexOf('.') == -1)
		{
			pricestringfixed = pricestring + ".00";
		}
	}

	if (pricestring.length == 4)
	{
		if (pricestring.indexOf('.') == 1)
		{
			pricestringfixed = pricestring;
		}
		if (pricestring.indexOf('.') == 2)
		{
			pricestringfixed = pricestring + "0";
		}
	}

	if (pricestring.length == 5)
	{
		if (pricestring.indexOf('.') == 2)
		{
			pricestringfixed = pricestring;
		}
		if (pricestring.indexOf('.') == 3)
		{
			pricestringfixed = pricestring + "0";
		}
	}

	if (pricestring.length == 6)
	{
		pricestringfixed = pricestring;
	}

	document.getElementById("totalcost").innerHTML = "<br />Total = £" + pricestringfixed;
}

var xmlHttp

function showUser(str,option,n)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	 	alert ("Browser does not support HTTP Request")
 		return
 	}
	var url="shopphotoget.php"
	url=url+"?g="+str
	url=url+"&p="+option
	url=url+"&n="+n
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 	{ 
 		document.getElementById("photograph").innerHTML=xmlHttp.responseText 
 	} 
}

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
 	{
 		// Firefox, Opera 8.0+, Safari
 		xmlHttp=new XMLHttpRequest();
 	}
	catch (e)
 	{
 		//Internet Explorer
 		try
  		{
  			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  		}
 		catch (e)
  		{
  			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  		}
 	}
	return xmlHttp;
}

// Copyright 2006-2007 javascript-array.com
// Drop Down Menus Script

var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 

//Script End
