
function ajLoad(url,id, noclose) {
//close
if (document.getElementById(id).innerHTML != '' && !noclose)
	url = '/more_info/blank.php';
if (document.getElementById) {
    var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
  }
  if (x) {
    x.onreadystatechange = function() {
      if (x.readyState == 4 && x.status == 200) {
        el = document.getElementById(id);
        el.innerHTML = x.responseText;
      }
    }
    x.open("GET", url, true);
    x.send(null);
  }
}

//custom design quote tool JS
function colorPicker()
	{
	//hide colour textfield from js enabled
	document.getElementById('color_text').style.display = 'block';
	document.getElementById('color_picker1').style.display = 'block';
	document.getElementById('color_picker2').style.display = 'block';
	}
function selectColor(id)
	{
	document.getElementById('display_color').style.backgroundColor = id;
	document.getElementById('chosen_color').value = id;
	}
function selectColor2(id)
	{
	document.getElementById('display_color2').style.backgroundColor = id;
	document.getElementById('chosen_color2').value = id;
	}
function showEcommerce(opt)
	{
	var ec = document.getElementById('ecommerce_options');
	if (opt == 'yes')
		ec.style.visibility = 'visible';
	else
		ec.style.visibility = 'hidden';
	}
function clearit(id, def)
	{
	if(document.getElementById(id).value == def)
		document.getElementById(id).value = '';
	}
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;
		}
	}
}
