<!--
var mesWi72="Please right click and choose 'Save target as...'";

// no right click
// document.oncontextmenu = function () {return false;}

/*
if(document.all){  // IE
	document.onmousedown = RightClick;
} else if (document.layers){  // NN4
	window.captureEvents(Event.MOUSEDOWN);
	window.onmousedown = RightClick;
} else if (document.getElementById && window.addEventListener){  // NN6
	window.addEventListener("mousedown",RightClickNN6,true);
}
*/


function RightClick(e){  // IE, NN4
	var name = '';
	var id = '';
	if(document.all || document.getElementById){
		if(event.button & 2){ // IE
			// window.alert("Ive got right click!hoge");
			name=event.srcElement.name;
			id=event.srcElement.id;
		}
	}else if(document.layers){ // NN4
		if(e.which == 3){
			// window.alert("Ive got right click!fuga");
			name=e.target.name;
			id=e.target.id;
		}
	}

	if (name == "DLLink" || id == "DLLink"){
		window.alert("Please purchase the product");
		return false;
	}
}


function RightClickNN6(e){  // NN6
	if(e.button == 2){
		var name=e.target.name;
		var id=e.target.id;
		// window.alert(name);
	}

	if (name == "DLLink" || id == "DLLink"){
		window.alert("Please purchase the product");
		return false;
	}
}



function LeftClick(){
	window.alert(mesWi72);
	return false;
}
//-->

<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}
//-->
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}
//-->

function showAll(){
  crossobj=(dom) ? document.getElementById("show_all").style : ie ? document.all.show_all : document.show_all;
  crossobj.display="block";
  m_crossobj=(dom) ? document.getElementById("show_all_menu").style : ie ? document.all.show_all_menu : document.show_all_menu;
  m_crossobj.display="none";
  m2_crossobj=(dom) ? document.getElementById("hide_all_menu").style : ie ? document.all.hide_all_menu : document.hide_all_menu;
  m2_crossobj.display="block";
}

function hideAll(){
  crossobj=(dom) ? document.getElementById("show_all").style : ie ? document.all.show_all : document.show_all;
  crossobj.display="none";
  m_crossobj=(dom) ? document.getElementById("show_all_menu").style : ie ? document.all.show_all_menu : document.show_all_menu;
  m_crossobj.display="block";
  m2_crossobj=(dom) ? document.getElementById("hide_all_menu").style : ie ? document.all.hide_all_menu : document.hide_all_menu;
  m2_crossobj.display="none";
}

var ie=document.all;
var dom=document.getElementById;
var ns4=document.layers;

function sort(flag,page_no)
{
        var sort_key;
        if (flag==1) {
                sort_key= 'hits desc';
        } else {
                sort_key = 'start_date desc';
        }
        document.forms[0].sort.value=sort_key;
        document.forms[0].page.value=page_no;
        document.forms[0].submit();
}



function warning(){  // Ken added 20070815
	window.alert("To watch Gallery pics, Purchase and login are requred");
} 



function activeMovie(str){
	var tempArr, movie_seq, url, samp_url, act_name;
	tempArr = str.split("&");

	movie_seq = tempArr[0];
	url = tempArr[1];
	samp_url = tempArr[2];
	temp = tempArr[3];
	// act_name = tempArr[4];
	act_name = 'hogehoge';

	// temp_arr = temp.split(" ");
	// act_name = temp_arr[0];

	MM_openBrWindow('', act_name, '');

       	if (window.XMLHttpRequest) {
		http_request = new XMLHttpRequest();
       	} else if (window.ActiveXObject) {
               	http_request = new ActiveXObject("Microsoft.XMLHTTP");
       	}
       	if (http_request) {
               	http_request.open("GET", "activeMovie.php?movie_seq="+movie_seq, true);

		http_request.onreadystatechange = function(){
			// catch response from activeMovie.php
			if ((http_request.readyState == 4) && (http_request.status == 200)){
	                	if (http_request.responseText == 0){ // movie is valid
       		                	window.open(url, act_name);
				} else { // movie is NOT valid, w/ red border 
       		                	// MM_openBrWindow(samp_url, act_name, '');
       		                	window.open(samp_url, act_name);
       		        	}
			}
		}
               	http_request.send(null); 
	}
}


function activeMovieDL(str){

       	if (window.XMLHttpRequest) {
		http_request = new XMLHttpRequest();
       	} else if (window.ActiveXObject) {
               	http_request = new ActiveXObject("Microsoft.XMLHTTP");
       	}
       	if (http_request) {
               	http_request.open("GET", "activeMovie.php?movie_seq="+str, true);

		http_request.onreadystatechange = function(){
			// catch response from activeMovie.php
			if ((http_request.readyState == 4) && (http_request.status == 200)){
	                	if (http_request.responseText == 0){ // movie is valid
					// window.alert("true. valid movie.");
					document.oncontextmenu = function () {return true;}
				} else { // movie is NOT valid, w/ red border 
					// document.oncontextmenu = function () {return false;}
					// document.oncontextmenu = function () {return true;}
					// window.alert("商品を購入してください");

					// catch right click
					if(document.all){  // IE
						document.onmousedown = RightClick;
					} else if (document.layers){  // NN4
						window.captureEvents(Event.MOUSEDOWN);
						window.onmousedown = RightClick;
					} else if (document.getElementById && window.addEventListener){  // NN6
						window.addEventListener("mousedown",RightClickNN6,true);
					}
       		        	}
			}
		}
               	http_request.send(null); 
	}
}

