/*
	ServiceSuite Live Chat Module v5.0	Copyright(C) 2007 Grail Networks Inc
	All Rights Reserved
	Unauthorized Duplication Prohibited
*/

var ss5_img = new Image();
ss5_img.onload=ss5_checkImage;
var ss5_ver='5.0';
var ss5_server='http://on.grailnetworks.com';
var ss5_reportcount=1; var ssgid = 'f243f020cbb2f46b07be217946375a3ab06a4587';
var xenreport_server='http://on.grailnetworks.com';
var ss5_chatStatus = 0;

function Neptide_callUser(userid)
{
	ss5_chatStatus++;
	if (userid!="tm") 
		window.open("http://on.grailnetworks.com/instanton/servicesuite/livehelp/chatframe.on?requestedid="+userid+"&cookies="+navigator.cookieEnabled,"ServiceSuite_"+userid,"width=544,height=290,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes");
	else {
		window.open("http://on.grailnetworks.com/instanton/servicesuite/livehelp/operator_textmessage.on?clientid=20759&gid=f243f020cbb2f46b07be217946375a3ab06a4587&action=c&cookies="+navigator.cookieEnabled,"ServiceSuite_"+userid,"width=544,height=290,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes");
		}
}

function Neptide_callOperator()
{
	ss5_chatStatus++;
	window.open("http://on.grailnetworks.com/instanton/servicesuite/livehelp/chatframe.on?clientid=20759&deptid=1&cookies="+navigator.cookieEnabled,"ServiceSuite_20759","width=544,height=290,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes");
}

var neptide_title=document.title;
var neptide_url=document.URL;
var neptide_refer=document.referrer;

function ss5_setPage(newurl, newtitle)
{
	neptide_url=newurl;
	neptide_title=newtitle;
}

var xenurl="";

function ss5_report()
{
	ss5_img = new Image();
	ss5_img.onload = ss5_checkImage;
	var ss5_d = new Date();
	if (ss5_reportcount==1) {
		xenurl = xenreport_server+'/instanton/servicesuite/livehelp/sitescripts/vrecorder.on?rc='+ss5_reportcount+'&ver='+escape(ss5_ver)+'&stamp='+ss5_d.getTime()+'&cid=20759&url='+escape(neptide_url)+'&title='+escape(neptide_title)+'&refer='+escape(neptide_refer)+'&deptid=1&localtime='+escape(ss5_d.toLocaleString())+'&cookies='+navigator.cookieEnabled+'&tz='+ss5_d.getTimezoneOffset()+'&gid=f243f020cbb2f46b07be217946375a3ab06a4587';
	} else {
		xenurl = xenreport_server+'/instanton/servicesuite/livehelp/sitescripts/vrecorder.on?cid=20759&rc='+ss5_reportcount+'&gid=f243f020cbb2f46b07be217946375a3ab06a4587';
	}
	if (navigator.userAgent.indexOf('MSIE')>-1) xenurl+="&isie=1";
	ss5_img.src= xenurl;
	if (ss5_reportcount<432) {
	setTimeout("ss5_report()",25000);
	ss5_reportcount++;
	}
}

function ss5_checkImage() {
}

ss5_report();
//browser metrics

var ss_IEreported=false;
var flashVersion=0,ssmetric_string="";

function getMetrics() {
ssmetric_string="";
sstzone = (new Date()).toString();
ssmiddletz="";
var ssre=null;
if (navigator.userAgent.indexOf('MSIE')>-1 && Number(ScriptEngineMajorVersion()+ "."+ScriptEngineMinorVersion())>=5.5) 
	ssre = /[A-Z]{3,}/;
else if (navigator.userAgent.indexOf('Mozilla')>-1) 
	ssre = /\(.*?\)/;
else if (navigator.userAgent.indexOf('Opera')>-1)
	ssre = /[A-Z]{3,}-\d*/;
if (ssre!=null) {
	var ssm = ssre.exec(sstzone);
	if (ssm!=null)
		ssmiddletz=ssm;
}
ssmetric_string+="Browser: "+navigator.userAgent+"\n";
ssmetric_string+="Timezone: "+ssmiddletz+" "+((new Date()).getTimezoneOffset()/-60)+"\n";
ssmetric_string+="Browser Name: "+navigator.appName+"\n";
ssmetric_string+="Browser Code Name: "+navigator.appCodeName+"\n";
ssmetric_string+="Browser Version: "+navigator.appVersion+"\n";
if (window.screen) 
{
	ssmetric_string+="Screen Colors: "+window.screen.colorDepth+"bit\n";
	ssmetric_string+="Screen Resolution: "+window.screen.width+"x"+window.screen.height+"\n";
	ssmetric_string+="Available Resolution: "+window.screen.availWidth+"x"+window.screen.availHeight+"\n";
}
ssmetric_string+="Platform: "+navigator.platform+"\n";
if (navigator.javaEnabled() < 1) ssmetric_string+="Java: No\n";
if (navigator.javaEnabled() == 1) ssmetric_string+="Java: Yes\n";
if (navigator.cookieEnabled) ssmetric_string+="Cookies: Yes\n"; else ssmetric_string+="Cookies: No\n";

}

