function getHttpObject(e){
	var xmlhttp;
	if(window.ActiveXObject){
		try{
			xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try{
				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}catch(E){
				xmlhttp=false;
			}
		}
}else if(window.XMLHttpRequest) {
		try{
			xmlhttp=new XMLHttpRequest();
		}catch(e){
			xmlhttp=false;
		}
	}
return xmlhttp;
}

function yomikomi(shubetsu,mode,id)
{
	var info;
	var httpObje=getHttpObject();
	httpObje.open("POST","../../script/"+shubetsu+".php?mode="+mode+"&id="+id,true);
	httpObje.send(null);
	httpObje.onreadystatechange=function(){
		if(httpObje.readyState==4){
			if(httpObje.status==200){
				info=httpObje.responseText;
				document.getElementById(shubetsu).innerHTML=info;
			}
		}
	}
}

function make_add_form(num,buill,edaban,kai)
{
	if(!num){var num=document.shop.shop_add_code.options[document.shop.shop_add_code.selectedIndex].value;}
	var info;
	var httpObje=getHttpObject();
	httpObje.open("POST","../../script/make_add_form.php?shop_add_code="+num+"&buill="+buill+"&edaban="+edaban+"&kai="+kai,true);
	httpObje.send(null);
	httpObje.onreadystatechange=function(){
		if(httpObje.readyState==4){
			if(httpObje.status==200){
				info=httpObje.responseText;
				document.getElementById("make_add_form").innerHTML=info;
			}
		}
	}
}

function make_area_form(name,num)
{
	if(!num)
	{
	if(name=="area_code1"){var num=document.link.area_code1.options[document.link.area_code1.selectedIndex].value;}
	if(name=="area_code2"){var num=document.link.area_code2.options[document.link.area_code2.selectedIndex].value;}
	if(name=="area_code3"){var num=document.link.area_code3.options[document.link.area_code3.selectedIndex].value;}
	if(name=="area_code4"){var num=document.link.area_code4.options[document.link.area_code4.selectedIndex].value;}
	if(name=="area_code5"){var num=document.link.area_code5.options[document.link.area_code5.selectedIndex].value;}
	}
	else if(num==0){num="";}
	
	var info;
	var httpObje=getHttpObject();
	httpObje.open("POST","../../script/area_list.php?name="+name+"&"+name+"="+num,true);
	httpObje.send(null);
	httpObje.onreadystatechange=function(){
		if(httpObje.readyState==4){
			if(httpObje.status==200){
				info=httpObje.responseText;
				document.getElementById(name).innerHTML=info;
			}
		}
	}
}

function yomikomi2(file,code,id,value)
{
	if(!value)
	{
	res=confirm("履歴のデータを一件削除しようとしています。削除してもよろしいですか？");
		if(res!=true){exit;}
	}
	var info;
	var httpObje=getHttpObject();
	httpObje.open("POST","../../script/"+file+".php?code="+code+"&id="+id+"&value="+value,true);
	httpObje.send(null);
	httpObje.onreadystatechange=function(){
		if(httpObje.readyState==4){
			if(httpObje.status==200){
				info=httpObje.responseText;
				document.getElementById("b"+code).innerHTML=info;
			}
		}
	}
}

function chprop(id,name,value)
{
	if(name=='height')
	{
	document.getElementById(id).style.height=value+"px";
	}
	if(name=='bgcolor')
	{
	document.getElementById(id).style.backgroundColor=value;
	}
}

function hoshi(num,tel,modosu)
{
	if(modosu)
	{
	for(i=1;i<6;i++)
		{
			if(modosu>=i){document.getElementById("a"+tel+i).style.color="red";}
			else{document.getElementById("a"+tel+i).style.color="#ccc";}
		}
	}
	else
	{
		for(i=1;i<6;i++)
		{
			if(num>=i){document.getElementById("a"+tel+i).style.color="#000";}
			else{document.getElementById("a"+tel+i).style.color="#ccc";}
		}
	}
}

