function switchTab(element) {
	document.getElementById('question').style.display = 'none';
	document.getElementById('reviews').style.display = 'none';
	document.getElementById('friend').style.display = 'none';
	document.getElementById('delivery').style.display = 'none';
	document.getElementById('interested').style.display = 'none';
	document.getElementById(element).style.display = 'inline';
	return false;
}

function ToggleNav(LayerID)  {

if (navigator.family == 'ie4' && navigator.version < 5){
	var obj = document.all[LayerID];              // IE 4 and below
	
	} else {
	var obj = document.getElementById(LayerID);   // IE 5
}	
	if (!obj) {
		alert(LayerID + " not found");
	} else {
	//alert(LayerID);
		if (obj.style.display == 'none') { 
			obj.style.display = 'block'; 
		} else {
			obj.style.display = 'none';
		}		
	}
}
// accordion

<!-- Hide javascript from older browsers --
function PopUp(theURL,winName,features)
	{window.open(theURL,winName,features);}

function checkAddressForm() {
	document.all.password1.style.display = 'none';
	document.all.password2.style.display = 'none';
	document.all.address1.style.display = 'none';
	document.all.address2.style.display = 'none';
	document.all.address3.style.display = 'none';
	document.all.address4.style.display = 'none';
	document.all.address5.style.display = 'none';
	document.all.phone.style.display = 'none';
	isOK = true;
	if (document.addresses.CD_Password1.value != document.addresses.CD_Password2.value ) {
		alert('Passwords do not match, please change and try again!');
		document.all.password1.style.display = 'inline';
		document.all.password2.style.display = 'inline';
		isOK = false;
	}
	if (document.addresses.CD_Password1.value == '' || document.addresses.CD_Password2.value == '') {
		alert('One or more Passwords are blank');
		document.all.password1.style.display = 'inline';
		document.all.password2.style.display = 'inline';
		isOK = false;
	}
	if ( isOK ) { 
		if (document.addresses.CD_CardholderStreetAddress.value == '' ) {
			document.all.address1.style.display = 'inline';
			if (isOK) { isOK = false }
		}
		if (document.addresses.CD_CardholderTownCity.value == '' ) {
			document.all.address2.style.display = 'inline';
			if (isOK) { isOK = false }
		}
		if (document.addresses.CD_CardholderCounty.value == '' ) {
			document.all.address3.style.display = 'inline';
			if (isOK) { isOK = false }
		}
		if (document.addresses.CD_CardholderPostCode.value == '' ) {
			document.all.address4.style.display = 'inline';
			if (isOK) { isOK = false }
		}
		if (document.addresses.CD_CardholderCountry.value == '' ) {
			document.all.address5.style.display = 'inline';
			if (isOK) { isOK = false }
		}
		if (document.addresses.CD_Telephone.value == '' ) {
			document.all.phone.style.display = 'inline';
			if (isOK) { isOK = false }
		}
		if (isOK) {
			return true;
		} else {
			alert('There are errors, please fix these and try again!');
			return false;		
		}
	}
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}
		
function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}

function setPrice(strCurrency,originalPrice,exchangeRate) {
	document.write(strCurrency + roundNumber(parseFloat(originalPrice)*parseFloat(exchangeRate),2))
}

function roundNumber(rnum, rlength) {
  var newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);
  return newnumber;
}
// end hide -->