///////////////////////////////////////
// maxBase
///////////////////////////////////////

///////////////////////////////////////
// top level functions

function setupSite(where,interp,popups) {
	if (typeof(where)=='undefined'){where=''}
	if (typeof(interp)=='undefined'){interp=false}
	if (typeof(popups)=='undefined'){popups=true}
	MAX = new Generics()
	MAX.BROWSER = new Browser()
	MAX.SITE = new Site(where,popups)
	if (interp && (typeof(interpSetup)=='function')) 
		{interpSetup()}
	}

function finishSite(where) {
	MAX.SITE.SwapFooter()
	}


///////////////////////////////////////

function addLoadEvent(func) {
//addLoadEvent(function() {/* more code to run on page load */})
	var oldonload = window.onload //use a closure to keep this value
	if (typeof window.onload != 'function') {window.onload = func}
	else {window.onload = function() 	{if (oldonload) {oldonload()}; func()}}
	}

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////
// the SITE Object

function Site(where,popups) {
	this.Menus={}
	this.Scripts=[]
	this.where=where
	this.popups=popups
	this.init()
	}

Site.prototype.toString = function() {
	return this.Title+': '+this.SubTitle
	}

///////////////////////////////////////
// MAX.SITE does images!

///////////////////////////////////////
// build an image name

Site.prototype.imgName= function(deg,ori) {
	b=typeof(ori)!='undefined'
	if (b) {
		var n=this.ipathn
		this.imagePath(ori)
		}
	
	if (typeof(deg)=='number')	{
		deg=this.asym(deg)}
	var out=this.ipath+deg.toLowerCase()+this.iext

	if (b) {this.imagePath(n)}
	return out
	}

///////////////////////////////////////
// format the image image

Site.prototype.imageText= function(deg,hi,fs1) {
	deg= wrapdeg(deg)
	var p= new Planet('point',deg)
	if (typeof(fs1)=='undefined') {fs1='+1'} 
	var a= ['<font size="'+fs1+'" face="Times, \"Times New Roman\", serif">'
				+'<b>' + p.nice('+1',hi) +'</b></font>'
				,'','' ]
	if (this.showWords) {a[1]= '<br>'+ MAX.INTERP.oneWord(deg)+'\n'} //toWords
	if (this.showDate) {a[2]= '<br><font size=-1>'+ MAX.SOL.dateof(deg)+'</font>\n'}
	return a
	}

Site.prototype.formatImage= function(deg,hi,id,sk,ti,verbose) {
	deg= wrapdeg(deg)
//	if (typeof(hi)=='undefined'){hi=''} //else {hi=' height='+hi}

	if (typeof(hi)=='undefined') {hi=''} 
	else {if (this.ipathn==1){hi=' width='+hi} else {hi=' height='+hi}}
	if (typeof(ti)=='undefined') {ti=''} 
	if (typeof(verbose)=='undefined') {verbose=true} 
	
	if (typeof(id)=='undefined' || id==null || id==''){id=''} else {id=' id='+id}
	if (typeof(sk)=='undefined' || id==null){sk=true}
	if (typeof(sk)=='undefined'){sk=true}
	var out='<img src="'+this.imgName(this.asym(deg))+'" border=2'+hi+id+'>' // ((hi!='')?'height='+hi:'')
	if (!verbose) {return out}
	var a=this.imageText(deg,hi)
	out=MAX.NAV.oneDegree(deg,out+'<br>\n'+a[0],ti,sk) +a[1]+a[2]
	return out
	}


///////////////////////////////////////
// add image path capability:

Site.prototype.initiOrient= function() {
	this.iorient={
		cookie:'cr0',
		use: (function(a){MAX.SITE.imagePath(this.geta(a))}),
		select: (function(a){this.cookie=a;MAX.SITE.imagePath(this.geta(a))}),
		geta: (function(a){return (this[a]==null)?0:this[a]}),
		get: (function(){return this.geta(this.cookie)}),
		set: (function(a){this[this.cookie]=a; var n=this.get(); MAX.BROWSER.createCookie(this.cookie,n); MAX.SITE.imagePath(n)}),
		store: (function(a){this[a]= MAX.BROWSER.readCookie(a)}),
		init: (function(){	this.store('cr0'); 	this.store('cr1'); this.store('cr2')})
		}
	this.iorient.init()
	}

Site.prototype.imagePath= function(idx) {
//this.iorient integrates with the ipath idea in which 
//we store the path and index to the path for easy 
//reference. the choices come from the path array.
	this.ipath= this.imgPaths[idx]
	this.ipathn=idx
	}

///////////////////////////////////////
//expose image path choices 

Site.prototype._porient= function(n) {
	this.iorient.set(MAX.Mod( n, 4 )) //setImagePathCookie()
	if (MAX.NAV) {MAX.NAV.changed()}
	}

Site.prototype.porient= function() {
	//function fun(title
	var out='';
	var choices=['Original Proportions','Horizontal Crop','Vertical Crop','Square Crop']
	for (var i=0;i<4;i++) {
		var a=choices[i].substr(0,4)
		if (this.ipathn==i) {a=a.toUpperCase()}
		else {a='<a title="View '+choices[i]+'" href="javascript:MAX.SITE._porient('+i+')">'+a+'</a>'}
		out+=a+'\n'
		}
	return out
	}

Site.prototype.getProportionLinks= function() {
	var a='<center><font size=+1>Proportion</font><br>\n'
	return a+this.porient()
	}

///////////////////////////////////////
// add hexagram link know-how

Site.prototype.getHexLineC= function(deg) {
	var i=332 //starting degree
	var c=2 //starting line 0..5.. 1..6
	//... ok my bad. it actually lines up at 332 on the 2nd line!
	var d=0
	deg=wrapdeg(deg)-1
	while (1<2) {
		d= Math.floor(i)
		if (d==deg) {return [c,i]}
		i= wrapdeg(i+0.9375) //ichingdelta
		c++
		}
	}

