//***************************************************
// 画像透過処理関数(imgTrans)
// 【使い方】
//    ・画像オンマウス時に透過処理を行います。
// 【書式】
//    function imgTrans( $img_id , $trans_par )
// 【引数】
//    1. $img_id    : 対象の画像id ( imgタグ内で指定したid値と同一のものを設定してください ※ページ内での重複厳禁 )
//    2. $trans_par : 透明度       ( 画像の透過度 ※例 0.5→50% ,1→100%(元画像) )
//***************************************************

function imgTrans($img_id, $trans_par) {
    
    var user_agent = navigator.userAgent;
    if(document.layers) {
        if($trans_par > 0) {
            document.layers[$img_id].visibility='visible';
        }
        else if($trans_par==0) {
            document.layers[$img_id].visibility='hidden';
        }
    } else if(user_agent.indexOf('Safari')!=-1) {
        
        document.getElementById($img_id).style.Opacity = $trans_par;
		  
    } else if(user_agent.indexOf('Mac_PowerPC') !=-1 && document.all) {
        if($trans_par > 0) {
            document.all($img_id).style.visibility='visible';
        }
        else if($trans_par==0) {
            document.all($img_id).style.visibility='hidden';
        }
    } else if(document.all) {
        
        document.getElementById($img_id).style.filter="alpha(opacity=0)";
        document.getElementById($img_id).filters.alpha.opacity  = ($trans_par * 100);
        
    } else if(user_agent.indexOf('Gecko')!=-1) {
        
        document.getElementById($img_id).style.MozOpacity = $trans_par;
    }
}

//***************************************************
// 画像切り替え(imgChange)
// 【使い方】
//    ・オンマウスイベント時、画像の切り替えを行います。
// 【書式】
//    function imgChange( $id , $img_path )
// 【引数】
//    1. $id       ：　変換対象の画像id（画像タグ内で指定したidを渡してください。※ページ内重複厳禁）
//    2. $img_path ：　変換後の画像パス
//***************************************************

function imgChange( $id , $img_path ) {
    
    document.getElementById($id).src = $img_path;

}

//***************************************************
// swfファイルを出力する(insertFlash)
//***************************************************
function insertFlash(flafile, wsize, hsize) {
    document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
    document.write('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
    document.write('WIDTH="'+wsize+'" HEIGHT="'+hsize+'" id="top" ALIGN="">');
    document.write('<PARAM NAME=movie VALUE="'+flafile+'">');
    document.write('<PARAM NAME=quality VALUE=high>');
    document.write('<PARAM NAME=bgcolor VALUE=#FFFFFF>');
    document.write('<PARAM name=loop value=true>');
    document.write('<EMBED src="'+flafile+'" loop=true quality=high bgcolor=#FFFFFF  WIDTH="'+wsize+'" HEIGHT="'+hsize+'" NAME="top" ALIGN=""');
    document.write('TYPE="application/x-shockwave-flash" PLUGINSPAGE="'+flafile+'://www.macromedia.com/go/getflashplayer"></EMBED> ');
    document.write('</OBJECT>');
}


//***************************************************
// テキストオンマウス時のバルーン表示
// 【書式】
//    shorToolTip(event,text)
// 【引数】
//    1. ev　　: イベント文字列
//    2. img   : バルーン表示する画像
//***************************************************
/* ※jquery移行のため不使用
function showToolTip(e,img){
    if(document.all){
      e = event;
    }
    var obj_disp = document.getElementById( 'balloon_area' );
    var obj_img  = document.getElementById( 'balloon_content' );
    obj_img.src = img;
    obj_disp.style.display = 'block';
    var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
    var leftPos = e.clientX - 80;
    if(leftPos<0){
      leftPos = 0;
    }
    obj_disp.style.left = leftPos + 'px';
    obj_disp.style.top  = e.clientY - obj_disp.offsetHeight -1 + st + 'px';
}

function hideToolTip(){
    document.getElementById('balloon_area').style.display = 'none';
    document.getElementById( 'balloon_content' ).src = 'images/qr_dummy.gif';
    document.getElementById('balloon_area').style.display = 'none';
}
*/
