var requiredMajorVersion = 9;
var requiredMinorVersion = 0;
var requiredRevision = 28;
var domain = "";
if(document.domain == 'test-oshiuri.excite.co.jp'){
    domain = 'test-oshiuri.excite.co.jp';
}else{
    domain = 'oshiuri.excite.co.jp';
}

function oshiuriPresent(presentFlashVars,main)
{
    var url;
    if(main){
        url = "http://"+domain+"/contents/oshiuri_present.swf";
    }else{
        url = "http://"+domain+"/contents/oshiuriProjector.swf";
        presentFlashVars += "&type=1&referer="+escape(location.href);
    }
    var so = new SWFObject(url, "player", "500", "405", "6", "#ffffff");
    so.addParam("FlashVars", presentFlashVars);
    so.addParam("quality", "high");
    so.write("oshiuri_contents");
}

function oshiuriPresentV2(presentFlashVars,width,height,main)
{
    if(typeof width == 'undefined'){
        width = 500;
    }
    if(typeof height == 'undefined'){
        height = 405;
    }
    var url = "http://"+domain+"/contents/";
    var swf;
    if(main){
        swf = "oshiuri_present";
    }else{
        swf = "oshiuriProjector";
        presentFlashVars += "&type=1&referer="+escape(location.href);
    }
	if (AC_FL_RunContent) {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
			'width', width,
			'height', height,
			'src', url+swf,
            'FlashVars',presentFlashVars,
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', swf,
			'bgcolor', '#ffffff',
			'name', swf,
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','always',
			'movie', url+swf,
			'salign', ''
			); //end AC code
	}
}

function oshiuriMovie(movieFlashVars,width,height)
{
    if(typeof width == 'undefined'){
        width = 420;
    }
    if(typeof height == 'undefined'){
        height = 367;
    }
    movieFlashVars += "&type=2&referer="+escape(location.href);
    if (AC_FL_RunContent && DetectFlashVer) {
        var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
        if(hasRightVersion) {  // 使用可能なバージョンが検出された場合
            AC_FL_RunContent(
                'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0',
                'width', width,
                'height', height,
                'src', 'http://'+domain+'/contents/oshiuriPlayer',
                'FlashVars',movieFlashVars,
                'quality', 'high',
                'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                'align', 'middle',
                'play', 'true',
                'loop', 'true',
                'scale', 'showall',
                'wmode', 'window',
                'devicefont', 'false',
                'id', 'oshiuriPlayer',
                'bgcolor', '#ffffff',
                'name', 'oshiuriPlayer',
                'menu', 'false',
                'allowScriptAccess','always',
                'allowFullScreen','true',
                'movie', 'http://'+domain+'/contents/oshiuriPlayer',
                'salign', ''
            );
        } else { 
            var alternateContent = 'このコンテンツには Adobe Flash Player が必要です。 ' + '<a href=http://www.macromedia.com/go/getflash/>Flash Player を入手する</a>';
            document.write(alternateContent);
        }
    }
}

function oshiuriFlash(flashFlashVars,embed)
{
    var url = "http://" + domain + "/contents/";
    if(embed){
        url    += "oshiuri_flash_embed";
    }else{
        url    += "oshiuri_flash";
    }

    var width=320;
    var height=300;

	if (AC_FL_RunContent) {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
			'width', width,
			'height', height,
			'src', url,
			'FlashVars',flashFlashVars,
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', 'oshiuriPlayer',
			'bgcolor', '#ffffff',
			'name', 'oshiuriPlayer',
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','always',
			'movie', url,
			'salign', ''
			); //end AC code
	}
}

