/** * progression 4 * * @author copyright (c) 2007-2010 taka:nium.jp, all rights reserved. * @version 4.0.22 * @see http://progression.jp/ * * progression libraries is dual licensed under the "progression library license" and "gpl". * http://progression.jp/license */ var progression; ( function() { progression = function() {}; var d = document, swf = swfobject, $ = function( id ) { return d.getelementbyid( id ); }, $t = function( tagname ) { return d.getelementsbytagname( tagname ); }, $i = function( value, defaultvalue ) { if( $x( value ) ) { return value; } return defaultvalue; }, $x = function( value ) { switch ( value ) { case "" : case null : case undefined : { return false; } } return true; }, $p = function( t1, t2 ) { if ( !$x( t1 ) || !$x( t2 ) ) { return t1; } for ( var p in t2 ) { var tt1 = t1[p], tt2 = t2[p]; if ( typeof( tt1 ) == "object" ) { $p( tt1, tt2 ); } else { t1[p] = $i( tt1, tt2 ); } } return t1; }, $css = function( idortagname, attribute ) { if ( idortagname.charat( 0 ) == "#" ) { var targets = [ $( idortagname.slice( 1 ) ) ]; } else { var targets = $t( idortagname ) || []; } for ( var i = 0, l = targets.length; i < l; i++ ) { var target = targets[i]; if ( target ) { $p( target, { style:attribute } ); } else { var attrstring = ""; for ( var p in attribute ) { attrstring += $decamelize( p ) + ":" + attribute[p] + ";"; } swf.createcss( idortagname, attrstring ); } } }, $decamelize = function( name ) { return name.replace( new regexp( "[a-z]", "g" ), function( $0 ) { return "-" + $0.tolowercase(); } ); }, $render = function( config ) { var html = d.getelementbyid( config.htmlcontentid ); if ( html ) { html.parentnode.removechild( html ); } if ( config.hscale != "none" || config.vscale != "none" ) { var css = { width:"100%", height:"100%", overflow:"auto", margin:"0", padding:"0", fontsize:"0", lineheight:"0", background:config.bgcolor }; $css( "html", css ); $css( "body", css ); switch ( config.hscale ) { case "window" : { var width = "100%", minwidth = config.width + "px", left = "0", marginleft = "0"; break; } case "default" : { var width = config.width + "px", minwidth = width; switch ( config.halign ) { case "center" : { var left = "50%", marginleft = "-" + math.ceil( config.width / 2 ) + "px"; break; } case "right" : { var left = "100%", marginleft = "-" + config.width + "px"; break; } default : { var left = "0", marginleft = "0"; } } break; } case "none" : default : { break; } } switch ( config.vscale ) { case "window" : { var height = "100%", minheight = config.height + "px", top = "0", margintop = "0"; break; } case "default" : { var height = config.height + "px", minheight = height; switch ( config.valign ) { case "middle" : { var top = "50%", margintop = "-" + math.ceil( config.height / 2 ) + "px"; break; } case "bottom" : { var top = "100%", margintop = "-" + config.height + "px"; break; } default : { var top = "0", margintop = "0"; } } break; } case "none" : default : { break; } } $css( "#" + config.attributes.id, { minwidth:minwidth, minheight:minheight } ); $css( "#" + config.contentid, { position:"absolute", width:width, height:height, left:left, top:top, marginleft:marginleft, margintop:margintop, lineheight:0 } ); $css( "#" + config.htmlcontentid, { position:"absolute", width:"0", height:"0", left:"0", top:"0", display:"none", visibility:"hidden" } ); } else { $css( "#" + config.contentid, { width:config.width + "%", height:config.height + "%" } ); } }, config = {}, defaultconfig = { version :"9.0.45", url :"index.swf", width :800, height :600, halign :"center", valign :"middle", hscale :"default", vscale :"default", contentid :"content", htmlcontentid :"htmlcontent", flashcontentid :"flashcontent", bgcolor :"#ffffff", expressinstallpath :"commons/scripts/swfobject/expressinstall.swf", params :{ allowscriptaccess :"always" }, flashvars :{}, attributes :{} }; progression.embedswf = function( customconfig ) { config = $p( customconfig, defaultconfig ); config.attributes.id = config.attributes.name = "external_" + config.contentid; config.params.bgcolor = config.bgcolor; config.params.wmode = "transparent"; //�ύx config.params.allowfullscreen = "true"; $css( "#" + config.htmlcontentid, { display:"none" } ); if ( new regexp( "^playstation 3" ).test( navigator.platform ) ) { $render( config ); } swf.embedswf( config.url, config.flashcontentid, "100%", "100%", config.version, config.expressinstallpath, config.flashvars, config.params, config.attributes, complete ); }; var complete = function( e ) { $p( $( "disabled_javascript" ), { style:{ display:"none" } } ); if ( e.success ) { $render( config ); var target = d.getelementbyid( config.attributes.id ); if ( target ) { target.style.outline = "none"; target.focus(); } } else { $css( "#" + config.htmlcontentid, { display:"block" } ); } }; } )();