Site.prototype.getHexLineR= function(deg) {
	var d=wrapdeg(this.getHexLineC(deg+1)[0],384)
	var c=this.getHexLineC(deg,384)
	var i=c[1]
	c=wrapdeg(c[0],384)
	if (i>Math.floor(i)) 
		{c--} // the prior line covers the starting fraction

	if (d-c==0) {return (this.iching330[MAX.Div(c,6)])+'.'+(1+MAX.Mod(c,6))}
	var out=''
	while (c<d){
		out+= (this.iching330[MAX.Div(c,6)])+'.'+(1+MAX.Mod(c,6))+','
		c++
		}
	out=out.substr(0,out.length-1)
	return out
	}

Site.prototype.getHexLine= function(deg) {
	var r=this.getHexLineR(deg)
	if (typeof(r)=='unassigned') {return '##.#'}
	if (typeof(r)=='string') {return r}
	return r[0]+'.'+r[1]
	}

Site.prototype.getHexLink= function(deg) {
	if (typeof(deg)!='string') {var a=this.getHexLine(deg)}
	else {var a=deg}
	var a2=a.split(',')
	a2=a2[0]
	a2=a2.split('.')
	a2=MAX.num2(a2[0])
	return '<a '
		+' onMouseOver="h('+deg+')")'
		+' onMouseOut="o()" '
		+'href="iching/lines/?'+a+'#'+a2+'" title="Go to hexagram '+a+'">'+a+'</a>'
	}


///////////////////////////////////////
// component-loaders
//	not for use with file extensions
//Site.loadScripts(Site.Scripts,'and/this/one') 
//Site.loadStyle(['layout','colors'])

Site.prototype.scriptLoader= function(code,ppf,r) {
	var out=''
	for (var i=0,n=r.length;i<n;i++) {
		var s=r[i].split(':')
		if (code=='*' || code.indexOf(s[0])>=0) 
			{out+='\n<script language="JavaScript" type="text/javascript" src="' +ppf+s[1]+'.js"></script>'}
		}
	return out
	}

function loadScripts(ppf,addtl) {
	//global
	var out='', r=addtl.split(',')
	for (var i=0,n=r.length;i<n;i++) 
		{out+='\n<script language="JavaScript" type="text/javascript" src="' +ppf+r[i]+'.js"></script>'}
	return out
	}

Site.prototype.loadScripts=function(code,ppf,addtl) {
	//SITE object
	var out=''
	if (!code) {code='*'}
	out+=this.scriptLoader(code,ppf,this.Scripts)
	if (addtl) {out+=loadScripts(ppf,addtl)}
	return out+'\n'
	}

Site.prototype.loadStyle= function(r) {
	if (!r) {r=['style']}
	var out=''
	for (var i=0,n=r.length;i<n;i++) 
		{out+='\n<link rel="stylesheet" type="text/css" href="' +ppf+r[i]+'.css" title="Default" />'}
	return out
	}

///////////////////////////////////////
// headers/ footers

Site.prototype.siteHeader= function(extra,div) {
	if (typeof(extra)!='string' || extra=='') {extra=this.SubTitle}
	if (typeof(div)!='string') {div=''}
	return div+'<font size=+4><a href="'+this.URL+'">'+this.Title+'</a></font><br>'+extra
	}

Site.prototype.SwapFooter= function(a) {
//add the customized footer 
// this means that we repeat the header before
// the actual footer text for all but the degree and mirror page(s)
// this is customization better done through inheritance
	if (MAX.SITE.noSwap){return}
	if (typeof(a)!='string') {	//spikeFooter:
		if ('degree,mirror'.indexOf(this.where)<0)
			{a=MAX.get('menu')}
		else {a=''} }
	a+=this.siteFooter()
	MAX.set('footer',a)
	}

///////////////////////////////////////
// menu system

Site.prototype.addMenuItem= function(which,key,whereto,caption) {
	var o={
		key: key,
		whereto: whereto,
		caption: caption
		}
	this.Menus[which][this.Menus[which].length]= o
	}

Site.prototype.renderSubMenu= function(which,where,div) {
	if (typeof(div)=='undefined'){div=''}
	//SITE.renderSubMenu('Browse',gallery)
	var r= this.Menus[which]
	if (typeof(r)=='undefined') {var out='no submenu "'+which+'".'; alert(out); return out }
	this.MenuWhich=which
	this.MenuWhere=where
	var a= MAX.NAV.sym;	if (!a) {a=''}// else {a='?'+a}
	var out=''
	for (var i=0,n=r.length;i<n;i++){
		var o=r[i]
		if (o.key=='') {out+=o.caption+'\n'}
		else {out+= this.siteLink(where,o.key,o.whereto+a,o.caption)+div+'\n'}
		}
	return out
	}

Site.prototype.siteLink= function(where,key,whereto, caption) {
	var n= where.indexOf(key), b= n>-1
	if (b) {caption= caption.toUpperCase()}
	if (b) {caption= '<b>'+caption+'</b>'}
	if (n==0) {return caption}
	return '<a href="'+whereto+'">'+caption+'</a>'
	}

Site.prototype.SwapMenu= function(id,where,extra,div) 
	{MAX.set(id,this.siteMenu(where,extra,div))}

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////
// the GENERICS Object

function Generics() {
	}

/////////////////////////////////////// GENERIC STRING

Generics.prototype.split= function(str,onwhat) {
//splits incoming strings 'onwhat', usually a ',' 
//returns an array of two elements, the first and remaining items listed in the string.
	var split = onwhat || ',';
	var i = str.indexOf(split);
	var n= str.length
	if (i==-1) {i=n}
	return [str.substr(0,i),str.substr(i+1)];
	}

Generics.prototype.foreach= function(cb,fun,str,onwhat) {
// calls the callback function with the results of the function, both variable, using the elements supplied in the string
	var a, a1=''
	do {
		a = this.split(str,onwhat)
		a1=a[0]
		str=a[1]
		cb(fun(a1))
		}
	while (str.length>0);
	}

/*
function example(a) {return '['+a+']'}
function logtext(a) {document.write(a+'<br>')}
function  test2() {
	var a = split('c,');
	document.write('x= [' + a[0] + '] and y = [' + a[1]+']  '+typeof(a[1])+' '+a[1].length+'<p>');
	foreach(logtext,example,'a,b,c')
	}
*/

///////////////////////////////////////
// comma-lists:

Generics.prototype.shiftLeft= function(a) {
	var i=a.lastIndexOf(',')
	return a.substr(i+1)+','+a.substr(0,i)
	}

