function login_menu(){
	if (document.long_move.id.value.length==0){
		alert("IDを入力してください。");
		document.long_move.id.focus();
		return;
	}else{
		if (jsChkStrWord(document.long_move.id.value) == false){
			alert("特殊文字は使用できません。");
			document.long_move.id.value = "";
			document.long_move.id.focus();
			return;
		}
	}
	if (document.long_move.pwd.value.length==0){
		alert("パスワードを入力してください。");
		document.long_move.pwd.focus();
		return;
	}
	document.long_move.submit();
}

function EnterCheck(){
	if(event.keyCode ==13){ 
		login_menu();
	}
}

function login_focus(){
	document.long_move.id.focus();
}

function jsChkStrWord(chk_str){
	var chkChar;
	var chkFormat = "_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	var chkString = jsRemoveBlank(chk_str.toLowerCase());
	for (var i = 0; i < chkString.length; i++){
		chkChar = chkString.substring(i, i+1);
		if (chkFormat.indexOf(chkChar) < 0) {
			return false;
		}
	}
	return true;
}

function jsRemoveBlank(chk_str){
	var chkString = chk_str;
	var returnString = "";
	for(var i = 0; i < chkString.length; i++){
		if (chkString.charCodeAt(i) != 32) returnString = returnString + chkString.substring(i, i+1);      
	}
	return returnString;
}

function logoutChk(url){
	location.href="logout.asp";
}

function view_check(val){
	location.href="/m_contents_view.asp?tc_idx="+val;
}

function userPicView(pic, width, height, mnum){
	window.open('/test_pic_view.asp?p_file='+pic+'&p_mnum='+mnum, 'picView', 'width='+width+', height='+height);
}

function commonSChk1(){
	form = document.sForm;
	strLength = form.keyword.value.length;
	if(form.keyword.value=="" || strLength<=0){
		alert('検索したいキーワードを入力してください。');
		form.keyword.focus();
		return false;
	}

	form.submit();
}

function id_pwd(){
	window.open('id_pwd.asp?suc=or', 'login', 'width=300, height=200');
}

function all_chk_send(cart_session_chk){
	form = document.all_chk;

	var check1=0;
	var num1 = form.tc_idx_val.length;
	
	//alert(num1);
	if (isNaN(num1) == true){					//1 desu
	if(form.tc_idx_val.checked == true)
				{
				check1=check1+1;
			//	alert ("aaaaaaa");
				}
	}
	else{
		for(i=0;i<=num1-1;i++){
			if(form.tc_idx_val[i].checked == true)
				{
				check1=check1+1;
				
				}
		}
	}

	if (check1 == 0){
		if (cart_session_chk == "N") {
			alert("カートはログイン後にご利用いただけます");
			form.action = "down_mv_before_cart_process.asp";
			form.submit();
			
		}else{
			alert("カートに追加する動画を選択してください");
		}
		
		return;
	}else{
		//if (check1 > 10){
			//alert("カートに一度に追加できる動画数は10個までです");
			//return;
		//}else{
			if (cart_session_chk == "N") {
				alert("カートはログイン後に利用ください。");
				form.action = "down_mv_before_cart_process.asp";
				form.submit();
				
			}else{
				form.action = "down_mv_before_cart_process.asp";
				form.submit();
			}
		//}
	}

}

function all_chk_send1(cart_session_chk){
	form = document.all_chk1;

	var check1=0;
	var num1 = form.tc_idx_val.length;
	//alert(num1);
	if (isNaN(num1) == true){					//1 desu
	if(form.tc_idx_val.checked == true)
				{
				//check1=check1+1;
				//alert ("aaaaaaa");
				}
	}
	else{
		for(i=0;i<=num1-1;i++){
			if(form.tc_idx_val[i].checked == true)
				{
				check1=check1+1;
				
				}
		}
	}

	if (check1 == 0){
		if (cart_session_chk == "N")
		{
			alert("カートはログイン後にご利用いただけます");
		}else{
			alert("カートに追加する動画を選択してください");
		}
		return;
	}else{
		//if (check1 > 10){
			//alert("カートに一度に追加できる動画数は10個までです");
			//return;
		//}else{
			form.action = "down_mv_before_cart_process.asp";
			form.submit();
		//}
	}

}

function all_send_contents(){
	form = document.all_chk_view;
	form.action = "down_mv_before_cart_process.asp";
	form.submit();
}


