﻿var o__config={};
o__config['ph']=o__config['1']={domain:'ph',province:'ZHEJIANG',city:192,mapid:1,x:545741,y:543535,mpx:0.2062891,mpy:0.3107211,ruler:200};
o__config['js']=o__config['2']={domain:'js',province:'ZHEJIANG',city:371,mapid:2,x:540838,y:536690,mpx:0.2062891,mpy:0.3107211,ruler:200};
o__config['hn']=o__config['3']={domain:'hn',province:'ZHEJIANG',city:178,mapid:3,x:547997,y:537383,mpx:0.2062891,mpy:0.3107211,ruler:200};
o__config['jx']=o__config['4']={domain:'jx',province:'ZHEJIANG',city:192,mapid:4,x:550584,y:540622,mpx:0.2062891,mpy:0.3107211,ruler:200};
o__config['xt']=o__config['5']={domain:'xt',province:'ZHEJIANG',city:372,mapid:5,x:546900,y:544323,mpx:0.2062891,mpy:0.3107211,ruler:200};
var city=0;
var province='';
var o_filter=[];
var o_nav=null;
var o_strlist=[];
var o__customValue=null;
var o_mapPath='';
var o_filePath='http://'+domain_config.image;
var host=document.location.href.toLowerCase().split('/')[2];
var arr=host.split('.');
var domain=arr[0]!='en'?arr[0]:arr[1]; 
if(typeof(o_mapid)=='undefined'||typeof(o_mapid)!='number')var o_mapid=0;
var pageMapType='index';
var useNav=true;

function setFilter(filter){
	if(!filter)filter=o_filter;
	for(var i=0;i<filter.length;i++){
		var item=filter[i];
		delete o__customValue[item];
	}
}

function setConfig(key){
	var flag=true;
	if(key&&o__config[key]){
		o__customValue=o__config[key];
		o_mapid=o__customValue.mapid;
	}
	else if(o__config[host]){
		o__customValue=o__config[host];
		o_mapid=o__customValue.mapid;
	}
	else if(o__config[domain]){
		o__customValue=o__config[domain];
		o_mapid=o__customValue.mapid;
	}
	else if(o__config[o_mapid]){
		flag=false;
		o__customValue=o__config[o_mapid];
	}
	else{
		o__customValue=o__config['gz'];
	}
	o__customValue.homePath='http://'+document.domain+'/';
	o__customValue.blogPath='http://'+domain_config.blog+'/';
	city_domain=o__customValue.domain;
	if(document.domain.indexOf('.o.cn')==-1)o__customValue.domain=document.domain;
	o_mapid=o__customValue.mapid;
	city=o__customValue.city;
	province=o__customValue.province;
	setFilter();
	o_mapPath='http://'+domain_config.map+'/resource/mappic/';
	//var dir='zh_cn';
	//if(typeof(o_locale)=='string')dir=o_locale;
	if(!key&&flag)document.write('<script src="/js/data/'+localeParam.locale+'/'+city_domain+'.js"></script>');
}
function setDomain(i){
	if(typeof(i)!='number')i=0;
	var arr=host.split('.');
	if(i>arr.length) {
		alert('domain err');
		return;
	}
	domain=arr[i];
}
function setLocaleParam(){
	localeParam={locale:'zh_cn',ext1:'',ext2:'_zh_cn'};
	if(typeof(locale)=='string')localeParam.locale=locale;
	localeParam.ext1=localeParam.locale=='zh_cn'?'':'_'+localeParam.locale;
	localeParam.ext2='_'+localeParam.locale;
}
function setNav(){
	if(useNav&&o_nav)document.write(o_nav);
	else document.getElementById('divMapNav').style.display='none';
}
function setHot(index){
	if(o_strlist[index]&&typeof(o_strlist[index])=='string')document.write(o_strlist[index]);
}
function setTitle(){
	if(o_strlist['city'])document.write('<title>都市圈-'+o_strlist['city']+'站</title>');
	else document.write('<title>都市圈</title>');
}
function setLogo(){
	document.write('<img src="/images/skin3/logo/'+localeParam.locale+'/'+getLogo()+'" border="0" width="146" height="88" />');
}
function getLogo(){
	var logoList={dy:'www.dycity.gov.cn.jpg'};
	var domain=city_domain;
	var logo=domain+'.gif';
	var arr=host.split('.');
	var myDomain=arr[arr.length-2]+'.'+arr[arr.length-1];
	if(myDomain!='o.cn') logo=document.domain+'.jpg';
	return logo;
}
var gameList=['gz','zs','macau','qz'];
var gameMap={};
setLocaleParam();
setConfig();