Generics.prototype.shiftRight= function(a) {
	var i=a.indexOf(',')
	return a.substr(i+1)+','+a.substr(0,i)
	}

///////////////////////////////////////
// returns numbers as strings. if its a single digit number, returns it padded with '0'

Generics.prototype.num2= function(n) {
	if (n.toString().length ==1)
		{return '0'+n};
	return n;
	}

Generics.prototype.num3= function(n) {
	if (n.toString().length ==1)
		{return '00'+n};
	if (n.toString().length ==2)
		{return '0'+n};
	return n;
	}

// returns an english suffix on the number
Generics.prototype.indexInEnglish= function(i) {
	var out='th';
	if (i != 11 & this.Mod(i,10)==1 ) 	{out='st'}
	if (i != 12 & this.Mod(i,10)==2 ) 	{out='nd'}
	if (i != 13 & this.Mod(i,10)==3 ) 	{out='rd'}
	return i+out;
	}

/////////////////////////////////////// GENERIC MATH

Generics.prototype.Mod= function(X, Y)	{return X - Math.floor(X/Y)*Y}
Generics.prototype.Div= function(X, Y)	{return Math.floor(X/Y)}
Generics.prototype.Log10= function(x) 	{return Math.LOG10E*Math.log(x)}
Generics.prototype.Sqr= function(x)		{return x*x}
Generics.prototype.Cbrt= function(x)	{return Math.pow(x,1/3.0)}
Generics.prototype.Sgn= function(x)	 	{return (x<0)?-1:+1}


///////////////////////////////////////
//generic type-testing

function isNull(a) {return typeof a == 'object' && !a}

///////////////////////////////////////
//add custom trig wrap functions

function wrapdeg(degree,max) {
	if (typeof(max)=='undefined') {max= 360}
    while (degree<1) { degree= max+degree }
    while (degree>max) { degree= degree-max};
	return degree;
	};

function warpdeg(degree) { // wrap and spiral up/down
	while (degree<1) { degree= 360+degree-1 }
    while (degree>360) { degree= degree-360+1 };
	return degree;
	};

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////

/////////////////////////////////////// 
// extend GENERICS with quick access to BROWSER

Generics.prototype.get= function(id) {
	var x= MAX.BROWSER.getElementById(id)
	if (x) {return x.innerHTML}
	return false
	}

Generics.prototype.set= function(id,txt) {
	var x= MAX.BROWSER.getElementById(id)
	if (x) {x.innerHTML=txt}
	return (!!x)
	}


///////////////////////////////////////
// the BROWSER object

function Browser() {
	this.DHTML = (document.getElementById || document.all || document.layers);
	}

/////////////////////////////////////// QUERYSTRING

/* parseQueryString(keys,queryString,raw,delim)

//	var queryObj= parseQueryString('sym=ari01,ref=Spring')

**keys -- give a list of keys in the order you expect them. if none are given on the commandline
	keys listed here are initialized to ''. you can pass simple defaults with 'key=string,..'
**queryString -- pass location.search or leave blank
	then we'll split it on commas and assign it to the keys you provide here
**raw -- if this comes in true, we won't un-escape the strings from the commandline.
**delim -- if you want, change the delimiter you're expecting on the commandline here.
--if no keys are specified in defaults or querystring, then .qs will contain the querystring on exit
*/

