/*
** ******************************************
** Global
** ******************************************
*/
MM_contentVersion = null;
MM_FlashCanPlay = false;
/*
** ******************************************
** Prototype
** ******************************************
*/
function setFlashVersion(PARAM_version, PARAM_reroot) {
	MM_contentVersion = PARAM_version;
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
		for (var i = 0; i < words.length; ++i) {
			if (isNaN(parseInt(words[i])))
			continue;
			var MM_PluginVersion = words[i]; 
		}
		MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
	} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
		document.write('on error resume next \n');
		document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
		document.write('</SCR' + 'IPT\> \n');
	}
	if ( MM_FlashCanPlay ) {
		return;
	} else {
		location.href = PARAM_reroot;
	}
}
// ******************************************
function fixAX(PARAM_path, PARAM_fileName, PARAM_suffix, PARAM_width, PARAM_height, PARAM_bgcolor, PARAM_align) {
	
		embedAttrs = new Object();
		params = new Object();
		objAttrs = new Object();
		//
		objAttrs.classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000";
		objAttrs.codebase = "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0";
		objAttrs.width = PARAM_width;
		objAttrs.height = PARAM_height;
		objAttrs.id = PARAM_fileName;
		objAttrs.align = PARAM_align;
		//
		params.allowScriptAccess = "sameDomain";
		params.movie = PARAM_path + PARAM_fileName + "." + PARAM_suffix;
		params.quality = "high";
		params.menu = false;
		params.bgcolor = PARAM_bgcolor;
		//
		embedAttrs.src = PARAM_path + PARAM_fileName + "." + PARAM_suffix;
		embedAttrs.quality = "high";
		embedAttrs.width = PARAM_width;
		embedAttrs.height = PARAM_height;
		embedAttrs.name = PARAM_fileName;
		embedAttrs.align = PARAM_align;
		embedAttrs.menu = false;		
		embedAttrs.allowScriptAccess = "sameDomain";
		embedAttrs.type = "application/x-shockwave-flash";
		embedAttrs.pluginspage = "http://www.macromedia.com/go/getflashplayer";
		//
		var str = '<object ';
		for (var i in objAttrs) {
			str += i + '="' + objAttrs[i] + '" ';
		}
		str += '>';
		for (var i in params) {
			str += '<param name="' + i + '" value="' + params[i] + '" /> ';
		}
		str += '<embed ';
		for (var i in embedAttrs) {
			str += i + '="' + embedAttrs[i] + '" ';
		}
		str += ' ></embed></object>';
		//
		document.write(str);
	
}
/*
** ******************************************
** new window
** ******************************************
*/
function getFullscreen( url ){
	var isWin=(navigator.appVersion.indexOf("Win")!=-1)? true : false;
	var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)? true : false;

	if(screen.availHeight > 768 || screen.availWidth > 1024){

		var ah=768;
		var aw=1024;
		var h = Math.floor( (screen.availHeight-ah)/2 );
		var w = Math.floor( (screen.availWidth-aw)/2 );

		var str="screenX=0,screenY=0";
		str = ",top="+h+",left="+w;

		if(window.screen){
			str+=",height="+ah;
			str+=",width="+aw;
		}

		var tmp=window.open(url,'Creatures',str);
		tmp.resizeTo(aw,ah);

	}else{
		if(isWin&&isIE){
			sw=screen.width;
			sh=screen.height;
			window.open(url,'Creatures','width='+sw+',height='+sh+',left=0,top=0,toolbar=no,directories=no,location=no,toolbar=no,menubar=no,resizable=yes,scrollbars=no');
		}else{
			var str="left=0,screenX=0,top=0,screenY=0";
			if(window.screen){
				var ah=screen.availHeight;
				var aw=screen.availWidth;
				str+=",height="+ah;
				str+=",width="+aw;
			}

			var tmp=window.open(url,'Creatures',str);
			tmp.moveTo(0,0);
			tmp.resizeTo(aw,ah);
		}
	}
}

/*
** ******************************************
** RollOver
** ******************************************
*/

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*
** ******************************************
** Subwin
** ******************************************
*/

function subwin_map(data){
  window.open(data, "crMap","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=589,height=525");
}
function subwin_mapNew(data){
  window.open(data, "crMapNew","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=589,height=525");
}
function subwin_spec(data){
  window.open(data, "crSpec","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=400,height=330");
}
function subwin_blog(data){
  window.open(data, "blog","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=420,height=420");
}
function subwin_banana(data){
  window.open(data, "banana","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=972,height=768");
}