<!--

function lingubot_navigate( url, target, win_attr ) {
    if ( url != "" )
    {
      if ( win_attr == "frame" )
        eval( target + ".location.href='" + url + "'" );
      else
        window.open( url, target, win_attr );
    }
}

function set_focus() {
    document.forms[ "form_lingubot" ].entry.focus();
}

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;var screenY = screen.availHeight;var width=screen.availWidth;var height=screen.availHeight;

 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 && !self.opener.closed && url != "") {

    self.opener.location = url;

    self.opener.focus();

    self.focus();

    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)

               window.open(url, target, features);

    else

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

//-->