function hidden(id,mode,txt)
{
	if(mode==1)
	{
	document.getElementById(id+"_hid").style.display="block";
	document.getElementById(id+"_come").style.display="none";
	mode="none";
	document.getElementById(id+"_inn").innerHTML="<h2 class='coment_b' style='display:inline;' onClick=\"hidden('"+id+"','2','"+txt+"');\">"+txt+"</h2>";
	}
	if(mode==2)
	{
	document.getElementById(id+"_hid").style.display="none";
	document.getElementById(id+"_come").style.display="block";
	mode="block";
	document.getElementById(id+"_inn").innerHTML="<h2 class='coment_b' style='display:inline;' onClick=\"hidden('"+id+"','1','"+txt+"');\">"+txt+"</h2>";
	}
}

function get_cook(coknam) {
	coktxt = document.cookie+";";
	stano = coktxt.indexOf(coknam);
		if (stano != -1){
		endno = coktxt.indexOf(";",stano);
		txt0 = unescape(coktxt.substring(stano+coknam.length+1,endno));
	}else{
	txt0 = "";
	}
return txt0;
}

function sav_cook(coknam,atai) {
day0 = new Date();
day0.setTime(theDay.getTime() + (3675 * 1000 * 60 * 60 * 24));
endday = day0.toGMTString();
document.cookie = coknam+"="+atai+";path= / ;expires="+endday;
}

function acc_log(site,chiiki,tel)
{
check=navigator.cookieEnabled;
	if(check!="")
	{
	id=1;
	ids=document.cookie;
	ids=ids.split("=");
	if(ids!=""){id=ids[1];}
	
	var httpObje=getHttpObject();
	httpObje.open("POST","../../script/acc_log.php?id="+id+"&site="+site+"&chiiki="+chiiki+"&tel="+tel,true);
	httpObje.send(null);
	httpObje.onreadystatechange=function(){
			if(httpObje.readyState==4){
				if(httpObje.status==200){
					id=httpObje.responseText;
					theDay=new Date();
					theDay.setTime(theDay.getTime() + (3675 * 1000 * 60 * 60 * 24));
					tmp="id="+id+";path= / ;";
					tmp+="expires="+theDay.toGMTString()+";";
					document.cookie=tmp;
				}
			}
		}
	}
}

function shop_form_check()
{
kin18=get_cook('kin18');
shubetsu=document.shop.shop_shubetsu.options[document.shop.shop_shubetsu.selectedIndex].value;

	if(document.shop.shop_shubetsu.options[document.shop.shop_shubetsu.selectedIndex].value==""||document.shop.shop_add_code.options[document.shop.shop_add_code.selectedIndex].value.length<18||document.shop.shop_key1.options[document.shop.shop_key1.selectedIndex].value==""&&document.shop.shop_key1_hoka.value==""||document.shop.shop_name_kana.value==""||document.shop.shop_name2.value=="")
	{
	alert("※印の付いた項目は必須項目です。ご確認・ご入力の上、もう一度送信ボタンを押してください。");
	return false;
	}
	else
	{
		if(document.shop.shop_tourokusha[0].checked==false&&document.shop.shop_tourokusha[1].checked==false||document.shop.shop_tourokusha[0].checked==true&&document.shop.shop_mail_mae.value==""||document.shop.shop_tourokusha[0].checked==true&&document.shop.shop_mail_ushiro.value=="")
		{
		alert("データ登録者が未入力、又は登録者がお店関係者なのにメールアドレスが入力されていません。ご確認・ご入力の上、もう一度送信ボタンを押してください。");
		return false;
		}
		else if(shubetsu=="e"||shubetsu=="f")
		{
			if(document.shop.ninshow_key.value!="otonadesu"&&kin18!="otonadesu")
			{
			alert("認証キーを入力してください");
			return false;
			}
		}
		else
		{
		return true;
		}
	}
}

function link_form_check()
{
	if(document.link.tantou_name.value==""||document.link.link_mail_mae.value==""||document.link.link_mail_ushiro.value==""||document.link.site_name.value==""||document.link.site_shurui.checked==false||document.link.link_hp_url.value==""&&document.link.link_mb_url.value==""||document.link.link_shubetsu.options[document.link.link_shubetsu.selectedIndex].value==""||document.link.adult_shubetsu.options[document.link.adult_shubetsu.selectedIndex].value==""||document.link.link_key.options[document.link.link_key.selectedIndex].value==""&&document.link.link_key_hoka.value=="")
	{
	alert("※リンクアドレスが空または、その他必須項目の何かが抜けているようです。今一度ご確認をお願い致します");
	return false;
	}
}

