function show_marks(type)
{
   var mark_first = document.getElementById('mark_first').value;
   var mark_cnt = document.getElementById('mark_cnt').value;
   var path = "/imgs/lowprice/brands/big/";
   if (type=='n')
   {
      mark_first = parseInt(mark_first)+1;
   }
   else if (type=='p')
   {
      mark_first = parseInt(mark_first) - 1;
   }
  // alert(mark_first);
   var i = 1;
   for(i=1; i<=9; i++)
   {
      var i1_src = document.getElementById('mark_'+(parseInt(mark_first)+i)).value;
      var i1_url = document.getElementById('mark_link_'+(parseInt(mark_first)+i)).value;
     // alert(' ' + i1_src + ' ' + i1_url);
      if (document.getElementById('mark_url_'+i))
      {
         document.getElementById('mark_src_'+i).src = path+i1_src+'.gif';
         document.getElementById('mark_url_'+i).href = i1_url;
      }
   }

   if (parseInt(mark_first)+9>=mark_cnt)
   {
      document.getElementById('mark_next').style.visibility = 'hidden';
   }
   else
   {
      document.getElementById('mark_next').style.visibility = 'visible';
   }
   if (mark_first==0)
   {
      document.getElementById('mark_prev').style.visibility = 'hidden';
   }
   else
   {
      document.getElementById('mark_prev').style.visibility = 'visible';
   }
   document.getElementById('mark_first').value = mark_first;
}



function resizeGroupBlock()
{
   var screen_w = document.body.offsetWidth;
   var w1 = 1024;
   var w2 = 1244;
   var w3 = 1440;
   allOfDivs = document.getElementsByTagName("DIV");
   //alert(document.body.offsetWidth);
   for (var i = 0; i < allOfDivs.length; i++)
   {
      var oObj = allOfDivs.item(i);
      if (oObj.className=="group_block dottedRight" || oObj.className=="group_block")
      {
         if (screen_w<w2)
         {
            if (oObj.id=="group_block4") oObj.style.display='none';
            if (oObj.id=="group_block4") oObj.style.display='none';
            if (oObj.id=="group_block3") oObj.className='group_block';
         }
         else if (screen_w>=w2)
         {
            if (oObj.id=="group_block4") oObj.style.display='block';
            if (oObj.id=="group_block5") oObj.style.display='none';
            if (oObj.id=="group_block3") oObj.className='group_block dottedRight';
            if (oObj.id=="group_block4") oObj.className='group_block';
         }
         else if (screen_w>w3)
         {
            if (oObj.id=="group_block4") oObj.style.display='block';
            if (oObj.id=="group_block5") oObj.style.display='block';
            if (oObj.id=="group_block3") oObj.className='group_block dottedRight';
            if (oObj.id=="group_block4") oObj.className='group_block dottedRight';
            if (oObj.id=="group_block5") oObj.className='group_block';
         }


      }

   }
}



/* листалка подарочных карт **/


var ua = navigator.userAgent.toLowerCase();
// Internet Explorer
isIE = (ua.indexOf("msie") != -1 && ua.indexOf("opera") == -1 && ua.indexOf("webtv") == -1);
if (isIE)
{
  var inline_d = 'inline';
}
else
{
  var inline_d = 'table-cell';
}

function show_list(type)
{
   var first = document.getElementById('list_first').value;
   var cnt = document.getElementById('list_cnt').value;

   //alert(first);
   if (type=='n')
   {
      document.getElementById('item_'+first).style.display='none';
      first = parseInt(first)+1;
      document.getElementById('item_'+(parseInt(first)+2)).style.display=inline_d;
   }
   else if (type=='p')
   {
      first = parseInt(first)-1;
      document.getElementById('item_'+first).style.display=inline_d;
      document.getElementById('item_'+(parseInt(first)+3)).style.display='none';
   }

   if (parseInt(first)+3>=cnt)
   {
      document.getElementById('list_next').style.visibility = 'hidden';
   }
   else
   {
      document.getElementById('list_next').style.visibility = 'visible';
   }
   if (first==0)
   {
      document.getElementById('list_prev').style.visibility = 'hidden';
   }
   else
   {
      document.getElementById('list_prev').style.visibility = 'visible';
   }
   document.getElementById('list_first').value = first;


   document.getElementById('item_2').className = 'right-b';
   document.getElementById('item_'+(parseInt(first)+1)).className = 'right-b';
   document.getElementById('item_'+(parseInt(first)+2)).className = 'no-b';

   //alert(first+'--item_'+(parseInt(first)+1)+'--item_'+(parseInt(first)+2));
}