if(typeof c8_deconcept=="undefined")var c8_deconcept=new Object();
if(typeof c8_deconcept.util=="undefined")c8_deconcept.util=new Object();
if(typeof c8_deconcept.SWFObjectUtil=="undefined")c8_deconcept.SWFObjectUtil=new Object();
c8_deconcept.SWFObject=function(swf,id,w,h,ver,c,quality,xiRedirectUrl,redirectUrl,detectKey){
if(!document.getElementById){return;}
this.DETECT_KEY=detectKey?detectKey:'detectflash';
this.skipDetect=c8_deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(swf){this.setAttribute('swf',swf);}
if(id){this.setAttribute('id',id);}
if(w){this.setAttribute('width',w);}
if(h){this.setAttribute('height',h);}
if(ver){this.setAttribute('version',new c8_deconcept.PlayerVersion(ver.toString().split(".")));}
this.installedVer=c8_deconcept.SWFObjectUtil.getPlayerVersion();
if(!window.opera&&document.all&&this.installedVer.major>7){
c8_deconcept.SWFObject.doPrepUnload=true;
}
if(c){this.addParam('bgcolor',c);}
var q=quality?quality:'high';
this.addParam('quality',q);
this.setAttribute('useExpressInstall',false);
this.setAttribute('doExpressInstall',false);
var xir=(xiRedirectUrl)?xiRedirectUrl:window.location;
this.setAttribute('xiRedirectUrl',xir);
this.setAttribute('redirectUrl','');
if(redirectUrl){this.setAttribute('redirectUrl',redirectUrl);}
}
c8_deconcept.SWFObject.prototype={
useExpressInstall:function(path){
this.xiSWFPath=!path?"expressinstall.swf":path;
this.setAttribute('useExpressInstall',true);
},
setAttribute:function(name,value){
this.attributes[name]=value;
},
getAttribute:function(name){
return this.attributes[name];
},
addParam:function(name,value){
this.params[name]=value;
},
getParams:function(){
return this.params;
},
addVariable:function(name,value){
this.variables[name]=value;
},
getVariable:function(name){
return this.variables[name];
},
getVariables:function(){
return this.variables;
},
getVariablePairs:function(){
var variablePairs=new Array();
var key;
var variables=this.getVariables();
for(key in variables){
variablePairs[variablePairs.length]=key+"="+variables[key];
}
return variablePairs;
},
getSWFHTML:function(){
var swfNode="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");
this.setAttribute('swf',this.xiSWFPath);
}
swfNode='<embed type="application/x-shockwave-flash" src="'+this.getAttribute('swf')+'" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'" style="'+this.getAttribute('style')+'"';
swfNode+=' id="'+this.getAttribute('id')+'" name="'+this.getAttribute('id')+'" ';
var params=this.getParams();
for(var key in params){swfNode+=[key]+'="'+params[key]+'" ';}
var pairs=this.getVariablePairs().join("&");
if(pairs.length>0){swfNode+='flashvars="'+pairs+'"';}
swfNode+='/>';
}else{
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","ActiveX");
this.setAttribute('swf',this.xiSWFPath);
}
swfNode='<object id="'+this.getAttribute('id')+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'" style="'+this.getAttribute('style')+'">';
swfNode+='<param name="movie" value="'+this.getAttribute('swf')+'" />';
var params=this.getParams();
for(var key in params){
swfNode+='<param name="'+key+'" value="'+params[key]+'" />';
}
var pairs=this.getVariablePairs().join("&");
if(pairs.length>0){swfNode+='<param name="flashvars" value="'+pairs+'" />';}
swfNode+="</object>";
}
return swfNode;
},
write:function(elementId){
if(this.getAttribute('useExpressInstall')){
var expressInstallReqVer=new c8_deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(expressInstallReqVer)&&!this.installedVer.versionIsValid(this.getAttribute('version'))){
this.setAttribute('doExpressInstall',true);
this.addVariable("MMredirectURL",escape(this.getAttribute('xiRedirectUrl')));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);
}
}
if(this.skipDetect||this.getAttribute('doExpressInstall')||this.installedVer.versionIsValid(this.getAttribute('version'))){
var n=(typeof elementId=='string')?document.getElementById(elementId):elementId;
n.innerHTML=this.getSWFHTML();
return true;
}else{
if(this.getAttribute('redirectUrl')!=""){
document.location.replace(this.getAttribute('redirectUrl'));
}
}
return false;
}
}
c8_deconcept.SWFObjectUtil.getPlayerVersion=function(){
var PlayerVersion=new c8_deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){
PlayerVersion=new c8_deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));
}
}else if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){
var axo=1;
var counter=3;
while(axo){
try{
counter++;
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+counter);
PlayerVersion=new c8_deconcept.PlayerVersion([counter,0,0]);
}catch(e){
axo=null;
}
}
}else{
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
}catch(e){
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
PlayerVersion=new c8_deconcept.PlayerVersion([6,0,21]);
axo.AllowScriptAccess="always";
}catch(e){
if(PlayerVersion.major==6){
return PlayerVersion;
}
}
try{
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
}catch(e){}
}
if(axo!=null){
PlayerVersion=new c8_deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
}
}
return PlayerVersion;
}
c8_deconcept.PlayerVersion=function(arrVersion){
this.major=arrVersion[0]!=null?parseInt(arrVersion[0]):0;
this.minor=arrVersion[1]!=null?parseInt(arrVersion[1]):0;
this.rev=arrVersion[2]!=null?parseInt(arrVersion[2]):0;
}
c8_deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major)return false;
if(this.major>fv.major)return true;
if(this.minor<fv.minor)return false;
if(this.minor>fv.minor)return true;
if(this.rev<fv.rev)return false;
return true;
}
c8_deconcept.util={
getRequestParameter:function(param){
var q=document.location.search||document.location.hash;
if(param==null){return q;}
if(q){
var pairs=q.substring(1).split("&");
for(var i=0;i<pairs.length;i++){
if(pairs[i].substring(0,pairs[i].indexOf("="))==param){
return pairs[i].substring((pairs[i].indexOf("=")+1));
}
}
}
return"";
}
}
c8_deconcept.SWFObjectUtil.cleanupSWFs=function(){
var objects=document.getElementsByTagName("OBJECT");
for(var i=objects.length-1;i>=0;i--){
objects[i].style.display='none';
for(var x in objects[i]){
if(typeof objects[i][x]=='function'){
objects[i][x]=function(){};
}
}
}
}
if(c8_deconcept.SWFObject.doPrepUnload){
if(!c8_deconcept.unloadSet){
c8_deconcept.SWFObjectUtil.prepUnload=function(){
__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
window.attachEvent("onunload",c8_deconcept.SWFObjectUtil.cleanupSWFs);
}
window.attachEvent("onbeforeunload",c8_deconcept.SWFObjectUtil.prepUnload);
c8_deconcept.unloadSet=true;
}
}
if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];}}
var c8_getQueryParamValue=c8_deconcept.util.getRequestParameter;
var c8_FlashObject=c8_deconcept.SWFObject;
var c8_SWFObject=c8_deconcept.SWFObject;
﻿
var C8PlayerMap_UserKey="";
var C8PlayerMap_ABCKey="";
var C8PlayerMap_UseMap=true;
var C8PlayerMap_UsePlayer=true;
function C8PlayerMap_getC8Parameter(src){
var paramList=new Object();
var start=src.indexOf("C8PlayerMap.js?")+15;
var keys=src.substring(start,src.length);
var keyPareList=keys.split("&");
for(var i=0;i<keyPareList.length;i++){
var onePare=keyPareList[i];
var keyValue=onePare.split("=");
paramList[keyValue[0]]=keyValue[1];
}
return paramList;
}
function C8PlayerMap_getC8PlayerKey(){
var sSrc="";
var j=0;
if(document.all){
var iCollection=document.getElementsByTagName("script").length;
for(var i=0;i<iCollection;i++){
sSrc=document.getElementsByTagName("script")[i].src;
j=sSrc.indexOf("C8PlayerMap.js?c8key=");
if(j!=-1)
break;
}
}
else{
sSrc=document.getElementsByName("city8script")[0].src;
}
return sSrc;
}
var C8PlayerMap_src=C8PlayerMap_getC8PlayerKey();
var paramList=C8PlayerMap_getC8Parameter(C8PlayerMap_src);
if(paramList.useMap==0||paramList.useMap=="0")
C8PlayerMap_UseMap=false;
else
C8PlayerMap_ABCKey=paramList.mapabckey;
if(paramList.usePano==0||paramList.usePano=="0")
C8PlayerMap_UsePlayer=false;
else
C8PlayerMap_UserKey=paramList.c8key;
if(C8PlayerMap_UseMap){
var abcURL="http://mapapi.house.sina.com.cn/fmp/v1.0/js/fmp.js?key=b04cc12a07d941616343fd13e660a6663b16045929f50538a7fdafed5a5b06958369fda5ccd6c02c";
abcURL="<script src=\'"+abcURL+"\' ><\/script> ";
document.write(abcURL);
}
﻿
if((typeof c8PanoDebug)=="undefined")
c8BaseURL=getC8ScriptSrc("C8PlayerMap.js");
else
c8BaseURL=getC8ScriptSrc("C8pano.js");
c8FlashURl=c8BaseURL;
function getC8ScriptSrc(s)
{
var sSrc="";
var iCollection=document.getElementsByTagName("script").length;
for(var i=0;i<iCollection;i++)
{
sSrc=document.getElementsByTagName("script")[i].src;
if(sSrc.indexOf(s)!=-1)
{
sSrc=sSrc.substr(0,sSrc.indexOf(s));
break;
}
}
return sSrc;
}
function C8IncludeScript(src)
{
document.write("<"+"script src=\""+src+"\""+
" type=\"text/javascript\"> <"+"/script>");
}
if((typeof c8_SWFObject)=="undefined")
C8IncludeScript(c8BaseURL+"c8swf.js");
c8EventReceiverList=new Array();
function c8RegistEventReceiver(receiver)
{
for(var i=0;i<c8EventReceiverList.length;i++)
{
if(c8EventReceiverList[i].receiver.id==receiver.id)
{
return false;
}
}
var aObject=new Object();
aObject.receiver=receiver;
c8EventReceiverList.push(aObject);
return true;
}
function unc8RegistEventReceiver(receiver)
{
for(var i=0;i<c8EventReceiverList.length;i++)
{
if(c8EventReceiverList[i].receiver.id==receiver.id)
{
c8EventReceiverList.splice(i);
return true;
}
}
return false;
}
function c8GlobalDispatchEvent(command,args)
{
var receiverId=args.split(",")[0];
for(var i=0;i<c8EventReceiverList.length;i++)
{
if(c8EventReceiverList[i].receiver.id==receiverId)
{
var event=new Object();
event.args=args;
c8EventReceiverList[i].receiver.dispatchC8Event(command,event);
return true;
}
}
return false;
}
function C8EventControl()
{
this.eventList=new Array();
}
C8EventControl.prototype.id=null;
C8EventControl.prototype.eventList=null;
C8EventControl.prototype.eventCode=null;
C8EventControl.prototype.addEventListener=function(eventType,functionName,
object)
{
for(var i=0;i<this.eventList.length;i++)
{
if(this.eventList[i].functionName==functionName&&
this.eventList[i].eventType==eventType&&
this.eventList[i].object==object)
{
return false;
}
}
var aObject=new Object();
aObject.eventType=eventType;
aObject.functionName=functionName;
aObject.object=object;
this.eventList[this.eventList.length]=aObject;
return true;
};
C8EventControl.prototype.removeEventListener=function(eventType,functionName,
object)
{
for(var i=0;i<this.eventList.length;i++)
{
if(this.eventList[i].eventType==eventType&&
this.eventList[i].functionName==functionName&&
this.eventList[i].object==object)
{
this.eventList.splice(i,1);
return true;
}
}
return false;
};
C8EventControl.prototype.removeAllEventListeners=function()
{
this.eventList=new Array();
};
C8EventControl.prototype.dispatchC8Event=function(eventType,event)
{
if(!event)
{
event=new Object();
}
event.target=this;
event.type=eventType;
for(var i=0;i<this.eventList.length;i++)
{
if(this.eventList[i].eventType==eventType)
{
var aFunction=this.eventList[i].functionName;
var object=(this.eventList[i].object)?this.eventList[i].object:
aFunction;
aFunction.call(object,event);
}
}
};
function C8SuspendedCallList()
{
this.base=C8EventControl;
this.base();
this.callList=new Array();
}
C8SuspendedCallList.prototype=new C8EventControl();
C8SuspendedCallList.prototype.callList=null;
C8SuspendedCallList.prototype.addCall=function(aFunctionName,aArgs)
{
this.callList.push(
{
functionName:aFunctionName,args:aArgs
}
);
};
C8SuspendedCallList.prototype.clearCallList=function()
{
this.callList=new Array();
};
C8SuspendedCallList.prototype.flushCallList=function()
{
for(var i=0;i<this.callList.length;i++)
{
var aCall=this.callList[i];
if(aCall.args==null)
{
aCall.args=new Array();
}
this[aCall.functionName].apply(this,aCall.args);
}
this.clearCallList();
};
function PanoOption()
{
return;
};
PanoOption.prototype.c8PanoKey="";
PanoOption.prototype.endDate="";
PanoOption.prototype.allowFullScreen=true;
PanoOption.prototype.poisID="pois";
PanoOption.prototype.flashID="FlashPanoObj";
PanoOption.prototype.cityCode='021';
PanoOption.prototype.domain="http://sh.city8.com/";
PanoOption.prototype.ajaxDomain="http://sh.city8.com/ajax/";
PanoOption.prototype.panoLibDomain="http://pic.city8.com/panolib/";
PanoOption.prototype.panoID=null;
PanoOption.prototype.logoHide=false;
PanoOption.prototype.language="simpleChinese";
C8Pano.EVENT_FLASH_COMUNICATE="onFlashTalkJS";
C8Pano.EVENT_FLASH_INITIALIZED="onFlashInited";
C8Pano.EVENT_PANO_PTZ_CHANGED="onPanoPTZChanged";
C8Pano.prototype.EVENT_PANO_PANOID_CHANGED="onPanoPanoIDChanged";
C8Pano.option=null;
function C8Pano(containerId,options)
{
this.base=C8SuspendedCallList;
this.base();
C8Pano.option=options;
C8Pano.instanceCount++;
if(options&&options.flashID)
{
this.id=options.flashID;
}
else
{
this.id="pano"+MMap.instanceCount;
}
if(options&&options.panoID)
{
this.panoID=options.panoID;
}
else
{
this.panoID="undefined";
}
if(options&&options.cityCode)
{
this.cityCode=options.cityCode;
}
else
{
this.cityCode="undefined";
}
if(options&&options.panoLibDomain)
{
this.panoLibDomain=options.panoLibDomain;
}
var flashName="c8panoplayer.swf";
if(options&&options.flashName)
{
flashName=options.flashName;
}
var so=new c8_SWFObject(c8FlashURl+flashName,this.id,"100%","100%",
"9.0.18","#FFffff");
so.addVariable("wmode","transparent");
so.addParam("allowScriptAccess",value="always");
so.useExpressInstall(c8BaseURL+"expressinstall.swf");
so.addVariable("flashID",this.id);
so.addVariable("panoID",this.panoID);
so.addVariable("cityCode",this.cityCode);
if(options&&options.poisID)
{
so.addVariable("poisID",options.poisID);
}
if(options&&options.ajaxDomain)
{
so.addVariable("g_Domain_Ajax",options.ajaxDomain);
}
if(options&&options.pan)
{
so.addVariable("pan",options.pan);
}
if(options&&options.tilt)
{
so.addVariable("tilt",options.tilt);
}
if(options&&options.zoom)
{
so.addVariable("zoom",options.zoom);
}
if(options&&options.domain)
{
so.addVariable("g_Domain",options.domain);
}
if(options&&options.logoHide)
{
so.addVariable("logoHide",options.logoHide);
}
if(options&&options.showPoi)
{
so.addVariable("showPoi",options.showPoi);
}
if(options)
{
so.addVariable("option",options);
}
if(options&&options.helpHide)
{
so.addVariable("helpHide",options.logoHide);
}
if(options&&options.endDate)
{
so.addVariable("endDate",options.endDate);
}
so.addVariable("g_Domain_PanoLib",this.panoLibDomain);
so.addParam("quality","high");
if(options&&options.allowFullScreen==false)
{
so.addParam("allowfullscreen","false");
}
else
{
so.addParam("allowfullscreen","true");
}
so.addParam("scale","noscale");
so.write(containerId);
this.flashProxy=document.getElementById(this.id);
this.pois=new Pois(this,"pois");
eval("window."+this.id+"=this.flashProxy");
c8RegistEventReceiver(this);
this.addEventListener(C8Pano.EVENT_FLASH_INITIALIZED,this.innerPanoInited,
this);
}
C8Pano.prototype=new C8SuspendedCallList();
C8Pano.instanceCount=0;
C8Pano.prototype.initialized=false;
C8Pano.prototype.flashProxy=null;
C8Pano.prototype.pois=null;
C8Pano.prototype.jsInited=false;
C8Pano.prototype.startShowFristPano=function()
{alert("starshow");
if(!this.canCall("startShowFristPano",arguments))
{
return;
}
this.flashProxy.callFlashAPI("startShowFristPano",true);
};
C8Pano.prototype.innerPanoInited=function(event)
{
this.initialized=true;
this.flushCallList();
jsInited=true;
};
C8Pano.prototype.innerPanoComunicate=function(event)
{
if(this.flashProxy.callFlashAPI("getFromJs",true))
{
this.initialized=true;
this.flushCallList();
jsInited=true;
}
};
function getPanoOptionObj()
{
C8Pano.option.flashDebug=false;
return C8Pano.option;
};
C8Pano.prototype.isInitialized=function()
{
if(this.initialized)
{
return true;
}
else
{
return false;
}
};
C8Pano.prototype.canCall=function(functionName,args)
{
if(this.isInitialized())
{
return true;
}
else
{
this.addCall(functionName,args);
return false;
}
};
C8Pano.prototype.Tracer=function(par)
{
if(!this.canCall("Tracer",arguments))
{
return;
}
this.flashProxy.callFlashAPI("myTracer",par);
};
C8Pano.prototype.setPanoInfo=function(panoID,cityCode,pan,tilt,zoom,radarPanFlag)
{
if(!this.canCall("setPanoInfo",arguments))
{
return;
}
this.flashProxy.callFlashAPI("setPanoInfo",panoID,cityCode,pan,tilt,zoom,
radarPanFlag);
};
C8Pano.prototype.showPanoHint=function(show)
{
if(!this.canCall("showPanoHint",arguments))
{
return;
}
this.flashProxy.callFlashAPI("showPanoHint",show);
};
C8Pano.prototype.startAutoDemo=function(dp,dt,dz,runtime)
{
if(!this.canCall("startAutoDemo",arguments))
{
return;
}
this.flashProxy.callFlashAPI("startAutoDemo",dp,dt,dz,runtime);
};
C8Pano.prototype.showPanobyTheodolite=function(x,y,e)
{
if(!this.canCall("showPanobyTheodolite",x,y,e))
{
return;
}
this.flashProxy.callFlashAPI("showPanobyTheodolite",x,y,e);
};
C8Pano.prototype.DrawMapbyTheodolite=function(x,y,e)
{
if(!this.canCall("DrawMapbyTheodolite",arguments))
{
return;
}
this.flashProxy.callFlashAPI("DrawMapbyTheodolite",x,y,e);
};
C8Pano.prototype.getPanoInfo=function()
{
if(!this.canCall("getPanoInfo",arguments))
{
return null;
}
return this.flashProxy.callFlashAPI("getPanoInfo");
};
C8Pano.prototype.getPanoInfoObj=function()
{
if(!this.canCall("getPanoInfoObj",arguments))
{
return null;
}
return this.flashProxy.callFlashAPI("getPanoInfoObj");
};
C8Pano.prototype.getTheodolite=function()
{
if(!this.canCall("getTheodolite",arguments))
{
return null;
}
return this.flashProxy.callFlashAPI("getTheodolite");
};
C8Pano.prototype.getTheodoliteNumber=function()
{
if(!this.canCall("getTheodoliteNumber",arguments))
{
return null;
}
return this.flashProxy.callFlashAPI("getTheodoliteNumber");
};
C8Pano.prototype.setDomainValue=function(domain,domainAjax,domainPanolib)
{
if(!this.canCall("setDomainValue",arguments))
{
return;
}
this.flashProxy.callFlashAPI("setDomainValue",domain,domainAjax,
domainPanolib);
};
C8Pano.prototype.setUserInfo=function(userid,name,level,acount)
{
if(!this.canCall("setUserInfo",arguments))
{
return;
}
this.flashProxy.callFlashAPI("setUserInfo",userid,name,level,acount);
};
C8Pano.prototype.callFlash=function(fucName,parg)
{
if(!this.canCall(fucName,arguments))
{
return;
}
this.flashProxy.callFlashAPI(fucName,arguments);
};
C8Pano.prototype.pachongPoiAdd=function(xx,yy,mainid,subid,tiltle,addr,tle,detailmsg,aibangid)
{
this.flashProxy.callFlashAPI("pachongPoiAdd",xx,yy,mainid,subid,tiltle,addr,tle,detailmsg,aibangid);
};
C8Pano.prototype.movieAddPoi=function(xx,yy,mainid,subid,tiltle,addr,tle,detailmsg,aibangid)
{
this.flashProxy.callFlashAPI("movieAddPoi",xx,yy,mainid,subid,tiltle,addr,tle,detailmsg,aibangid);
};
C8Pano.prototype.callAnyAPI=function(fucName,parg)
{
if(!this.canCall(fucName,arguments))
{
return;
}
var temary=new Array();
for(var i=1;i<arguments.length;i++)
{
temary.push(arguments[i]);
}
this.flashProxy.callFlashAPI("callAnyAPI",fucName,temary);
};
function Pois(pano,ID)
{
this.base=C8SuspendedCallList;
this.base();
Pois.instanceCount++;
this.id=ID;
if(pano)
{
this.flashProxy=pano.flashProxy;
}
c8RegistEventReceiver(this);
}
Pois.prototype.EVENT_POI_CHANGED="onPoiChanged";
Pois.prototype=new C8SuspendedCallList();
Pois.prototype.instanceCount=0;
Pois.prototype.initialized=false;
Pois.prototype.flashProxy=null;
Pois.prototype.addNewPoi=function()
{
this.flashProxy.callFlashAPI("addNewPoi");
};
Pois.prototype.setActivePoi=function(poiID)
{
this.flashProxy.callFlashAPI("setActivePoi",poiID);
};
﻿
var C8PlayerMap_PlayerID="";
var C8PlayerMap_MapID="";
var C8PlayerMap_thisMap="";
var C8PlayerMap_thisPlayer="";
var C8PlayerMap_initCxx="lnigmuronnNGEE";
var C8PlayerMap_initCyy="nmfkmlkktNOIM";
var C8PlayerMap_RadarAngleChanged=false;
var C8PlayerMap_optPanoID="14596_1AZR";
var C8PlayerMap_optCityCode="021";
var C8PlayerMap_optMapZoom=15;
var C8PlayerMap_setRadarCxx="";
var C8PlayerMap_setRadarCyy="";
var C8PlayerMap_setRadarPan="";
var C8PlayerMap_radarInited=false;
C8PlayerMap.prototype.player=null;
C8PlayerMap.prototype.map=null;
function C8PlayerMap_setDefaultPlayerMap(opt){
if(C8PlayerMap_UsePlayer){
var playerOptions=C8PlayerMap_getDefaultPlayerOption(opt);
C8PlayerMap_thisPlayer=new C8Pano(C8PlayerMap_PlayerID,playerOptions);
C8PlayerMap_thisPlayer.addEventListener("onFlashInited",C8PlayerMap_onPlayerInited);
C8PlayerMap.prototype.player=C8PlayerMap_thisPlayer;
}
if(!C8PlayerMap_UseMap)
return;
var mapOptions=C8PlayerMap_getDefaultMapOption(opt);
C8PlayerMap_thisMap=new MMap(C8PlayerMap_MapID,mapOptions);

C8PlayerMap_thisMap.addEventListener(MMap.EVENT_MAP_INITIALIZED,C8PlayerMap_mapInited);
}
function C8PlayerMap_getDefaultPlayerOption(opt){
var pid=C8PlayerMap_optPanoID;
var cityCode=C8PlayerMap_optCityCode;
if(typeof opt!="undefined"){
if(typeof opt.panoID!="undefined"){
pid=opt.panoID;
}
if(typeof opt.cityCode!="undefined"){
cityCode=opt.cityCode;
}
}
var playerOptions=new PanoOption();
playerOptions.panoID=pid;
playerOptions.cityCode=cityCode;
playerOptions.allowFullScreen=true;
playerOptions.ajaxDomain=opt.ajaxDomain;
playerOptions.domain=opt.domain;
playerOptions.panoLibDomain=opt.panoLibDomain;
return playerOptions;
}
function C8PlayerMap_getDefaultMapOption(opt){
if(typeof opt!="undefined"){
if(typeof opt.mapCxx!="undefined")
C8PlayerMap_initCxx=opt.mapCxx;
if(typeof opt.mapCyy!="undefined")
C8PlayerMap_initCyy=opt.mapCyy;
}
var mapOptions={mapId:"fmptest",zoomLevel:C8PlayerMap_optMapZoom};
mapOptions.center=new MLatLng(C8PlayerMap_initCyy,C8PlayerMap_initCxx);
return mapOptions;
}
function C8PlayerMap(pID,mID,opt){
try{
C8PlayerMap_PlayerID=pID;
C8PlayerMap_MapID=mID;
if(typeof opt=="undefined"){
C8PlayerMap_setDefaultPlayerMap(opt);
return;
}
if(C8PlayerMap_UsePlayer&&(typeof opt.showPano=="undefined"||opt.showPano!=false)){
var playerOptions;
if(typeof opt.playerOption=="undefined"){
playerOptions=C8PlayerMap_getDefaultPlayerOption(opt);
}
else{
playerOptions=opt.playerOption;
C8PlayerMap_optPanoID="14596_1AZR";
C8PlayerMap_optCityCode="021";
}
C8PlayerMap_thisPlayer=new C8Pano(C8PlayerMap_PlayerID,playerOptions);
C8PlayerMap_thisPlayer.addEventListener("onFlashInited",C8PlayerMap_onPlayerInited);
}
if(C8PlayerMap_UseMap&&(typeof opt.showMap=="undefined"||opt.showMap!=false)){
var mapOptions;
if(typeof opt.mapOption=="undefined"){
mapOptions=C8PlayerMap_getDefaultMapOption(opt);
}
else
mapOptions=opt.mapOption;
C8PlayerMap_thisMap=new MMap(C8PlayerMap_MapID,mapOptions);
C8PlayerMap_thisMap.addEventListener(MMap.EVENT_MAP_INITIALIZED,C8PlayerMap_mapInited);
}
this.player=C8PlayerMap_thisPlayer;
this.map=C8PlayerMap_thisMap;
}
catch(e){
alert(e.description);
}
}
function C8PlayerMap_onPlayerInited(event){
C8PlayerMap_thisPlayer.addEventListener("onPanoPanoIDChanged",C8PlayerMap_onPanoIDChanged,this);
C8PlayerMap_thisPlayer.addEventListener("onPanoPTZChanged",C8PlayerMap_dragPanoViewChanged,this);
}
function C8PlayerMap_mapInited(event){
C8PlayerMap_thisMap.switchDefaultDBClickProcessor(false);
C8PlayerMap_thisMap.addEventListener(MMap.EVENT_CITY8_RADAR_INITIALIZED,C8PlayerMap_onRadarInited);
C8PlayerMap_thisMap.addEventListener(MMap.EVENT_CITY8_RADAR_POSCHANGED,C8PlayerMap_radarPosChanged);
C8PlayerMap_thisMap.addEventListener(MMap.EVENT_MAP_DBCLICK,C8PlayerMap_handleMapDBClick);
C8PlayerMap_thisMap.addEventListener(MMap.EVENT_CITY8_RADAR_ANGLECHANGED,C8PlayerMap_radarAngleChanged);
C8PlayerMap_thisMap.addEventListener(MMap.EVENT_GET_COORD_MAP_TO_SCREEN,C8PlayerMap_getCoordMapToScreen);
C8PlayerMap_thisMap.addCity8Radar(0,0x0066FF,50,80,false,C8PlayerMap_initCxx,C8PlayerMap_initCyy,false);
C8PlayerMap_thisMap.setCompassScale(50);
}
function C8PlayerMap_setRadarFov(f){
C8PlayerMap_thisMap.setCity8RadarFov(f);
}
function C8PlayerMap_onRadarInited(event){
C8PlayerMap_radarInited=true;
C8PlayerMap_thisMap.getCoordMapToScreen(C8PlayerMap_setRadarCxx,C8PlayerMap_setRadarCyy);
}
function C8PlayerMap_onPanoIDChanged(event){
var aList=event.args.split(",");
var pid=aList[1];
var x=aList[2];
var y=aList[3];
if(x==null||x==""||y==null||y==""){
//alert("C8PlayerMap_onPanoIDChanged Param Error "+event.args);
return;
}
C8PlayerMap_setRadarCxx=x;
C8PlayerMap_setRadarCyy=y;
var p=aList[4];
C8PlayerMap_setRadarPan=p;
if(!C8PlayerMap_radarInited){
return;
}
C8PlayerMap_thisMap.getCoordMapToScreen(x,y);
}
function C8PlayerMap_radarPosChanged(event){
var x=event.args.split(",")[1];
var y=event.args.split(",")[2];
C8PlayerMap_thisPlayer.showPanobyTheodolite(x,y,"MAPABC");
}
function C8PlayerMap_handleMapDBClick(event){
var x=event.args.split(",")[2];
var y=event.args.split(",")[3];
C8PlayerMap_thisMap.openCity8Radar(false);
C8PlayerMap_thisMap.setCity8RadarPos({lat:y,lng:x});
C8PlayerMap_thisPlayer.showPanobyTheodolite(x,y,"MAPABC");
}
function C8PlayerMap_radarAngleChanged(event){
var pan=event.args.split(",")[1];
C8PlayerMap_RadarAngleChanged=true;
C8PlayerMap_thisPlayer.setPanoInfo(" "," ",pan,-1000,-1000,true);
C8PlayerMap_RadarAngleChanged=false;
}
function C8PlayerMap_getCoordMapToScreen(event){
var x=event.args.split(",")[1];
var y=event.args.split(",")[2];
var f=C8PlayerMap_isRadarOutOfMap(x,y);
if(C8PlayerMap_setRadarPan=="")
return;
C8PlayerMap_thisMap.setCity8RadarAngle(C8PlayerMap_setRadarPan);
C8PlayerMap_thisMap.setCity8RadarPos({lat:C8PlayerMap_setRadarCyy,lng:C8PlayerMap_setRadarCxx});
if(f){
C8PlayerMap_thisMap.setCenterByLatLng(C8PlayerMap_setRadarCyy,C8PlayerMap_setRadarCxx);
}
C8PlayerMap_thisMap.openCity8Radar(true);
C8PlayerMap_thisMap.showCity8Radar(true);
}
function C8PlayerMap_isRadarOutOfMap(x,y){
var ws=document.getElementById(C8PlayerMap_MapID).style.width;
var w=ws.replace("px","");
var w1=parseInt(w);
var hs=document.getElementById(C8PlayerMap_MapID).style.height;
var h=hs.replace("px","");
var h1=parseInt(h);
var offset=0;
var max_x=w1/2+128-offset;
var max_y=h1/2+128-offset;
var min_x=128-w1/2+offset;
var min_y=128-h1/2+offset;
if(x<min_x||x>max_x)
return true;
if(y<min_y||y>max_y)
return true;
return false;
}
function C8PlayerMap_dragPanoViewChanged(event){
var aList=event.args.split(",");
if(!C8PlayerMap_RadarAngleChanged)
C8PlayerMap_thisMap.setCity8RadarAngle(aList[5]);
C8PlayerMap_thisMap.setCity8RadarFov(aList[4]);
}
function C8PlayerMap_getAngle(r){
var val=(r*180)/Math.PI;
return val-Math.floor(val/360)*360;
}
function C8PlayerMap_getAngleTilt(r){
return(r*180)/Math.PI;
}
function C8PlayerMap_setPano(pid,pan,tilt,_cityCode){
try{
C8PlayerMap_thisPlayer.setPanoInfo(pid,_cityCode,pan,tilt,-1000);
}
catch(e){
alert(e.description);
}
}