function init() { Playbutton(); Stopbutton(); Vidbutton(); Listbutton(); Onwardbutton();
                  Backbutton(); SmOnwardbutton(); SmBackbutton(); Add_BKM_button(); Update_BKM_button(); 							 }

var domain = window.location.protocol+"//"+window.location.hostname+(window.location.port ? ":" + window.location.port : '') + '/';

//var ap_url;

function preload_images (imagesPath, images) {
  preloads = new Object();
  for (i=0; i<images.length; i++) {
    preloads[i] =  new Image(); preloads[i].src = imagesPath + images[i];
  }
}

function addBookmark(url, title)
{
if (!url) url = location.href;
if (!title) title = document.title;
//Gecko
if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel ("Онлайн ТВ и телепрограмма на MY-TVset", "http://my-tvset.ru", "");
//IE4+
else if (typeof window.external == "object") window.external.AddFavorite("http://my-tvset.ru", "Онлайн ТВ и телепрограмма на MY-TVset");
//Opera7+
else if (window.opera && document.createElement)
{
var a = document.createElement('A');
if (!a) return false; //IF Opera 6
a.setAttribute('rel','sidebar');
a.setAttribute('href',url);
a.setAttribute('title',title);
a.click();
}
else return false;
return true;
}

function updateLiveInternetCounter() {
  var liCounter = new Image(1,1);
  liCounter.src = 'http://counter.yadro.ru/hit?r='+
  ((typeof(screen)=='undefined')?'':';s'+screen.width+
  '*'+screen.height+'*'+(screen.colorDepth?screen.colorDepth:
  screen.pixelDepth))+';u'+escape(document.URL)+
  ';h'+escape(document.title.substring(0,80))+';'+Math.random();
}

preload_images (domain + 'img/interface/', Array('bmr.png', 'exred.png', 'lr.png', 'searchbg.png', 'input.png', 'btnbluel.png', 'btnbluer.png', 'btnblue.png'));

function getTimeZone($out) {
  var curDateTime = new Date();
  $time_zone = -(curDateTime.getTimezoneOffset()/60)-3;
  ajax = new myajax();
  ajax.createRequest();
  var url = domain + 'set_timezone.php';
  ajax.setParam_of_Send('set_time_zone='+$time_zone);
  ajax.setParam('POST', url, true);
  ajax.CurrentAction = function() {
    if ($out) {
      var data = this.request.responseText;
      $('tpPanel').innerHTML = data;
    }
  }
  ajax.Send();
}

function imp() {
  $hide('div_title')
}

// <interface>

function Show_Aut_Form() {
  if ($('Playerbody')) $hide('Playerbody');
  $show('AlphaBg');
  $('authForm').reset();
  $hide('logerDiv');
  $show('authForm');
  Get_Top_Reg_Form($('authForm'));
  $('login').focus();
}
function NoShow_Aut_Form() {
  if ($('Playerbody')) $show('Playerbody');
  $hide('AlphaBg');
  $hide('authForm');
  $('authForm').reset();
}
function NoShow_Sett_Form() {
  if ($('Playerbody')) $show('Playerbody');
  $hide('AlphaBg');
  $hide('settForm');
  $('settForm').reset();
}

function Show_Rest_Form() {
  $('restForm').reset();
  $show('restForm');
  $hide('authForm');
  $obj = $('restForm').getElementsByTagName('input').item(0);
  if ($obj) $obj.focus();
}
function NoShow_Rest_Form() {
  $hide('restForm');
  Show_Aut_Form();
}

function showCountryes()
{
  if ($('CountriesBtn').className=='bn') {
    $show('CountriesBody');
    $('CountriesBtn').className='bl';
  }
  else {
    $hide('CountriesBody');
    $('CountriesBtn').className='bn';
  }
  get_chist_height();
}

/*function get_chist_height() {
  if ($('Other')) $other_height = $('Other').clientHeight; else $other_height = -12;
  height = $('Content').clientHeight + $other_height - $('Countries').clientHeight;
  $('Channels').style.height = height+'px';
  $('ChannelsBody').style.height = (height - 135) + 'px';
}*/

function get_chist_height() { 
  $element = $('Channels');
  $height = $('content_block').offsetHeight - $('Countries').clientHeight - 24;
  $element.style.height = $height+'px';
  $('ChannelsBody').style.height = ($height - 135) + 'px';
  setTimeout(function () { get_chist_height() }, 1000);
}

// </interface>

//<captcha>
function update_captcha($obj) {
  var ap_url = 'd=' + new Date().getTime();
  $obj.src = domain + 'registration/img/captcha.php?' + ap_url;
}
//</captcha>

//<settings>
function import_settings(page) {

  var ap_url = 'd=' + new Date().getTime();
  page  = 'page=' + page;
  
  $addScript(domain + 'js/regform.js'); 
  $addStylesheet(domain + 'css/regform.css');

  ajax = new myajax();
  ajax.createRequest();
  var url = domain + 'options/index.php';
  ajax.setParam_of_Send(ap_url, page);
  ajax.setParam('POST', url, true);
  if (typeof opera != 'undefined') $hide('settForm');
  ajax.CurrentAction = function() {
    updateLiveInternetCounter();
    var data = this.request.responseText;
    $('Settings').innerHTML = data;
    Button_blue($('Settbutton'));
  }
  ajax.Send();
  delete ajax;
  if ($('Playerbody')) { $hide('Playerbody'); }
  $show('AlphaBg');

}

function use_settings($url) {
  $ptype = false;
  if ($url == 'ptype.php') $ptype = true;
  if (checkSettForm() == true) {
    ajax = new myajax();
    ajax.createRequest();
    ajax.getVars_of_Form('settForm');
    $url = domain + 'options/' + $url;
    ajax.setParam('POST', $url, true);
    ajax.CurrentAction = function () {
      updateLiveInternetCounter();
      var data = this.request.responseText;
      $show('Sett_errorDiv');
      $('Sett_errors').innerHTML = data;
      if ($('settcomplit')) {
	    $('Settbutton').value = "Закрыть";
	    $('Settbutton').onclick = function () { NoShow_Sett_Form(); return false; };
	    if ($ptype) ptype_change();
      } else if ($('Sett_xep_code')) update_captcha($('Sett_xep_code'));
    }
    ajax.Send();
    delete ajax;
  }
}

