// Prevent people from submitting a form twice
function stopSecondSubmit(theForm) {
	if (document.getElementById) {
		for (var sch = 0; sch < theForm.length; sch++) {
			if (theForm.elements[sch].type.toLowerCase() == "submit") theForm.elements[sch].disabled = true;
		}
	}
	return true;
}

function toggleTable(el) {
	var myelement = document.getElementById(el);
	//var nameelement = document.getElementById(el + "-featurename");
	//var myimg = document.getElementById(el + "-img");

	if( !myelement.style.display || myelement.style.display == "none" ) {
		//myelement.style.display = "inline";
		
		if(navigator.userAgent.indexOf("Firefox") != -1)
			myelement.style.display = "table-cell";
		else
			myelement.style.display = "inline";
		
		//myelement.style.display = "table-cell";
		
		/*
		if(navigator.userAgent.indexOf("Firefox") != -1)
			myelement.style.display = "inline";
		else
			myelement.style.display = "table-cell";
		*/

		//myimg.src= "/_images/matrix/minus.gif";
		//nameelement.style.fontWeight = "bold";
	} else {
		myelement.style.display = "none";
		//myimg.src= "/_images/matrix/plus.gif";
		//nameelement.style.fontWeight = "normal";
	}
}

function checkForm(){
	if ((dmn.sDomainValue.value=='') || (dmn.sDomainValue.value=='Enter domain name')){
		alert('Please enter a domain name');
		dmn.sDomainValue.select();
		dmn.sDomainValue.focus();
		return false
	}
	return true;
}	
	
function checkDomains(){
	if (! conclude.chkTerms.checked){
		alert('Please read and then accept the terms and conditions');
		return false;
	}else{
		return true;
	}
}
		
function showHide(id){
	var styleAdd;
	styleAdd = 'block';
	if ((document.getElementById('tr'+id).style.display=='block')|| (document.getElementById('tr'+id).style.display=='')){
		styleAdd='none';
	}
	 
	document.getElementById('tr'+id).style.display = styleAdd;
}


function formatValue(amount){
	var i = parseFloat(amount);
	if(isNaN(i)) { i = 0.00; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	i = Math.abs(i);
	i = parseInt((i + .005) * 100);
	i = i / 100;
	s = new String(i);
	if(s.indexOf('.') < 0) { s += '.00'; }
	if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
	s = minus + s;
	return s;
}
