//ウィンドウ内ポップアップ表示用スクリプト

function showBox(element){
     $('overlay').show();
     center(element);
     return false;
}


function showBox2(){
     $('overlay').show();
     return false;
}

function hideBox(element){
     element.hide();
     $('overlay').hide();
     return false;
}

function center(element){
     var my_width = 0;
     var my_height = 0;

     if ( typeof( window.innerWidth ) == 'number' ){
         my_width = window.innerWidth;
         my_height = window.innerHeight;
     } else if ( document.documentElement &&
              ( document.documentElement.clientWidth ||
                document.documentElement.clientHeight ) ){
         my_width = document.documentElement.clientWidth;
         my_height = document.documentElement.clientHeight;
     } else if ( document.body &&
                 ( document.body.clientWidth || document.body.clientHeight )
                ){
         my_width = document.body.clientWidth;
         my_height = document.body.clientHeight;
     }

     element.style.position = 'absolute';
     element.style.zIndex = 99;
     var scrollY = 0;

     if ( document.documentElement && document.documentElement.scrollTop ){
         scrollY = document.documentElement.scrollTop;
     } else if ( document.body && document.body.scrollTop ){
         scrollY = document.body.scrollTop;
     } else if ( window.pageYOffset ){
         scrollY = window.pageYOffset;
     } else if ( window.scrollY ){
         scrollY = window.scrollY;
     }

     var elementDimensions = Element.getDimensions(element);
     var setX = ( my_width - elementDimensions.width ) / 2;
     var setY = ( my_height - elementDimensions.height ) / 2 + scrollY;
     
     setX = ( setX < 0 ) ? 0 : setX;
     setY = ( setY < 0 ) ? 0 : setY;
     
     element.style.left = setX + "px";
     element.style.top = setY + "px";
     element.style.display = 'block';
}

function flash_loading(swf){
    
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="500" height="200" id="loading" align="middle">');
　　document.write('<param name="allowScriptAccess" value="sameDomain" />');
　　document.write('<param name="wmode" value="transparent" />');
　　document.write('<param name="allowFullScreen" value="false" />');
　　document.write('<param name="movie" value="'+swf+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" />   <embed src="'+swf+'" quality="high" bgcolor="#000000" width="500" height="200" name="loading" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
　　document.write('</object>');
    
}

    