function checkSettForm() {
  var error = new Array();
  var focused = false;

  if ($('sett_curpass')) {
    if ($('sett_curpass').value == '') {
      error[error.length] = '<td>Вы не указали <b>текущий пароль</b></td></tr>';
      if (!focused) focused = $('sett_curpass');
    }
  }
  if ($('sett_password')) {
    if ($('sett_password').value == '') {
      error[error.length] = '<td>Вы не указали <b>пароль</b></td></tr>';
      if (!focused) focused = $('sett_curpass');
    }
	else if (getPasswordStrength($('sett_password').value) < 50) {
      error[error.length] = '<td><b>пароль</b> недостаточно сильный, рекомендуемое значение силы пароля - "<b>'+ pass_strength_phrases[50] +'"</b></td></tr>';
      if (!focused) focused = $('sett_password');
    }
    else if ($('sett_password2').value == '') {
      error[error.length] = '<td>Вы не подтвердили <b>пароль</b></td></tr>';
      if (!focused) focused = $('sett_password2');
    }
	else if ($('sett_password').value != $('sett_password2').value) {
      error[error.length] = '<td><b>пароли</b> не совпадают</td></tr>';
      if (!focused) focused = $('sett_password');
    }
  }

  if ($('sett_nickname')) {
    if ($('sett_nickname').value == '') {
        error[error.length] = '<td>Вы не указали <b>ник посетителя</b>.</td></tr>';
        if (!focused) focused = $('sett_nickname');
    }
  }
  if ($('sett_name')) {
    if ($('sett_name').value == '') {
      error[error.length] = '<td>Вы не указали <b>имя</b>.</td></tr>';
      if (!focused) focused = $('sett_name');
    }
  }
  if ($('sett_email')) {
    if ($('sett_email').value == '') {
      error[error.length] = '<td>Вы не указали <b>e-mail</b>.</td></tr>';
      if (!focused) focused = $('sett_email');
    }
  }
  if ($('Condition_rest') && $('Condition_rest').value == 4) {
    if ($('sett_question').value == '') {
      error[error.length] = '<td>Вы не указали <b>секретный вопрос</b>.</td></tr>';
      if (!focused) focused = $('sett_question');
    }
    if ($('sett_answer').value == '') {
      error[error.length] = '<td>Вы не указали <b>ответ</b> на <b>секретный вопрос</b>.</td></tr>';
      if (!focused) focused = $('sett_question');
    }
  }
  if ($('sett_email')) {
    if ($('sett_email').value == '') {
      error[error.length] = '<td>Вы не указали <b>e-mail</b>.</td></tr>';
      if (!focused) focused = $('sett_email');
    }
  }
  if ($('sett_code')) {
    if ($('sett_code').value == '') {
        error[error.length] = '<td>Вы не указали <b>защитный код</b></td></tr>';
        if (!focused) focused = $('sett_code');
    }
  }

  if (focused) focused.focus();

  if (error != '') {
    error_out = error[0];
	for (i=1; i<error.length; i++) {
          error_out += '<tr><td>&nbsp;</td>' + error[i];
		}
        $show('Sett_errorDiv');
        $('Sett_errors').innerHTML = '<table><tbody><tr><td valign="top" width="150">&nbsp;Ошибки отправки формы:</td>' + error_out + '</tbody></table>';

        if ($('Sett_xep_code')) update_captcha($('Sett_xep_code'));

        error = '';
        return false;
    }

    return true;

}

//</settings>

//<telecasts_panel>

function show_tp_panel()
{
  b = $('btnShowBkPanel');
  if (b.className=='bup') {
    b.title = 'Закрыть панель';
    b.className='bdown';
    $show('tpPanelBox');
  }
  else {
    b.className='bup';
    b.title = 'Панель выбора часового пояса';
    $hide('tpPanelBox');
  }
}

//</telecasts_panel>

//<channel_panel>
function showBookmarkInfo()
{
  if ($('btnShowInfBkm').className=='bi') {
    $('btnShowInfBkm').title = 'Закрыть панель управления маркерами каналов';
    $('btnShowInfBkm').className='bx';
    $show('chPanelBox');
  }
  else {
    $('btnShowInfBkm').className='bi';
    $('btnShowInfBkm').title = 'Панель управления маркерами каналов';
    $hide('chPanelBox');
  }
}

function set_markers($marker) {
  if ($marker == 1) $('mrktp').src = domain + "img/markers/mrktpon.png";
  else $('mrktp').src = domain + "img/markers/mrktpoff.png";
  if ($('mrkbm')) {
    if ($marker == 2) $('mrkbm').src = domain + "img/markers/mrkbmon.png";
    else $('mrkbm').src = domain + "img/markers/mrkbmoff.png";
  }
  if ($marker == 3) $('mrknone').src = domain + "img/markers/mrkon.png";
  else $('mrknone').src = domain + "img/markers/mrkoff.png";

  setTimeout(function () {
  	$('btnShowInfBkm').className='bi';
    $('btnShowInfBkm').title = 'Панель управления маркерами каналов';
    $hide('chPanelBox'); }, 300);

  $('markerid').value = '&marker=' + $marker;

  update_channels(param_string);

}
//</channel_panel>

//<search>
function show_searchstring() {
  $show('Searchstring');
  $('search_str').focus();
}
function hide_searchstring() {
  if ($('search_str').value == '') $hide('Searchstring');
}
function Search_submit() {
  parameters = $('ChannelsBody').getElementsByTagName('input').item(0).value;
  parameters = parameters.split('&');
  $('Hidden_inputs').innerHTML = '';
  for (i=0; i<parameters.length; i++) {
	param = parameters[i].split('=');

    Node = document.createElement('input');
    Node.type = 'hidden';
    Node.name = param[0];
    Node.value = param[1];
    $('Hidden_inputs').appendChild(Node);
  }
}
//</search>

// <player>

var play = 1;

function Playbutton() { 
  var b = $('Playbutton');
  if (b) {
    b.onmouseover = function () {
      b.style.zIndex = 90; if (play == 0) {
      	b.className = 'pbup';
      	b.title = 'Воспроизводить';
      } else {
      	b.className = 'pauseup';
     	b.title = 'Приостановить';
    } }
    b.onmouseout = function () { if (play == 0) {
     b.style.zIndex = 75; b.className = 'pbout'} else {b.className = 'pauseout'} }
    b.onmousedown = function () { if (play == 0) { b.className = 'pbdown'} else {b.className = 'pausedown'} getbut() }
    b.onmouseup = function () { if (play == 0) {b.className = 'pbup'} else  b.className = 'pauseup' }
    b.onclick = playpause;
  }
}

