function disablesubmit () {			
	$('placeorder_warning').style.display = "inline";
	$('placeorderbutton').style.display = "none";
}
function warnDelete () {
	var links = document.getElementsByClassName("delete");
	for(var i = 0; i < links.length; i++) {
		links[i].onclick = function() {
			var con = confirm("Are you sure you want to delete this?");
			if (con == true) {
				return true;
			}
			else {
				return false;
			}
		}
	}
}
function popUp () {
	var popuplinks = document.getElementsByClassName("popup");
	for (var i = 0; i < popuplinks.length; i++) {
		popuplinks[i].onclick = function() {
			
			var pop = window.open(this.href, "pop", "width=600, height=450, toolbar=0, statusbar=0, scrollbars=1, resizable=1");
			pop.focus();
			return false;
						
		}	
	}	
	var outlinks = document.getElementsByClassName("outlink");
	for (var i = 0; i < outlinks.length; i++) {
		outlinks[i].onclick = function () {
			var out = window.open(this.href, "out");
			out.focus();
			return false;
		}
	}
}

function checkterms () {
	if($('inv_name') && $('inv_phone') && $('inv_email')) {
		if($('inv_name').value == "" || $('inv_phone').value == "" || $('inv_email').value == "") {
			alert('You need to fill in your name, phone number and email');
			return false;
		}
	}
	
	if($('terms').checked == false) {
			alert('Please confirm you have read and understood the terms and conditions');
			return false;
	}
	return true;
}

window.onload = function () {
	warnDelete();
	popUp();
}