//////////////////////////////////////////
// Popup window
function Popup(url) {
  if(url == 0) return;
  var newwin = window.open(url);
  newwin.focus();
}
//////////////////////////////////////////

//////////////////////////////////////////
// 
function fnTrapKD(btn){
  if (document.all){
    if (event.keyCode == 13){
      btn.click();
      event.returnValue = false;
      event.cancel = true;
      return false;
    }
  }
  else if (document.getElementById){
    if (event.which == 13){
      event.returnValue = false;
      event.cancel = true;
      btn.click();
      return false;
    }
  }
  else if(document.layers){
    if(event.which == 13){
      event.returnValue = false;
      event.cancel = true;
      btn.click();
      return false;
    }
  }
}
//////////////////////////////////////////

//////////////////////////////////////////
// Set control's focus
function setfocus(ctl) {
  ctl=eval(ctl);
  if(ctl.value=='') {
    ctl.focus();
  }
}
//////////////////////////////////////////

//////////////////////////////////////////
// Advertisment
function ImageAd(Link,Url,Width,Height) {
  document.write("<a href='"+Link+"' target='_blank'><img src='"+Url+"' border='0'");
  if(Width!="") {
    document.write(" width='"+Width+"'");
  }
  if(Height!="") {
    document.write(" height='"+Height+"'");
  }
  document.write("></a>");
}

function FlashAd(Url,Width,Height) {
  document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0'");
  if(Width!="") {
    document.write(" width='"+Width+"'");
  }
  if(Height!="") {
    document.write(" height='"+Height+"'");
  }
  document.write(">");
  document.write("<param name='quality' value='high'><param name='wmode' value='transparent'>");
  document.write("<param name='movie' value='"+Url+"'>");
  document.write("<embed src='"+Url+"'");
  if(Width!="") {
    document.write(" width='"+Width+"'");
  }
  if(Height!="") {
    document.write(" height='"+Height+"'");
  }
  document.write(" pluginspage='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' type='application/x-shockwave-flash' quality='high' wmode='transparent'></embed>");
  document.write("</object>");
}
//////////////////////////////////////////