function js_check()
{
	if(!navigator.javaEnabled())
	{
	alert("javascriptが有効になっていない場合はalertを表示するつもりだったけど、有効じゃないと表示しない事に気付く(⌒▽⌒)ｱﾊﾊ!");
	return false;
	}
}

function kin18_check(shubetsu)
{
if(!shubetsu){shubetsu=document.shop.shop_shubetsu.options[document.shop.shop_shubetsu.selectedIndex].value;}
	if(shubetsu=="e"||shubetsu=="f")
	{
	kin18=get_cook('kin18');
	id=get_cook('id');
		if(kin18=="otonadesu")
		{
		ok=1;
		}
		else
		{
		res=confirm("禁止ワードが含まれたデータを「表示」または「送信」する為の認証キーを取得しようとしています。\n\nこのデータを表示または登録させる為には、閲覧者が20歳以上である事と、認証キーが必要です。\nまた、このデータには当サイトが定める禁止ワードが含まれています。未成年の方の閲覧は固くお断り致しております。\nまた、成人の方であっても、人によって不快に感じられる方がいらっしゃるかも知れません。そんな場合も、全て自己責任でのご利用をお約束ください。\n\n20歳以上の方で、お約束下さる方のみ『OK』ボタンを押してください。");
			if(res==1)
			{
			prp=prompt("認証キーを受信する為のメールアドレスをご入力ください。出来るなら、『＠』の代わりに『<>』でご入力ください。");
				if(prp)
				{
				var httpObje=getHttpObject();
				httpObje.open("POST","../../script/send_mail.php?id="+id+"&prp="+prp,true);
				httpObje.send(null);
				alert("認証キーをご指定メールアドレス宛にお送り致しました");
				}
			}
		ok=2;
		}
	return ok;
	}
}


function coupon(mode)
{
	if(mode==1){document.getElementById("coupon").style.display="block";}
	else{document.getElementById("coupon").style.display="none";}
}

function recover()
{
	if(document.recover_id.mail_mae.value==""||document.recover_id.mail_ushiro.value=="")
	{
	alert("メールアドレスを入力してください");
	return false;
	}
	else
	{
		var info;
		var httpObje=getHttpObject();
		httpObje.open("POST","../../script/recover_id.php?mail_mae="+document.recover_id.mail_mae.value+"&mail_ushiro="+document.recover_id.mail_ushiro.value+"&imano_id="+document.recover_id.imano_id.value,true);
		httpObje.send(null);
		httpObje.onreadystatechange=function(){
			if(httpObje.readyState==4){
				if(httpObje.status==200){
					info=httpObje.responseText;
					document.getElementById("recover").innerHTML=info;
				}
			}
		}
	}
}

function recover2()
{
	if(document.recover_id.key.value=="")
	{
	alert("メールでお送りした、ID復旧用のキーを入力してください");
	return false;
	}
	
	else
	{
		var info;
		var info2="IDの復帰が完了しました♪";
		var httpObje=getHttpObject();
		httpObje.open("POST","../../script/recover_id.php?key="+document.recover_id.key.value+"&mail_ushiro="+document.recover_id.mail_ushiro.value,true);
		httpObje.send(null);
		httpObje.onreadystatechange=function(){
			if(httpObje.readyState==4){
				if(httpObje.status==200){
					info=httpObje.responseText;
					if(info.length==10)
					{
					document.getElementById("recover").innerHTML="<a href=index.php?sb=7&category="+info+">IDの復帰が完了しました♪こちらのリンクをクリックしてください♪</a>";
					theDay=new Date();
					theDay.setTime(theDay.getTime() + (3675 * 1000 * 60 * 60 * 24));
					tmp="id="+info+";path= / ;";
					tmp+="expires="+theDay.toGMTString()+";";
					document.cookie=tmp;
					}
					else
					{
					document.getElementById("recover").innerHTML=info;
					}
				}
			}
		}
	}
}

