/******* Copyright U of C Federal Credit Union SCRIPTS ***********/
/**      INCLUDED IN THIS FILE                                  **/
/**      Preload Rollover Images - line 7                       **/
/**      Macromedia Swap Image & Restore Script - line 23       **/
/**      Macromedia Display Text in Status Bar Script - line 43 **/
/**      Macromedia Open New Browser Window  - line 52          **/
/**      Macromedia Preload Images  - line 63                   **/
/**      Macromedia Reload Window if Nav4 Resized  - line 73    **/
/**      Macromedia Show / Hide Layers - line 84                **/
/**      Open New Browser Window / Center - line 99             **/
/**      Secure Email Set Contact - line 117                    **/
/**      Tooltip for 3rd parties - line 148                     **/
/**      Phishing websites redirect - line 242                  **/
/**      Clear Default Text                                     **/

/************************************************************/
/***      PRELOAD Rollover Images Script                  ***/
/***      ONLY for use with template rollover images      ***/
/***      NOT for use with page images                    ***/

var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}

//preloadimages("/images/header/btn_acct_access_f2.gif","/images/header/btn_loans_f2.gif","/images/header/btn_mortgages_f2.gif")


/************************************************************/
/***        Macromedia Swap Image & Restore Script        ***/
/************************************************************/
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

/************************************************************/
/***    Macromedia Display Text in Status Bar Script      ***/
/************************************************************/
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

/************************************************************/
/***          Macromedia Open New Browser Window          ***/
/***          Added windowName.focus                      ***/
/************************************************************/
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
  windowName = window.open(theURL,winName,features);
  windowName.focus();
}

/************************************************************/
/***          Macromedia Preload Images                   ***/
/************************************************************/
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

/************************************************************/
/***          Macromedia Reload Window if Nav4 Resized    ***/
/************************************************************/
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

/************************************************************/
/***          Macromedia Show / Hide Layers               ***/
/************************************************************/
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

/************************************************************/
/***             Open New Browser Window            	  ***/
/***              and Center in screen           	      ***/
/************************************************************
 * Opens Loan24 Application window
 */
function openLoan24Window()
{
	openWindow('https://www.elevationscu.com/secure/loan24/login.php','Loan24',785,500,'status=yes,scrollbars=yes,resizable=yes')
}

function openWindow(theUrl,winName,w,h,features) {
  if(screen.width){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  }else{winl = 0;wint =0;}
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(theUrl,winName,settings);
  win.window.focus();
}

function disclosureWin(page) {
	  openWindow('/disclosures/popup/disclosures.cfm?disclosureDoc=/disclosures/' + page,'externalsite',760,470,'scrollbars=yes')
}

/************************************************************/
/***             Secure Emails                         	  ***/
/************************************************************/
function setContact( c_id, c_name ) {
	document.contact_list.contactId.value = c_id;
	document.contact_list.contactName.value = c_name;
	document.contact_list.submit();
}
function setCareer( c_id, c_name ) {
	document.career_list.contactId.value = c_id;
	document.career_list.careerName.value = c_name;
	document.career_list.submit(); 
}
function setEvent( s_id, s_name ) {
	document.seminarList.seminarId.value = s_id;
	document.seminarList.seminarName.value = s_name;
	document.seminarList.submit();
}


/************************************************************/
/***             Tooltip for 3rd party links              ***/
/************************************************************/

// Tooltip JavaScript
var tipWidth = "200px"; //default tooltip width
var disappearDelay = 100; //tooltip disappear speed onMouseout (in miliseconds)
var verticalOffset = "4px"; //horizontal offset of tooltip from anchor link
var horizontalOffset = "20px"; //horizontal offset of tooltip from anchor link
// No further editting needed
var ie4 = document.all;
var ns6 = document.getElementById&&!document.all;

if (ie4 || ns6) {document.write('<div id="toolTip"></div>')}

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden, tipWidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipWidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipWidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontalOffset)*-1 : parseInt(verticalOffset)*-1
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function showToolTip(menucontents, obj, e){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidetip()
dropmenuobj=document.getElementById? document.getElementById("toolTip") : toolTip
dropmenuobj.innerHTML=menucontents

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", tipWidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
}

function hidetip(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayHideTip(){
if (ie4||ns6)
delayhide=setTimeout("hidetip()",disappearDelay)
}

function clearhidetip(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}
// end Tooltip Javascript


/************************************************************/
/***             Phish Website Redirects               	  ***/
/************************************************************/

// To include another phishing site, just add url/ip to this list
var phish_sites = Array ('219.153.14',
						 '80.35.51.216',
						 '219.153.14',
						 'ansl.com',
						 'renew-account',
						 'update-profile4174',
						 'uofcfcu.i-print.pl');
var i;
for (i=0; i <= phish_sites.length; i++)
{
	if (document.URL.indexOf(phish_sites[i]) >= 0) 
	{
		document.location.href = 'http://www.antiphishing.org';
	}
}
// Phish site reported 120205 - Inktomi
if (document.URL.indexOf('secure.bankuofcfcu.com') >= 0)
{
	document.location.href = 'https://www.uofcfcu.com/security/phishing_attempt/';		
}
// Phish site reported 120705 - Inktomi
if (document.URL.indexOf('www.uofcfou.com') >= 0)
{
	document.location.href = 'http://www.antiphishing.org';
}

// Clear Default Text

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 

// Print Page Window as Pop Up and Print Part of Page
function printPartOfPage(elementId)
{
 var printContent = document.getElementById(elementId);
 var printWindow = window.open('', '', 'left=100,top=100,width=800,height=500,menubar=yes,toolbar=yes,titlebar=yes,status=yes,scrollbars=yes,resizable=yes');

 printWindow.document.write(printContent.innerHTML);
 printWindow.document.close();
 printWindow.focus();
 printWindow.print();

}