function getFlashVersion() {
	var dontKnow = false;
	var flashVersion = 0;
	agent = navigator.userAgent.toLowerCase();
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object') { 
			if (flashPlugin.description.indexOf('6.') != -1) flashVersion = 6;
			else if (flashPlugin.description.indexOf('5.') != -1) flashVersion = 5;
			else if (flashPlugin.description.indexOf('4.') != -1) flashVersion = 4;
			else if (flashPlugin.description.indexOf('3.') != -1) flashVersion = 3;
		}
	}

	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
		document.write('<scr' + 'ipt language="VBScript"\> \n');
		document.write('on error resume next \n');
		document.write('if IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")) then flashVersion = 6 \n');
		document.write('if flashVersion < 6 and IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")) then flashVersion = 5 \n');
		document.write('if flashVersion < 5 and IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")) then flashVersion = 4 \n');
		document.write('if flashVersion < 4 and IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")) then flashVersion = 3 \n');
		document.write('neptide_IEreport_fv(flashVersion)');
		document.write('</scr' + 'ipt\> \n'); 
	}
		
	else if (agent.indexOf("webtv/2.5") != -1) flashVersion = 3;

	else if (agent.indexOf("webtv") != -1) flashVersion = 2;

	else {
		flashVersion = flashVersion_DONTKNOW;
		dontKnow = true;
	}

	return flashVersion;
}

flashVersion_DONTKNOW = -1;
function ss_detect() 
{
	neptided = new Date();
	getMetrics();
	flashVersion = getFlashVersion();
	if (flashVersion != flashVersion_DONTKNOW) ssmetric_string+="Flash Version: "+flashVersion+"\n";
	ss_report_metrics();
}

function ss_IEreport_fv(fv)
{
	flashVersion=fv;
	if (flashVersion != flashVersion_DONTKNOW) {
		ssmetric_string+="Flash Version: "+flashVersion+"\n";
		ss_report_metrics();
		ss_IEreported=true;
	}
}

function ss_report_metrics() 
{
	if (ss_IEreported) return;
	reportimg = new Image();
	reportimg.src="http://on.grailnetworks.com/instanton/servicesuite/livehelp/sitescripts/vrecorder.on?cid=20759&gid="+ssgid+"&metrics="+escape(ssmetric_string);
}

ss_detect(); //no start load time generated

var ss5_cA=0;

function ss_oCA(x) {
	var e,w,h,s;
	switch(x) {case 1:e=false;w=544;h=290;s=1;break;default:x=1;e=false;w=544;h=290;s=1;break;}
	if (x>0) ss_oC(s,x,false,e,w,h); else ss_oC(s,false,-x,e,w,h);
}
function ss_oC(secure,did,uid,ss5e,w,h) {
ss5_cA++;
var ss5_d = new Date(),ss5_bU,sswhi;
ss5_bU=((secure!=null && secure>0)?"https://on.grailnetworks.com/instanton/servicesuite/livehelp/":"http://on.grailnetworks.com/instanton/servicesuite/livehelp/");
if (did>0) sswhi="&deptid="+did; else sswhi="&userid="+uid;
	if (!ss5e) {
		window.open(ss5_bU+"chatframe.on?clientid=20759"+sswhi+"&currentpage="+escape(document.URL)+"&ua="+escape(navigator.userAgent)+"","ServiceSuite_20759","width="+w+",height="+h+",scrollbars=auto,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes");
	} else {
		document.location.href=ss5_bU+"embeddedchat.on?clientid=20759"+sswhi+"&pos="+w+"&l="+h+"";
	}
}
function Neptide_openChat(secure,deptid)
{
	ss_oC(secure,deptid,false,false,544,290);
}
function ss5vis(ss5tg,ss5n) {
	var ss5t=document.getElementById(ss5tg);
	if (ss5t!=null) ss5t.style.visibility=(ss5n)?"visible":"hidden"; 
}
function ss5_aI(ss5_cs,ss5d,ss5ig) {
	var ss5i=document.getElementById('ssChatIconImg'+ss5d);
	switch(ss5_cs) {
		case 0: ss5vis('ssChatIconUnAvail'+ss5d,true);if (ss5i) {if (ss5ig[0].indexOf('http')==-1) ss5ig[0]="http://on.grailnetworks.com"+ss5ig[0];ss5i.src=ss5ig[0];}break;
		case 1: ss5vis('ssChatIconAvail'+ss5d,true);if (ss5i) {if (ss5ig[1].indexOf('http')==-1) ss5ig[1]="http://on.grailnetworks.com"+ss5ig[1];ss5i.src=ss5ig[1];}break;
	}
}
ss5_aI(0,'',new Array('http://web.uncg.edu/hrs/benefits/live_benefits_away.gif','http://web.uncg.edu/hrs/benefits/live_benefits_here.gif'));//copyright(c) 2010 Grail Networks, Inc.