function changeLanguage(lan)
{
  document.frm.method="POST";
  document.forms[0].action.value=3;
  document.forms[0].language.value = lan;

  if (document.forms[0].news_action)
    document.forms[0].news_action.value = 1;

  if (document.forms[0].seminar_action)
    document.forms[0].seminar_action.value = 1;

  document.forms[0].submit();

}
function goHome(){
	document.forms[0].id.value=0;
	document.forms[0].submit();
}
function registerMail(pageid){
  document.frm.method="POST";
  document.forms[0].id.value=pageid;
  document.forms[0].submit();
}

function navigate(pageid)
{
  document.frm.method="POST";
  document.frmnav.id.value=pageid;
  document.frmnav.submit();
/*
  //document.forms[0].language.value = lan;

  if ((pageid==19 || pageid==29) && document.forms[0].news_action)
    document.forms[0].news_action.value = 1;

  if (pageid==20 && document.forms[0].seminar_action)
    document.forms[0].seminar_action.value = 1;

  if (pageid==3)
  {
    if (document.forms[0].basket_action)
    {
      document.forms[0].basket_action.value=1;
    }

  }
  if (document.forms[0].book_action)
    document.forms[0].book_action.value=1;

  document.forms[0].submit();
*/
}

function addToBasket(bookid)
{
  document.frm.method="POST";
  document.forms[0].action.value=4;

  document.forms[0].page_booktobasket.value = bookid;

  document.forms[0].submit();

}
function showNews(id)
{
  document.frm.method="POST";
  document.forms[0].page_newsid.value=id;

  document.forms[0].id.value=15;

  document.forms[0].submit();

}
function quickSearch()
{
  document.frm.method="POST";
  /*if (document.forms[0].book_searchquick.value=='')
    return;*/

  if (document.forms[0].book_restoreSearch)
    document.forms[0].book_restoreSearch.value=0;

  if (document.forms[0].book_action)
    document.forms[0].book_action.value=1;
  
  if (document.forms[0].book_likeWord)
    document.forms[0].book_likeWord.value="";
  
  document.forms[0].id.value=10;
  document.forms[0].submit();

}

function showCatalogue(id){
  document.frm.method="POST";
  document.forms[0].catalog_parentid.value=id;
  document.forms[0].id.value=22;
  if (document.forms[0].book_action)
    document.forms[0].book_action.value=1;

  if (document.forms[0].book_returnFrom)
    document.forms[0].book_returnFrom.value = 0;

  if (document.forms[0].book_returnTo)
    document.forms[0].book_returnTo.value = 0;

  document.forms[0].submit();
}

function showBook(id){
  document.frm.method="GET";
  document.forms[0].page_bookid.value=id;
  document.forms[0].id.value=23;
  document.forms[0].submit();
}

function showPaging(from,total,maxperpage){

  if (total*1<=maxperpage*1)

  return;
  var i = 0;
  var pagefrom = 0
  do
  {
    i++;
    if (pagefrom+1==from)
      document.write(' &nbsp;<FONT style=background:#FFDDDD SIZE=2 COLOR=#C00000>&nbsp;<b>' + i + '</b>&nbsp;</FONT>&nbsp; ');
    else if (((from/maxperpage+6) > i && (from/maxperpage-5) < i)
         || (i <= 6)
         || (i + 5 > total/maxperpage))
      document.write(' &nbsp;<a class=\"submenu\" href=\"javascript:navPage('+ (pagefrom*1+1) +')\">'+i+'</a>&nbsp; ') ;
    else if (((from-1)/maxperpage+7) == i || ((from-1)/maxperpage-5) == i)
      document.write(' ... ') ;

    pagefrom=i*maxperpage;
  }
  while (pagefrom<total)
}
