function flashAuth(fname) {

	function basicParam() {return this;}
	flashAuth.prototype.basicParam = basicParam;
	function objectParam() {return this;}
	flashAuth.prototype.objectParam = objectParam;
	function extendParam() {return this;}
	flashAuth.prototype.extendParam = extendParam;
	function embedParam() {return this;}
	flashAuth.prototype.embedParam = embedParam;

	this.filename = fname;
	return this;
}
function writeSWF(swfobj) {

	var objectTag = '<object ';
	var embedTag  = '<embed ';

	for(i in swfobj.objectParam) {
		if(i == 'prototype') {continue}
		objectTag += i + '=' + '"' + eval('swfobj.objectParam.'+i) + '" ';
	}
	for(i in swfobj.embedParam) {
		if(i == 'prototype') {continue}
		embedTag += i + '=' + '"' + eval('swfobj.embedParam.'+i) + '" ';
	}
	for(i in swfobj.basicParam) {
		if(i == 'prototype') {continue}
		objectTag += i + '=' + '"' + eval('swfobj.basicParam.'+i) + '" ';
		embedTag  += i + '=' + '"' + eval('swfobj.basicParam.'+i) + '" ';
	}
	objectTag += '>' + "\n";
	for(i in swfobj.extendParam) {
		if(i == 'prototype') {continue}
		objectTag += '<param name="' + i + '" value="' + eval('swfobj.extendParam.'+i) + '">' + "\n";
		embedTag  += i + '=' + '"' + eval('swfobj.extendParam.'+i) + '" ';
	}

	embedTag  += 'src="' + swfobj.filename + '"></embed>';
	objectTag += '<param name="movie" value="' + swfobj.filename + '">';

	putTag = objectTag + "\n" + embedTag + "\n" + '</object>';

	document.write(putTag);

}

function openNewWindow(tga,wi,he) {

	var jumpto = tga.href;
	
	window.open(jumpto,"onw","menubar=yes,toolbar=no,location=yes,status=yes,scrollbars=yes,resizable=yes,width=" + wi + ",height=" + he);

}

function open_win(url){
	window.open(url,"a1","menubar=no,toolbar=no,location=yes,status=no,scrollbars=no,resizable=yes,width=460,height=520");
}

function $sd(tb) {
	return document.getElementById(tb);
}

//function menuImageSwap() {
//
//	/* genre, ranking, write, guide */
//	var idl = new Array("genre", "ranking", "write", "guide");
//	var imov = new Array("/img/common/menu_01_top_on.gif", "/img/common/menu_02_genre_on.gif", "/img/common/menu_03_ranking_on.gif", "/img/common/menu_04_mymelma_on.gif");
//
//	for(var i in idl) {
//
//		var v = $sd(idl[i]).getElementsByTagName("A")[0].getElementsByTagName("IMG")[0].src;
//
//		$sd(idl[i]).getElementsByTagName("A")[0].onmouseout = (function(i,v) {
//			return function() {
//				$sd(idl[i]).getElementsByTagName("A")[0].getElementsByTagName("IMG")[0].src = v;
//			}
//		}).call(this,i,v);
//
//		$sd(idl[i]).getElementsByTagName("A")[0].onmouseover = (function(i) {
//			return function() {
//				$sd(idl[i]).getElementsByTagName("A")[0].getElementsByTagName("IMG")[0].src = imov[i];
//			}
//		}).call(this,i);
//
//	}
//
//}

function backToTop() {
  var x1 = x2 = x3 = 0;
  var y1 = y2 = y3 = 0;
  if (document.documentElement) {
      x1 = document.documentElement.scrollLeft || 0;
      y1 = document.documentElement.scrollTop || 0;
  }
  if (document.body) {
      x2 = document.body.scrollLeft || 0;
      y2 = document.body.scrollTop || 0;
  }
  x3 = window.scrollX || 0;
  y3 = window.scrollY || 0;
  var x = Math.max(x1, Math.max(x2, x3));
  var y = Math.max(y1, Math.max(y2, y3));
  window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));
  if (x > 0 || y > 0) {
      window.setTimeout("backToTop()", 25);
  }
}

function domainPartCheck(ma) {

	var dpa = ma.split("@");
	var dp = dpa[1];
	if (!dp) { 
		alert("メールアドレスの入力を確認してください。");
		return false;
	}

	var fa = new Array(
		'hotmail.co.jp',
		'msn.com',
		'yahoo.co.jp',
		'mail.goo.ne.jp',
		'gmail.com'
	);

	for(var i=0;i <= fa.length;i++) {
		if(dp == fa[i]) {
			if(!confirm("フリーメールアドレスをご利用になる場合、審査に時間が掛かったり、審査通過出来ない場合があります。\nよろしいですか？")) {
				return false;
			}
		}
	}

}


//window.onload = function() {
//	menuImageSwap();
//}
window.onerror = function() {
    return true;
}