function Stopbutton() { 
  var b = $('Stopbutton');
  if (b) {
    b.onmouseover = function () { b.className = 'sbup' };
    b.onmouseout = function () { b.className = 'sbout' };
    b.onmousedown = function () { b.className = 'sbdown'; getbut() };
    b.onmouseup = function () { b.className = 'sbup' };
    b.onclick = function () { playpause(); $('Playbutton').className = 'pbout' };
  }
}

function Add_BKM_button() {
  var b = $('Add_BKM_button');
  if (b) {
    b.onmouseover = function () { b.src = 'img/player/bkmup.png' };
    b.onmouseout = function () { b.src = 'img/player/bkmout.png' };
    b.onmousedown = function () { b.src = 'img/player/bkmdown.png'; };
    b.onmouseup = function () { b.src = 'img/player/bkmup.png' };
    b.onclick = function () { add_bookmarks(); };
  }
}

function Update_BKM_button() {
  var b = $('Update_BKM_button');
  if (b) {
    b.onmouseover = function () { b.src = 'img/player/updup.png' };
    b.onmouseout = function () { b.src = 'img/player/updout.png' };
    b.onmousedown = function () { b.src = 'img/player/upddown.png'; };
    b.onmouseup = function () { b.src = 'img/player/updup.png' };
    b.onclick = function () { update_bookmarks(); };
  }
}

function Onwardbutton() {
  var b = $('Onwardbutton');
  if (b) {
    b.onmouseover = function () { b.style.zIndex = 90; b.src = 'img/player/owup.png' };
    b.onmouseout = function () { b.style.zIndex = 80;  b.src = 'img/player/owout.png' };
    b.onmousedown = function () { b.src = 'img/player/owdown.png'; };
    b.onmouseup = function () { b.src = 'img/player/owup.png' };
    b.onclick = function () { swith.list_Channels(0) };
  }
}

function Backbutton() {
  var b = $('Backbutton');
  if (b) {
    b.onmouseover = function () { b.style.zIndex = 90; b.src = 'img/player/bkup.png' };
    b.onmouseout = function () { b.style.zIndex = 80;  b.src = 'img/player/bkout.png' };
    b.onmousedown = function () { b.src = 'img/player/bkdown.png'; };
    b.onmouseup = function () { b.src = 'img/player/bkup.png' };
    b.onclick = function () { swith.list_Channels(1) };
  }
}

function SmOnwardbutton() {
  var b = $('SmOnwardbutton');
  if (b) {
    b.onmouseover = function () { b.style.zIndex = 90; b.src = 'img/player/smowup.png' };
    b.onmouseout = function () { b.style.zIndex = 80;  b.src = 'img/player/smowout.png' };
    b.onmousedown = function () { b.src = 'img/player/smowdown.png'; };
    b.onmouseup = function () { b.src = 'img/player/smowup.png' };
    b.onclick = function () { swith.list_Channels(0) };
  }
}

function SmBackbutton() {
  var b = $('SmBackbutton');
  if (b) {
    b.onmouseover = function () { b.style.zIndex = 90; b.src = 'img/player/smbkup.png' };
    b.onmouseout = function () { b.style.zIndex = 80;  b.src = 'img/player/smbkout.png' };
    b.onmousedown = function () { b.src = 'img/player/smbkdown.png'; };
    b.onmouseup = function () { b.src = 'img/player/smbkup.png' };
    b.onclick = function () { swith.list_Channels(1) };
  }
}

function Vidbutton() { 
  var b = $('imgVidbutton');
  if (b) {
    if ($('Playbutton')) {
     out = 'img/player/vboutl.png';
    }
    else {
      out = 'img/player/vbout.png';
    }
    b.onmouseover = function () { b.src ='img/player/vbup.png' };
    b.onmouseout = function () { b.src = out };
    b.onmousedown = function () { b.src = 'img/player/vbdown.png' };
    b.onclick = function () {
	  $url = this.parentNode.href;
	  $url = $url.split('?');
	  $ptype = $url[1].split('&');
	  $ptype = $ptype[$ptype.length - 1];
	  param_string = $('ChannelsBody').getElementsByTagName('input').item(0).value + '&' + $('cnlID').value;
	  $url = $url[0] + '?' + param_string + '&' + $ptype;
      this.parentNode.href = $url;

    }
  }
}

function Listbutton() {
  var b = $('Listbutton');
  if (b) {
    b.onmouseover = function () { b.className ='lbup' };
    b.onmouseout = function () { b.className='lbout' };
    b.onmousedown = function () { b.className='lbdown' };
    b.onmouseup = function () { b.className = 'lbup' };
    b.onclick = function () { import_bookmarks() };
  }
}

function getbut()
{
  if (play==0) play=1; else play=0;
}

$stream = null;
$pause = '<center><img style="margin-top: 160px" src="img/interface/pause.png?2"></center>';
function playpause()
{ 
  if (play==0) {
    $stream = $('Playerbody').innerHTML;
    $('Playerbody').innerHTML = $pause;
    $('Stopbutton').className='sboff';
    $hide('Stopbutton');
  }
  else {
    $('Playerbody').innerHTML = $stream;
    $('Stopbutton').className='sbout';
    $show('Stopbutton');
  }
}

//</player>

//<bookmarks>

