﻿function account(){
var LOGIN=((document.cookie+';').match(/uid=([^;]+);/))?'?login='+RegExp.$1:'';
location.href='https://www.maniaxdvd.com/page/account/'+LOGIN; }

function set_cart(itm){
var cart=((document.cookie+';').match(/cart=([^;]+);/))?RegExp.$1:':';
var data=cart.split(':'); var ck="cart="+data[0]+itm+'.:'+data[1];
var exp=new Date();exp.setTime(exp.getTime()+(48000*60*60));
document.cookie=ck+';expires='+exp.toGMTString()+';path=/;domain=.maniaxfilm.com;';
alert('カートに入れました'); }

function set_combo(itm){
var cart=((document.cookie+';').match(/cart=([^;]+);/))?RegExp.$1:':';
var data=cart.split(':'); ck='cart='+data[0]+':'+data[1]+itm+'.';
var exp=new Date();exp.setTime(exp.getTime()+(48000*60*60));
document.cookie=ck+';expires='+exp.toGMTString()+';path=/;domain=.maniaxfilm.com;';
alert('コンボセットに入れました'); }

function find(){
var knd=document.findform.schoice.value;
var wrd=document.findform.sword.value;
if(wrd.length < 2){alert('検索語が短かすぎます');}
else if(knd==''){alert('検索方法を選んでください');}
else{var knds=knd.split(','); wrd=zen2han(wrd);
if(knds[1]!=''){knd='&kind='+knds[1];}else{knd='';}
if(knds[0]=='actress'){wrd+='*';}
var urlwrd=encodeURIComponent(wrd);
location.href='list.php?ktype1='+knds[0]+'&key1='+urlwrd+knd;} }

function price(){
if(document.priceform.minprice.value && document.priceform.maxprice.value){
location.href='list.php?ktype1=price&range1='+document.priceform.minprice.value+'.00&range2='+document.priceform.maxprice.value+'.00';}
else{alert('価格帯を入力してください');} }

function logio(sts){
if(sts=='O'){var exp=new Date();exp.setTime(exp.getTime()-(24*60*60));
document.cookie='uid=;expires='+exp.toGMTString()+';path=/;domain=.maniaxfilm.com;';
document.getElementById('logio').innerHTML='<a href="javascript:logio(\'I\');">ログイン</A>';}
else{document.getElementById('logwin').style.visibility='visible';
document.getElementById('logwinf').src='https://www.maniaxdvd.com/page/account/lib/login.php';} }

//function autologin(L){location.replace('autologin.php?uid='+encodeURI(L)+'&url='.encodeURI(location.href));}

function closeLWin(w){document.getElementById(w).style.visibility='hidden'; }

function moviedl(){
alert('右クリックをして「対象をファイルに保存」でサンプル動画をダウンロードしてください。');
return false; }

function crrate(tid,file,res){
if(res){document.getElementById(dId).innerHTML = res;}
else if(file){window.dId = tid; loadfile(file,arguments.callee);}
else{} }

function loadfile(file,fnc){
try{httpObj = new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){httpObj = new XMLHttpRequest();}
if(httpObj){
httpObj.onreadystatechange = function(){
if(httpObj.readyState == 4 && httpObj.status == 200){fnc('','',httpObj.responseText);} }
httpObj.open("get", file, true); httpObj.send(null);} }

function zen2han(str){str=str.replace(/@/g,'＠'); str=str.replace(/&/g,'＆');
var zen = new RegExp("[　！＂＃＄＇（）＊＋、－．／０-９：；＜＝＞？Ａ-Ｚ［＼］＾＿｀ａ-ｚ｛｜｝]","g");
str=str.replace(zen,function ($0){return $0=='　'?' ':String.fromCharCode($0.charCodeAt(0)-65248);});
str=str.replace(/[“”「」()\"]|^[\s]+|[\s]+$|([\s])[\s]+/g,"$1");
return str; }
