function showDate() {
	var today = new Date();
	var month = today.getMonth();
	var day = today.getDate();
	var week = today.getDay();
	var year = today.getFullYear();
	var weekday = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
	var month_names = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
	
	document.write (weekday[week] + ", " + month_names[month] + " " + day + ", " + year);
}


//show chosen tab at various screens
var currenttab = '';
function showTab(num, count){
	for(i=1; i<count+1; i++){
		document.getElementById("tab"+i).style.display = "none";
		document.getElementById("navTab"+i).className = "";
	}
	document.getElementById("tab"+num).style.display = "";
	document.getElementById("navTab"+num).className = "selected";
	currenttab = num;
	scroll(0,0);
}


//obscure email addresses on a page
//use inline as in <script>displayMail('mydomain.com','myname','email me');</script>
 function displayMail(Server, Login, Display){  
     if ((Display.length == 0) || (Display.indexOf('@')+1)) {  
     	document.write('<a href=' + '"mai' + 'lto:' + Login + '@' + Server + '">' + Login + '@' + Server + '<\/a>'); 
     }  
     else  {  
     	document.write('<a href=' + '"mai' + 'lto:' + Login + '@' + Server + '">' + Display + '<\/a>'); 
     }  
}


//modal popup window
var popWin = '';
function popWindow(file, height, width){
	/*
	if(window.showModalDialog){
		popWin = window.showModalDialog(file, '', 'dialogHeight:'+height+'px; dialogWidth:'+width+'px; resizable:yes; scroll:yes');
	}
	else{
		if(popWin.closed != undefined){if(!popWin.closed){popWin.close();};}
		popWin = window.open(file, 'help', 'height=' + height + ', width=' + width + ', resizable, scrollbars=yes, modal=yes, dialog=yes, menubar=yes');
		popWin.moveTo(20,20);
		popWin.focus();
	}
	*/	
	if(popWin.closed != undefined){if(!popWin.closed){popWin.close();};}
	popWin = window.open(file, 'help', 'height=' + height + ', width=' + width + ', resizable, scrollbars=yes, modal=yes, dialog=yes, menubar=yes');
	popWin.moveTo(20,20);
	popWin.focus();
}


function checkContentEdit(form) {
	missinginfo = "";
	var rePat = /.(php)$/;

	if (form.cnt_pages.value == "") { missinginfo += "\n - Page URL" } else { if(!rePat.test(form.cnt_pages.value)) { missinginfo += "\n - Incorrect file type (*.php)" } }

	if (missinginfo != "") { 
		missinginfo = "_____________________________\n" + "Please check form below :\n" + missinginfo + "\n_____________________________";
		alert(missinginfo);
		return false;
	} else { 
		return true;
	};
}
