//function to change background colour
function menuMain(place, col){
	document.getElementById(place).style.background = col;
}

//Show / hide details
function togglemenu(elmnt)
{
if (document.getElementById(elmnt).style.visibility == "visible") 
{document.getElementById(elmnt).style.visibility="hidden", document.getElementById(elmnt+"p").setAttribute("src","../images/info.gif");}
else
{document.getElementById(elmnt).style.visibility="visible", document.getElementById(elmnt+"p").setAttribute("src","../images/hide.gif");}
}

// hide picture for small resolution
function hidePic(elmnt)
{
if (screen.width <1000) document.getElementById(elmnt).style.display="none"
}

function list()
{
var amount = 0
var details = ""
for (var i=0;i<document.book.Cost.length;i++)
{
if (document.book.Cost[i].checked==true) detail = amount = document.book.Cost[i].value, details = document.book.Cost[i].id
}
document.book.amount.value = money(amount);
document.book.details.value = details;
}

//function to display figures to 2 decimal places
function money(str)
{
str = str.toString();
var size = str.length
var place = str.indexOf(".")
var diff = size-place
{
if (size>0 && place==-1) 
{str = (str+".00");}
else if (diff==2) 
{str = (str+"0");}
else if (size>0) 
{str = str;}
else 
{str}
}
return str
}

//Show / hide details
function togglesp(elmnt)
{
if (document.getElementById(elmnt).style.display == "none") 
{document.getElementById(elmnt).style.display="block";}
else
{document.getElementById(elmnt).style.display="none";}
}

//Show photo
function showphoto(elmnt)
{
document.getElementById(elmnt).style.visibility = "visible"
}

//Hide photo
function hidephoto(elmnt)
{
document.getElementById(elmnt).style.visibility = "hidden"
}
