/*
function InitLeftMenu(menu_ind, level) {
   var menu = new COOLjsMenu("MainMenu", MENU_ITEMS, level)
   if (menu_ind) var submenu = new COOLjsMenu("MainMenu2", menu_ind, level)
   
   menu.initTop();
   if (menu_ind) submenu.initTop();

   menu.init();
   menu.show();

   if (menu_ind) {
      submenu.init();
      submenu.show();
   }
}
*/

function DetectBrowserType () {
   var ua = navigator.user_agent; 
   var appver = navigator.appVersion;

   var ispda = (appver.indexOf("Windows CE") > -1 || appver.indexOf("PPC") > -1);

   if (ispda) {
      window.location = 'pda/index.htm';
   } else {
      //alert ('AppVer = ' + appver + ', ua = ' + ua);
   }
}



function InitHorMenu(menu_ind, level) {
   var menu = new COOLjsMenu("MainMenuHor", MENU_ITEMS_HOR, level)
   
   menu.initTop();
   menu.init();
   menu.show();
}



function DrawHorMenuBar (is_top, top_off, bot_off) {
   document.write('<TABLE border="0" cellSpacing="0" cellPadding="0" width="100%">');
   if (top_off > 0) {
      document.write('<tr><td><img src="memu/b.gif" width="4" height="' + top_off + '"></td></tr>');
   }
   if (is_top) {
      document.write('<tr><td class="clsHorTopBar"></td></tr>');
   } else {
      document.write('<tr><td class="clsHorBotBar"></td></tr>');
   }
   if (bot_off > 0) {
      document.write('<tr><td><img src="memu/b.gif" width="4" height="' + bot_off + '"></td></tr>');
   }
   document.write('</TABLE>');
}



function DrawPageLeftPart(gr_path, draw_submenu) {
   document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">');


   //**************************************************************************
   //*** Первая часть страницы (Logo AnyNotes)
   //**************************************************************************

   document.write('  <tr>');

   document.write('  <td class="clsLeftMenu">');
   document.write('  </td>');

   document.write('  <td class="clsMainTable" valign="top">');

   document.write('  <div align="center"><center>');
   document.write('  <table border="0" width="90%">');
   document.write('      <tr><td><img src="memu/b.gif" width="4" height="5"></td></tr>');
   document.write('      <tr>');
   document.write('          <td valign="center"><img src="main_gr/an-title.gif" width="152" height="38"></td>');
   document.write('          <td valign="center" align="right"><font color="#B48768" face="Arial">Powerful notes organizer</font></td>');
   document.write('      </tr>');
   document.write('  </table>');
   document.write('  </center></div>');

   document.write('  </td>');

   document.write('  <td class="clsRightBorder">&nbsp;</td>');
   document.write('  </tr>');



   //**************************************************************************
   //*** Вторая часть страницы (horizontal menu)
   //**************************************************************************

   document.write('  <tr>');
   document.write('  <td class="clsLeftMenu"></td>');

   document.write('  <td class="clsHorMenu" valign="top">');

   DrawHorMenuBar (true, 20, 0);

   document.write('<div align="center"><center>');
   document.write('<TABLE border="0" cellSpacing="0" cellPadding="0" width="90%"><TR><td>');
   InitHorMenu();
   document.write('</td></TR></TABLE>');
   document.write('</center></div>');

   DrawHorMenuBar (false, 0, 20);

   DrawHorSpace(750);

   document.write('  </td>');

   document.write('  <td class="clsRightBorder"></td>');
   document.write('  </tr>');




   //**************************************************************************
   //*** Третья часть страницы (основной контент)
   //**************************************************************************

   document.write('  <tr>');

   document.write('  <td class="clsLeftMenu">');


   //--- Создаем упор для меню, чтобы при сжатии страницы текст не заезжал на боковые кнопки
   //document.write('    <TABLE border="0" cellSpacing="0" cellPadding="0" width="160"><TBODY>');
   //document.write('      <TR><td></td></TR>');
   //document.write('    </TBODY></TABLE>');
  

   document.write('  </td>');

   document.write('  <td class="clsMainTable" valign="top">');

}


