if ( !window.gameonblog_entry_siww_count ) window.gameonblog_entry_siww_count = 0;
window.gameonblog_entry_siww_count++;
var gameonblog_entry_siww = function () {//	var rootPath_siww = 'http://localhost:8080/siww/';	var rootPath_siww = 'http://spaceinvadersww.com/bpt/';	var gamePath = rootPath_siww;
	var tag_id = 'gameonblog_entry_siww';
	var div_id = tag_id + '_flashcontent';
	var script_id = tag_id + '_scp';
	var object_id = tag_id + '_object';
	var myAmazonID = '';
	var myCategoryNum = 0;
	var mySkinID = 0;
	var myTypeId = 0;
	var myItemId = 0;
	var myParentId = 0;
	var myChildId = 0;
	var script_elem = document.getElementById(script_id);
	var in_html = script_elem.innerHTML;
	script_elem.parentNode.removeChild(script_elem);
	var script_argv = in_html.split(',');
	if (script_argv.length != 0) {
		script_argv[0].match(/([0-9a-zA-Z\-]+)/);
		myAmazonID = RegExp.$1;
		script_argv[1].match(/([0-9a-zA-Z\-]+)/);
		myCategoryNum = RegExp.$1;		if (script_argv[2] && script_argv[2].match(/([1-8]+)/)) {
			mySkinID = RegExp.$1;
		}
		if (script_argv[3] && script_argv[3].match(/([0-9]+)/)) {
			myTypeId = RegExp.$1;
		}
		if (script_argv[4] && script_argv[4].match(/([0-9]+)/)) {
			myItemId = RegExp.$1;
		}
		if (script_argv[5] && script_argv[5].match(/([a-zA-Z0-9_]+)/)) {
			myParentId = RegExp.$1;
		}
		if (script_argv[6] && script_argv[6].match(/([a-zA-Z0-9_]+)/)) {
			myChildId = RegExp.$1;
		}
	}

	return {
		rootPath_siww : rootPath_siww,
		gamePath : gamePath,
		script_id : script_id,
		div_id : div_id,
		object_id : object_id,
		myAmazonID : myAmazonID,
		myCategoryNum : myCategoryNum,
		mySkinID : mySkinID,
		myTypeId : myTypeId,
		myItemId : myItemId,
		myParentId : myParentId,
		myChildId : myChildId,
		myFile : '',
		write_script : function () {
			var myStr = '';
			myStr += '<script type="text/javascript" src="'+this.rootPath_siww+'js/swfobject_source.js"><\/script>';
			this.div_id += '_' + window.gameonblog_entry_siww_count;
			myStr += '<div id="' + this.div_id + '"></div>';
			myStr += '<script type="text/javascript" src="'+this.rootPath_siww+'js/setcontent_entry_siww.js"><\/script>';
			document.write(myStr);
		},
		add_load_event : function (func) {
			var oldonload = window.onload;
			if (typeof window.onload != 'function'){
				window.onload = func;
			} else {
				window.onload = function(){
				oldonload();
				func();
				}
			}
		},
		initover_lay_flash_siww : function () {
			if (!document.getElementsByTagName){ return; }
			var anchors = document.getElementsByTagName("a");

			// loop through all anchor tags
			for (var i=0; i<anchors.length; i++){
				var anchor = anchors[i];

				if (anchor.getAttribute("href") && (anchor.getAttribute("rel") == "overLayFlash")){
					anchor.onclick = function () {
						this.showFlashsiww(this); 
						return false;
					}
				}
			}
		},
		so_write : function (mySkinID) {
			var so = new SWFObject(this.rootPath_siww + 'blogparts_entry_siww.swf?'+Math.random(), this.object_id, "322", "262", "8", "#ffffff");
			so.addVariable("referrer", location.href);
			so.addVariable("amazonID", this.myAmazonID);
			so.addVariable("categoryNum", this.myCategoryNum);
			if (mySkinID) {
				so.addVariable("skin_id", mySkinID);
			}
			if (myTypeId) {
				so.addVariable("type_id", myTypeId);
			}
			if (myItemId) {
				so.addVariable("itemId", myItemId);
			}
			if (myParentId) {
				so.addVariable("parentId", myParentId);
			}
			if (myChildId) {
				so.addVariable("childId", myChildId);
			}
			so.addParam("scale", "noscale");
			so.addParam("wmode", "window");
			so.addParam("base", ".");
			so.addParam("quality", "high");
			so.addParam("allowScriptAccess", "always");
			so.write(this.div_id);
		},
		showFlashsiww : function (myFile, w_width, w_height){
			this.myFile = myFile;
			window.open(this.rootPath_siww + 'game_entry.html?' + myFile,"_blank", "width=" + w_width + ",height=" + w_height+",scrollbars=no");
		},		start : function (){			var sch1;
			var verno;
			var version=get_flash_version();
			var dotno = version.indexOf(".");						if(dotno > 0){				verno=version.slice(0,dotno);			}else{				verno=version;			}			
			sch1=eval(verno);			if(sch1<9){
				document.write("<br><a href='http://www.adobe.com/products/flashplayer/' target='_blank'><img src='http://spaceinvadersww.com/images/noFlashplayer.jpg' border='0'></a><br>");
			}else{				this.init();			};

		},
		init : function (myFile){			this.write_script();
			this.add_load_event(this.initover_lay_flash_siww);
		},
		hideScrollBar : function (){},
		_dummy : null
	};
}();function get_flash_version() {
 var version='0.0.0';
 if(navigator.plugins && navigator.mimeTypes['application/x-shockwave-flash']){
  var plugin=navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin;
  // the code below is used in SWFObject
  //var plugin=navigator.plugins['Shockwave Flash'];
  if (plugin && plugin.description) {
   // convert the description like 'Shockwave Flash 9.0 r28' into version string like '9.0.8';
   // regex is provided by SWFObject
   version=plugin.description.replace(/^[A-Za-z\s]+/, '').replace(/(\s+r|\s+b[0-9]+)/, ".");
  }
  
 } else { // in the case of Win IE
  var x='';
  try {
   // for ver.7 and later
   var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
   x=axo.GetVariable("$version");
  } catch(e) {
   try {
    // for ver.6
    axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
    x="WIN 6,0,21,0";
    /*
     * GetVariable() crashes player version 6.0.22-29, and
     * players which have those versions throws when access 
     * to AllowScriptAccess
     */
    axo.AllowScriptAccess="always";
    x=axo.GetVariable("$version");
   } catch(e) {
    if (!x.match(/^WIN/)) {
     try {
      // for 4.x,5.x
      axo=null;
      axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
      // version 3 player throws when you call GetVariale().
      x=axo.GetVariable("$version");
     } catch(e) {
      if (axo) {
       // for 3.x
       x="WIN 3,0,18,0";
      } else {
       try {
        // for 2.x
        axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
        x="WIN 2,0,0,11";
       } catch(e) {
        x="WIN 0,0,0,0";
       }
      }
     }
    }
   }
  }
  // convert ActiveX version string to our version string like '9.0.28'
  version=x.replace(/^WIN /,'').replace(/,[0-9]+$/,'').replace(/,/g,'.');
 }
 // check version string format
 // Quicktime enabled Safari returns a description in natural language
 if (version.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)) {
  return version;
 } else {
  return '0.0.0';
 }
}gameonblog_entry_siww.start();
//gameonblog_entry_siww.init();
