<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>

<meta name="description" content="Map container page." />

<?php

$autoStart = false;
include_once('../wiki.php');

//
//	Language File
//
	if( !isset($_GET['l']) || !ctype_alpha($_GET['l']) ){
		$_GET['l'] = 'en';
	}
	$langFile = './lang/'.$_GET['l'].'/WBmap.php';
	if( !is_file($langFile) ){
		$langFile = './lang/en/WBmap.php';
	}
	include_once($langFile);


//
//	Javascript files
//

	if( $_GET['key'] == 'offline'){
		echo '<script src="http://wikyblog.loc/include/x_google/v2.5/maps.js?file=api&v=1&key=somethinghere" type="text/javascript"></script>';
		
	}elseif(isset( $_GET['key']) ){
		$key =& $_GET['key'];
		$goodKey = true;
		if( strpos($key,'&') !== false ){
			$goodKey = false;
			
		}elseif( strpos($key,'"') !== false ){
			$goodKey = false;
		}
		
		if( $goodKey ){
			//echo '<script src="http://maps.google.com/maps?file=api&v=2&key='.$_GET['key'].'" type="text/javascript"></script>';
			echo '<script src="http://maps.google.com/maps?file=api&v=2&key='.$_GET['key'].'" type="text/javascript"></script>';
		}else{
			echo 'illegal map key';
		}
	}
	
	echo "\n";
	
	echo '<style type="text/css" >/*<![CDATA[*/ ';
	echo '@import "'.$wbDirPrefix.'/include/js/maps.css?v='.$_GET['v'].'";';
	echo ' /*]]>*/</style>';

?>

<style type="text/css">
body,html {	FONT-FAMILY:ARIAL;FONT-SIZE: small;margin:0px;padding:0px;line-height:160%}
v\:* { behavior:url(#default#VML);}
</style>
<script type="text/javascript">
	var mapDiv;
	var myGmap;
	var myCtrl = false;
	var p = parent;
	
	
	var mapObj = new Object();
	mapObj.overlays = Array();
	mapObj.letters = Array();
	mapObj.current = -1;
	mapObj.count = 0;
	mapObj.listeners = Array();
	mapObj.tempO = Array();
	mapObj.len = 0;
	mapObj.editing = false;
	mapObj.ID = false;
	
	function go(){
		if( (typeof(p.wbMaps) != "undefined") 
			&& (typeof(p.wbMaps.init) != "undefined") 
			//&& (typeof(GMap2) != "undefined") //onload="go()" won't execute until javascript is loaded too
			){
				p.wbMaps.init(self);
				
		}else{
			setTimeout(function(){go()},500);
		}
	}
	
	function dcg(t){
		return window.document.getElementById(t);
	}

</script>
</head>

<body onload="go()" onunload="GUnload()">
	<div id="mapDebug0" style="padding:20px;display:none;">
	<?php echo $langA['MAP_DEBUG_O'] ?>
	</div>
	
	<div id="mapDebug1" style="padding:20px;display:none;background-color:white;">
	<?php echo $langA['MAP_DEBUG_1'] ?>
	</div>
	
<div id="mapDiv" style="height:500px;background-color:#f1f1f1;">
	<?php echo $langA['loading_map'] ?>
	<noscript>
	<?php echo $langA['MAP_NO_SCRIPT']; ?>
	</noscript>
</div>
<div id="WBmapDescs" style="display:none"></div>

</body>

</html>