if (top.frames.length != 0) { top.location = self.document.location; };
var scrID = getScrID();
if (scrID >= 2) {
};
var duration = 0;
var countSec = 1;
function addSec(){
 duration++;
 if (countSec) { setTimeout('addSec()',998); }
};
var pI = parseInt;
var flash = getFlashVersion();
var abpAttempts = 3;
document.onload = onL();
function onL() {
 setTimeout('hideABP()',1600);
 setTimeout('extLinks()',2000);
 window.onscroll = scrollEvent;
 setTimeout("scrollEvent()",1250);
};
function scrollEvent() {
  var db = document.body;
  var hg = 0;
  if (db) {
    hg = document.body.clientHeight;
    if (db.offsetHeight > hg) hg = db.offsetHeight;
    if (db.scrollHeight > hg) hg = db.scrollHeight;
  }
  var _docHeight = (document.height !== undefined) ? document.height : document.body.offsetHeight;
  var _scrlHeight = (document.documentElement.clientHeight !== undefined) ? document.documentElement.clientHeight : window.innerHeight;
  var _bt = _docHeight-_scrlHeight;
  $('foot').style.marginBottom=-_bt+'px';
};
function extLinks() {
 var as = document.getElementsByTagName("a");
 if (!as) return;
 for (var hj=0; hj<as.length; hj++) {
  var anr = as[hj];
  if (anr && anr.rel == 'external') anr.target = "_blank";
 }
};
function hideABP(){
 var objs = document.getElementsByTagName('*');
 for (hj=0; hj<objs.length;hj++)
 if (objs[hj].className){
   if (objs[hj].className.indexOf('-objtab-') > 0) {
    objs[hj].className = 'abp';
   }
   if (objs[hj].className.indexOf(' visible') > 0) {
    objs[hj].className = 'abp';
   }
 }
 if (abpAttempts > 0) {
   abpAttempts--;
   setTimeout('hideABP()',1000);
 }
};
function getMaupa(){
 return '&'+'#6'+'4;';
};
function decodeChars(nm){
 var obj = getObj(nm);
 if(obj){
  obj.innerHTML = obj.innerHTML.replace(/maupa/g,getMaupa()).replace(/kropa/g,'.').replace(/~/g,'hanzo');
 }
};
function getScrID(){
 var sc = screen;
 if (sc) {
   var sw = sc.width;
   var sh = sc.height;
   if (sw <= 320) return 2; else
   if (sw <= 760) return 1;
 }
 return 0;
};
function SWF(targetID,swfSrc,swfNm,swfW,swfH,swfBG,addInf) {
 var swfO = $(targetID);
 if (swfO) {
  var addPar = '';
  var addVar = '';
  if(addInf) {
   addPar = '<param name="FlashVars" value="'+addInf+'">';
   addVar = 'FlashVars="'+addInf+'" ';
  }
  swfO.innerHTML =
  '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" '+
  'width="'+swfW+'" height="'+swfH+'" id="'+swfNm+'" align="middle">'+
  '<param name="allowScriptAccess" value="sameDomain">'+
  '<param name="movie" value="'+swfSrc+'">'+
  '<param name="quality" value="high">'+
  '<param name="wmode" value="transparent">'+
  '<param name="bgcolor" value="'+swfBG+'">'+
  addPar+
  '<embed src="'+swfSrc+'" '+addVar+'quality="high" wmode="transparent" bgcolor="'+swfBG+'" width="'+swfW+'" height="'+swfH+'" name="'+swfNm+'" '+
  'align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">'+
  '</object>'+"\n";
 }
};
function $(id) {return document.getElementById(id);};
function getObj(nm) {var obj=$(nm); if(!obj){return document.all(nm);} else {return obj;}};
function setFocus(nm) {if(nm){var foc=$(nm); if(foc){foc.focus();}}};
function insHTML(nm,txt) {if(nm){var obj=getObj(nm); if(obj){obj.innerHTML = txt;return true}else{return false;}}};
function getFlashVersion() {
 var fV = 0;
 var nv = navigator;
 if (nv.plugins && nv.plugins.length) {
   x = nv.plugins["Shockwave Flash"];
   if (x && x.description) {
    var vArr = x.description.split(".");
    fV = pI(vArr[0].split(" ")[2]);
   } else
   if (nv.plugins["Shockwave Flash 2.0"]) {
    fV = 2;
   }
 } else
 if (nv.mimeTypes && nv.mimeTypes.length) {
   x = nv.mimeTypes['application/x-shockwave-flash'];
   if (x && x.enabledPlugin) {
    fV = 1;
   }
 } else
 if(nv.appVersion.indexOf("Mac") == -1 && window.execScript) {
   var obj = -1;
   try { obj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); } catch(err) { }
   if(typeof obj == "object") {
    var flashV = -1;
    try {flashV = obj.GetVariable("$version");} catch(err) { }
    if(flashV != -1) {
     var vArr = flashV.split(",");
	fV = pI(vArr[0].split(" ")[1], 10);
    }
   }
 }
 return fV;
};
function clk(an,tc){
  var inp = $(an);
  if (inp){
    var ids = res[lastTab];
    var chbO;
    if (ids) chbO = $(ids);
    if (chbO && chbO.checked) {
      if(tc) chbO.checked = false;
      $('b'+ids).className = "nb";
    } else {
      ids = an.substr(0,an.length-1);
      for (var hj=1; hj<=5; hj++){
        var chb = $(ids+hj);
        if (chb && chb.checked) {
          if(tc) chb.checked = false;
        }
        $('b'+ids+hj).className = "nb";
      }
    }
    if(tc) inp.checked = true;
    $('b'+an).className = "nbA";
  }
  fadeIn('bNext');
  $('bNext').className='hand';
  $('bNext').onclick=function() { chTab(lastTab+1); }
  res[lastTab-1] = an;
};
function chSex(val){
 var as = document.getElementsByTagName("b");
 if (!as) return;
 for (var hj=0; hj<as.length; hj++) {
  var anr = as[hj];
  if (anr && anr.id.indexOf("sx") == 0) {
    var arr = anr.id.split('_');
    var id = 1;
    if (val == 'f') id = 2;
    else if (val == 'n') id = 3;
    anr.innerHTML = arr[id];
  }
 }
};
function checkDInput(eNm,len) {
  if (!len) { len = 4; }
  var el = $(eNm);
  if (el){
    var val = parseInt(el.value);
    if (el.value.length != len || val < 1899 || val > 2008) {
      if (el.value.length > 0) el.style.border = '1px solid #D96';
      return 1;
    } else {
      el.style.border = '0';
      el.style.borderBottom = '1px dotted #666';
      return 0;
    }
  }
  return 1;
};
function checkNInput(eNm,len) {
  if (!len) { len = 3; }
  var el = $(eNm);
  if (el){
    var val = el.value;
    var VerName = /^([a-zA-Z_-])+$/;
    if (el.value.length < len || !VerName.test(val)) {
      if (el.value.length > 0) el.style.border = '1px solid #D96';
      return 1;
    } else {
      el.style.border = '0';
      el.style.borderBottom = '1px dotted #666';
      return 0;
    }
  }
  return 1;
};
function checkSelect(eNm) {
  var el = $(eNm);
  if (el && el.selectedIndex >= 1) return 0;
  return 1;
};
function chkInitFields(){
  var err = 0;
  err += checkNInput('inTxt1');
  err += checkDInput('inTxt2',4);
  err += checkSelect('inSel1');
  err += checkSelect('inSel2');
  if (err>0) {
    grayOut('bStart');
    var b = $('bStart');
    b.onclick = undefined;
    b.className = "fade";
  } else {
    fadeIn('bStart');
    var b = $('bStart');
    b.onclick = function(){
      info.push($('inTxt1').value);
      info.push($('inTxt2').value);
      info.push($('inSel1').value);
      info.push($('inSel2').value);
      grayOut('bStart');
      setTimeout("loadTest()",300);
      $('bStart').onclick = undefined;
    };
    b.className = "hand";
  }
};
function checkEMLinput(eml){
  var el = $(eml);
  if (el){
    if (el.value.length == 0) { 
      el.style.border = '1px solid #FFF';
      el.style.borderBottom = '1px dotted #666';
      return 0;
    }
    var val = el.value;
    var VerName = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-.])+.([A-Za-z]{2,4})$/;
    if (el.value.length > 6 && VerName.test(val)) {
      el.style.border = '1px solid #FFF';
      el.style.borderBottom = '1px dotted #666';
      return 0;
    }
  }
  el.style.border = '1px solid #D96';
  return 1;
};
function chkCloseFields(){
  var err = 0;
  err += checkEMLinput('eml');
  if (err > 0) {
    grayOut('bStart');
    var b = $('bStart');
    b.onclick = undefined;
    b.className = "fade";
  } else {
    var b = $('bStart');
    SetAlpha(b,100);
    b.className = "hand";
    b.onclick = function(){
      info.push($('eml').value);
      chTab(2);
      this.style.display='none';
    };
  }
};