var action = 1;
var $cnlID;
function import_bookmarks() {

  ajax = new myajax();
  ajax.createRequest();
  var ap_url = 'd=' + new Date().getTime();
  ajax.setParam_of_Send(ap_url);
  
  if (action == 0) {
    if (typeof bookmarks == 'undefined') {

      param_string = $('ChannelsBody').getElementsByTagName('input').item(0).value;

	  ajax.setParam_of_Send(param_string);
      var url = domain + 'bookmarks/aj_bookmarks.php?5';
      ajax.setParam('GET', url, true);
      
      ajax.CurrentAction = function() {
        updateLiveInternetCounter();
        var data = this.request.responseText;
        bookmarks = document.createElement('div');
        bookmarks.innerHTML=data;
        
        $('Telecasts').innerHTML = bookmarks.innerHTML;
      }
      ajax.Send();
    }
	else {
      $('Telecasts').innerHTML = bookmarks.innerHTML;
    }
    $('Listaction').innerHTML = 'Перейти к новостям - ';
    $('Listbutton').title = 'Перейти к новостям';
    action = 2;
  }
  else if (action == 1) { 

	if (typeof telecasts == 'undefined' || $cnlID != $('cnlID').value) { 

      $('Telecasts').innerHTML = '<div id="telecasts_h" class="header"><strong>Загрузка телепрограммы</strong></div><div id="bodyTelecasts" class="body">' + indicator(120) + '</div>';
      
      $cnlID = $('cnlID').value;
      
      ajax.setParam_of_Send($cnlID, 'c=11');
      var url = domain + 'telecasts/aj_telecasts.php';

      ajax.setParam('GET', url, true);

      ajax.CurrentAction = function() {
        updateLiveInternetCounter();
        var data = this.request.responseText;
        telecasts = document.createElement('div');
        telecasts.innerHTML = data;
        $('Telecasts').innerHTML = data;
      }
      //ajax.Send();
	}
	else {
      $('Telecasts').innerHTML = telecasts.innerHTML;
	}

    $('Listaction').innerHTML = 'Перейти к закладкам - ';
    $('Listbutton').title = 'Перейти к закладкам';
    action = 0;

  } else if (action == 2) {

	body_height = $('Telecasts').clientHeight - 25;
    $('Telecasts').innerHTML = '<div class="header"><b>Интересные новости</b></div><div id="DIV_NNN_5631" class="body" style="height: ' + body_height + 'px"></div>';

	update_News();

    $('Listaction').innerHTML = 'Перейти к телепрограмме - ';
    $('Listbutton').title = 'Перейти к телепрограмме';
    action = 1;

  }
  delete ajax;
  
  return false;
}

function update_News() {
  updateLiveInternetCounter();
  var ap_url = '?d=' + new Date().getTime();
  var parent = $('Add_scripts');
  parent.innerHTML = '';
  script = document.createElement('script');
  script.type = 'text/javascript';
  script.src = 'http://nnn.novoteka.ru/show.cgi?adp=5631&div=DIV_NNN_5631&nnn=5631' + ap_url;
  parent.appendChild(script);
}

function update_bookmarks ($param) {

  ajax = new myajax();
  var ap_url = 'd=' + new Date().getTime();
  ajax.setParam_of_Send(ap_url);
  
  ajax.createRequest();
  var url = domain + 'bookmarks/aj_bookmarks.php';
  ajax.setParam('GET', url, true);

  ajax.CurrentAction = function() {
    updateLiveInternetCounter();
    var data = this.request.responseText;
    bookmarks = document.createElement('div');
    bookmarks.innerHTML=data;
    if ($('bookmarks')) {
      action = 0;
      import_bookmarks();
    }
    param_string = $('ChannelsBody').getElementsByTagName('input').item(0).value;
    if ($param) param_string = param_string + '&marker=' + $param;
    update_channels(param_string);
  }
  ajax.Send();
  delete ajax;
}

function add_bookmarks (channelID) {

  ajax = new myajax();
  var ap_url = 'd=' + new Date().getTime();
  if (channelID) {
    ajax.setParam_of_Send('channelID=' + channelID, ap_url);
  } else ajax.setParam_of_Send(ap_url);
  

  ajax.createRequest();
  var url = domain + 'bookmarks/add_bookmark.php';
  ajax.setParam('GET', url, true);
 
  ajax.CurrentAction = function() {
    updateLiveInternetCounter();
    var data = this.request.responseText;
	if (data) {
      alert (data);
      if ($('Add_BKM_button')) $hide('Add_BKM_button');
	} else {
       if ($('bookmarks')) update_bookmarks();
       if ($('ContentBodyBM')) update_bookmarks_page(domain + 'bookmarks/bookmarks_update.php');
       $hide('Add_BKM_button');
	} 
  }
  ajax.Send();
  delete ajax;
}

function sourceDragStart(channelID) {  
  window.event.dataTransfer.effectAllowed="copy";
  window.event.dataTransfer.setData("Text", channelID);
}

function targetDragEnter(obj) {
  window.event.returnValue=false;
  window.event.dataTransfer.dropEffect="copy";
}

function targetDrop() {
  window.event.returnValue=false;
  channelID=window.event.dataTransfer.getData("Text");
  if (/^[0-9]+$/.test(channelID)) add_bookmarks(channelID);
}

function ShowBkmTools() {
  if ($('btnShowBkPanel').className=='bup') {
    $show('bmPanel');
    $('btnShowBkPanel').className='bdown';
  }
  else {
    $hide('bmPanel');
    $('btnShowBkPanel').className='bup';
  }
  get_chist_height();
}

var basket = 0;
function BasketAction() {

  if (basket == 0) {
    Basket_Empty();
  } else
  if (basket == 1) {
    Basket_Closed();
  } else
  if (basket == 2) {
    update_bookmarks_page(domain + 'bookmarks/bookmarks_del.php', true);
  }
  return false;
}

var param_string;

function set_param_string (param_string) {
  param_string = param_string;
}

function update_bookmarks_page(url, basket) {
  ajax = new myajax();
  ajax.createRequest();
  if (basket) ajax.getVars_of_Form('frm_notes_remuved');
  ajax.setParam('GET', url, true);
  ajax.CurrentAction = function () {
    updateLiveInternetCounter();
    var data = new String();
    data = this.request.responseText;
    $('ContentBodyBM').innerHTML = data;
    Basket_Closed();
    update_channels();
    setTimeout(function () { get_pos_bmPanel(); }, 10);
  }
  ajax.Send();
  delete ajax;
}

function load_bookmarks_page(url) {
  ajax = new myajax();
  ajax.createRequest();
  ajax.setParam('GET', url, true);
  ajax.CurrentAction = function () {
    updateLiveInternetCounter();
    var data = new String();
    data = this.request.responseText;
    $('Content').innerHTML = data;
    setTimeout(function () { get_pos_bmPanel(); }, 10);
  }
  ajax.Send();
  delete ajax;
}


function get_pos_bmPanel() {
  if ($('ContentBodyBM')) {
    var bmPanel_left = parseInt($('ContentBodyBM').clientWidth) - 93;
    $('bmPanel').style.left = bmPanel_left + 'px';
  } 
}

function Basket_Closed() {
  $('Basket').style.background = 'url('+ domain + 'img/bm/bsktclosed.png) no-repeat';
  $('Basket').title = 'Нажмите для перехода в режим удаления.';
  $('frm_notes_remuved').innerHTML = null;
  basket = 0;
}

