function isEmpty(string) {
	var whitespace = " \t\n\r";
	var chr;
	if ((string == null) || (string.length == 0)) {
		return true;
	}
    for (i = 0; i < string.length; i++) {
		chr = string.charAt(i);
		if (whitespace.indexOf(chr) == -1) return false;
    }
    // All characters are whitespace.
    return true;
}

function tooLong(string, max) {
	if (string.length > max) {
		return true;
	}
}

function showError(ourform, where, warning) {
	ourform.elements[where].focus();
	if (document.getElementById) {
		document.getElementById(where).style.backgroundColor = '#fa0';
	}
	alert(warning);
}

function goLocation(referer) {
	var referer;
  	parent.location = 'dl.php?status=success&referer=' + referer;
}

function DownLoadForm(referer) {
	var ref = referer;
	setTimeout("goLocation('" + ref + "')", 2000);
}

function confirmSelectaPix(form) {
	var thisSelection = form.subj.options[form.subj.selectedIndex].value;
	if(thisSelection==2) {
		if(confirm("Have you checked that your question\nisn't answered in our FAQ?\nIf not, please do so before emailing us")) {
			form.submit();
			return true;	
		}
	}
	else {
		form.submit();
		return true;	
	}	
}