
/* ピーニティ：Websites JavaScript --default.js-- */
/* 最終更新日：2006-05-10 */
/* JS Programmed by Takashi Yanagiba */





//ポップウィンドウ表示処理
function popWin(theURL, winName, features) {
  window.open(theURL, winName, features);
}


//ポップウィンドウセンター表示処理
function popWinCenter(theURL, winName, wHeight, wWidth) {
   sWidth = screen.availWidth;
   sHeight = screen.availHeight;
   x = (sWidth - wWidth) / 2;
   y = (sHeight - wHeight) / 2;
   newWin = window.open(theURL, winName, "width="+wWidth+",height="+wHeight);
   newWin.moveTo(x,y);
}


//滑らかなページトップスクロール処理
function smoothScroll() {
	var scrj = 1;
   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("smoothScroll()",20);
   } else {
      scrollTo(0,0);
      scrj = 1;
   }
}


//入力フィールド色変動処理
function ChangeColor(thisPAS,bgCL,bdCL) {
    if (!document.all && document.getElementById) { //-- NN6以上
        thisPAS.style.backgroundColor = bgCL;
//        thisPAS.style.borderColor = bdCL;
    } else if(document.all) {                       //-- IE4.x以上
        thisPAS.style.backgroundColor = bgCL;
//        thisPAS.style.borderColor = bdCL;
    }
}

function SetChgColor(thisPAS,num, override) {
    if(override && thisPAS.className.indexOf("error") > -1){
        num =9;
    }

    switch (num) {
    case 0:         // onBlur 離れた時
        ChangeColor(thisPAS,"#FFFFFF","#CCCCCC");
        break;
    case 1:         // onFocus フォーカスが与えられた時
        ChangeColor(thisPAS,"#fff8dc","#003300");
        break;
    case 9:         // エラー
        ChangeColor(thisPAS,"#FFCC99","#000000");
        break;
    }
}