//"Accept terms" form submission- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

var checkobj

function agreesubmit(el){
checkobj=el
if (document.all||document.getElementById){
for (i=0;i<checkobj.form.length;i++){  //hunt down submit button
var tempobj=checkobj.form.elements[i]
if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=!checkobj.checked
}
}
}

function defaultagree(el){
if (!document.all&&!document.getElementById){
if (window.checkobj&&checkobj.checked)
return true
else{
alert("Please read/accept terms to submit form")
return false
}
}
}

function newWin(url, name, w, h) {
  l = (screen.availWidth-10 - w) / 2;
  t = (screen.availHeight-10 - h) / 2;

  features = "width="+w+",height="+h+",left="+l+",top="+t;
  features += ",screenX="+l+",screenY="+t;
  features += ",scrollbars=1,resizable=0,location=0";
  features += ",menubar=0,toolbar=0,status=0";

  window.open(url, name, features);
}

function decision(message, url){
if(confirm(message)) location.href = url;
}

function insertimage(text) {
	text = ''+text+'';
	opener.document.forms['articleform'].photo.value  += text;
	opener.document.forms['articleform'].photo.focus();
    window.close(); 
}

function popupEvent(day, month, year, w, h) {
	var winl = (screen.height - w) / 2;
	var wint = (screen.height - h) / 2;
	win = window.open("/services/events/popup.php?day=" + day + "&month=" + month + "&year=" + year + "","Calendar","scrollbars=yes, status=yes, location=no, toolbar=no, menubar=no, directories=no, resizable=yes, width=500, height=" + h + ", top=" + wint + ", left=" + winl + "");
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}