
var scrj = 1;
function softScrollBack() {
   if(navigator.appName == "Microsoft Internet Explorer" && document.compatMode == "CSS1Compat")
      var scdist = document.body.parentNode.scrollTop;
   else
      var scdist = document.body.scrollTop;
   if(scrj<50 && scdist) {
      scdist = (scdist>2) ? Math.ceil(scdist*.2) : 1;
      scrj++;
      scrollBy(0,-scdist);
      setTimeout("softScrollBack()",20);
   } else {
      scrollTo(0,0);
      scrj = 1;
   }
}

function OpenWindow (url) {
	window.open(url,'SubWindow','width=480,height=480,scrollbars=yes,status=yes');
}


function openImage(url){
	window.open(url, 'imageViewer', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,width=100,height=100');
}

function openMovie(url){
	window.open(url, 'movieViewer', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,width=480,height=300');
}

	
function nowDateSet() {
		d_Now = new Date();
		d_Year = d_Now.getYear();
		d_Year = (d_Year < 2000) ? d_Year+1900 : d_Year; 
		d_Month = d_Now.getMonth() + 1;
		d_Day = d_Now.getDate();
		
		if(d_Month < 10){
			d_Month = "0"+d_Month;
		}
		if(d_Day < 10){
			d_Day = "0"+d_Day;
		}
		document.form1.newsDate.value = d_Year + "-" + d_Month +"-"+ d_Day;


}
	
function nowTimeSet() {
		d_Now = new Date();
		d_Hour = d_Now.getHours();
		d_Min = d_Now.getMinutes();
		d_Sec = d_Now.getSeconds();
		
		if(d_Hour < 10){
			d_Hour = "0"+d_Hour;
		}
		if(d_Min < 10){
			d_Min = "0"+d_Min;
		}
		if(d_Sec < 10){
			d_Sec = "0"+d_Sec;
		}
		document.form1.newsTime.value = d_Hour + ":" + d_Min +":"+ d_Sec;

}


function groupSet($groupName) {
	document.form1.groupName.value = $groupName;
}

function comDel(ID,comID){ 

	passwd = window.prompt("書き込み時に登録したパスワードを入力してください", ""); 
	
	if(passwd != "" && passwd != null){ 
		location.href = "comment.php?action=del&ID=" + ID + "&comID=" + comID + "&pass=" + passwd + "&display=news";
	} 

}

function comDel2(ID,comID){ 

	passwd = window.prompt("書き込み時に登録したパスワードを入力してください", ""); 
	
	if(passwd != "" && passwd != null){ 
		location.href = "comment.php?action=del&ID=" + ID + "&comID=" + comID + "&pass=" + passwd ;
	} 

}

function setTag ( param ) {

    tagData = document.form1.newsTag.value;
    if (tagData) {
        tagArray = tagData.split(",");
        tagPlus = 1;
        for (i = 0; i < tagArray.length; i++) {
            if (tagArray[i]==param) {
                i = tagArray.length;
                tagPlus = 0;
            }
        }
        if (tagPlus) {
            document.form1.newsTag.value = tagData + ',' + param;
        }
    } else {
        document.form1.newsTag.value = param;
    }

	return false;

}

// 追加分、ロールオーバー用
// JavaScript Document
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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_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_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];}
}