Browser.prototype.parseQueryString= function(keys,queryString,raw,delim) {
	queryString = (queryString) ? queryString : location.search;
	queryString = queryString.replace(/^.*\?(.+)$/,'$1');
	delim = (delim) ? delim : ',';
	//
	var pair, queryObject = new Object
	var k= keys.split(',')
	if (k) {for (var i=0, m=k.length; i<m; i++) {
		var r=(k[i]+'=').split('=') //initialize keys specified properties
		queryObject[r[0]]= r[1]
//		var s=split(k[i],'=')
//		k[i]=s[0]
//		v[i]=s[1]
		}}
	//
	if (!((pair=queryString.match(/([^=]+)=\'?([^\&\']*)\'?\&?/)) && pair[0].length)) {
		var v= queryString.split(delim)
		if (!k) {queryObject['qs']=queryString}
		else {for (var i=0, m=k.length; i<m; i++) {
			var r=(k[i]+'=').split('=') //initialize keys specified properties
			if (v[i]=='') {
				v[i]=r[1]
				}
			if (r[1]!='')	{
				k[i]=r[0]
				}
			queryObject[k[i]]= (raw) ? v[i] : unescape(v[i])
			}}
		}
	else {
		while ((pair = queryString.match(/([^=]+)=\'?([^\&\']*)\'?\&?/)) && pair[0].length) {
			queryString = queryString.substring( pair[0].length );
			if (/^\-?\d+$/.test(pair[2])) pair[2] = parseInt(pair[2]);
			queryObject[pair[1]] = (raw) ? pair[2] : unescape(pair[2]);
			}
		}
	return queryObject;
	}

/////////////////////////////////////// GENERIC COOKIE

Browser.prototype.eraseCookie= function(name) {
	this.createCookie(name,"",-1)
	}

Browser.prototype.createCookie= function(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
		}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
	}

Browser.prototype.readPlainCookie= function(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
	return null;
	}

Browser.prototype.readCookie= function(name,value) {
	if (typeof(value)=='undefined') {value=null}
	var link=this.readPlainCookie(name) // return us to the last list page we were on
	if (link==null) {link=value}
	return link
	}

///////////////////////////////////////
// http://www.quirksmode.org/viewport/compatibility.html
// see also: http://www.alistapart.com/articles/footers/

Browser.prototype.ClientHW= function() {
	var x,y;
	if (self.innerHeight) // all except Explorer
		{
		x = self.innerWidth;
		y = self.innerHeight;
		}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
		{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
		}
	else if (document.body) // other Explorers
		{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
		}
	return [x,y]
	}

Browser.prototype.ClientWidth= function() { return BROWSER.ClientHW()[0] }
Browser.prototype.ClientHeight= function() { return BROWSER.ClientHW()[1] }

///////////////////////////////////////
// http://www.quirksmode.org/js/dhtmloptions.html

Browser.prototype.getElementById= function(name) {
	if (document.getElementById)	{return document.getElementById(name)}
	else if (document.all)			{return document.all[name]}
	else if (document.layers) 		{return document.layers[name]}
	}

Browser.prototype.getElementStyleById= function(name) {
	if (document.getElementById)	 {return document.getElementById(name).style}
	else if (document.all)			{return document.all[name].style}
	else if (document.layers)		{return document.layers[name]}
	}

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////

/////////////////////////////////////// 
// the PLANET Object

function Planet(name,loc) {
	// name	- name
	// sign		- init-caps A3 of sign
	// isign		- zero based sign index
	// dir			- direct/rx A2
	// pos		- printable degree/minutes
	// deg		- one-based degree of zodiac
	// sdeg		- one-based degree in sign
	// ddeg	- decimal, one based degree of zodiac
	// sym		- A5 sign+ two-digit deg
	// dsym	- A8 sign+ two-digit deg+ two-digit min [ +Rx ]

	this.name	= name;

	if (typeof(loc)=='number')
		{if (isNaN(loc)) {return}
		loc= MAX.SITE.asym(loc)}

	this.sign	= loc.substr(0,1).toUpperCase()+loc.substr(1,2); 
	this.signl	= this.sign.toLowerCase(); 
	this.isign	= MAX.SITE.nSign(this.sign)

	var 	a2=loc.substr(3,2);
	var 	a3=loc.substr(5,2);

	var 	a4=loc.substr(7,2);
	if (a3.substr(0,1).toUpperCase()=='R') 	{a4=a3;a3=''}
	if (a4.substr(0,1).toUpperCase()=='R') 	{a4='Rx'} else {a4=''}
	this.dir= a4

	if (a2=='')	{a2='01'}
	var d=parseInt(a2,10),
		m=parseInt(a3,10);

	this.pos=MAX.num2(d)+'&deg;' 
	if (m)	{this.pos+=MAX.num2(m)}

	this.ddeg= this.isign*30+d
	if (m>0) {this.ddeg+= m/60} else {m=0}

	this.dsym=this.sign+MAX.num2(d)
	if (m>0) {this.dsym+= MAX.num2(m)}
	this.dsym+= this.dir.substr(0,1).toLowerCase()

	if (m>0) {d++}
	this.deg= this.isign*30+d
	this.sdeg= d
	this.sym=this.sign+MAX.num2(d)
	}

Planet.prototype.toQueryString= function(bsimple) {
	return (!!bsimple) ? this.dsym : this.name+'='+this.dsym;
	}

Planet.prototype.nicenum = function() {
	return '<font size=-1>'+(this.sdeg-1)+'..</font> '+this.sdeg
	}

Planet.prototype.nice = function(fontsize,height) {
	//use params as hints to calc if we want/need to abbrev the sign name
	if (typeof(fontsize)!='string' 
		|| typeof(height)!='number')
			{return MAX.SITE.signs[this.isign]+' '+this.nicenum()}
	//
	var n= MAX.SITE.signs[this.isign]
	if (height<80 && n.length>3) {n=n.substr(0,3)}//+'.'}
	return n+' '+this.nicenum()
	//
	}

Planet.prototype.toString = function() {
    return '[Planet ' 
	+':'+this.name
	+':'+this.dir
	+':'+this.sym
	+':'+this.deg
	+':'+this.sign
	+':'+this.pos
	+ ']'
	}

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////
// and the PLANETSYSTEM object

function PlanetSystem(name,points,keys) {
	//manages lists of planets
	this.name=name;
	if (typeof(points) == 'string') 
		{this.fromQueryString(keys,points)}
	else this.addPoints(points) 
	}

PlanetSystem.prototype.addPoints= function(points) 
	{for (var point in points) {this[point]= new Planet( point, points[point] )}}

//

PlanetSystem.prototype.toQueryString= function(keys,bsimple) {
	var a='';
	if (keys) {
		var r=keys.split(',')
		for (var i=0,m=r.length; i<m; i++) {
			if (r[i].toLowerCase()!='name') {
				var p=this[r[i]]
				if (p && p.name) {
					a+=p.toQueryString(bsimple)+'&'
					}
				}
			}
		}
	else {
		for (var p in this) {if (this[p].name) {a+= this[p].toQueryString(bsimple)+'&'}}
		}
	return a.substr(0,a.length-1);
	}

PlanetSystem.prototype.fromQueryString= function(keys,queryString) {
	keys = (keys) ? keys : '';
	queryString = (queryString) ? queryString : location.search;
	queryString = queryString.replace(/^.*\?(.+)$/,'$1');
	delim = '&';
	raw=false;
	//
	var pair, k= keys.split(',')
	if (k.length>1) {for (var i=0, m=k.length; i<m; i++) {
		var r=(k[i]+'=').split('=') //initialize keys specified properties
		this[r[0]]= r[1]
		}}
	//
	var points= new Object
	//
	if (!((pair=queryString.match(/([^=]+)=\'?([^\&\']*)\'?\&?/)) && pair[0].length)) {
		var v= queryString.split(delim)
		if (k.length==1) {this['qs']=queryString}
		else {for (var i=0, m=k.length; i<m; i++) 
			{points[k[i]]= (!!raw) ? v[i] : unescape(v[i])	 }}
		}
	else {
		while ((pair = queryString.match(/([^=]+)=\'?([^\&\']*)\'?\&?/)) && pair[0].length) {
			queryString = queryString.substring( pair[0].length );
			if (/^\-?\d+$/.test(pair[2])) pair[2] = parseInt(pair[2]);
			points[pair[1]] = (!!raw) ? pair[2] : unescape(pair[2]);
			}
		}
	this.addPoints(points) 
	return 
	}

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////
//add trigonometric functions
//http://stjarnhimlen.se/comp/tutorial.html#Bcode

//deg/radians
var degra = Math.PI/180;
var radeg = 180/Math.PI;

//time system helpers
var fracHrsToMs= 1000*60*60*24 //*fracHrs = Ms
var minutesToMs= 60*1000

//wrap
function rev(angle)	 	{return angle-Math.floor(angle/360)*360}		// 0<=a<360
function rev2(angle)	{var a = rev(angle); return (a>=180 ? a-360 : a)}	// -180<=a<180

//sin
function sind(angle) 	{return Math.sin(angle*degra)}
function cosd(angle) 	{return Math.cos(angle*degra)}
function tand(angle) 	{return Math.tan(angle*degra)}
function asind(c) 		{return radeg*Math.asin(c)}
function acosd(c) 		{return radeg*Math.acos(c)}
function atand(c) 		{return radeg*Math.atan(c)}
function atan2d(y,x) 	{return radeg*Math.atan2(y,x)}

/////////////////////////////////////// 

/////////////////////////////////////// 

/////////////////////////////////////// 

///////////////////////////////////////
// add the SOL Object

function Sol() {
	//http://stjarnhimlen.se/comp/ppcomp.html#5
	//http://stjarnhimlen.se/comp/tutorial.html
	//Orbital elements of the Sun:
	//N = longitude of the ascending node
	//i = inclination to the ecliptic (plane of the Earth's orbit)
	//w = argument of perihelion
	//a = semi-major axis, or mean distance from Sun
	//e = eccentricity (0=circle, 0-1=ellipse, 1=parabola)
	//M = mean anomaly (0 at perihelion; increases uniformly with time)
	//Related orbital elements are:
	//w1 = N + w   = longitude of perihelion
	//L  = M + w1  = mean longitude
	//q  = a*(1-e) = perihelion distance
	//Q  = a*(1+e) = aphelion distance
	//P  = a ^ 1.5 = orbital period (years if a is in AU, astronomical units)
	//T  = Epoch_of_M - (M(deg)/360_deg) / P  = time of perihelion
	//v  = true anomaly (angle between position and perihelion)
	//E  = eccentric anomaly
	//One Astronomical Unit (AU) is the Earth's mean distance to the Sun, or 149.6 million km. 
	//When closest to the Sun, a planet is in perihelion, and when most distant from the Sun it's in aphelion. 
	//For the Moon, an artificial satellite, or any other body orbiting the Earth, one says perigee and apogee instead, 
	//for the points in orbit least and most distant from Earth.
	this.N = 0.0
	this.i = 0.0
	this.a = 1.000000  //(AU)
	this.goal=''

//1914
//1120
	//DeltaT http://user.online.be/felixverbelen/dt.htm ... using 5h29m here not dT so the error is fixed for this year at least. 2006
	this.deltaT=0 //(329) *60*1000 // the error hovers around 26 seconds of arc or maybe 2 mins. so dont show seconds at all.
	this.deltaT2=(14-(14*60)) *60*1000 //	to fix up the date post-find
//0112
//1026
//1126
	//alert(this.deltaT/fracHrsToMs)
	}


Sol.prototype.dateCalc= function(y,m,d,UT) {
	//3. The time scale: The time scale in these formulae are counted in days. Hours, minutes, seconds are expressed as fractions of a day.
	//Day 0.0 occurs at 2000 Jan 0.0 UT (or 1999 Dec 31, 0:00 UT). This "day number" d is computed as follows (y=year, m=month, D=date, UT=UT in hours+decimals):
	//Note that ALL divisions here should be INTEGER divisions. Finally, include the time of the day, by adding:
	//   d = 367*y - 7 * ( y + (m+9)/12 ) / 4 + 275*m/9 + D - 730530
	//   d = 367*y - 7 * ( y + (m+9)/12 ) / 4 + 275*m/9 + D - 730530
	//  d = d + UT/24.0        (this is a floating-point division)  //  9 april 1990, at 0:00 UT :=> -3543
	this.date= new Date(y,m-1,d,UT)//(UT*fracHrsToMs)-this.deltaT)//toUTCString()
	//var dd= new Date()
	//dd.setTime(this.date.getTime())
	//this.date.setTime( this.date.getTime() ) //-this.deltaT ) dont adjust this for ET, adj for local time zone instead.
	this.date.setTime( this.date.getTime() +(this.date.getTimezoneOffset()*minutesToMs))

	//alert(dd+'\n'+this.date+'\n'+UT)
	this.d=this.dateCalcUT(y,m,d,UT)
	//this.date= new Date(y,m-1,d,UT)//(UT*fracHrsToMs)-this.deltaT)//toUTCString()
	//this.d=this.date.getDate() //= 367*y-Div(7*(y+Div(m+9,12)),4)+Div(275*m,9)+d-730530+UT/24
	//document.write(this.date-this.d+' timd<br>')
	this.calc()
	}

Sol.prototype.dateCalcUT= function(y,m,d,UT) {
	return 367*y-MAX.Div(7*(y+MAX.Div(m+9,12)),4)+MAX.Div(275*m,9)+d-730530+UT/24 -(this.deltaT/fracHrsToMs)/24
	}

Sol.prototype.calc= function() { //based on this.d
	this.ecl = 23.4393 - 3.563E-7 * this.d
	this.ecl = this.ecl * Math.PI/180

	this.w = 282.9404 + 4.70935E-5 * 	this.d
	while (this.w>360) {this.w-=360}
	while (this.w<0) {this.w+=360}
	this.w = this.w * Math.PI/180

	this.e = 0.016709 - 1.151E-9 * 	this.d

	this.M = 356.0470 + 0.9856002585 * 	this.d	
	while (this.M>360) {this.M-=360}
	while (this.M<0) {this.M+=360}
	this.M = this.M * Math.PI/180

	this.E = this.M + this.e * Math.sin(this.M) * ( 1.0 + this.e * Math.cos(this.M) )
	//
	this.xv = Math.cos(this.E) - this.e
	this.yv = Math.sqrt(1.0 - this.e*this.e) * Math.sin(this.E)
	//
	this.v = Math.atan2( this.yv, this.xv )
	this.r = Math.sqrt( this.xv*this.xv + this.yv*this.yv )
	//
	this.lonsun= this.v+ this.w
	}


Sol.prototype.convertCoordinateSystemsCode= function() {
	var xs = this.r * Math.cos(this.lonsun)
	var ys = this.r* Math.sin(this.lonsun)
	//
	var xe = xs
	var ye = ys * Math.cos(this.ecl)
	var ze = ys * Math.sin(this.ecl)
	//
	this.RA  = Math.atan2( ye, xe )
	this.Dec = Math.atan2( ze, Math.sqrt(xe*xe+ye*ye) )

//12. Equatorial coordinates
//Let's convert our rectangular, ecliptic coordinates to rectangular, equatorial coordinates:
//simply rotate the y-z-plane by ecl, the angle of the obliquity of the ecliptic:
	var xg=xe
	var yg=ye
	var zg=ze

	xe = xg
    ye = yg * Math.cos(this.ecl) - zg * Math.sin(this.ecl)
    ze = yg *Math.sin(this.ecl) + zg * Math.cos(this.ecl)

//Finally, compute the planet's Right Ascension (RA) and Declination (Dec):
	this.RA  = Math.atan2( ye, xe )
	this.Dec = Math.atan2( ze, Math.sqrt(xe*xe+ye*ye) )

//Compute the geocentric distance:
//    rg = sqrt(xg*xg+yg*yg+zg*zg) = sqrt(xe*xe+ye*ye+ze*ze)
	}


Sol.prototype.show= function(y,m,d,UT) {
	this.dateCalc(y,m,d,UT)
	this.showCurrent()
	}

Sol.prototype.showCurrent= function() {
	var n=this.lonsun*(180/Math.PI) //RA*(180/Math.PI)
	while (n>360) {n-=360}
	while (n<0) {n+=360}
	var m=Math.abs(n)
	var i=MAX.Div(m,30)
	var j=m-i*30
	var k=(m-i*30-Math.floor(j))*60
	var l=(m-i*30-Math.floor(j)-Math.floor(k)/60)*60*60
	i++
	var out=''
	+'<table>'
	+'<tr>'
//	+'<td>Solar Longitude</td>'
	+'<td>date</td><td>sign</td><td>deg</td><td>deg</td>'
	+'</tr>'
	+'<tr>'
//	+'<td>'+this.lonsun+'</td>'
	+'<td>'+this.d+'= '+this.date+' <hr>'

//	var d=this.date
//	var 
	+this.formatDate() //date.toUTCString().match(/\d\d:\d\d:\d\d/) 
//	+this.date.toUTCString().match(/\d\d:\d\d:\d\d/) 
	+'</td>' //+' &nbsp;&nbsp;&nbsp; '+this.date.getTime().toString()+'</td>'
	+'<td>'+this.goal //'&nbsp;&nbsp;&nbsp;'
	+'sign#'+i
	+'</td>'
	+'<td>'
	+Math.floor(j)+'&deg;'+Math.floor(k)+'\''+Math.floor(l)+'"'
	+'</td>'
	+'<th>'+(this.lonsun*(180/Math.PI)-(MAX.Div(this.lonsun*(180/Math.PI),360)*360))+'</td>'
	+'</tr>'
//	+'<tr><td>RA</td><td>'+this.RA+'</td><th>'+this.RA*(180/Math.PI)+'</td></tr>'
//	+'<tr><td>Dec</td><td>'+this.Dec+'</td><td>'+this.Dec*(180/Math.PI)+'</td></tr>'
	+'</table>'
	+'<p>'

	document.write(out)
	}


Sol.prototype.find= function(deg) {
//	document.write(deg+'::::::::::::::::::::::::::<br>')

	function wraprad(rad){
		return wrap(rad*180/Math.PI)
		}

	function wrap(l4){
		while (l4>=360) {l4-=360}
		while (l4<0) {l4+=360}
		return l4
		}

	function dist(l6){
		l6=wrap(l6)								// 2-358= -356 |wrap = -356+360= 4
		if (l6>180) {l6=360-l6}				// 358-2= 356 |wrap=356 |>180= 360-356= 4
		return l6
		}

	function dista(l6)
		{return Math.abs(dist(l6))}

	//pick a day
	this.goal=deg
	this.year=2006 //SITE.year
	this.ut0=this.dateCalcUT(2006,0,1,0)
	this.dateCalc(2006,3,20,0)
	this.d0=this.d
	while (2>1) {
		var l4=wraprad(this.lonsun)
		var l5=dist(l4-deg)
		//check tolerance
		if (l5>0 && l5<(1/60/60)) {break}
		//next day
		this.d+=1
		this.calc()
		this.d-=1
		//measure speed and project
		var l5=wraprad(this.lonsun)
		var l6=deg-l4 //dist(deg-l4)
		var l7=dista(l5-l4)
		this.d+= (l6)*(l7)
		if (this.d<this.ut0)	 {this.d+=365}
/*
		document.write(''
			+this.d+' : : : '
			+l4+' : : : '
			+l5+' : : : '
			+l6+' : : : '
			+l7+' : : : '
			+deg+' : : : '+(Math.abs(l4-deg)>180)+' : : : '+(l6*l7)+'<br>')
*/
		this.calc()
		}
	//we've computed how far, in decimal days, we've had to move forward from d0
	//to get to the angle we were looking for. adjust the decimal days to the millisecond
	//counting integer used by js dates so that we have the GMT/UTC for our event
	this.date.setTime(this.date.getTime()+this.deltaT2+(1000*60*60*24)*(this.d-this.d0))
	return this.date
	}
	
Sol.prototype.formatDate= function(dt) {
	if (typeof(dt)=='undefined') {dt=this.date}
	var DA= new String("JanFebMarAprMayJunJulAugSepOctNovDec")
	var M3= 3 * dt.getMonth()
	function lz(a) {
		if ((a+'').length==1) {
		a='0'+a} 
		return a}
	return DA.substr(M3, 3) + "-" + dt.getDate() + "-" + dt.getFullYear()  +' '+ lz(dt.getHours()) +':'+lz(dt.getMinutes())
	}

Sol.prototype.dateof= function(deg) {
	return this.formatDate(this.find(deg))
	}

/////////////////////////////////////// 

/////////////////////////////////////// 

/////////////////////////////////////// 

/////////////////////////////////////// 

///////////////////////////////////////
// the ICHING Object

function IChing() {
	this.lastrule=''
	}

IChing.prototype.hlInfluenceStarts= function(deg) {
//hexagram and line at which the degree's influence starts
	var i=332 //starting degree
	var c=2 //starting line 0..5.. 1..6
	var d=0
	deg=wrapdeg(deg)-1
	while (1<2) {
		d= Math.floor(i)
		if (d==deg) {return [c,i]}
		i= wrapdeg(i+0.9375) //ichingdelta
		c++
		}
	}


IChing.prototype.hexInfo= function(deg) {
	var d=wrapdeg(this.hlInfluenceStarts(deg+1)[0],384)
	var c=this.hlInfluenceStarts(deg,384)
	var i=c[1]
	c=wrapdeg(c[0],384)
	if (i>Math.floor(i)) 
		{c--} // the prior line covers the starting fraction
	var out=''
	var n=0
	while (c<d){
		if (out.length>0)	{out+='<p>'}
		out+='<dl>'
		if (n==MAX.Div(c,6))
			{out+='<dd><b>'+this.aname(MAX.num2(MAX.Div(c,6))+'.'+(1+MAX.Mod(c,6)))+this.hexline(MAX.Div(c,6),(1+MAX.Mod(c,6)),false)+'</b>\n'}
		else {out+= this.hexinfo(MAX.SITE.iching330[MAX.Div(c,6)],(1+MAX.Mod(c,6)),'+1')}
		n=MAX.Div(c,6)
		out+='</dl>'
		c++
		}
	return '<table class=ttb width=400><tr><td>'+out+'</td></tr></table>'
	}

IChing.prototype.hexInfo2= function(deg) {
	var a2=(''+deg).split('.')
	if (a2.count==1) {a2[1]=0}
	var out= ''
	out+='<dl>'
	out+=this.hexinfo(parseInt(a2[0],10),parseInt(a2[1],10),'+1')
	out+='</dl>'
	return '<table class=ttb width=400><tr><td>'+out+'</td></tr></table>'
	}

IChing.prototype.aname= function(a)
		{return '<a name="'+a+'">'}//+'('+a+')'}

IChing.prototype.hexlinerules= function(l) {
		if (this.lastrule.indexOf(l)>-1) {return '*'}
		return ''
		}

IChing.prototype.hexname= function(i){
		var a=iching['h'+MAX.num2(i)]
		if (typeof(a)=='undefined'){return '**error @'+'h'+MAX.num2(i)+'**'}
		var r=a.split(';')
		this.lastrule=r[0]
		var a=r[1]+'| ('+r[2]+')'
		var r=a.split('|')
		return r
		}

IChing.prototype.hexlink= function(i) {
		return '<a href="iching/lines/#'+MAX.num2(i)+'" title="Go to #'+i+': '+this.hexname(i)
			+' '+MAX.SITE.asym(Math.ceil(this.lineToDeg(this.startsAtLine(i)-3 )))+'..'
			+'">'+MAX.num2(i)+'</a>'
		}

IChing.prototype.hexlinks= function(){
		var out=''
		for (var i=1;i<=64;i++){out+=this.hexlink(i)+'\n'
			if (i % 16 ==0){out+='<br>'}
			}
		return 'Hexagrams by Number:<br>'+out
		}

IChing.prototype.hexlinkseq= function(){
		var out='<table>'
		var rtxt=['Spring','Summer','Fall','Winter']
		var row=0
		var idx=5
		for (var i=0;i<64;i++){
			if (i % 16 ==0){
				if (row>0){out+='</td></tr>'}
				if (row>=rtxt.length){break}
				out+='<tr><td>'+rtxt[row]+':</td><td>'
				row++
				}
			//alert(i+': '+MAX.SITE.iching330[i])
			idx=wrapdeg(idx+1,64)
			out+=this.hexlink(MAX.SITE.iching330[idx-1])+'\n'
			}
		out+='</td></tr></table>'
		return 'Hexagrams by Position in the Zodiac:<br>'+out
		}

IChing.prototype.hexline= function(h,l,hyperlink){
		if (typeof(hyperlink)=='undefined'){hyperlink=true}
		var a=iching['l'+MAX.num2(h)+l]
		if (typeof(a)=='undefined') {return '**error @'+h+'.'+l+'**'}
		if (l==0){return a}
		for (var i=0;i<64;i++) {if (MAX.SITE.iching330[i]==h) {break} }
		var line= wrapdeg((i*6)+l,384)
		var d1= this.lineToDeg(line-1)
		var d2= d1+0.9375 - (1/60/60)
		var degs=' &nbsp; '
		var d0=''
		var d3=''

		function hexLink(line,c) {
			var h=MAX.SITE.iching330[MAX.Div(line,6)]
			if (typeof(h)=='undefined'){h=0}
			var l=(1+line%6)
			return '<a href="iching/lines/?'+MAX.num2(h)+'.'+l+'#'+MAX.num2(h)+'" title="Continue in the circle to hexagram '+h+'.'+l+'">'+c+'</a>'
			}

		if (hyperlink){
			if (l==1){d0=hexLink(line-2,'&lt;--')+' '}
			if (l==6){d3=' '+hexLink(line+1,'--&gt;')}
			if (Math.floor(d1)==Math.floor(d2)) {degs+=d0+MAX.NAV.oneDegree(Math.ceil(d2),MAX.SITE.asym(Math.ceil(d2)))+d3}
			else {degs+=d0+MAX.NAV.oneDegree(Math.ceil(d1),MAX.SITE.asym(Math.ceil(d1)))+', '
					+MAX.NAV.oneDegree(Math.ceil(d2),MAX.SITE.asym(Math.ceil(d2)))+d3 }
			}

		var b= location.search.indexOf(h+'.'+l)>-1

		return '<b>'+ ((b)? '====&gt;&nbsp;<font size=+1><i>':'')+'#'+h+'.'+l+this.hexlinerules(l)+((b)?'</i></font>':'')+'</b>: '
			+'<font size=-1>'+this.fmtDegree(d1)+' .. '+this.fmtDegree(d2)+degs+'</font>'
			+'<br>'+((b)?'<font size=+1><b>':'')+a+((b)?'</b></font>':'')+'<p>'
		}

IChing.prototype.hexinfo= function(h,l,fs){
		if (typeof(fs)=='undefined'){fs='+2'}
		var out= this.aname(MAX.num2(h))
			+'<dt><font size='+fs+'><b>#'+h
		if (typeof(l)=='undefined')
			{out+=' <font size=-3><a href="iching/lines/#top">(top)</a></font>'}
		out+='<br>'+(this.hexname(h)+'').toUpperCase()+'</b></font>\n'
			+'<br>'+this.hexline(h,0)
			+'<p>'
		if (typeof(l)=='undefined'){
			for (var l=1;l<=6;l++)
				{out+='<dd>'+this.aname(MAX.num2(h)+'.'+l)+this.hexline(h,l)+'\n'}
			}
		else {out+='<dd><b>'+this.aname(MAX.num2(h)+'.'+l)+this.hexline(h,l,false)+'</b>\n'}
		return out
		}

IChing.prototype.startsAtLine= function(hex) {
	for (var i=0;i<64;i++) {if (MAX.SITE.iching330[i]==hex) {break} }
	return 3+i*6
	return ''
	}

IChing.prototype.lineToDeg= function(line) //fmtDegree(lineToDeg(line))
	///////////////////////////////////////////////////
	{return wrapdeg( 332 + (wrapdeg(line-1,384)-1) * 360 / 384 )}
	///////////////////////////////////////////////////
	

IChing.prototype.degToLine= function(deg) {
//ZodiacNav.prototype.getHexLineC= function(deg) {
	///////////////////////////////////////////////////
	deg=wrapdeg(deg)
	var i=332 //starting degree
	var line=3 //starting line 0..5.. 
	//... ok my bad. it actually lines up at 333rd on the 3rd line!
	while (1<2) {
		if (Math.ceil(i)==deg) {return line} //[c,i]}
		i= wrapdeg(i+0.9375) //ichingdelta
		line= wrapdeg(line+1,384)
		}
	///////////////////////////////////////////////////
	}

//

IChing.prototype.fmtDegree= function(n) {
	n+= 1/60/60 //shift the start, off by one
	var d= Math.floor(n)
	var m= (n-d)*60
	var s= (m-Math.floor(m))*60
	m=Math.floor(m)
	s=Math.floor(s)
	return d+'&deg;'+MAX.num2(m)+'\''+MAX.num2(s)+'"'
	}

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////

///////////////////////////////////////
// link to the comment system
// dont require an actual connection to that server unless the user clicks the link

Site.prototype.CommentLink= function(n,id,topic) {
	if (!id) {id=this.IdCommentsSite}
	if (!topic) {topic=this.IdCommentsSiteTopic}
	if (!id) {return}
	//<script type="text/javascript" src="http://rateyourmusic.com/bclw?b=90000044708"></script>
	var yct='Send us feedback<br>Sign the Guestbook'
	ycsx=[] //give up reading the comment count
	ycso=[0,30,0,0,'_self',1,470,550,'rateyourmusic.com/yaccs/p/',yct,yct,yct,'',0,'archived',id,'&']
	get_comment_link(topic)
	}


Site.prototype.DegreeCommentLink= function() {
	var id=this.IdCommentsDegrees
	var topic=this.IdCommentsDegreesBaseID+MAX.NAV.p.ddeg
	if (!id) {return}
	//<script type="text/javascript" src="http://rateyourmusic.com/bclw?b=90000044707"></script>
	var yct='~~ speak your mind ~~'
	ycsx=[] //give up reading the comment count
	ycso=[0,30,0,0,'_self',1,470,550,'rateyourmusic.com/yaccs/p/',yct,yct,yct,'',0,'archived',id,'&']
	get_comment_link(topic)
	}

///////////////////////////////////////
// add YACCS Code (part 1) -->

quot="'";
quotcq="','";

function yaccs_c(){document.write(ycso[0]);}

function ycs(e){
	for(var i=0;i<ycso[2];i++){
		if(ycsx[i*2]==e)
			{return ycsx[(i*2)+1]}
		}
	if(e<ycso[3])
		if(ycso[2]>=ycso[1]) {return -1}
		else{return 0}
	else return 0
	}

function get_comment_link(e){
	cc=ycs(e)
	if(cc==0){yfs=ycso[9]} 
	if(cc==1){yfs=ycso[10]}
	if(cc>1){yfs=ycso[11]; if(ycso[13]){yfs+=cc}	yfs+=ycso[12]}
	if(cc==-1){yfs=ycso[14]}
	if(ycso[5]) {document.write('<a target="'+ycso[4]
		+'" class="yaccslink" href="javascript:void(0)" onclick="window.open('
		+quot+'http://'+ycso[8]
		+'commentsn/blog_id='+ycso[15]+'_and_blog_entry_id='+e
		+quotcq+'yaccs'
		+quotcq
		+'scrollbars=yes,resizable=yes,left=80,top=80'
		+',height='+ycso[6]
		+',width='+ycso[7]
		+quot+')">'+yfs+'<\/a>')}
	else{ 
		document.write('<a class="yaccslink" href="http://'+ycso[8]+ 
		'commentsn?blog_id='+ycso[15]+ ycso[16] +
		'blog_entry_id='+e+ ycso[16] +'returnurl='+document.URL+'">'+yfs+'<\/a>')
		}
	}

//function get_custom_comment_link(e,f,g,h,m,n,o,p,q,r){get_comment_link(e)}
//function yaccs(e,f,g,h,m,n,o,p,q,r,ar){get_comment_link(e)}

//<!-- End YACCS Code (part 1) -->

///////////////////////////////////////

Site.prototype.UpdateMoon= function(id) {
	MAX.SITE.showDate=false
	var r=MAX.get(id)
	MAX.set(id,'')
	r=(r.substr(r.indexOf('>Moon')+1)).split(' ')
	var s=r[1]
	var d=r[2]; d=d.substr(0,d.length-1); d=parseInt(d,10)
	var m=r[3]; m=m.substr(0,m.length-1); m=parseInt(m,10)
	if (m>0) {d++}
	s= s.substr(0,3).toLowerCase()+MAX.num2(d)
	var out= MAX.INTERP.popDegreeText('Current Moon Position is:<br>'+r[1]+' '+r[2]+' '+m+'\'',s,160)
	document.write(out
		+'<br><font size=-1>Moon Position from '
		+'<a href="http://www.widgetsworld.co.uk/">widgetsworld.co.uk/</a></font>')
	}

///////////////////////////////////////
//;#
