function activex_flash(wd,hd,fn,idname){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"" name="'+fn+'" width="'+wd+'" height="'+hd+'" align="right" id="'+idname+'">');
	document.write('<param name="movie" value="'+fn+'">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="menu" VALUE="false">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<embed src="'+fn+'" width="'+wd+'" height="'+hd+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="'+idname+'"></embed></object> ');
}

function activex_movie(wd,hd,fn,idname){
	document.write('<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" type="application/x-oleobject" standby="Loading ...." name="'+fn+'" width="'+wd+'" height="'+hd+'" id="'+idname+'">');
	document.write('<param name="FileName" value="'+fn+'">');
	document.write('<param name="loop" value="1">');
	document.write('<param name="AutoSize" value="1">');
	document.write('<param name="ShowControls" value="1">');
	document.write('<param name="AutoRewind" value="true">');
	document.write('<param name="ShowDisplay" value="0">');
	document.write('<param name="DefaultFrame" value="Slide">');
	document.write('<param name="Autostart" value="-1">');
	document.write('<param name="SendMouseClickEvents" value="1">');
	document.write('<param name="EnableContextMenu" value="false">');
	document.write('<param name="TransparentAtStart" value="-1">');
	document.write('<param name="AnimationAtStart" value="0">');
	document.write('</object>');
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function open_win (url,name, w, h){
  var posx=0;
  var posy=0;
  posx = (screen.width - w)/2-1;
  posy = (screen.height - h)/2-1;
  var oWin = window.open(url, name, "scrollbars=no,width="+w+",height="+h+", top="+posy+", left="+posx );
  try{ oWin.focus(); } catch(Exception){}
}

function open_win1 (url,name, w, h){
  var posx=0;
  var posy=0;
  posx = (screen.width - w)/2-1;
  posy = (screen.height - h)/2-1;
  var oWin = window.open(url, name, "scrollbars=yes,width="+w+",height="+h+", top="+posy+", left="+posx );
  try{ oWin.focus(); } catch(Exception){}
}

function pop_click(a) {
	open_win("/popup/pop_click.asp?idx="+a,"POP_C",0,0);
}

function isSpacing(strString){
	return (strString.indexOf(" ") != -1);
}

function autoBlur(){ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
	document.body.focus(); 
} 
document.onfocusin=autoBlur; 

function numFormat(num){
    var str = Number(num) + "";
    if( str=='NaN') return;
    var leng = str.length;
    var size = 3;
    var cnt = Math.floor(leng / size);
    var pos = leng % size;
    var result = "";

    for( var i=cnt;i>0;i--)
		result=","+str.substr(pos+(i-1)*size,size)+result ;
    return (pos==0)?result.substring(1):str.substr(0,pos)+result;
}

function CheckChar(strValue){
	for (i=0; i<strValue.length; i++){
		if ((strValue.substr(i, 1) >= "0" && strValue.substr(i, 1) <= "9")) {}
		else return false;
	}
	return true;
}

function Top() {
	location.href = "/";
}

function Etc() {
	alert("準備中です.");
}

function LtransLogIn() {
	location.href = "/login/login.asp?m_qry=2&qry=4";
}

function LtransLogOut() {
	location.href = "/login/logout.asp";
}
	
function LtransMember() {
	location.href = "/member/member_join.asp?m_qry=2&qry=5";
}

function LtransMemberModify() {
	location.href = "/member/member_modify.asp?m_qry=2&qry=6";
}

function LtransMemberSearch() {
	location.href = "/login/search_id.asp?m_qry=2&qry=7";
}

function IsEnter() {
	if(window.event.keyCode == 13){
		log_submit();
	}
}

if(typeof(Number.prototype.toFixed)!='function' || (.9).toFixed()=='0' || (.007).toFixed(2)=='0.00'){
	Number.prototype.toFixed=function(f){
		if(isNaN(f*=1) || f<0 || f>20) f=0;
		var s='',x=this.valueOf(),m='';
		if(this<0){s='-'; x*=-1;}
		if(x>=Math.pow(10,21)) m=x.toString();
		else{
			m=Math.round(Math.pow(10,f)*x).toString();
			if(f!=0){
				var k=m.length;
				if(k<=f){
					var z='00000000000000000000'.substring(0,f+1-k);
					m=z+m;
					k=f+1;
				}
				var a=m.substring(0,k-f);
				var b=m.substring(k-f);
				m = a+'.'+b;
			}
		}
		if(m=='0') s='';
		return s+m;
	}
}