function DrawPageRightPart() {
   document.write('  </td>');
   document.write('  <td class="clsRightBorder"></td>');
   document.write('  </tr>');


   //**************************************************************************
   //*** Нижняя часть страницы (TaurSoft Logo)
   //**************************************************************************

   document.write('  <tr>');
   document.write('  <td class="clsLeftMenu"></td>');

   document.write('  <td class="clsHorMenu" valign="top">');

   DrawHorMenuBar (true, 40, 10);


   document.write('  <div align="center"><center> ');
   document.write('  <table border="0" cellSpacing="1" cellPadding="3" width="90%">');
   document.write('      <tr>');
   document.write('         <td><img src="memu/b.gif" width="2" height="10"></td>');
   document.write('      </tr>');
   document.write('      <tr>');
   document.write('         <td align="center" valign="top"><img src="main_gr/taur1.gif" width="154" height="39"></td>');
   document.write('      </tr>');
   document.write('      <tr>');
   document.write('         <td align="center" valign="top"><font size="2" face="Arial">Copyright © 2000-2009 TaurSoft</font></td>');
   document.write('      </tr>');
   document.write('      <tr>');
   document.write('         <td><img src="memu/b.gif" width="2" height="10"></td>');
   document.write('      </tr>');
   document.write('  </table>');
   document.write('  </center></div>');


   document.write('  </td>');

   document.write('  <td class="clsRightBorder"></td>');
   document.write('  </tr>');


   document.write('</table>');

}


function DrawStart() {
   DrawPageLeftPart('main_gr', false);

   //--- Задаем левый отступ для текста страницы
   document.write('<TABLE border="0" cellSpacing="0" cellPadding="0" width="100%"><TR>');
   document.write('<td><img src="memu/b.gif" width="12" height="1"></td>');
   document.write('<td valign="top">');

}


function DrawEnd(level) {
   //--- Задаем правый отступ для текста страницы
   document.write('</td>');
   document.write('<td><img src="memu/b.gif" width="12" height="1"></td>');
   document.write('</TR></TABLE>');

   DrawPageRightPart();
}



function DrawBar0() {
   document.write('<TABLE border="0" cellSpacing="0" cellPadding="0" width="98%"><TR>');
   document.write('<td class="clsBar0Left"></td>');
   document.write('<td class="clsBar0Mid">&nbsp;</td>');
   document.write('<td class="clsBar0Right"></td>');
   document.write('</TR></TABLE>');
}

function DrawBar0Per(iPercent) {
   document.write('<TABLE border="0" cellSpacing="0" cellPadding="0" width="' + iPercent + '%"><TR>');
   document.write('<td class="clsBar0Left"></td>');
   document.write('<td class="clsBar0Mid">&nbsp;</td>');
   document.write('<td class="clsBar0Right"></td>');
   document.write('</TR></TABLE>');
}

function DrawBar0H(th, bh) {
   document.write('<TABLE border="0" cellSpacing="0" cellPadding="0" width="98%">');
   document.write('<TR><td height="' + th + '"></td><td></td><td></td></TR>');
   document.write('<TR>');
   document.write('<td class="clsBar0HLeft"></td>');
   document.write('<td class="clsBar0HMid">&nbsp;</td>');
   document.write('<td class="clsBar0HRight"></td>');
   document.write('</TR>');
   document.write('<TR><td height="' + bh + '"></td><td></td><td></td></TR>');
   document.write('</TABLE>');
}


function DrawBarDots() {
   document.write('<TABLE border="0" cellSpacing="0" cellPadding="0" width="98%"><TR>');
   document.write('<td class="clsBarDotsLeft"></td>');
   document.write('<td class="clsBarDotsMid">&nbsp;</td>');
   document.write('<td class="clsBarDotsRight"></td>');
   document.write('</TR></TABLE>');
}




function DrawVertSpace(iSpace) {
   document.write('<table border="0" cellpadding="0">');
   document.write('    <tr>');
   document.write('        <td><img src="memu/b.gif" width="2" height="' + iSpace + '"></td>');
   document.write('    </tr>');
   document.write('</table>');
}

function DrawHorSpace(iSpace) {
   document.write('<table border="0" cellpadding="0">');
   document.write('    <tr>');
   document.write('        <td><img src="memu/b.gif" width="' + iSpace + '" height="1"></td>');
   document.write('    </tr>');
   document.write('</table>');

   //document.write('<p><img src="memu/b.gif" width="4" height="' + iSpace + '"></p>');
}



/*
function aaa() {
   alert(document.body.clientHeight);
}
*/


