﻿// JScript File

if (document.images) {

  image1on = new Image();
  image1on.src = "/images/buttonOn.gif";

  image1off = new Image();
  image1off.src = "/images/buttonOff.gif";
    
}

function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    }
  }
}

function chgBg(aID,imgName) {
    var objB = document.getElementById(aID);
    objB.style.background = "url('/images/" + imgName + "') no-repeat"; 
}

function preloadImages() { 
   if (document.images) { 
       for (var i = 0; i < preloadImages.arguments.length; i++) { 
         (new Image()).src = preloadImages.arguments[i]; 
       } 
   } 
 }

function setHover(id,tagname) {  //fix the :hover pseudoclass in IE6-
    el = document.getElementById(id);
    if(el) {
      tn = el.getElementsByTagName(tagname);
      for(i=0;i<tn.length;i++){
	tn[i].onmouseover= function(){
	  this.className ? this.className += ' sfhover' : this.className = 'sfhover';
	}
	tn[i].onmouseout = function(){
	  this.className = this.className.match(/ over/) ? this.className.replace(/ over/,'') : this.className.replace(/^over/,'');
	}
      }	
    }
  }
  
function openWin(aLink) {
	var positionX = (screen.width - 380) / 2;
	var positionY = (screen.height -380) / 2;	
	
    winP = window.open(aLink,'myWin','top=' + positionY + ', left=' + positionX + ', width=470, height=320,scrollbars=1,resizable=0');
    winP.focus();
}

function openFPE() {
	var positionX = (screen.width - 400) / 2;
	var positionY = (screen.height -400) / 2;	
	
    winP = window.open('/forgotPasswordExpert.aspx','myWin','top=' + positionY + ', left=' + positionX + ', width=400, height=180,scrollbars=0,resizable=0');
    winP.focus();
}

function openFPA() {
	var positionX = (screen.width - 400) / 2;
	var positionY = (screen.height -400) / 2;	
	
    winP = window.open('/forgotPasswordAttorney.aspx','myWin','top=' + positionY + ', left=' + positionX + ', width=400, height=180,scrollbars=0,resizable=0');
    winP.focus();
}

function openGuide(aLink) {
	var positionX = (screen.width - 560) / 2;
	var positionY = (screen.height - 560) / 2;	
	
    winP = window.open(aLink,'myWin','top=' + positionY + ', left=' + positionX + ', width=560, height=560,scrollbars=0,resizable=0');
    winP.focus();
}

function openTCC(aLink) {
	var positionX = (screen.width - 320) / 2;
	var positionY = (screen.height - 320) / 2;	
	
    winP = window.open(aLink,'myWin','top=' + positionY + ', left=' + positionX + ', width=320, height=120,scrollbars=0,resizable=0');
    winP.focus();
}

function openTOU(aLink) {
	var positionX = (screen.width - 560) / 2;
	var positionY = (screen.height - 560) / 2;	
	
    winP = window.open(aLink,'myWin','top=' + positionY + ', left=' + positionX + ', width=560, height=560,scrollbars=1,resizable=0');
    winP.focus();
}

