<!--
var now =1;
function log_msg(ap){
  var hello_str = "本活動為KKBOX會員專屬，請先註冊成為KKBOX會員後，登入您的帳號參加活動，謝謝！";
  alert(hello_str);
  if(ap=='home1'){
    window.location.href="/login_to.php?to=/event/20090909copyright/index.shtml";
  }else{

  }
}

//this page'css
function show_page(pageNum){
  for(i=1; i<=13; i++){
    div_show = '#page_'+i;
    page_show = '#p'+i;
    page_show2 = '#d'+i;
    if(i==pageNum){
      $(div_show).show();
      $(page_show).removeClass('line');
      $(page_show2).removeClass('line');
      $(page_show).addClass('line1');
      $(page_show2).addClass('line1');
      now=i;
    }else{
      $(div_show).hide();
      $(page_show).removeClass('line1');
      $(page_show2).removeClass('line1');
      $(page_show).addClass('line');
      $(page_show2).addClass('line');
    }
  }
}

//visit next page
function next(total){
  if(now<total){
    now++;
  }
  show_page(now);
}

//visit preceding page
function pre(){
  if(now>1){
    now--;
  }
  show_page(now);
}

//ajax connect
function ajax_connect(url, method, pars, show_out) {
  $.ajax({
  type: method,
  url: url,
  data: pars,
  success: function(data){
  $('#'+show_out).html(data);
  }
  });
}


//init load album info
function goNextPage(page, vote_id){
  var t = new Date();
  t = t.getTime();
  var pars = "t="+t+"&page="+page+"&vote_id="+vote_id;
  var show_out = "show_out";
  ajax_connect('ajax_content.php', 'post', pars, show_out);
}

//voteing 
function voting(vote_cnt, vote_id){
  btn = "#pic"+vote_id;
  //$(btn).attr('href','#');
  $(btn).attr('href','javascript:alert("每人6票， 同一作品只能投一票~");');
  
  var t = new Date();
  t = t.getTime();
  var voting_btn = "voting_"+vote_id;
  var pars = "t="+t+"&vote_cnt="+vote_cnt+"&vote_id="+vote_id;
  var show_out = "vote_cnt_"+vote_id;
  ajax_connect('vote.php', 'post', pars, show_out);//get data
  return ;
}


