//グローバルJavascriptファイル;
function viewSwf(URL,width,height){
	document.writeln("<object type='application/x-shockwave-flash' width='"+width+"' height='"+height+"' data='"+URL+"'>");
	document.writeln("<param name='movie' value='"+URL+"' />");
	document.writeln("<param name='wmode' value='transparent' />");
	document.writeln("<param name='quality' value='high' />");
	document.writeln("</object>");
}
function viewWmv(URL,width,height) {
	document.writeln("<object classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6' width='"+width+"' height='"+height+"' standby='Loading Microsoft Windows Media Player components...' type=\'application/x-oleobject'>");
	document.writeln("<param name='URL' value='"+URL+"' />");
	document.writeln("<param name='AutoStart' value='true' />");
	document.writeln("<embed src='"+URL+"' type='application/x-mplayer2\' pluginspage='http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&' PlayCount='0' width='"+width+"' height='"+height+"' />");
	document.writeln("</object>");
}
function myChgPic(myPicURL){
	$("gallery_area").style.background = "url(./img/girl/pc_main_"+myPicURL+") no-repeat center";
}
function showhide(id,ids){
	if(document.getElementById(id).style.display == "none"){
		document.getElementById(id).style.display = "block";
		document.getElementById(ids).style.display = "none";
	}else{
		document.getElementById(id).style.display = "none";
		document.getElementById(ids).style.display = "block";
	}
}
function _externalLinks() {
	if (!document.getElementsByTagName) return false;
	var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].className.match("popupwindow")) {
			links[i].onclick = function() {
				window.open(this.href, 'MailMagazine', 'width=450, height=300, menubar=no, toolbar=no, scrollbars=no');
				return false;
			}
		}else if (links[i].className.match("gallery_popup")){
			links[i].onclick = function() {
				window.open(this.href, 'Gallery', 'width=620, height=480, menubar=no, toolbar=no, scrollbars=no');
				return false;
			}
		}
	}
	for (var i=0; i<links.length; i++) {
		var anchor = links[i];
		if (anchor.getAttribute("href") &&
			anchor.getAttribute("rel") == "external")
		anchor.target = "_blank";
	}
}
function _onChangeMonth() {
	var month = $("month").value;
	if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12){
		var max = 32;
	} else if (month == 4 || month == 6 || month == 9 || month == 11){
		var max = 31;
	} else {
		var max = 29;
	}
	var tbl = '<option value="1">1</option>';
	for (var i=2; i<max; i++){
		tbl += '<option value="'+i+'">'+i+"</option>\n";
	}
	$("day").innerHTML = tbl;
}
function load() {
	_externalLinks();
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("map_area"));
		var point = new GLatLng(35.529476,139.667828);
		map.setCenter(point, 15);
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		map.addOverlay(new GMarker(point));
	}
}

window.onload = _externalLinks;