/*______________________________________



	putFlash Version 0.8 r11

	Last updated on 2003.6.5



	Copyright (C) 2000-2003

	Business Architects Inc. All rights reserved.

	http://www.b-architects.com/



______________________________________*/



/*---------------------------------------

	2006/04	Remodeling for "FlashVars"  propaty

-----------------------------------------*/



var pluginspages = new Array();

pluginspages[0] = "http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"; // English

pluginspages[1] = "http://www.macromedia.com/jp/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"; // Japanese



var pluginVer = 0;





function pfAltAction(Obj) {

	if (Obj.nonflashSW == 1) location.href = Obj.nonFlashSRC;

	return Obj.nonFlashSRC;

}



function pfAltContent(Obj) {

	if (Obj.nonflashSW == 1) return "";

	return Obj.nonFlashSRC;

}





function pfFlashPlayerObject() {

	if(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]){

		return navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;

	}

}



function putflash (Obj) {

	

	if (!Obj.dir) Obj.dir = '';

	if (!Obj.id) Obj.id = 'putflash';

	if (!Obj.requiredVer) Obj.requiredVer = 6;

	if (!Obj.bgcolor) Obj.bgcolor = "#ffffff";

	if (!Obj.quality) Obj.quality = "high";

	if (!Obj.language) Obj.language = 0;

	if (!Obj.macie4exec && Obj.macie4exec != "0") Obj.macie4exec = 0;

	if (!Obj.moz_exec && Obj.moz_exec != "0") Obj.moz_exec = 1;

	if (!Obj.opera_exec && Obj.opera_exec != "0") Obj.opera_exec = 0;

	if (!Obj.nonflashSW && Obj.nonflashSW != "0") Obj.nonflashSW = 0;

	if (!Obj.nonFlashSRC) Obj.nonFlashSRC = "";

	if (!Obj.swLiveConnect) Obj.swLiveConnect = "false";

	if (!Obj.menu) Obj.menu = "false";

	if (!Obj.disableCodebase) Obj.disableCodebase = 0;

	if (!Obj.flashVars) Obj.flashVars= '';



	var plugin = pfFlashPlayerObject();

	if (plugin) {
		pluginVer = parseInt(plugin.description.substring(plugin.description.indexOf("Flash") +6));
		//pluginVer = parseInt(plugin.description.substring(plugin.description.indexOf(".") -1));
	} else {

		// for Win MSIE

		document.writeln('<script type="text/vbscript">');

		document.writeln('On Error Resume Next');

		document.writeln('Private swfEnableFlag');

		document.writeln('swfEnableFlag = false');

		document.writeln('swfEnableFlag = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.' + Obj.requiredVer + '"))');

		document.writeln('If swfEnableFlag Then');

		document.writeln('pluginVer = ' + Obj.requiredVer);

		document.writeln('End If');

		document.writeln('</script>');

	}



	document.open();

	if (Obj.hedSRC) document.write(Obj.hedSRC);

	if (pluginVer < Obj.requiredVer){

		document.write(pfAltAction(Obj));

	} else {

 		document.write(pfGetObjectElement(Obj));

	}

	if (Obj.fotSRC) document.write(Obj.fotSRC);

	document.close();

}









function pfGetObjectElement(Obj){

	if (window.opera && Obj.opera_exec != 1) {

		return pfAltAction(Obj);

	}



	if (!Obj.file || !Obj.width || !Obj.height || !Obj.id) {

		return "";

	}



	var result = "";

	result += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';



	if(!Obj.disableCodebase){

		result += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"';

	}

	result += ' id="' + Obj.id + '" width="' + Obj.width + '" height="' + Obj.height + '" name="' + Obj.id + '">';

	result += '<param name="movie" value="' + Obj.dir + Obj.file + '">';

	result += '<param name="quality" value="' + Obj.quality + '">';

	result += '<param name="bgcolor" value="' + Obj.bgcolor + '">';

	result += '<param name="menu" value="' + Obj.menu + '"' + '>';

	if (Obj.salign) result += '<param name="salign" value="' + Obj.salign + '"' + '>';

	if (Obj.scale) result += '<param name="scale" value=' + Obj.scale + '' + '>';

	if (Obj.flashVars) result += '<param name="FlashVars" value="' + Obj.flashVars+ '"' + '>';



	if ((navigator.appVersion.indexOf('Win',0) != -1 && navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1) && !window.opera){

		result += pfAltContent(Obj);

	} else {

		result += pfGetEmbedElement(Obj);

	}

	result += '</object>';

	return result;

}







function pfGetEmbedElement(Obj){

	if (Obj.moz_exec != 1 && (navigator.userAgent.indexOf("Gecko/") != -1)) return pfAltAction(Obj);



	if (Obj.macie4exec != 1 && (navigator.appVersion.indexOf('Mac',0) != -1)){

		if (navigator.appVersion.indexOf('MSIE 4.',0) != -1) return pfAltAction(Obj);

		if (navigator.appVersion.indexOf('MSIE 3.',0) != -1) return pfAltAction(Obj);

	}



	var result = "";

	result += '<embed src="' + Obj.dir + Obj.file + '"';

	result += ' menu="' + Obj.menu + '"';

	result += ' quality="' + Obj.quality + '"';

	result += ' swLiveConnect="' + Obj.swLiveConnect + '"';

	result += ' bgcolor="' + Obj.bgcolor + '"';

	result += ' width="' + Obj.width + '"';

	result += ' height="' + Obj.height + '"';

	if (Obj.salign) result += ' salign="' + Obj.salign + '"';

	if (Obj.scale) result += ' scale="' + Obj.scale + '"';

	if (Obj.flashVars) result += ' FlashVars="' + Obj.flashVars + '"';

	result += ' type="application/x-shockwave-flash"';

	result += ' pluginspage="' + pluginspages[Obj.language] + '"';

	result += ' name="' + Obj.id + '"';

	result += '></embed><br>';

	return result;

}








