/*-----------------
   common.js
------------------*/

/* 
wold=window.onload;
window.onload=brc;

function brc() {
    if (document.getElementById && !window.opera) {
        eles=document.getElementsByTagName('body');
        if (!document.all) {
            eles[0].setAttribute('oncontextmenu','return(brc2()); ');
            }
        else eles[0].oncontextmenu=brc2;
        }
    if (wold) wold();
    }

    function brc2() {
        return(false);
    }

 */
// {{{ url

/**
 * オンマウスフェード
 *
 * @param url ロケーション先URL
 * @return void
 */
j$(function(){
    j$("a.fade img").fadeTo(0,1.0);
    j$("a.fade img").hover(function(){
         j$(this).fadeTo(200,0.8);
     },
     function(){
         j$(this).fadeTo(200,1.0);
     });
});

// }}}
// {{{ outlink

/**
 * 別タブリンクメソッド
 *
 */

function outLink() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "out")
     anchor.target = "_blank";
 }
}
window.onload=outLink;
// }}}
// {{{ setupDes/offDes/onDes

/**
 * テキストエリア初期化メソッド
 *
 */
function setupDes() {

    var textarea = document.getElementsByTagName("textarea");
    for (i = 0; i < textarea.length; i++) {
        if (textarea[i].className.search("nodes") < 0) {
            if (textarea[i].value == textarea[i].defaultValue) {textarea[i].className += " ondes"; }
            textarea[i].onfocus = function() {offDes(this); }
            textarea[i].onblur = function() {onDes(this); }
        }
    }
    var input = document.getElementsByTagName("input");
    for (i = 0; i < input.length; i++) {
        if ((input[i].className.search("nodes") < 0) && ((input[i].getAttribute("type") == "text")||(input[i].getAttribute("type") == null))) {
            if (input[i].value == input[i].defaultValue) {input[i].className += " ondes"; }
            input[i].onfocus = function() {offDes(this); }
            input[i].onblur = function() {onDes(this); }
        }
    }
    return;
}
function offDes(from) {
    if (from.className.search("ondes") < 0) {return 0;}
    from.className = from.className.replace(/ondes/, "");
    from.value = "";
    return 1;
}
function onDes(from) {
    if (from.value != "") {return 0;}
    from.className += " ondes";
    from.value = from.defaultValue;
    return 1;
}
// }}}



/*---------------------------------------------------------------------------*/
/* インスタンス化                                                            */
/*---------------------------------------------------------------------------*/
//Ins = new Instance();
/*---------------------------------------------------------------------------*/

