//ok_showpopup("#ok_popup");
  //ok_page_change("ok_member_content"); ok_popup_title  ok_promo_title
  var page_type;
  var menu_type;
  var logined = false;
  
  function ok_showpopup(box , content ){
    page_type = page_type ? page_type : "ok_bonus_content";
    menu_type = menu_type ? menu_type : "sub_account";
    $("#ok_popup_bg").show();
      if(box){
        // console.log('box: '+ box + " page_type: " +page_type);
        $(box).slideDown('slow');
      }else{
        $("#ok_popup").slideDown('slow');
      }
    ok_page_change(page_type, menu_type);
    ok_check_login();
    // ok_popuptext($content);
    // setTimeout(function(){ok_hiddenpopup()}, 5000);
  }
  
  function ok_check_login(){
    // console.log('logined: '+ logined );
    if(logined == false){ //ok_popup_title  ok_promo_title
      // console.log('Didn\'t login');
    	$("#ok_promo_title").show();
      	$("#ok_popup_title").hide();
      	$("#ok_popup_phone_title").hide();
    	$("#ok_faq_bottom").hide();
    } else {
    	$("#ok_popup_title").show();
      	$("#ok_popup_phone_title").show();
      	$("#ok_promo_title").hide();
    	$("#ok_faq_bottom").show();
    }
  }
  
  function ok_info(status, email){
    ok_user_status = status;
    ok_user_email = email;
    ok_show_off();
  }
  /* id="checkout_email" */
  function ok_show_off(){
    if(ok_user_status == 'in'){
      $("text.sitebg").val(ok_user_email);
//       $("#checkout_email").prop("readonly", true);
    	// console.log( 'Login Info Email:  ' + ok_user_status + ' ' + ok_user_email) ;
    }
  }
  
  function ok_popuptext(content = null){
      if($content){
          $("#ok_popup_index").html($content);
      }
  }

  function ok_hiddenpopup(){
    // alert('ok_hiddenpopup');
    $(".ok_popup_bg").hide();
    $(".ok_popup").hide();
  }

  function ok_page_change(page, title){
     $(".ok_content").hide();
     $("#"+page_type).hide();
     //$("#ok_member_content" + page).show(); 
     $("#"+page).show();
    ok_menu_change(title);
    // console.log('page: '+ page + ' menu: ' + title);
    menu_type = title ? title : menu_type;
    page_type = page ? page : page_type;
  }
  // link_underline_w link_underline_o
  function ok_menu_change(menu){
    $(".link_underline_o").removeClass('link_underline_o').addClass('link_underline_w');
    //$("#"+menu).removeClass('link_underline_w').addClass('link_underline_o');
    $("#"+menu).toggleClass('link_underline_w link_underline_o')
    if((menu == "sub_account")||(menu == "sub_eam")||(menu == "sub_points")||(menu == "sub_history")||(menu == "sub_rewards"))
    {
    	$("#menu_account").show();
      	$("#account").removeClass('link_underline_w').addClass('link_underline_o');
    } else {$("#menu_account").hide();}
    if((menu == "sub_vouchers")||(menu == "sub_booking")){
    	$("#menu_record").show();
      	$("#record").removeClass('link_underline_w').addClass('link_underline_o');
    }else {$("#menu_record").hide();}
    if(menu == "sub_profile"){
      	$("#profile").removeClass('link_underline_w').addClass('link_underline_o');
    }else {}
    
  }

  function ok_confirm_redeem(id = null){
    if(id == 'all'){ // ok_confirm_button ok_confirm ok_confirm_redeem('all')
      ok_show('.ok_confirm_button');
      ok_hidden('.ok_confirm');
    }else{
      ok_show('#confirm' + id); // bnt'+av_codes.id 'confirm'+av_codes.id
      ok_hidden('#bnt' + id);
    }
  }
  
  function ok_show(so){
  	$(so).show();
  }
  
  function ok_hidden(hid){
  	$(hid).hide();
  }

  function ok_toggle(page){
    // console.log('toggle: '+ page );
  	$( "#" + page ).toggle();
  }
  
  function ok_login(){
  	logined = true;
  }
  
  function ok_logout(){
  	logined = false;
  }
  
  function ok_this_lan(){
  	return $(location).attr('pathname').slice(1,3); 
  }

 
