function admin_focus(i,ii){
   var theForm1 = document.getElementById(i);
   var theForm2 = document.getElementById(ii);
   if(theForm1.value){
      theForm2.focus();
   }else{
      theForm1.focus();
   }
}

function admin_menu(total,open){
   for(i=1;i<=total;i++){
      document.getElementById('menu_head_'+i).style.display = 'none';
      document.getElementById('menu_name_'+i).className = 'tbl_1 tbl_2 menu_1 cursor_1 menu_4';
   }
   document.getElementById('menu_head_'+open).style.display = 'block';
   document.getElementById('menu_name_'+open).className = 'tbl_1 tbl_2 menu_1 cursor_1 menu_1';
}

function hideproduct(i){
   document.getElementById('desc1').style.display = 'none';
   document.getElementById('desc2').style.display = 'none';
   document.getElementById('desc3').style.display = 'none';
   document.getElementById('desc'+i).style.display = 'block';
   document.getElementById('menu1').className = 'prod_desc_1';
   document.getElementById('menu2').className = 'prod_desc_1';
   document.getElementById('menu3').className = 'prod_desc_1';
   document.getElementById('menu'+i).className = 'prod_desc_2';
}

function prod_thumb(i,ii){
   if(ii=="1"){
      document.getElementById('theimgdiv').style.display = 'block';
      document.getElementById('theimg').src = '/pic/stuff/'+i;
   }else{
      document.getElementById('theimgdiv').style.display = 'none';
   }
}

function BlinkTxt() {
   if(document.getElementById && document.all){
      obj = document.getElementsByTagName("blink");
      for(var i=0; i<obj.length; i++)
         if(obj[i].style.visibility=="hidden") {
            obj[i].style.visibility="visible";
         }else{
            obj[i].style.visibility="hidden";
         }
      setTimeout('BlinkTxt()',750);
   }
}

function SubmitForm(i){
   document.getElementById(i).submit();
}

function ChangePass(){
   var theform = document.getElementById('password');
   if(theform.disabled==true){
      document.getElementById('password').disabled = false;
      document.getElementById('link').style.display = "none";
      document.getElementById('form').style.display = "block";
   }else{
      document.getElementById('password').disabled = true;
      document.getElementById('link').style.display = "block";
      document.getElementById('form').style.display = "none";
   }
}

function ChangeBirth(){
   var theformtgl = document.getElementById('tgl');
   var theformbln = document.getElementById('bln');
   var theformthn = document.getElementById('thn');
   if(theformtgl.disabled==true){
      document.getElementById('tgl').disabled = false;
      document.getElementById('bln').disabled = false;
      document.getElementById('thn').disabled = false;
      document.getElementById('linkbirth').style.display = "none";
      document.getElementById('formbirth').style.display = "block";
   }else{
      document.getElementById('tgl').disabled = true;
      document.getElementById('bln').disabled = true;
      document.getElementById('thn').disabled = true;
      document.getElementById('linkbirth').style.display = "block";
      document.getElementById('formbirth').style.display = "none";
   }
}

function mustLogin(){
   alert("Maaf anda harus memiliki GeoAccount untuk meng-akses halaman ini.");
   location.href='/member/signup.html';
}

function goToForumForm(i){
   location.href=i;
}

function pss_avatar2form(i,ii){
   var theVal = document.getElementById(i);
   theVal.value = theVal.value+ii;
   theVal.focus();
}

function pss_bbcode2form(i,ii,iii){
   var theVal = document.getElementById(i);
   var thePrompt = prompt("Type "+ii+" text","");
   var theBBcode = "["+iii+"]"+thePrompt+"[/"+iii+"]";
   if(thePrompt){
      theVal.value = theVal.value+theBBcode;
   }
   theVal.focus();
}

function pss_img_slider1(){
   var tinggi = document.getElementById('img_cont').offsetHeight;
   var top_now = document.getElementById('img_cont').style.marginTop;
   var theKali = document.getElementById('block_stuff_now').value;
   var theKalix = document.getElementById('block_stuff_las').value;
   var theKaliy = document.getElementById('block_stuff_nol').value;

   if(parseFloat(top_now)==parseFloat(75)-parseFloat(75)*theKaliy || theKali==theKalix){
      stopInterval1 = clearInterval(stopInterval1);
      if(theKali==theKalix){
      }else{
         document.getElementById('block_stuff_now').value = parseFloat(theKali)+1;
         document.getElementById('block_stuff_nol').value = parseFloat(theKaliy)-1;
         document.getElementById('img_cont').style.marginTop = parseFloat(top_now)+1;
      }
   }else{
      document.getElementById('img_cont').style.marginTop = parseFloat(top_now)+1;
      document.getElementById('nowsss').innerHTML = (parseFloat(top_now)+" == "+parseFloat(75)*0);
   }
}

function pss_img_slider_run1(){
   stopInterval1 = setInterval('pss_img_slider1()',1);
}

function pss_img_slider2(){
   var tinggi = document.getElementById('img_cont').offsetHeight;
   var top_now = document.getElementById('img_cont').style.marginTop;
   var theKali = document.getElementById('block_stuff_now').value;
   var theKaliy = document.getElementById('block_stuff_nol').value;

   if(parseFloat(top_now)==-parseFloat(tinggi-(75*theKali)) || theKali=="0"){
      stopInterval2 = clearInterval(stopInterval2);
      if(theKali=="0"){
      }else{
         document.getElementById('block_stuff_now').value = theKali-1;
         document.getElementById('block_stuff_nol').value = parseFloat(theKaliy)+1;
      }
   }else{
      document.getElementById('img_cont').style.marginTop = parseFloat(top_now)-1;
      document.getElementById('nowsss').innerHTML = (parseFloat(top_now)+" == "+(-parseFloat(tinggi-(75*theKali))));
   }
}

function pss_img_slider_run2(){
   stopInterval2 = setInterval('pss_img_slider2()',1);
}

function pss_show_hide(i,ii){
   var theDiv = document.getElementById(ii);
   if(i=="2"){
      theDiv.style.display = "block";
   }else{
      theDiv.style.display = "none";
   }
}
