// JavaScript Flashmaps Document
function check_exist(str_find, str){
	var result=-1;
	var re = new RegExp(str_find) 
  if (str.search(re) != -1)
      result = 0;
   else
      result = -1;
   return result;
} 



   function maximize(sFile,width_fm,height_fm){ 
// Enlarge map
// Browser detection
if (parseInt(navigator.appVersion.charAt(0))>=4)
{
	var isSF=(check_exist("Safari", navigator.appVersion)!=-1)?1:0;
	var isNN=(navigator.appName=="Netscape")?1:0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}// Window size calculation
tantoW = (width_fm*100)/screen.width;
tantoH = (height_fm*100)/screen.height;
if (tantoW > tantoH) {
 newW = screen.width;
 newH = (((screen.width*100)/width_fm)/100)*height_fm;
 posX = 0;
 posY = (screen.height - newH) / 2;
} else {
 if (tantoW < tantoH) {
   newW = (((screen.height*100)/height_fm)/100)*width_fm;
  newH = screen.height;
  posX = (screen.width - newW) / 2;
  posY = 0;
 } else {
  newW = screen.width;
  newH = screen.height;
  posX = 0;
  posY = 0;
 }
}

var optNN='scrollbars=no,menubar=no,width=' + newW + ',height=' + newH + 'left=' + posX + ',top=' + posY +'';
var optIE='scrollbars=no,menubar=0,width=' + newW + ',height=' + newH + 'left=' + posX + ',top=' + posY+'';
var optSF='width=' + newW + ',height=' + newH ;
var newWindow = '';

// Function Original
  if (isIE)
	  {
		  newWindow=window.open('about:blank','',optIE);
	  }
  else {  
	  	if (isSF)
		{
		  newWindow=window.open('','',optSF);
		  }
		else
		  {
		  newWindow=window.open('','',optNN);
		  }
	  }
      newWindow.document.writeln('<HTML>');
      newWindow.document.writeln('<HEAD>');
      newWindow.document.writeln('<title>Flashmaps FindMe! Dynamic</title>');
      newWindow.document.writeln('<style>body{margin:0px;}td{font-family: Arial;font-size:10}</style>');
      newWindow.document.writeln('<sc'+'ript>');
      newWindow.document.writeln('var isNN,isIE;');
      newWindow.document.writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
      newWindow.document.writeln(' isNN=(navigator.appName=="Netscape")?1:0;');
      newWindow.document.writeln(' isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
      newWindow.document.writeln('function reSizeToMap(){');
      newWindow.document.writeln(' if (isIE){');
      newWindow.document.writeln('  width=' + newW + ';');
      newWindow.document.writeln('  height=' + newH + ';');
      newWindow.document.writeln('  window.moveTo(' + posX + ',' + posY + ')');
      newWindow.document.writeln('  window.resizeTo(width,height);}');
      newWindow.document.writeln(' else {');       
      newWindow.document.writeln('  window.innerWidth=' + newW + ';');
      newWindow.document.writeln('  window.innerHeight=' + newH + ';');
      newWindow.document.writeln('  window.scrollbars=false;}}');       
      newWindow.document.writeln('</sc'+'ript>');
      newWindow.document.writeln('</HEAD>')
      newWindow.document.writeln('');
      newWindow.document.writeln('<BODY bgcolor=#FFFFFF scroll="no" onload="reSizeToMap();self.focus()">');
      newWindow.document.writeln('<TABLE width="100%" border="0">');
      newWindow.document.writeln('  <TR><TD valign="middle" align="center">');
      newWindow.document.writeln('<!-- Flash object -->');
      newWindow.document.writeln('    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
      newWindow.document.writeln('    codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
      newWindow.document.writeln('    ID="tigris" WIDTH="' + (newW-40) + '" HEIGHT="' + (newH-40) + '" ALIGN="center">');
      newWindow.document.writeln('    <PARAM NAME=movie VALUE="'+sFile+'"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>  '); 
      newWindow.document.writeln('    <EMBED src="'+sFile+'" quality=high bgcolor=#FFFFFF  ');
      newWindow.document.writeln('    swLiveConnect=FALSE WIDTH="' + (newW-40) + '" HEIGHT="' + (newH-40) + '" NAME="tigris" ALIGN=""');
      newWindow.document.writeln('    TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
      newWindow.document.writeln('    </EMBED>');
      newWindow.document.writeln('    </OBJECT>');
      newWindow.document.writeln('  </TD></TR>')
      newWindow.document.writeln('</TABLE>');
      newWindow.document.writeln('</BODY>')
      newWindow.document.writeln('</HTML>'); 
  newWindow.document.close();  

}