function sougo_link_check(id,namae)
{
	if(id=="shop_hp_url")
	{
		if(namae=="shop"){url=document.shop.shop_hp_url.value; shubetsu='hp';}
	}
	else if(id=="shop_mb_url")
	{
		if(namae=="shop"){url=document.shop.shop_mb_url.value; shubetsu='mb';}
	}
	else if(id=="shop_bl_url")
	{
		if(namae=="shop"){url=document.shop.shop_bl_url.value; shubetsu='bl';}
	}
	else if(id=="link_hp_url")
	{
		if(namae=="link"){url=document.link.link_hp_url.value; shubetsu='hp';}
	}
	else if(id=="link_mb_url")
	{
		if(namae=="link"){url=document.link.link_mb_url.value; shubetsu='mb';}
	}
	else if(id=="link_bl_url")
	{
		if(namae=="link"){url=document.link.link_bl_url.value; shubetsu='bl';}
	}

var info;
	var httpObje=getHttpObject();
	httpObje.open("POST","../../script/sougo_link.php?url="+url+"&shubetsu="+shubetsu,true);
	httpObje.send(null);
	httpObje.onreadystatechange=function(){
		if(httpObje.readyState==4){
			if(httpObje.status==200){
				info=httpObje.responseText;
				document.getElementById(id).innerHTML=info;
			}
		}
	}
}

function url_check(link_url)
{
var url=eval("document.link."+link_url+".value");
	if(url)
	{
	var httpObje=getHttpObject();
		httpObje.open("POST","../../script/url_check.php?url="+url,true);
		httpObje.send(null);
		httpObje.onreadystatechange=function(){
			if(httpObje.readyState==4){
				if(httpObje.status==200){
					info=httpObje.responseText;
					if(info==1){alert("ご入力戴いたURLは、既に登録されています");}
					else if(info==2){alert("ご入力戴いたURLは、現在申請中です");}
				}
			}
		}
	}
}

function kirikae(page)
{
document.getElementById("top").style.display="none";
document.getElementById("ank_top").style.display="none";
document.getElementById("tab_top").style.zIndex="0";
document.getElementById("studio").style.display="none";
document.getElementById("ank_studio").style.display="none";
document.getElementById("tab_studio").style.zIndex="0";
document.getElementById("satsuei").style.display="none";
document.getElementById("ank_satsuei").style.display="none";
document.getElementById("tab_satsuei").style.zIndex="0";
document.getElementById("club").style.display="none";
document.getElementById("ank_club").style.display="none";
document.getElementById("tab_club").style.zIndex="0";
document.getElementById("cameraman").style.display="none";
document.getElementById("ank_cameraman").style.display="none";
document.getElementById("tab_cameraman").style.zIndex="0";
document.getElementById("bus").style.display="none";
document.getElementById("ank_bus").style.display="none";
document.getElementById("yoyaku").style.display="none";
document.getElementById("ank_yoyaku").style.display="none";
document.getElementById("event").style.display="none";
document.getElementById("ank_event").style.display="none";
document.getElementById("sitemap").style.display="none";
document.getElementById("ank_sitemap").style.display="none";
document.getElementById("news").style.display="none";
document.getElementById("ank_news").style.display="none";
document.getElementById("tips").style.display="none";
document.getElementById("ank_tips").style.display="none";

document.getElementById(page).style.display="block";
document.getElementById("ank_"+page).style.display="block";
document.getElementById("tab_"+page).style.zIndex="1";
}

var map;
var markers = new Array(1);

function onLoad() {
map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(43.04900796448075,141.33893966674805),14);
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.addControl(new GOverviewMapControl());
map.setMapType(G_NORMAL_MAP);
var marker = null;
var n_markers = 0;
var markeropts = new Object();
markeropts.title = "PhotoPlaceアミューズ";

var marker = new GMarker(new GLatLng(43.044766208783045,141.35004937648773));
map.addOverlay(marker);

var marker = new GMarker(new GLatLng(43.047237988406685,141.3273122906685));
map.addOverlay(marker);

markers[n_markers] = marker;
GEvent.addListener(markers[0], "click", function () {markers[0].openInfoWindowHtml("ニュー札幌PhotoPlaceアミューズ<br />中島公園よりも、旭山公園や円山公園の方が近くなった<br>レンタルフォトスタジオです。");});
GEvent.trigger(marker,"click");
n_markers++;
map.addOverlay(marker);

/*var sw = new GLatLng(43.044178141867064,141.33413314819336);
var ne = new GLatLng(43.04856890541176,141.34580612182617);
var bounds = new GLatLngBounds(sw, ne);
var flowerImage = new GGroundOverlay("./images/yajirushi.gif", bounds);
map.addOverlay(flowerImage);*/
}


