<!--
function OpenInFrame (sUrl) {
  //Be sure that your frame is now called pubMain
  //parent.pubMain.location = sUrl
  //window.opener.parent.pubMain.location = surl;
  window.opener.parent.frames['pubMain'].location.href=sUrl;
}


//Opens a link in the window that opened the popup
function setOpenerWindowLocation (dirrectToThisUrl) {
  window.opener.location=dirrectToThisUrl;
  self.focus();
}

function entryfieldsetfocus() {
  document.forms[0].ENTRY.focus();
}

function checkTarget(targetName) {
  for(var i = 0; i < parent.frames.length; i++) {
    if(parent.frames[i].name == targetName) {
      return true;
    }
    return false;
  }
}

// Browser Window Size and Position
function pageWidth() {return window.innerWidth != null? window.innerWidth: document.body != null? document.body.clientWidth:null;}
function pageHeight() {return window.innerHeight != null? window.innerHeight: document.body != null? document.body.clientHeight:null;}
function posLeft() {return window.pageXOffset != null? window.pageXOffset: document.body.scrollLeft != null? document.body.scrollLeft:0;}
function posTop() {return window.pageYOffset != null? window.pageYOffset: document.body.scrollTop != null? document.body.scrollTop:0;}
function posRight() {return posLeft()+pageWidth();}
function posBottom() {return posTop()+pageHeight();}

function openLink(url, target, style) {
  var screenX=screen.availWidth/2;var screenY = screen.availHeight/4;var width=(screen.availWidth/2.25);var height=screen.availHeight/2;
  var features = "'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes,width=" + width + ",height=" + height +",left=" + screenX + ",top=" + screenY + ",screenX=" + screenX + ",screenY=" + screenY + "'";
 
if (self.opener.opener && !self.opener.opener.closed && url != "") {
    self.opener.opener.location = url;
    self.opener.opener.focus();
    self.focus();
    entryfieldsetfocus();
    return;
  }
 
if (self.opener && !self.opener.closed && url != "") {
    self.opener.location = url;
    self.opener.focus();
    self.focus();
    entryfieldsetfocus();
    return;
  }
 
  if(url.length > 3 && url != "" && url != null) {
    if(target.length > 2 && checkTarget(target))
      parent.frames[target].location.replace(url);
    else if(target.length > 2 && target != null)
      var popup = window.open(url, target, features);
    else
      var popup = window.open(url, url, features);
  }
}

function OpenWin(popSetts) {

//-- Check function calls ----------------------------
  if (!popSetts['name']) {    popSetts['name']    = 'Popup';}
  if (!popSetts['w']) {       popSetts['w']       = 600;}
  if (!popSetts['h']) {       popSetts['h']       = 700;}
  if (!popSetts['scroll']) {  popSetts['scroll']  = 'No';}
  if (!popSetts['loc']) {     popSetts['loc']     = 'No';}
  if (!popSetts['l']) {       popSetts['l']       = 0;}
  if (!popSetts['t']) {       popSetts['t']       = 0;}
  if (!popSetts['menu']) {    popSetts['menu']    = 'No';}
  if (!popSetts['resiz']) {   popSetts['resiz']   = 'No';}
  if (!popSetts['tools']) {   popSetts['tools']   = 'No';}

  /*
  status = popSetts['name']+' '+
           popSetts['w']+' '+
           popSetts['h']+' '+
           popSetts['scroll']+' '+
           popSetts['loc']+' '+
           popSetts['l']+' '+
           popSetts['t']+' '+
           popSetts['menu']+' '+
           popSetts['resiz']+' '+
           popSetts['tools'];
  */

  //---if i and t = 0 calculate center of screen for popup
  if(popSetts['l'] == 0 && popSetts['t'] == 0){
        var swh = screen.height;
        var sww = screen.width;
        sww = (sww/2)-(popSetts['w']/2);
        swh = (swh/2)-(popSetts['h']/2);
        popSetts['l'] = sww;
        popSetts['t'] = swh;
  }
  //-----------------------------------------------------

  //-- Popps the new window if url is set----------------
  if (popSetts['url']){
    oWin = window.open(popSetts['url'], popSetts['name'],
                      'width='        + popSetts['w'] +
                      ',height='      + popSetts['h'] +
                      ',scrollbars='  + popSetts['scroll'] +
                      ',location='    + popSetts['loc'] +
                      ',left='        + popSetts['l'] +
                      ',top='         + popSetts['t'] +
                      ',menubar='     + popSetts['menu'] +
                      ',alwaysRaised=Yes'+
                      ',resizable='   + popSetts['resiz'] +
                      ',toolbar='     + popSetts['tools']);



    agent = navigator.userAgent;

    if ((agent.indexOf('Mozilla') != -1) && ((agent.indexOf('Spoofer') == -1) && (agent.indexOf('compatible') == -1))) {
      oWin.focus();
    }
  }
}
function getAnswerFor(question) {
  document.forms[0].ENTRY.value = question;
  document.forms[0].submit();
}

function externalUrl(sUrl) {
	if(sUrl.length > 3){
		window.open(sUrl,'external_url','width=1008,height=630,toolbar=yes,scrollbars=yes,menubar=yes,location=yes,resizable=yes');
		entryfieldsetfocus();
	}
}

function externalUrlSmall(sUrl) {
	if(sUrl.length > 3){
		window.open(sUrl,'external_url','width=550,height=450,toolbar=no,scrollbars=no,menubar=no,location=no,resizable=yes');
		entryfieldsetfocus();
	}
}
//-->