///////////////////////////////////////////
/////////  GenMeta1 & Meta1 //////////////
//////////////////////////////////////////
function GenMeta1_Meta1(){
	this.myBrowser=new MyBrowser()
	this.resized=0
}
GenMeta1_Meta1.prototype.__Meta1_init=
GenMeta1_Meta1.prototype._init=
function _init(){
	if(window.addEventListener){
		window.addEventListener("resize",resize,false)
	}else{
		window.attachEvent("onresize",resize)
	}
	this.resetMenu=0
this.resetMenus=new Array()	
	window.onload=this.onload()
	this.canvas=document.getElementById("canvas")
	this.canvas.onmouseover=this.associateObjWithEvent(
		this,"canvasMouseover")
	mybody=document.getElementById("body")
	mybody.onclick=this.associateObjWithEvent( this,"bodyClick")
	this.canvas.onclick=this.associateObjWithEvent(
this,"canvasClick")
}
GenMeta1_Meta1.prototype.associateObjWithEvent=
function (obj,methodName){
    return (function(e){
        e = e||window.event;
        return obj[methodName](e, this);
    });
}
GenMeta1_Meta1.prototype.associateObjWithFunc=
function (obj,methodName){
    return (function(parms){
        return obj[methodName](this,parms);
    });
}
GenMeta1_Meta1.prototype.doMarkerClicked=function(){
	return
}
GenMeta1_Meta1.prototype.canvasClick=
function (obj,methodName){
//alert("canvasClick"+this.resetMenus.length)
	for(var x=0;x<this.resetMenus.length;x++){
if((this.resetMenus[x])
&&( this.resetMenus[x].parms.isResetMenu=="canvasClick")){
//alert(x)		
	this.resetMenus[x].resetMenu()
	this.resetMenu[x]=0
}
	}
}
GenMeta1_Meta1.prototype.canvasMouseover=
function (obj,methodName){
	if((this.resetMenu)
	&&(this.resetMenu.parms.isResetMenu=="canvasMouseover")){
		this.resetMenu.resetMenu()
		this.resetMenu=0
	}
}
GenMeta1_Meta1.prototype.__Meta1_getHrefBase=
GenMeta1_Meta1.prototype.getHrefBase=
function getHrefBase(funcPageId){
	if(isLocal){
		var str="index.php?"
	}else{
		var str=this.getUrlBase()+"/index.php?"
	}
	if(funcPageId)str+="pageId="+funcPageId
	return str
}
GenMeta1_Meta1.prototype.getUrlBase=
function getUrlBase(){
	if(isLocal=='1'){
		return "http://localhost"
	}else{
		return url
	}
}

/*
GenMeta1_Meta1.prototype.getMyVirtualDir=
function vdir{
	if(isLocal=='1'){
		return "/"+myVirtualName
	}else{
		return "/~"+hostUsername+"/"+myVirtualName
	}
}
*/
GenMeta1_Meta1.prototype.HTTPReq=function(myHTTP){
	if(myHTTP.req.readyState<4)return
	this.myBody.style.cursor="default"	
	if(!myHTTP.req.responseText)return
//alert(myHTTP.req.responseText)
	return myHTTP.getVarss()
}
GenMeta1_Meta1.prototype.HTTPSend=function (myHttp,funcname){
	this.myBody.style.cursor="wait"
	myHttp.req.onreadystatechange=
		this.associateObjWithFunc(this,funcname)
	myHttp.req.open("GET",myHttp.url,true)
	myHttp.req.send(null)
}
GenMeta1_Meta1.prototype.mousemove=
function (event,element){
	var evt=new MyMouseEvent(event)
	this.mousemoveXY=evt.getMouseXY()
}
GenMeta1_Meta1.prototype.bodyClick=
function (obj,methodName){
}
GenMeta1_Meta1.prototype.__Meta1_onFontResize=
GenMeta1_Meta1.prototype.onFontResize=
function onFontResize(){
//	alert("onFontResize")
}
GenMeta1_Meta1.prototype.__Meta1_onload=
GenMeta1_Meta1.prototype.onload=
function onload(){
}
GenMeta1_Meta1.prototype.resize=
function resize(){
	switch(bd.browser){
	case "Netscape":this.resizeIt();return
	default:
		if(this.resized){
			this.resized=0
		}else{
			this.resizeIt()
		}	
	}
}
GenMeta1_Meta1.prototype.__Meta1_resizeIt=
GenMeta1_Meta1.prototype.resizeIt=
function resizeIt(){
	if(isLocal)this.resized=1
	this.myBrowser=new MyBrowser()
}
//////////////// deprecate //////////////////
GenMeta1_Meta1.prototype.__Meta1_setMenu=
GenMeta1_Meta1.prototype.setMenu=
function setMenu(parent,myXml,parms){
	this.menu=new Menu(parent,myXml,parms)
	this.menu.build(pageId)
}
///////////////////////////////////////////////

