var preUrl, dpp, pp, theP, tpvar url;//var siteCom;var xmlMode = true;var pt = {};var ph = {};var succProc = new Function('data','updatePage(data)');//var divFunc = new Function('data','updateDiv(data)');var evPat = '//xmlEV';//searchvar s = {};var lg = {};//var ck, iP, ckTheme; //input page num/// showDivvar onDiv = {};var origDiv = {};var origDLink = {};/// 9-3-6/*var siteCom = 'animeart.com';var xPreH = 'http://animeart.com/p/x?';var cDom = 'http://animeart.com:8080/'; // content domvar uiPreH = 'http://ui.animeart.com:8080/us/users/';*/var siteCom, serverName, preH, xPreH, cDom, uiPreH;var iURL, uHistC;var optionsArgsForm;var lastDA = 'main';var yesMetric, isIE, isIEV;/////////////////////////////////////////////site conffunction sConf(){}/////////////////////////////////////////////pages conffunction pConf(preUrl2,dpp2,pp2,theP2,tp2){	preUrl = preUrl2;	dpp = dpp2;	pp = pp2;	theP = theP2;	tp = tp2;}/////////////////////////////////////////////function pInit(country,siteCom2,preH2,sTheme)//function pInit(country,siteCom2,preH2,dTheme)
function pInit(country,siteCom2,preH2,dTheme){	//var i = siteCom.indexOf("us.");	//if(i!=-1)	/*	if(siteCom2.startsWith("us."))	{		siteCom = siteCom2.substring(3);		serverName = siteCom;	}	else	{		siteCom = siteCom2;		serverName = siteCom;	}	*/	if(country=="us")	{		siteCom = siteCom2;		serverName = siteCom;	}	else	{		siteCom = country+"."+siteCom2;		serverName = siteCom;	}	//preH = preH2;	//xPreH = xPreH2;	//preH = 'http://'+siteCom+'/p/'+hType+'?'; // h vs a	preH = 'http://'+siteCom+'/p/'+preH2; // h? vs h?a/	//xPreH = 'http://'+siteCom+'/p/'+xType+'?';	xPreH = preH+'x?';	//cDom = 'http://'+siteCom+':8080/'; // content dom	cDom = 'http://animeart.com:8080/'; // temp this	uiPreH = 'http://ui.'+siteCom+':8080/'+country+'/';	ck = new Cookie();	ck.conf(document, 's', 9999, '/', serverName);	ck.read();

	//alert('after reading ck');	//"var c = new Cookie();"+	//"ck.conf(document, 's', 240);"+	//"ck.read();"+	//"var c = document.getElementById('c');"+	s[ck.tp] = ' selected';	lg[ck.lg] = ' selected';	//2-16-6	//"if(!ck.theme) ck.theme = 'A1';	//209	isIEV = (navigator.appName == "Microsoft Internet Explorer")? "1" : "0";
	/// 8-27-6
	isIE = (navigator.appName == 'Microsoft Internet Explorer')? true : false;
	//var isIE =  "0";	ckTheme = new Cookie();	ckTheme.conf(document, 'theme', 9999, '/'); // no servername	ckTheme.read();	/// 9-25-6 off this	/*	// 12-3-6 off test...	if(!ckTheme.theme || ckTheme.theme.length<279) ckTheme.theme =	(dTheme!="" && dTheme.length>278)? dTheme : "FFFFFF.000000.0000AF.6633CC.FFFFFF.000000.DFD6FF.6699FF.000000.FFFFDE.7B68EE.000000.E7EEFF.9999CC.000000.EEEEEE.4B0082.FFFFFF.4B0082.CCCCFF.4B0082.FFFFFF.20B2AA.FFFFFF.EEEEEE.C4C9BC.FFFFFF.6DB6CE.00008B.FFFFFF.0000FF.000000.F0F8FF.99CCFF.FFFFFF.008000.00008B.FFFFFF.DEB887.990033";	*/
/*	if(!ckTheme.theme || ckTheme.theme.length<279) ckTheme.theme =	(dTheme!="" && dTheme.length>278)? dTheme : "";
*/
/// 8-25-7

	//if(ckTheme.theme.length<279) ckTheme.theme =	//(dTheme!="" && dTheme.length>278)? dTheme : "";	//if(ckTheme.theme.length<279) ckTheme.theme = ""; /// 8-27-7 off test
	if(!ckTheme.theme || ckTheme.theme=='undefined' || ckTheme.theme==null) ckTheme.theme = "";
	// off	//if(ck.theme) ck.theme = "";
	if(!ckTheme.themeN) ckTheme.themeN = (dTheme)? dTheme : 0; // test	/// temp here...	if(!ck.yesMetric) ck.yesMetric = "1"; // test	yesMetric = (ck.yesMetric=="1");	/// 10-1-6	//def pref	if(!ck.gView)	{		ck.gView = '1';		ck.save();	}	//document.write('<div id=sTheme><LINK REL=stylesheet TYPE=text/css HREF=http://animeart.com:8080/css/'+ck.theme+'.css></div>');	//document.write(	//var html = '<LINK REL=stylesheet TYPE=text/css HREF=http://animeart.com/p/h?color/'+ck.theme+'.css>';	//var html = '<LINK REL=stylesheet TYPE=text/css HREF=http://animeart.com/p/sp?color?'+ck.theme+'.css>';	//document.getElementById('sTheme').innerHTML = '&nbsp;<LINK REL=stylesheet TYPE=text/css HREF=http://'+siteCom+'/p/sp?color?'+ck.theme+'.css>';
/// 8-17-7 now mv to PageContent tomcat
/*	document.getElementById('sTheme').innerHTML = '&nbsp;<LINK REL=stylesheet TYPE=text/css HREF=http://'+siteCom+	// connect here to setTheme	//'/p/h?color/'+	'/p/sp?color?'+	//ck.theme+	// note..	//isIE+'.'+sTheme+	/// temp off	isIE+'.'+ckTheme.theme+	//"1.FFFFFF.000000.0000AF.6633CC.FFFFFF.000000.E9FFE4.99CC99.000000.F7FFFA.99CC99.000000.99CC99.336666.000000.99CC66.4B0082.FFFFFF.4B0082.CCCCFF.4B0082.FFFFFF.20B2AA.FFFFFF.EEEEEE.406121.FFFFFF.5C8B2F.78B53D.FFFFFF.B3B3B3.0000BB.F5FFF5.FFFFCC.FFFFFF.99CC99.336666.FFFFFF.78B53D.000000"+	'.css>';	//'1';*/
	/*	// 8-21-6	if(navigator.appName == "Microsoft Internet Explorer")	{		//document.write('<script src=http://animeart.com:8080/js/menu/Menu.js>');		// ie fix;		document.getElementById('Menu').innerHTML = '&nbsp;<LINK REL=stylesheet TYPE=text/css HREF='+cDom+'css/MenuIE.css>';	}	else	{		document.getElementById('Menu').innerHTML = '<LINK REL=stylesheet TYPE=text/css HREF='+cDom+'css/Menu.css>';	}	*/	//document.write(html);}///////////////////////////////////////////function pWindow(url,title){	//"window.location.href = '"+	/// 7-29-6	newWindow = window.open(url, null, "width=700,height=600,resizable=1,scrollbars=1,toolbar=0,status=1,locationbar=0");	newWindow.focus();}///////////////////////////////////////////function pWindowTop(url,title){	//"window.location.href = '"+	/// 7-29-6	newWindow = window.open(url, null, "resizable=1,scrollbars=1,toolbar=0,status=1,locationbar=1");	//newWindow = window.open(url, title, "resizable=yes,scrollbars=yes,toolbar=no,status=yes,locationbar=yes");	newWindow.focus();}///////////////////////////////////////////// 7-14-6function gg(url){	//if(!xmlMode)	//{	location.href = preH+url;	//}}///////////////////////////////////////////function search(){	// 11-14-5	// now using p/h? instead of p/h/; cuz dumb tomcat coding problems...	//"var c = document.getElementById('c');"+	var ss = document.ss;	//"ck.domain = '."+siteCom+"';	// temp this dup cuz works for ma...	// 4-25-6 off test	/*	ck = new Cookie();	ck.conf(document, 's', 9999, '/', '.'+siteCom);	ck.read();	*/	if(ck.tp!=ss.type.value || ck.lg!=ss.lang.value)	{		ck.tp = ss.type.value;		ck.lg = ss.lang.value;		ck.save();	}	if(ss.lang.value=='n')	{		ss.lang.value = 'e';	}	else if(ss.lang.value!='e')	{		ss.lang.value = 'j';	}	if(ss.type.value=='all')	{		location.href = preH+'series/search/'+ss.lang.value+'/'+ss.type.value+'?'+ss.key.value;	}	else if(ss.type.value.length==3)	{		location.href = preH+'series/search/'+ss.lang.value+'/'+ss.type.value+'/'+ss.key.value+'/p?1';	}	else	{		location.href = preH+ss.type.value+ss.lang.value+'/'+ss.key.value+'/p?1';	}}//////////////////////////////////////////function checkPP(e,func,name)function checkPP(e,f,pp){	var characterCode;	if(e && e.which)	{		e = e;		characterCode = e.which;	}	else	{		e = window.event;		if(e && e.keyCode) characterCode = e.keyCode;	}	//var pp = document.getElementById(name).value;	if(characterCode == 13)	{		//perPage(p.value);		eval(f+'(pp);');	}	//return false;}//////////////////////////////////////////checkPP(event,'goPage',this.value)/// js action//checkJ(event,'goPage('+this.value+')')function checkJ(e,f){	var characterCode;	if(e && e.which)	{		e = e;		characterCode = e.which;	}	else	{		e = window.event;		if(e && e.keyCode) characterCode = e.keyCode;	}	//var pp = document.getElementById(name).value;	if(characterCode == 13)	{		//perPage(p.value);		//eval(f+'();');		eval(f+';');	}	//return false;	return true;}//////////////////////////////////////////temp for oldsfunction gPage(theP){	theP = parseInt(theP);	if(theP<1 || isNaN(theP))	{		alert("Please enter a valid page number.");	}	else	{		if(theP>tp) theP = tp;		// 11-14-5		// now using p/h? instead of p/h/; cuz dumb tomcat coding problems...		//"	if(s.type.value==\"all\") location.href='preH+"series/search/'+s.lang.value+'/'+s.type.value+'?'+s.key.value;		//"	else location.href='preH+"series/search/'+s.lang.value+'/'+s.type.value+'/'+s.key.value+'/p?1';		//"if(ppnformN+".pp.value!=pp) pp=ppnformN+".pp.value;		/// 3-26-6 test!		px(preUrl+'?'+theP+((pp!=dpp)? '&pp='+pp : ''));	}}/////////////////////////////////////////////function gPage(theP)function gP(theP){	theP = parseInt(theP);	if(theP<1 || isNaN(theP))	{		alert("Please enter a valid page number.");	}	else	{		//alert('preUrl='+preUrl);		if(theP>tp) theP = tp;		// 11-14-5		// now using p/h? instead of p/h/; cuz dumb tomcat coding problems...		//"	if(s.type.value==\"all\") location.href='preH+"series/search/'+s.lang.value+'/'+s.type.value+'?'+s.key.value;		//"	else location.href='preH+"series/search/'+s.lang.value+'/'+s.type.value+'/'+s.key.value+'/p?1';		//"if(ppnformN+".pp.value!=pp) pp=ppnformN+".pp.value;		/// 3-26-6 test!		px(preUrl+'?'+theP+((pp!=dpp)? '&pp='+pp : ''));	}}///////////////////////////////////////////function perPage(thePP){	thePP = parseInt(thePP);	if(thePP<1 || isNaN(thePP))	{		alert("Please enter a valid page number.");	}	else	{		if(thePP>50) thePP = 50;		//"var newP = Math.ceil(pp*p/thePP);		var newP = Math.ceil(pp*(theP-1)/thePP)+1;		// cuz errors... fix later		px(preUrl+'?'+newP+((thePP!=dpp)? '&pp='+thePP : ''));		//location.href = preUrl.replace("p/x?","p/h?")+'?'+newP+((thePP!=dpp)? '&pp='+thePP : '');	}}///////////////////////////////////////////// this javasc error func name! discv 1-7-6//"function gp()function goPage(theP){	theP = parseInt(theP);	if(theP<1 || isNaN(theP))	{		alert("Please enter a valid page number.");	}	else	{		if(theP>tp) theP = tp;		// 11-14-5		// now using p/h? instead of p/h/; cuz dumb tomcat coding problems...		//"	if(s.type.value==\"all\") location.href='preH+"series/search/'+s.lang.value+'/'+s.type.value+'?'+s.key.value;		//"	else location.href='preH+"series/search/'+s.lang.value+'/'+s.type.value+'/'+s.key.value+'/p?1';		px(preUrl+'?'+theP+((pp!=dpp)? '&pp='+pp : ''));		//"location.href=\'pagesPanel.app.hPreH+pagesPanel.url+"?';	}}////////////////////////////////////////////// 7-9-6// for admin servItem table...function showHide(element, yesShow){	if(document.getElementById(element))	{		element = document.getElementById(element);	}	//if(!element) return;	//if(showHide == "show")	if(yesShow)	{		//element.style.visibility = "visible";		element.style.display = 'block';	}	//else if(showHide == "hide")	else	{		//element.style.visibility = "hidden";		element.style.display = 'none';	}}///////////////////////////////////////////// displayDiv... for cart,etc...function dDiv(div,on){	//was on	if(on)	{		//document.getElementById(div).style.display = 'block';		document.getElementById(div).style.display = 'table-cell';		//document.getElementById(div).style.display = disp;	}	else	{		document.getElementById(div).style.display = 'none';	}}///////////////////////////////////////////function dDiv2(div){	//was on	if(onDiv[div]==1)	{		onDiv[div] = 0;		document.getElementById(div).style.display = 'none';	}	else	{		onDiv[div] = 1;		document.getElementById(div).style.display = 'block';	}}///////////////////////////////////////////function showDiv(dLink, div, url){	if(onDiv[dLink]==1)	{		onDiv[dLink] = 0;		document.getElementById(div).innerHTML = origDiv[dLink];		document.getElementById(dLink).innerHTML = origDLink[dLink];	}	else	{		onDiv[dLink] = 1;		origDiv[dLink] = document.getElementById(div).innerHTML;		origDLink[dLink] = document.getElementById(dLink).innerHTML;		pxDiv(div, url);		document.getElementById(dLink).innerHTML = '[x]';	}}///////////////////////////////////////////function dA(linkName, divName, url){	if(lastDA)	{		document.getElementById(lastDA).className = 'dA';	}	document.getElementById(linkName).className = 'hl';	//document.getElementById(divName).className = 'hl';	lastDA = linkName;	//alert('divName='+divName);	//document.getElementById(divName).innerHTML = "div content; url="+url;	// why failed????	//document.getElementById(divName).innerHTML = "div content";	pxDiv(divName, url);}/////////////////////////////////////////////function px(url2)//function pxD(url2, divName)function pxDiv(divName, url){	//url = url2;	///5-6-6 test	//document.onLoad = "px('"+url+"');";	//document.onUnLoad = "alert('u="+url+"');";	//alert('start url='+url);	if(ph[url])	{		//alert('has url='+url);		//alert('already url='+url);		updateDiv('', divName, url); // test!		// dup herer...		//document.getElementById(divName).innerHTML = ph[url];		return;	}	// test	if(!iURL)	{		//var i = document.location.href.lastIndexOf('?');		var i = document.location.href.indexOf('?');		//preUrl+'?'+document.location.href.substring(iP		iURL = document.location.href.substring(i+1);		//alert('iURL='+iURL);		// cache input page		ph[iURL] = document.getElementById(divName).innerHTML;	}	// test!!!	var divFunc = new Function('data','updateDiv(data,\''+divName+'\',\''+url+'\')');	// not sure!!	var failedDiv = new Function('data','failedDiv(\''+divName+'\')');	//alert('url='+xPreH+url);	//alert('req='+xPreH+url);	//var myAjax = new Ajax.Request(url,	// test preUrl! 8-14-6	var myAjax = new Ajax.Request(xPreH+url,	{method: 'get',	parameters: '',	onSuccess: divFunc,	onFailure: failedDiv});	//p[url] = data;	//alert('end url='+url);}///////////////////////////////////////////// assume simplefunction updateDiv(data, divName, url){	if(!ph[url])	{		//alert('getting url='+url);		//pt[url] = data.responseXML.documentElement.getElementsByTagName('h')[0].firstChild.nodeValue;		ph[url] = data.responseXML.documentElement.getElementsByTagName('h')[0].firstChild.data;	}	document.getElementById(divName).innerHTML = ph[url];	//alert('af url='+url);	//document.getElementById('h').innerHTML = ph[url];}///////////////////////////////////////////function failedDiv(divName){	//alert('failed divName='+divName);	//document.getElementById('t').innerHTML = 'Error';	document.getElementById(divName).innerHTML = 'An error has occurred. Please try again later.';	//window.scrollTo(0,0);}///////////////////////////////////////////function px(url2){	//alert("px;x="+xmlMode);	if(!xmlMode)	//if(true)	{		location.href = preH+url2;		//location.href = url2.replace(/x/,"h");		return;	}	//5-6-6 test	// temp flaw fix more later	// test	//if(!url) url = preUrl+'?1';	// test if need to save first/input page	//if(!pt[preUrl+'?1'])	url = url2;	//alert("url2="+url2);	if(!iP)	{		//var i = document.location.href.indexOf('/p/'); // cuz need the /p/(x?..)		var i = document.location.href.indexOf('?');		//iP = document.location.href.lastIndexOf('?');		iP = true; // test...		//var theUrl = preUrl+'?'+document.location.href.substring(iP,iP+1);		//var theUrl = preUrl+'?'+document.location.href.substring(iP,document.location.href.length);		//var theUrl = document.location.href.substring(i+3,document.location.href.length);		/// flaw replace h w/ x here		//var theUrl = 'x'+document.location.href.substring(i+4,document.location.href.length);		var theUrl = document.location.href.substring(i+1,document.location.href.length);		//alert("t="+theUrl);		//if(!pt[url])		//{			//url = preUrl+'?1';			pt[theUrl] = document.getElementById('t').innerHTML;			ph[theUrl] = document.getElementById('h').innerHTML;		//}	}	///5-6-6 test	//document.onLoad = "px('"+url+"');";	//document.onUnLoad = "alert('u="+url+"');";	if(pt[url])	{		updatePage();		return;	}	//alert("px;req="+xPreH+url);	var myAjax = new Ajax.Request(xPreH+url,	{method: 'get',	parameters: '',	onSuccess: succProc,	onFailure: failedProc});	//p[url] = data;}///////////////////////////////////////////function updatePage(data){	if(!pt[url])	{		pt[url] = data.responseXML.documentElement.getElementsByTagName('t')[0].firstChild.nodeValue;		ph[url] = data.responseXML.documentElement.getElementsByTagName('h')[0].firstChild.data;	}	document.getElementById('t').innerHTML = pt[url];	document.getElementById('h').innerHTML = ph[url];	//document.getElementById('h').innerHTML = eval(ph[url]);	var i = 0;	while(true)	{		i = ph[url].indexOf(evPat,i);		if(i==-1) break;		var i2 = ph[url].indexOf(evPat, i+1);		eval(ph[url].substring(i+evPat.length,i2));		//document.getElementById('t').innerHTML += "*";		//document.getElementById('h').innerHTML += ph[url].substring(i+evPat.length,i2);		//i+=1;		i = i2+1;	}	/*	else	{		document.getElementById('h').innerHTML += 'i='+i;	}	*/	window.scrollTo(0,0);}/////////////////////////////////////////////function failedProc(data)function failedProc(){	document.getElementById('t').innerHTML = 'Error';	document.getElementById('h').innerHTML = 'An error has occurred. Please try again later.';	window.scrollTo(0,0);}//////////////////////////////////////////////////////////////////////////////////////function uHist(usernamePath, hasPic){	uHistC = new Cookie();	uHistC.conf(document, 'uHist', 9999, '/', serverName);	uHistC.read();	theDate = new Date();	timeSec = theDate.getTime();	var sortHist = {};	var hasUser = {};	//uHistC.read(); // test!	//document.write('orig uHistN='+uHistC.uHistN);	//if(!uHistC.uHist) uHistC.uHist = {};	if(!uHistC.uHistN) uHistC.uHistN = 0;	/*	{	uHistC.uHist = {};	// tests	uHistC.uHist['aa'] = timeSec;	uHistC.uHist['ta8'] = timeSec+500000;	uHistC.uHist['ma'] = timeSec+5000;	}	else	{	uHistC.uHist['tt'] = timeSec+5000;	}	*/	var arSort = new Array();	var i = 0;	var j = 0;	//uHistC.uHist[usernamePath] = timeSec;	if(hasPic)	{		arSort[j++] = timeSec; // note starts w/ 0		sortHist[timeSec] = usernamePath;		hasUser[usernamePath] = 1;	}	//document.write('<br>input user='+usernamePath);	// now cont w/ 1	//for(i=1; i<=uHistC.uHistN; i++)	// i=1 cuz uHistN starts w/ 1	for(i=1; i<=uHistC.uHistN; i++)	{		//document.write('<br>orig user='+uHistC['u'+i]);		if(hasUser[uHistC['u'+i]]) continue;		hasUser[uHistC['u'+i]] = 1;		//uHist[uHistC['u'+i]] = uHistC['t'+i]; // uHist[username] = time		sortHist[uHistC['t'+i]] = uHistC['u'+i]; // sortHist[timeSec] = user;		arSort[j] = uHistC['t'+i]; // arSort[i] = timeSec;		j++;	}	/*	for(user in uHistC.uHist)	{		//theHtml += "<br>user="+user;		sortHist[uHistC.uHist[user]] = user;		arSort[i++] = uHistC.uHist[user]; // timeSec	}	*/	arSort = arSort.sort();	var min = arSort.length-9; // for 8 max	if(min<-1) min = -1;	uHistC.uHistN = 0; // init	j = 0;	var theHtml = "";	//uHistC.uHist = {}; // init again	//for(timeSec in sort sortHist)	//for(i=0; i<arSort.length; i++)	for(i=arSort.length-1; i>min; i--)	{		// don't show when first accessed		// also don't show when self access again..		if(timeSec!=arSort[i])		{			//theHtml += "<br>user="+sortHist[timeSec]+", timeSec="+timeSec;			//theHtml +=  "<br>user="+sortHist[arSort[i]]+", timeSec="+arSort[i];			if((j++%4)==0) theHtml += "<br>";			theHtml +=			//","+i+"			//"<img src="+uiPreH+sortHist[arSort[i]]+"/album/cateDbs/0/0/c/0i.jpg>";			"<a href="+preH+"u/"+sortHist[arSort[i]]+"/profile>"+			"<img src="+uiPreH+sortHist[arSort[i]]+"/album/cateDbs/0/0/c/0.jpg width=20 height=20></a>";		}		// save again...		//uHistC.uHist[sortHist[arSort[i]]] = arSort[i];		uHistC['u'+(i+1)] = sortHist[arSort[i]]; // user =		uHistC['t'+(i+1)] = arSort[i]; // timeSec =		uHistC.uHistN++;	}	document.getElementById('uHist').innerHTML = theHtml;	//document.write(theHtml+",uHistN="+uHistC.uHistN);	if(hasPic) uHistC.save();}///////////////////////////////////////////function uHistClear(){	/*	for(i=1; i<=uHistC.uHistN; i++)	{		uHistC['u'+i] = '';		uHistC['t'+i] = '';	}	*/	uHistC.uHistN = 0;	uHistC.save();	document.getElementById('uHist').innerHTML = "";}///////////////////////////////////////////function getCheckedIndex(e){	for(i=0; i<e.length; i++)	{		if(e[i].checked) return i;	}	return -1;}///////////////////////////////////////////function setOptionsArgsForm(f){	optionsArgsForm = f;}///////////////////////////////////////////// f==document.sS// ie: photos: 0-1: 2// ie: relationship: 0-2: 3// ie: lookingFor: 0-5: 6// starts with 0function getOptionsArgs(name,len){	//var args = '&';	var args = '';	for(i=0; i<len; i++)	{		//(sS['photos-1'].checked)? 'photos-1=1' : ''		if(optionsArgsForm[name+'-'+i].checked) args += '&'+name+'-'+i+'=1';	}	return args;}///////////////////////////////////////////var ER = 6366.707;// -12 == 12 S; latidude//-12 == 12 W; longitude// globe distvar distC = {}; //dist cachefunction gDist(lati1,longi1,lati2,longi2){	var dk = ""+lati1+longi1+lati2+longi2;	if(distC[dk])	{		//alert('already='+distC[dk]);		return distC[dk];	}	//nautical mile = 1.15078	var radlat1 = Math.PI*(lati1)/180/100; // /100 cuz vars passed in *100 format...	var radlat2 = Math.PI*(lati2)/180/100;	var radlong1 = Math.PI*(longi1)/180/100;	var radlong2 = Math.PI*(longi2)/180/100;	radlat1 = Math.PI/2-radlat1;	if(longi1<0) radlong1 = Math.PI*2+radlong1;	//if(longi1<0) alert('longi1='+longi1);	radlat2 = Math.PI/2-radlat2;	if(longi2<0) radlong2 = Math.PI*2+radlong2;	//if(longi2<0) alert('longi2='+longi1);	var x1 = ER*Math.cos(radlong1)*Math.sin(radlat1);	var y1 = ER*Math.sin(radlong1)*Math.sin(radlat1);	var z1 = ER*Math.cos(radlat1);	var x2 = ER*Math.cos(radlong2)*Math.sin(radlat2);	var y2 = ER*Math.sin(radlong2)*Math.sin(radlat2);	var z2 = ER*Math.cos(radlat2);	var d = Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2));	var theta = Math.acos((ER*ER+ER*ER-d*d)/(2*ER*ER));	//var distance = theta*ER;	//distance = Math.round(theta*ER*100)/100; // format...	var dist = Math.round(theta*ER*100)/100;	distC[dk] = dist;	return dist; // .00 format}///////////////////////////////////////////