function Exit(){
	parent.window.close();
}
function btn_over(id,pass){
	document.getElementById(id).src = pass;
}
function ErrorAlert(Err) {
	window.alert(Err);
}
function ChangeImg(Id,Img){
	document.getElementById(Id).src = Img;
	return true;
}
function gal_img_change(id,pass,num){
	var No = num;
	var i = 0;
	var time = 1;
	//	document.getElementById(id).src = pass;
	
	if(navigator.appName.charAt(0) == "M") {
		document.getElementById(id).filters.blendTrans.Apply();
		document.getElementById(id).filters.blendTrans.duration = time;
		document.getElementById(id).src = pass;
		document.getElementById(id).filters.blendTrans.Play();
	}else{
		document.getElementById(id).src = pass;
	}
	
	for (i=1; i<=10; i++) {
		if (i == No) {
			//IE
			document.getElementById("img_s_" + No).style.filter = "progid:DXImageTransform.Microsoft.BasicImage(opacity=0.4)";
			//firefox｡｢mac
			document.getElementById("img_s_" + No).style.MozOpacity = "0.4";
			//firefox
			document.getElementById("img_s_" + No).style.opacity = "0.4";	
		}else {
			document.getElementById("img_s_" + i).style.filter = "progid:DXImageTransform.Microsoft.BasicImage(opacity=1)";
			document.getElementById("img_s_" + i).style.MozOpacity = "1";
			document.getElementById("img_s_" + i).style.opacity = "1";
		}
	}
}


function gal_mail(Gid){
	var Gw;
	if(Gid){
		Gw = window.open('','gal_mail','toolbar=no,location=no,directories=no,status=0,menubar=no,scrollbars=no,resizable=no,width=400,height=380,innerWidth=400,innerHeight=380');
		Url = '/mail/?gal_id='+Gid;
		Gw.location.href = Url;
	}
}
function gal_quest(Gid){
	var Gw;
	if(Gid){
		Gw = window.open('','gal_quest','toolbar=no,location=no,directories=no,status=0,menubar=no,scrollbars=no,resizable=no,width=400,height=460,innerWidth=400,innerHeight=460');
		Url = 'quest.php?gal_id='+Gid;
		Gw.location.href = Url;
	}
}
function gal_staf(Gid){
	var Gw;
	if(Gid){
		Gw = window.open('','gal_staf','toolbar=no,location=no,directories=no,status=0,menubar=no,scrollbars=no,resizable=no,width=400,height=280,innerWidth=400,innerHeight=280');
		Url = 'info.php?gal_id='+Gid
		Gw.location.href = Url;
	}
}

function gal_time(Gid,TS,TE){
	var Gw;
	if(Gid){
		Gw = window.open('','gal_time','toolbar=no,location=no,directories=no,status=0,menubar=no,scrollbars=no,resizable=no,width=600,height=600,innerWidth=600,innerHeight=600');
		Url = '/schedule/day_samname.php?gal_id='+Gid+'&time_start='+TS+'&time_end='+TE;
		Gw.location.href = Url;
	}
}

function gal_window(Gid){
	var Gw;
	if(Gid){
		Gw = window.open('','gal_win','toolbar=no,location=no,directories=no,status=0,menubar=no,scrollbars=no,resizable=no,width=800,height=620,innerWidth=800,innerHeight=620');
		Url = '/gals/gal.php?id='+Gid
		Gw.location.href = Url;
		Gw.focus();
	}
}
function gal_window_new(URL){
	if(URL){
		subwin = window.open(URL,'gal_window','toolbar=no,location=no,directories=no,status=0,menubar=no,scrollbars=no,resizable=no,width=800,height=620,innerWidth=800,innerHeight=620');
		subwin.focus();
	}else{
		alert("オープンウインドウエラー");
	}
}
function gals_imagesfilter(Id,Im){
	if(Id){
		if(navigator.appName.charAt(0) == "M"){
			document.getElementById(Id).filters.blendTrans.apply();
			document.getElementById(Id).src=Im;
			document.getElementById(Id).filters.blendTrans.play();
		}else{
			document.getElementById(Id).src=Im;
		}
	}
}