/*Mobil javascript*/
//common
function byId(cid){
   return document.getElementById(cid);
}

//live page interaction for order / city 
function goAndTake(isFirst){
   cKota = byId('kota').value;
   cfor=byId('for2').value;
   if (cfor.indexOf('~~sp~~') > -1) cfor=cfor.split('~~sp~~')[ (byId('for1').value=='series' ? 1 : 0) ];
   cfor=cfor.toLowerCase(cfor).replace(' ','_');
   
   bs=byId('all').value;
   abs=bs.split('/'); 
   bbs=abs[abs.length-1];
   bs=bs.replace(bbs,'');
   if (cKota == 'allcity'){
      url = bs+(cfor ? cfor : 'index_0')+'.html';
   } else {
      url = bs+(cfor ? cfor+'_' : 'mobil_')+cKota.toLowerCase()+'.html';
   }
   if (url) document.location.href=url;
}
function kotaChange(activbox){
   for (iBox=0; iBox < kotaCount; iBox++){
      ckota='kota_' + iBox.toString();
      lbl = 'label_' + iBox.toString();
      if (ckota){
         if (activbox == ckota){
            k = byId(ckota);
            k.checked=true;
            l = byId(lbl);
            byId('kota').value=l.innerHTML;
         } else {
            byId(ckota).checked=false;
         }
      }
   }
   if (activbox != 'allcity'){
      byId('allcity').checked=false;
   } else {
      byId('kota').value='allcity';
      byId('allcity').checked=true;
   }
}

function adjustFooter() {
      if (navigator.appName=='Opera'){
         leftH = 1077;
      } else {
         leftH = 1080;
      }
      rightH = document.getElementById('maincontent').offsetHeight;
      
      if (leftH != rightH){
          if (leftH > rightH){
             oSt = document.getElementById('box4-s1x');
             sisa = ((leftH - rightH) + 2);
             newH = (oSt.offsetHeight +  sisa );
             document.getElementById('box4-s1x').style.height=newH + 'px';
          }
      }
      document.getElementById('leftcontent').style.height=leftH + 'px';
}
