// Flash Abfrage

//Netscape Flash-Abfrage
var ver = 0;
var flash = false;

if (navigator.plugins && navigator.plugins['Shockwave Flash']) {
  var words = navigator.plugins["Shockwave Flash"].description.split(" ");
  for (var a = 0; a < words.length; ++a) {
	  if (isNaN(parseInt(words[a]))) continue;
		ver = parseInt(words[a]);
  }
} 

//Internet Explorer FlashAbfrage
if (document.all) {
  document.write(''+
  '<s'+'cript language="VBScript">\nOn error resume next\n'+
  'ver=0\n'+
  'For i=5 to 3 step -1\n'+
  'Set x = CreateObject("ShockwaveFlash.ShockwaveFlash." & i)\n'+
  'v = IsObject(x)\n'+
  'if v then \n'+
  'ver=i\n'+
  'Exit For\n'+
  'End If\n'+
  'next\n'+
  '</scrip'+'t>')
}

flash = (ver >= 5)? true : false;




function writeFlash(swf,width,height,name,align,AltenativImg) {
  if (flash) {
    if (!name) name = swf.substr(0,(swf.length-4));
    toWrite = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=' + width + ' HEIGHT=' + height + ' ID='+name+'><PARAM NAME=movie VALUE="'+swf+'"><PARAM NAME=quality VALUE=high><EMBED src="' + swf + '" quality=high WIDTH='+ width  +' HEIGHT='+ height  +' TYPE="application/x-shockwave-flash" NAME="'+ name +'" ID="'+ name +'" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swliveconnect="true"></EMBED></OBJECT>';
    //alert(toWrite);
  } else if (AltenativImg == 'home') {
    toWrite='<img src="/img/flash/0_0_home.jpg" width="'+width+'" height="'+height+'" usemap="#Map" border="0"><map name="Map"><area shape="rect" coords="1,50,191,240" href="javascript:document.location.href=getTrURL(\'1\');"><area shape="rect" coords="200,98,390,290" href="javascript:document.location.href=getTrURL(\'2\');"><area shape="rect" coords="399,150,540,289" href="javascript:document.location.href=getTrURL(\'3\');"><area shape="rect" coords="551,100,740,290" href="javascript:document.location.href=getTrURL(\'6c\');"><area shape="rect" coords="350,-3,670,90" href="http://www.macromedia.com/download/" target="_blank"></map>'
	} else if (AltenativImg == 'hometeaser') {
    toWrite='<a href="javascript:document.location.href=getTrURL(\'9\');"><img src="/img/flash/0_0_hometeaser.jpg" width="'+width+'" height="'+height+'" border="0"></a>'
	} else if (AltenativImg != null) {
    toWrite = '<img src="' + AltenativImg + '" width="'+width+'" height="'+height+'" border="0" alt="">'; 
  }
  document.write(toWrite);
}


// Macromedia Scripte

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



function MM_swapImgRestore() { 

  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_preloadImages() { 

  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_findObj(n, d) { 

  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); return x;

}



function MM_swapImage() { 

  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];}

}

// Ad Game

function openGame() {
	MM_openBrWindow('/dyn/2_gamezone/adgame/index.html','arcade_flash','width=390,height=460,toolbar=no,location=no,menubar=no,scrollbars=no,resizable=no');
}

function openAmbuscade() {
	MM_openBrWindow('/dyn/2_gamezone/invaders/flash.jsp','games','width=606,height=460,scrollbars=yes');
}
