// PROVIDE ALTERNATE swBaseHRef

if(window==top){swBaseHRef="";}

// Disables "Dotted Link" in IE
function linkBlur(){
  for(i=0;i < document.links.length;i++){
  if(document.links[i].focus) document.links[i].onfocus = document.links[i].blur;
  }
}

var preloadFlag = false;
function preloadImages() {
  if (document.images) {
    toolTopR = newImage("toolTop_right.gif");
    toolTopL = newImage("toolTop_left.gif");
    toolMid = newImage("toolMid.gif");
    toolBot = newImage("toolBottom.gif");
    preloadFlag = true;
  }
}

// Image Preload/Rollover Stuff...
function newImage(arg) {
  if (document.images) {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
  }
}

function changeImages() {
  if (document.images && (preloadFlag == true)) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
    }
  }
}

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;
}

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];}
}



// Open Centered "More..." Window
function openMoreWindow(URL,WinName,W,H,Features){
  openCenterWin(URL,WinName,W,H,Features);
}


// Open Centered Show Me Window
function launchShowMe(url){
  openCenterWin(url,'showme','500','400','status=yes,resizable=yes');
}

// Open Centered Exercise Window
function launchExercise(url){
  openCenterWin(url,'exercise','550','450','status=yes,resizable=yes');
}

// Open Top Left Practice Instructions Window
function launchPractice(url){
  openTRWin(url,'practice','450','540','status=no,resizable=yes,scrollbars=yes');
}

// Open Regular Centered Window
var centWin = null;
function openCenterWin(URL,WinName,W,H,Features){
  if(!Features){Features = "status=no,scrollbars=no,resizable=yes"}
  LeftPosition = (screen.width) ? (screen.width-W)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-H)/2 - 50 : 0;
  Settings = 'width='+W+',height='+H+',top='+TopPosition+',left='+LeftPosition+','+Features;
  centWin = window.open(swBaseHRef+URL,WinName,Settings);
  if(centWin){
    centWin.focus();
  }
}

// Open Top Left Window
var TRWin = null;
function openTRWin(URL,WinName,W,H,Features){
  if(!Features){Features = "status=no,scrollbars=no,resizable=yes"}
  LeftPosition = 0
  TopPosition = 10
  Settings = 'width='+W+',height='+H+',top='+TopPosition+',left='+LeftPosition+','+Features;
  TRWin = window.open(swBaseHRef+URL,WinName,Settings);
  if(TRWin){
    TRWin.focus();
  }
}



function PrintPolicy() { //in header of each policy page
  if (parent.text) { //doc is in a fremset
    parent.text.focus();
    parent.text.print();
  }
  else { // doc is in a simple window
    this.print();
  }
}