function Basket_Empty() {
  $('Basket').style.background = 'url('+ domain + 'img/bm/bsktempty.png) no-repeat';
  $('Basket').title = 'Выйти из режима удаления';
  basket = 1;
}

function NoteRemoved(element, bmid) {
  if (basket != 0) {
    obj = element.getElementsByTagName('div').item(0);
    if (obj.style.display == 'block') {
      obj.style.display = 'none';
      $remove('bmid' + bmid);
      index = $('frm_notes_remuved').getElementsByTagName('input').length;
      if (index == 0) {
        Basket_Empty();
      }
    } else {
      obj.style.display = 'block';
      $('Basket').style.background = 'url('+ domain + 'img/bm/bsktful.png) no-repeat';
      $('Basket').title = 'Очистить корзину.';
		index = $('frm_notes_remuved').getElementsByTagName('input').length;
        Node = document.createElement('input');
        Node.type = 'hidden';
        Node.name = 'bmid[' + index + ']';
        Node.value = bmid;
        $('frm_notes_remuved').appendChild(Node);
        Node.id = 'bmid' + bmid;
      basket = 2;
    }
    return false;
  }
}

var add_bookmark = 1;
function add_bookmark_Mode() {
  if ( add_bookmark == 0 ) {
    $('addBmMode').style.background = 'url('+ domain + 'img/bm/addbkm.png) no-repeat';
    $('addBmMode').title = 'Нажмите для перехода в режим добавления.';
    add_bookmark = 1;
  } else {
    $('addBmMode').style.background = 'url('+ domain + 'img/bm/selbkm.png) no-repeat';
    $('addBmMode').title = 'Нажмите чтобы покинуть режим добавления.';
    add_bookmark = 0;
  }
  update_channels();
}

//</bookmarks>

function indicator(top) {
 $indicator = '<div style="padding-top: ' + top + 'px; text-align: center"><img src="' + domain + 'img/interface/indicator.gif"></div>';
 return $indicator;
}


//<annonses>
var $annons;
function out_annonses($obj) {

  if ($annons) {

    $('bodyTelecasts').innerHTML = $annons;

    $('Listaction').innerHTML = 'Перейти к телепрограмме - ';
    $('Listbutton').title = 'Перейти к телепрограмме';
    action = 1;
    
	return false;
  }
  
  $('bodyTelecasts').innerHTML = indicator(120);
  
  $param = $obj.href;
  $param = $param.split('?');
  $param = $param[1].split('&');
  var ap_url = 'd=' + new Date().getTime();

  ajax = new myajax();
  ajax.createRequest();
  var url = domain + 'telecasts/annonses.php';
  ajax.setParam('GET', url, true);
  ajax.setParam_of_Send($param[1], $param[2], ap_url);

  ajax.CurrentAction = function () {

    updateLiveInternetCounter();

	$annons = this.request.responseText;

    $('bodyTelecasts').innerHTML = $annons;

    $('Listaction').innerHTML = 'Перейти к телепрограмме - ';
    $('Listbutton').title = 'Перейти к телепрограмме';
    action = 1;
  }

  ajax.Send();
  delete ajax;

  return false;
}
//</annonses>

//<channelslist>

function change_countrye(param_string) {
  if (ajax_zone() == true) return true;
  update_channels(param_string);
  return false;
}

function update_channels(param_string) {

   ajax = new myajax();
  
   if (!param_string) param_string = $('ChannelsBody').getElementsByTagName('input').item(0).value;

   param_string += $('markerid').value;
   
   if (add_bookmark == 0)
     ajax.setParam_of_Send(param_string, 'addmode=true');
   else
     ajax.setParam_of_Send(param_string);

	ajax.createRequest();
    var url = domain + 'channels_update.php';
    ajax.setParam('GET', url, true);
    ajax.CurrentAction = function () {
      
      updateLiveInternetCounter();
      var data = new String();
	  data = this.request.responseText;

	  dataArray = data.split('<split>');
      $('CountryeFuter').innerHTML = dataArray[0];
      $('ChannelsBody').innerHTML = dataArray[1];

	  $hide('CountriesBody');
      $('CountriesBtn').className='bn';
      get_chist_height();

    }

    ajax.Send();
    delete ajax;

    return false;

}

//</channelslist>

//<channeltypes>

function ajax_zone () {
   if (!$('Player')) {
     if (!$('ContentBodyBM')) return true;
   }
   return false;
}

function click_BN (obj, param_string) {

   if (ajax_zone() == true) return true;

   get_cim(obj);
   if (!param_string) { 
     param_string = obj.name.split('?');
     param_string = param_string[1];
   } 
   update_channels(param_string);
   return false;
}

function qwe(obj) {
   obj.title = obj.id + '\n' + obj.className;
}
function get_cim (obj) {

  cim = new Array($('headnavBNdisabled'), $('footnavBNdisabled'));
  it = obj.id.split('_');
  it = it[1];
  obj = new Array($('headnav_'+it), $('footnav_'+it));
  type = new Array('headnavBNdisabled', 'footnavBNdisabled');

  for ($i=0; $i<2; $i++) {

    cim[$i].href = cim[$i].name;
    cim[$i].id = cim[$i].className;
    cim[$i].className = '';
    cim[$i].onclick = function () {
      return click_BN(this, false);
    }

    obj[$i].name = obj[$i].href;
    obj[$i].href = 'javascript: void(0);';
    obj[$i].className = obj[$i].id;
    obj[$i].id = type[$i];
    obj[$i].onclick = null;

  }

}

//</channeltypes>

//<write_us>

function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:window.innerHeigth;
}

function Get_Top_Reg_Form($obj) {

  window_height = getClientHeight();
  form_height = $obj.clientHeight;
  if (form_height > window_height) {
    $obj.style.marginTop = '-220px';
    $obj.style.position = 'absolute';
  } else {
    $obj.style.position = 'fixed';
    margin_top = Math.floor($obj.clientHeight/2);
    $obj.style.marginTop = '-' + margin_top + 'px';
  }

}