///////////// deprecate ///////////////////////
GenMeta1_Meta1.prototype.__Meta1_setMapPlaces=
GenMeta1_Meta1.prototype.setMapPlaces=
function setMapPlaces(parms){
//if(place)parms.showPlace=place
	var myXml=new MyXml()
	myXml.loadStr(placesXml)
	this.googleMapPlaces=new GoogleMapPlaces(document.getElementById("map"),myXml)
	this.googleMapPlaces.map.addControl(new GSmallMapControl());
	this.googleMapPlaces.map.addControl(new GMapTypeControl());
	this.googleMapPlaces.setLinks()
	this.googleMapPlaces.mapLinkOn=parms.mapLinkOn
	this.googleMapPlaces.mapLinkOff=parms.mapLinkOff
	this.googleMapPlaces.showPlace(parms.showPlace,parms.zoom)
	this.googleMapPlaces.setOverlays()	
}
///////////////////////////////////
GenMeta1_Meta1.prototype.setMousemoveOn=
function setMousemoveOn(){
	document.onmousemove=this.associateObjWithEvent(this,"mousemove")
	if(bd.browser!="IE")document.captureEvents(Event.MOUSEMOVE)
}	

///////////////////////////////////////////
///////////////////////////////////////////
/////////////////////////////////////////////
GenMeta1.deriveFrom(GenMeta1_Meta1)
function GenMeta1(){
	this.GenMeta1_Meta1()
}
GenMeta1.prototype.__GenMeta1_init=
function _init(){
	this.__Meta1_init() 
	this.setMousemoveOn()
}
GenMeta1.prototype.__GenMeta1_setMapPlaces=
function setMapPlaces(){
	if(!parms.zoom)parms.zoom=4
//if(place)parms.showPlace=place
	var myXml=new MyXml()
	myXml.loadStr(placesXml)
	el=document.getElementById("map")
	el.style.border="1px solid #c0c0c0"	
	this.googleMapPlaces=new GoogleMapPlaces(el,myXml)
	this.googleMapPlaces.map.addMapType(G_PHYSICAL_MAP)
var ind=this.googleMapPlaces._tempfix(parms.showPlace)
	this.googleMapPlaces.map.addControl(new GMapTypeControl());
	this.googleMapPlaces.map.addControl(new GLargeMapControl())
	this.googleMapPlaces.map.addControl(new GScaleControl())	
	this.googleMapPlaces.map.addControl(new GOverviewMapControl())	
	var optGMapType=myXml.getFieldData(
myXml.xmlDom.documentElement.childNodes[ind],"optGMapType")
	switch(optGMapType){
	case "hybrid":
		this.googleMapPlaces.map.setMapType(G_HYBRID_MAP)
		break
	case "normal":
		this.googleMapPlaces.map.setMapType(G_NORMAL_MAP)
		break
	case "physical":
		this.googleMapPlaces.map.setMapType(G_PHYSICAL_MAP)
		break
	case "satellite":
		this.googleMapPlaces.map.setMapType(G_SATELLITE_MAP)
		break
	default:
		this.googleMapPlaces.map.setMapType(G_HYBRID_MAP)
	}
	this.googleMapPlaces.setLinks()
	this.googleMapPlaces.mapLinkOn=parms.mapLinkOn
	this.googleMapPlaces.mapLinkOff=parms.mapLinkOff
	var optGMapZoom=myXml.getFieldData(
myXml.xmlDom.documentElement.childNodes[ind],"optGMapZoom")
	if(optGMapZoom>0)parms.zoom=optGMapZoom
	this.googleMapPlaces.mapTagBackgroundColor=parms.mapTagBackgroundColor
	this.googleMapPlaces.showPlace(
parms.showPlace,parms.zoom,ind)
	if(myXml.xmlDom.documentElement.childNodes.length<2)
		el.style.marginLeft="40px"
	this.googleMapPlaces.setOverlays()	
}


