var opera=0;
if (navigator.userAgent.indexOf("Opera")!=-1) opera=1;

//bodystyle.css+
var fnorm=10;
var fsmall=Math.round(fnorm*0.70);
var fbig=Math.round(fnorm*1.25);

//MATH
function min(a,b){return ((a<b)?a:b);}
function max(a,b){return ((a>b)?a:b);}

//IO:
function documentwriteln(str) {document.writeln(str);}
function documentwrite(str) {document.write(str);}

function corr_width() {return max(document.body.clientWidth,800);}
function corr_height() {return max(document.body.clientHeight,600);}

document.writeln('<STYLE>');
document.writeln('<!--');
document.writeln('BODY {margin:15px;');
document.writeln('background-color:rgb(234,244,253);');
document.writeln('color:#000000;');
document.writeln('font-family:"Arial";');
document.writeln('font-size:'+fnorm+'pt;');
document.writeln('font-style:normal;');
document.writeln('font-weight:normal;');
document.writeln('line-height:150%;');
document.writeln('padding-right:40px;');
document.writeln('}');
document.writeln('TABLE {font-size:10pt;line-height:150%;}');
document.writeln('.ital {font-style:italic;}');
document.writeln('.norm {font-size:'+fnorm+'pt;font-style:normal;font-weight:normal;font-family:"Arial"}');
document.writeln('.big {font-size:'+fbig+'pt;font-family:"Arial";font-style:normal;font-weight:bold;}');
document.writeln('.small {font-size:'+fsmall+'pt;}');
document.writeln('.wing {font-style:normal;font-family:Wingdings;text-align:right;}');
document.writeln('.bold {font-style:normal;font-weight:bold;font-family:"Arial";}');
document.writeln('.symb {font-style:normal;font-family:Symbol;}');
document.writeln('.up {font-size:60%;font-style:normal;position:relative;top:-5px;}');
document.writeln('.down {font-size:60%;font-style:normal;position:relative;top:2px;}');
document.writeln('-->');
document.writeln('</STYLE>');
var mode=0;
var kv="'";

//Превращает "xxx.gif" в "images/xxx.gif"
//Превращает "xxx.jpg" в "images/xxx.jpg"

function full(sss)
 {var ttt=sss.lastIndexOf("/");
  if (ttt<=0) return "images/"+sss;
   else return "images/"+sss.substring(ttt+1,sss.length);
  }

function min(a,b){return ((a<b)?a:b);}
function max(a,b){return ((a>b)?a:b);}

function documentwriteln(str) {document.writeln(str);if (mode) {jg=confirm(str);if (!jg) mode=0;};}
function documentwrite(str) {document.write(str);if (mode) {jg=confirm(str);if (!jg) mode=0;};}

//Фон и тд
var fonlight=full("fon3_light.jpg");var fondark=full("fon3_dark.jpg");
var textdark="rgb(0,0,0)";var textlight="#ffffff";
var allfont='font-family:"Times New Roman" ; font-size:13pt; font-style:normal;';

// Создает три класса class+class_name+"_up/_down_/cdown",
// которые при наведении на них меняют color, а затем при нажатии меняют background-image и border 
// Пример класса : "Y5"

//SAFE
function put_style_border_button(class_name,width,height,clup,bgimup,cldown,bgimdown)
 {var st="border-top:double 0px "+textdark+"; border-right:double 2px "+textdark+"; border-left:double 0px "+textdark+";"
     +allfont+"padding-top:7px;padding-bottom:3px;padding-left:3px;padding-right:3px;line-height:90%; text-align:center; position:relative;visibility:inherit;"
     +"height:"+height+"; cursor:hand;letter-spacing:0pt; font-weight:bold;margin-top:0;";
 //Темный фон-темный цвет ->  Темный фон-светный цвет -> Светлый фон-темный цвет
  var st_up="border-bottom:double 2px "+textdark+";background:url('"+full(bgimup)+"');color:"+clup+";";
  var st_down="border-bottom:double 2px "+textdark+";background:url('"+full(bgimup)+"');color:"+cldown+";";
  var st_cdown="border-bottom:solid 1px;background:url('"+full(bgimdown)+"');color:"+clup+";";
  documentwriteln(".class"+class_name+"_up {"+st+st_up+"}");
  documentwriteln(".class"+class_name+"_down {"+st+st_down+"}");
  documentwriteln(".class"+class_name+"_cdown {"+st+st_cdown+"}");
  }

// Создает три класса class+class_name+"_up/_down_/cdown",
// которые при наведении на них меняют color и background-image, 
//  а при нажатии меняют color,background-image, line-height и text-indent;
// Пример класса : "X"

//SAFE
function put_style_image_button(class_name,width,height,clup,imageup,cldown,imagedown,clcdown,imagecdown,sz1,sz2,sz3,alg)
 {var st="border-style:none;"+allfont+"position:relative;visibility:inherit;width:"+width+";height:"+height+";cursor:hand;line-height:50%;padding-right:12px;letter-spacing:-1pt;font-weight:normal;v-aling:middle;";
  var g1=12;var g2=12;var g3=10;
  if (arguments.length>9) {g1=sz1;g2=sz2;g3=sz3;};
  var g4='right';
  if (arguments.length>12) {g4=((alg=='l')?'left':((alg=='r')?'right':'center'));};
  var st_up="color:"+clup+";background:url('"+full(imageup)+"') no-repeat;padding-top:"+g1+"px;text-indent:1px;text-align:"+g4+";";
  var st_down="color:"+cldown+";background:url('"+full(imagedown)+"') no-repeat;padding-top:"+g2+"px;text-indent:1px;text-align:"+g4+";";
  var st_cdown="color:"+clcdown+";background:url('"+full(imagecdown)+"') no-repeat;padding-top:"+g3+"px;text-indent:5px;text-align:"+g4+";";
  documentwriteln(".class"+class_name+"_up {"+st+st_up+"}");
  documentwriteln(".class"+class_name+"_down {"+st+st_down+"}");
  documentwriteln(".class"+class_name+"_cdown {"+st+st_cdown+"}");
 }