function import_mailform() {

  if (!$('writeForm')) {

    var ap_url = 'd=' + new Date().getTime();
    
    if (typeof $regform == 'undefined') {
      $addScript(domain + 'js/regform.js');
      $addStylesheet(domain + 'css/regform.css')
    }

    ajax = new myajax();
    ajax.createRequest();
    var url = domain + 'mailbox/write_us.php';
    ajax.setParam_of_Send(ap_url);
    ajax.setParam('GET', url, true);
    ajax.CurrentAction = function() {

      updateLiveInternetCounter();
      
      var data = this.request.responseText;
      newNode = document.createElement('div');
      newNode.innerHTML=data;
      $('Import').appendChild(newNode);
      $('write_name').focus();
      Button_blue($('Writebutton'));
      Get_Top_Reg_Form($('writeForm'));
    }
    ajax.Send();
    delete ajax;

    if ($('Playerbody')) { $hide('Playerbody'); }
    $show('AlphaBg');

  }
  else {
    update_captcha($('write_xep_code'));
    Show_Mail_Form();
    $('write_name').focus();
  }
  return false;
}

function Show_Mail_Form() {
  if ($('Playerbody')) $hide('Playerbody');
  $show('AlphaBg');
  $('writeForm').reset();
  $hide('write_errorsDiv');
  $show('writeForm');
  $('Writebutton').value = 'Отправить';
  $show('writeComplit');
  $('Writebutton').onclick = Mail;
  $('write_name').focus();
}
function NoShow_Mail_Form() {
  if ($('Playerbody')) $show('Playerbody');
  $hide('AlphaBg');
  $hide('writeForm');
  $('writeForm').reset();
}

function Mail(){
  if (checkMail() == true) {
    ajax = new myajax();
    ajax.createRequest();
    ajax.getVars_of_Form('writeForm');
	ajax.param_of_send = ajax.param_of_send + '&message=' + $('write_message').value;
    ajax.setParam('POST', domain + 'mailbox/mail.php', true);
    ajax.CurrentAction = function () {
      var data = this.request.responseText;
      $show('write_errorsDiv');
      $('write_error').innerHTML = data;
      if ($('mailcomplit')) {
        $('Writebutton').value = 'Закрыть';
        $show('writeComplit');
        $('Writebutton').onclick = NoShow_Mail_Form;
      } else update_captcha($('write_xep_code'));
      Get_Top_Reg_Form($('writeForm'));
    }
    ajax.Send();
  }
}

function checkMail() {

    var error = new Array();
    var focused = false;

    if ($('write_name').value == '') {
        error[error.length] = '<td>Вы не указали <b>имя</b>.</td></tr>';
        if (!focused) focused = $('write_name');
    }
    if ($('write_email').value == '') {
    	error[error.length] = '<td>Вы не указали <b>e-mail</b>.</td></tr>';
    	if (!focused) focused = $('write_email');
    }
    if ($('write_subject').value == '') {
        error[error.length] = '<td>Вы не указали <b>тему сообщения</b>.</td></tr>';
        if (!focused) focused = $('write_subject');
    }
    if ($('write_message').value == '') {
    	error[error.length] = '<td>Вы не указали <b>текст собщения</b>.</td></tr>';
    	if (!focused) focused = $('write_message');
    }
    if ($('write_code').value == '') {
        error[error.length] = '<td>Вы не указали <b>защитный код</b></td></tr>';
        if (!focused) { 
          focused = $('write_code');
        }
    }

    if (focused) focused.focus();

    if (error != '') {
        error_out = error[0];
		for (i=1; i<error.length; i++) {
          error_out += '<tr><td>&nbsp;</td>' + error[i];
		}
        $show('write_errorsDiv');
        $('write_error').innerHTML = '<table><tbody><tr><td valign="top" width="150">&nbsp;Ошибки отправки формы:</td>' + error_out + '</tbody></table>';

        update_captcha($('write_xep_code'));

        error = '';
        Get_Top_Reg_Form($('writeForm'));
        return false;
    }

    return true;
}
//</write_us>

//<registration>
function import_regform() {

  if (!$('regForm')) { 

    var ap_url = 'd=' + new Date().getTime();

    if (typeof $regform == 'undefined') {
      $addScript(domain + 'js/regform.js');
      $addStylesheet(domain + 'css/regform.css')
    }

    ajax = new myajax();
    ajax.createRequest();
    var url = domain + 'registration/regform.php';
    ajax.setParam_of_Send(ap_url);
    ajax.setParam('GET', url, true);
    ajax.CurrentAction = function() {
      updateLiveInternetCounter();
      var data = this.request.responseText;
      newNode = document.createElement('div');
      newNode.innerHTML=data;
      $('Import').appendChild(newNode);
      $('reg_login').focus();
      Button_blue($('Regbutton'));
    }
    ajax.Send();
    delete ajax;

    if ($('Playerbody')) { $hide('Playerbody'); }
    $show('AlphaBg');
    $hide('authForm');

  }
  else {
    Show_Reg_Form();
    $('reg_login').focus();
  }

}
//</registration>

//<login>
function loginn() {
  ajax = new myajax();
  ajax.createRequest();
  ajax.getVars_of_Form('authForm');
  ajax.setParam('POST',  domain + 'login/login.php', true);
  ajax.CurrentAction = function () {
    var data = this.request.responseText;
    $show('logerDiv');
    $('loger').innerHTML = data;
    if ($('complit')) {
	  $('Loginbutton').value = "Закрыть";
	  $('Loginbutton').onclick = function () { NoShow_Aut_Form(); return false; };
  	  ptype_change();
	  after_Login();
	  setTimeout(function () { NoShow_Aut_Form(); }, 800);
    } else {
      $('authForm').reset();
      $('login').focus();
    }
  }
  ajax.Send();
  delete ajax;
}

function after_Login() {
    if ($('bookmarks')) update_bookmarks(2); else {set_markers(2);  }
	  $('chPanel').innerHTML = '<img src="' + domain + 'img/markers/mrktpoff.png" id="mrktp" onclick="javascript: set_markers(1)" title="Установить маркер телепрограммы" /><img src="' + domain + 'img/markers/mrkbmon.png" id="mrkbm" onclick="javascript: set_markers(2)" title="Установить маркер закладок" /><img src="' + domain + 'img/markers/mrkoff.png" id="mrknone" onclick="javascript: set_markers(3)" title="Снять маркеры" />';
      if ($('ContentBodyBM')) {
		load_bookmarks_page(domain + 'bookmarks/bookmarks_load.php');
      }
	  $('menuAuth').innerHTML = '<li class=""><a href="javascript: void(0);" title="Настройки" onclick="javascript: return  import_settings(1);" class="account"></a></li><li class="b"><a href="' + domain + 'bookmarks/"  title="Мои закладки" onclick="" class="bookmarks"></a></li><li class="b"><a href="javascript: void(0);"  title="Закрыть учетную запись" onclick="javascript: return logout();" class="exit"></a></li>';
	  if ($('Update_BKM_button')) $show('Update_BKM_button');
}

