// CoactiveFullContact.js
// Belongs in /scripts
// Copyright 2001-2004 Coactive Systems Corporation

var as1 = 'physreferral.bayhealth.org';
var as2 = 'physreferral.bayhealth.org';
var secure = 'https://';
var unsecure = 'http://';
var currentServer = as2;

function CoactiveFullContactAgent() {
alert('InetPub');
 w=window.open(secure+currentServer+'/HcAgentConsole','HcAgentConsole','width=640,height=480,resizable,scrollbars,status');
 w.focus();
}
function CoactiveFullContactGenericAgent() {
 w=window.open(secure+currentServer+'/AgentInteractionConsole','AgentInteractionConsole','width=640,height=480,resizable,scrollbars,status');
 w.focus();
}
function CoactiveFullContactHcAdmin() {
 w=window.open(secure+currentServer+'/HcAdmin','HcAdmin','resizable,status,scrollbars,height=480,width=640');
 w.focus();
}
function CoactiveFullContact(c) {
 w=window.open(secure+currentServer+'/CcpApp1Servlet?ccContext='+c,'Ccp','width=540,height=540,resizable,scrollbars');
 w.focus();
}
function CoactiveFullContact2(c) {
 w=window.open(secure+currentServer+'/CcpApp2Servlet?ccContext='+c,'Ccp','width=540,height=660,resizable,scrollbars');
 w.focus();
}
function CoactiveFullContactConnect() {
 w=window.open(secure+currentServer+'/CcpConnectServlet','CcpConnect','width=540,height=540,resizable,scrollbars');
 w.focus();
}
function CoactiveFullContactSurvey(c,s) {
 w=window.open(secure+currentServer+'/CcrServlet?ccContext='+c+'&survey='+s,'Ccr','width=540,height=540,resizable,scrollbars');
 w.focus();
}
function CoactiveProviderReferral(c,s) {
 frame(secure+currentServer+'/HcuReferralServlet?ccContext='+c,s);
}
function CoactiveProviderReferral2(c) {
 w=window.open(secure+currentServer+'/HcuReferralServlet?ccContext='+c,'CcReferral','width=500,height=500,resizable,scrollbars,menubar');
 w.focus();
}
function CoactiveProviderReferral3(c) {
 w=window.open(secure+currentServer+'/HcuReferralServlet?ccContext='+c,'CcReferral','width=500,height=500,resizable,scrollbars');
 w.focus();
}
function CoactiveRegistrationEnrollment(c,s) {
 frame(secure+currentServer+'/HcuProgramServlet?ccContext='+c,s);
}
function CoactiveRegistrationEnrollment2(c) {
 w=window.open(secure+currentServer+'/HcuProgramServlet?ccContext='+c,'CcRegistration','width=500,height=500,resizable,scrollbars,menubar');
 w.focus();
}
function CoactiveRegistrationEnrollment3(c) {
 w=window.open(secure+currentServer+'/HcuProgramServlet?ccContext='+c,'CcRegistration','width=500,height=500,resizable,scrollbars');
 w.focus();
}
function CoactiveJewishSurvey(c) {
 w=window.open(secure+currentServer+'/NLSTServlet?ccContext='+c,'JewishHospital','width=540,height=540,resizable,scrollbars');
 w.focus();
}
function frame(u,s)
{
	var isWin = (navigator.userAgent.indexOf("Windows") >= 0);
	var isMac = (navigator.userAgent.indexOf("Macintosh") >= 0);
	var ieBrowserCode = "MSIE";
	var isIE = false;
	var version = 0;
		
	// Check for IE
	var i = navigator.userAgent.indexOf(ieBrowserCode);
	if (i > 0)
	{
		isIE = true;
		start = i + ieBrowserCode.length + 1;
		end = navigator.userAgent.indexOf(".", start);
		version = parseInt(navigator.userAgent.substring(start,end));
	}

	var hasIframe = ( isIE && ( (isWin && version>=4 && version<6) || (isMac && version>=5) ) );
 if (hasIframe) {
  if (typeof s!='string'||s=='') var s='width:500;height:700;z-index:-1';
  document.write('<iframe src="'+u+'" style="'+s+'" frameborder="0">');
  document.write('<p>Your browser is an older version that cannot completely display this page.<p>');
  document.write('</iframe>');
 } else {
  document.write('<p>This application has opened in a new window because it displays best with Internet Explorer version 4.x and 5.x and you have another browser. Please use the new window.<p>');
  w=window.open(u,'nif','width=500,height=500,resizable,scrollbars,menubar');
 w.focus();
 }
}
