/*	This writes out a link to authorization and claims status, which appears on the Home page
		and on most Provider pages.
	IF the claims site is ACTIVE, set claimsActive = 1
	IF the claims site is NOT ACTIVE, set claimsActive = 0

	When set to 1, the link goes to the claims status page 
	When set to 0, the link launches a popup to inform user that claims checking is temporarily down.
	
	A user with scripting turned off will not see the link.
*/

var claimsActive = 1; // SET THIS TO 1 IF ACTIVE, 0 IF NOT
var linkCode = 'https://www.orthonet-online.com/gsi'; // URL to the claims status login page
function goClaimsCheck() {
	// blanked out first; separated and spaced for easier viewing/editing
	if(claimsActive) {
		cWindow = window.open(linkCode,'cwin');
		}
	else {
		popWin('/claims_na.html', 360, 180);
		}
	// write it out
	
	}

// Returns a friendly-formatted date
function insertDate() {
	var dStr = "";
	var d = new Date();
	var wd = d.toLocaleString();
	wd = wd.substring(0, wd.indexOf(','))                                                                          ;
	dStr = wd+", ";
	dStr += 1+d.getMonth();
	dStr += "/"+d.getDate();
	dStr += "/"+d.getFullYear();
	return dStr;
	}

// Returns a friendly-formatted time
function insertTime() {
	var t = new Date();
	var tStr = "";
	var t12;
	var tMark = "AM";
	var t00 = "0";
	t12 = t.getHours();
	if (t12 > 11) {
		if (t12 > 12)t12 -= 12;
		tMark = "PM";
		}
	else if (t12 == 0) t12 = 12;
	tStr = t12+":";
	if (t.getMinutes() < 10) tStr += t00;
	tStr += t.getMinutes();
	tStr += " "+tMark;
	return tStr;
	}

function popWin(URL, w, h) {
	var winX = (screen.width / 2) - (w/2);
	var winY = (screen.height / 2) - (h/2);
	aWindow = window.open(URL,'popwin','toolbar=no,status=no,menubar=no,width='+w+',height='+h+',left='+winX+',top='+winY+'');
	}