//</login>

//<restoration>

function import_rest_form(page) {

  ajax = new myajax();

  var ap_url = 'd=' + new Date().getTime();
  page  = 'page=' + page;

  ajax.createRequest();
  var url = domain + 'restoration/restform.php';
  ajax.setParam_of_Send(ap_url, page);
  ajax.setParam('POST', url, true);
  ajax.CurrentAction = function() {
    updateLiveInternetCounter();
    var data = this.request.responseText;
    $('Settings').innerHTML = data;
    Button_blue($('Restbutton'));
	Show_Rest_Form();
  }
  ajax.Send();
  delete ajax;
  
}

function use_restoration($action) {
  if (checkRestForm() == true) {
    ajax = new myajax();
	ajax.createRequest();
    ajax.getVars_of_Form('restForm');
    $url = domain + 'restoration/' + $action;
    ajax.setParam('POST', $url, true);
    ajax.CurrentAction = function () {
      updateLiveInternetCounter();
      var data = this.request.responseText;
      $show('Rest_errorsDiv');
      $('Rest_error').innerHTML = data;
      if ($('restonecomplit')) {
        $('Restbutton').value = "Шаг 2";
        $('Restbutton').onclick = function () { import_rest_form(2); return false; };
        setTimeout(function () { import_rest_form(2); }, 800);
      } else
      if ($('resttwocomplit')) {
        $('Restbutton').value = "Закрыть";
        $('Restbutton').onclick = function () { NoShow_Rest_Form(); return false; };
      } else update_captcha($('Rest_xep_code'));
	}
	ajax.Send();
    delete ajax;
  }
}

function checkRestForm() {
    var error = new Array();
    var focused = false;

	if ($('Rest_email')) {
      if ($('Rest_email').value == '') {
     	error[error.length] = '<td valign="top">Вы не указали <b>e-mail</b></td></tr>';
    	if (!focused) focused = $('Rest_email');
      }
	}
    if ($('Rest_login')) {
      if ($('Rest_login').value == '') {
        error[error.length] = '<td valign="top">Вы не указали <b>логин</b></b></td></tr>';
        if (!focused) focused = $('Rest_login');
      }
    }
    if ($('Rest_nick')) {
      if ($('Rest_nick').value == '') {
        error[error.length] = '<td valign="top">Вы не указали <b>ник</b></td></tr>';
        if (!focused) focused = $('Rest_nick');
      }
    }
    if ($('Rest_name')) {
      if ($('Rest_name').value == '') {
        error[error.length] = '<td valign="top">Вы не указали <b>имя</b></td></tr>';
        if (!focused) focused = $('Rest_name');
      }
    }
    if ($('Rest_question')) {
      if ($('Rest_question').value == '') {
        error[error.length] = '<td valign="top">Вы не ответили на <b>вопрос</b></td></tr>';
        if (!focused) focused = $('Rest_question');
      }
    }
    if ($('Rest_code')) {
      if ($('Rest_code').value == '') {
        error[error.length] = '<td valign="top">Вы не указали <b>защитный код</b></td></tr>';
        if (!focused) focused = $('Rest_code');
      }
    }


    if (focused) focused.focus();

    if (error != '') {
        error_out = error[0];
		for (i=1; i<error.length; i++) {
          error_out += '<tr><td>&nbsp;</td>' + error[i];
		}
        $show('Rest_errorsDiv');
        $('Rest_error').innerHTML = '<table><tbody><tr><td valign="top" width="150">&nbsp;Ошибки отправки формы:</td>' + error_out + '</tbody></table>';

        update_captcha($('Rest_xep_code'));

        error = '';
        return false;
    }

    return true;

}

//</restoration>

var $inbk = 'none';
//<logout>
function logout() {
  ajax = new myajax();
  var ap_url = 'd=' + new Date().getTime();
  ajax.createRequest();
  var url = domain + 'login/logout.php';
  ajax.setParam_of_Send(ap_url);
  ajax.setParam('GET', url, true);
  ajax.CurrentAction = function () {
    $('menuAuth').innerHTML = '<li class=""><a href="javascript: void(0);" onclick="javascript: return Show_Aut_Form()">Авторизация</a></li>';
    window.location.reload();
  }
  ajax.Send();
  delete ajax;
}
//<//logout>

//<ptype>
function ptype_change() {

  if ($('pcbox')) {

    param_string = $('ChannelsBody').getElementsByTagName('input').item(0).value;

    ajax = new myajax();
    ajax.createRequest();
    var url = domain + 'ptypechange.php';
    var ap_url = 'd=' + new Date().getTime();
    ajax.setParam_of_Send(param_string, ap_url);
    ajax.setParam('GET', url, true);
	ajax.CurrentAction = function () {

      updateLiveInternetCounter();

      var data = this.request.responseText;
      $('pcbox').innerHTML=data;
      Playbutton(); Stopbutton(); Vidbutton(); Listbutton(); Onwardbutton(); Backbutton(); SmOnwardbutton(); SmBackbutton(); Add_BKM_button(); Update_BKM_button();
      if ($('Add_BKM_button')) {
	  	if ($('inbk')) {
		  $('Add_BKM_button').style.display = $('inbk').value;
	  	}
	  }
      if ($('pcbox_ptype')) {
		$ptype = $('pcbox_ptype').value;
      } else $ptype = 1;
      if ($ptype == 1) pcbox_height = 54; else pcbox_height = 86;
	  $('Content').style.height =  $('Content_body').clientHeight + pcbox_height + 'px';
	  get_chist_height();
    }
  ajax.Send();
  delete ajax;
  }

  return false;
}
//<//ptype>

//<channels list>
function load_Channel(param_string) {

  var ap_url = 'd=' + new Date().getTime();
  if ($('SwithChannel')) {

    swith.add_Channel();

	playstop();
	
    ajax = new myajax();
    ajax.createRequest();
    var url = domain + 'aj_translation.php';
    ajax.setParam_of_Send(param_string, ap_url);
    ajax.setParam('GET', url, true);

    ajax.CurrentAction = function () {
      updateLiveInternetCounter();
      var data = new String();
	  data = this.request.responseText;
	  dataArray = data.split('<split>');
      $('SwithChannelName').innerHTML = dataArray[0];
      $('Player').innerHTML = dataArray[1];
      $('channel_logo').src = domain + 'img/channels/logos/' + dataArray[2];
      $('channel_name').innerHTML = dataArray[3] + ' - онлайн трансляция';
      $('cn-1').innerHTML = dataArray[3];
      $('cn-2').innerHTML = dataArray[3];
      document.title = dataArray[3] + ' онлайн трансляция на MY-TVset.ru';
      if ($('Add_BKM_button')) {
      	$('Add_BKM_button').style.display = dataArray[4];
		$inbk = dataArray[4];
	  }
      if (!$('bookmarks') && !$('DIV_NNN_5631')) {
	     $('Telecasts').innerHTML = '<div class="header"><b>Загрузка телепрограммы</b></div><div id="bodyTelecasts" class="body"></div>';
        load_Telecasts(param_string);
 	  } else if ($('DIV_NNN_5631')) update_News();
      
      show_Button('back');
    }

    ajax.Send();
    delete ajax;
    
    return false;
  }
}

function load_Telecasts(param_string) {

  if ($('bodyTelecasts')) $('bodyTelecasts').innerHTML = indicator(120);

  setTimeout(function () {

	ajax = new myajax();
    ajax.createRequest();
    ajax.setParam_of_Send(param_string);
    var url = domain + 'telecasts/aj_telecasts.php';
    ajax.setParam('GET', url, true);

    ajax.CurrentAction = function () {
     updateLiveInternetCounter();
      var data = this.request.responseText;
      if (typeof telecasts == 'undefined') {
        telecasts = document.createElement('div');
	  }
      telecasts.innerHTML = data;
      if (!$('bookmarks') && !$('DIV_NNN_5631')) {
	    $('Telecasts').innerHTML = data;
      }
    }
    
    ajax.Send();
    delete ajax;
    
  }, 1500);
}

var swith = new Object();

swith.channellist = new Array();
swith.currentchannel = 0;
swith.toserver = true;

swith.add_Channel = function () {
  if ($('SwithChannel')) {
    if (swith.toserver == true) { 
      swith.currentchannel = swith.channellist.length; 
      var line = new Array();
      line['SwithChannelName'] = $('SwithChannelName').innerHTML;
      line['Player'] = $('Player').innerHTML;
      line['channel_logo'] =  $('channel_logo').src;
      line['channel_name'] = $('channel_name').innerHTML;
      
	  if (typeof telecasts != 'undefined') {
        line['Telecasts'] = telecasts.innerHTML;
	  } else {
        line['Telecasts'] = false;
	  }


      if ($annons) {
        line['annons'] = $annons;
        $annons = false;
      } else {
		line['annons'] = false;
      }

      swith.channellist.push(line);
      show_Button('back');

    }
    hide_Button('onwar');
    swith.toserver = true;
  }
}

function show_Button(button) {
  if (button == 'back') {
    if ($('Backbutton')) $show('Backbutton');
    if ($('SmBackbutton')) $show('SmBackbutton');
  }
  if (button == 'onwar')
  {
    if ($('Onwardbutton')) $show('Onwardbutton');
    if ($('SmOnwardbutton')) $show('SmOnwardbutton');
  }
}

function hide_Button(button) {
  if (button == 'back') {
    if ($('Backbutton')) $hide('Backbutton');
    if ($('SmBackbutton')) $hide('SmBackbutton');
  }
  if (button == 'onwar')
  {
    if ($('Onwardbutton')) $hide('Onwardbutton');
    if ($('SmOnwardbutton')) $hide('SmOnwardbutton');
  }
}

swith.list_Channels = function (direction) {
  count = swith.channellist.length;
  if (direction == 0) {
	if (swith.currentchannel < count-1) {
      swith.currentchannel+=1;
      show_Button('back');
	  if (swith.currentchannel == count-1) hide_Button('onwar');
	} else {
      hide_Button('onwar');
	}

  } else {
    if (swith.toserver == true) swith.add_Channel();
    if (swith.currentchannel > 0) {
      swith.currentchannel-=1;
      show_Button('onwar');
      if (swith.currentchannel == 0) hide_Button('back');
	} else {
	  hide_Button('back');
	}
  }
  $('SwithChannelName').innerHTML = swith.channellist[swith.currentchannel]['SwithChannelName'];
  $('Player').innerHTML = swith.channellist[swith.currentchannel]['Player'];
  $('channel_logo').src = swith.channellist[swith.currentchannel]['channel_logo'];
  $('channel_name').innerHTML = swith.channellist[swith.currentchannel]['channel_name'];
  if (!$('bookmarks')) {
    $('Telecasts').innerHTML = swith.channellist[swith.currentchannel]['Telecasts'];
    $('Listaction').innerHTML = 'Перейти к закладкам - ';
    $('Listbutton').title = 'Перейти к закладкам';
    action = 0;
  }
  $annons = swith.channellist[swith.currentchannel]['annons'];
  if (typeof telecasts != 'undefined') telecasts.innerHTML = swith.channellist[swith.currentchannel]['Telecasts'];
  swith.toserver = false;
  playstop();

}

function playstop() {
  if ($('Stopbutton')) {
    $('Stopbutton').className='sbout';
    $show('Stopbutton');
    $('Playbutton').className = 'pauseout';
    play = 1;
  }
}

//</channels list>

function GetLink(obj) {
    param_string = $('ChannelsBody').getElementsByTagName('input').item(0).value;
  obj.href = domain + "search.php?" + param_string;
}

//<form style>
function Button_blue() {
  var IE='\v'=='v';
  if(!IE) { 
    for (var i = 0; i < arguments.length; i++) {
      b = arguments[i];
      if (b) {
        b.onmouseover = function () { b.parentNode.className = 'buttonover'; return false};
        b.onmouseout = function () { b.parentNode.className= 'buttonout'; b.style.padding = '3px 1px 4px 1px';     return false};
        b.onmousedown = function () { b.style.padding = '4px 0px 4px 2px'; return false };
        b.onmouseup = function () { b.style.padding = '3px 1px 4px 1px'; return false};
      }
    }
  }



}


//</form style>
