/* <h1>Dan's JavaScript Modules: </h1>

<h3>loading...</h3>
<hr />
the big package: all protos, widgets, coversions, ajax, and utils
 */  //<script src='/pub/edjs.js' type='text/javascript'></script>


//test4432
// begin code

IE = false;

var FF3 = navigator.userAgent.match(/firefox\/3\.0/i) ;

var browser="DOM";1//@cc_on?5:5;     IE=true; IE2=true;
var myServer=""
var startuptime22=(new Date()).getTime()



// #############  Data Handles  - getters and putters, 
var Doc=document



function el2(tid) //fetches element by id,  or if passesd an elm, returns it.
{
	return document.getElementById( tid  ) 
}

function el(tid, no2) //fetches element by id,  or if passesd an elm, returns it.
{ 

  if(no2){
	var  mx=arguments.length; var  r=[];
	 for(var z=0;z<mx;z++){  r[z]=document.getElementById( arguments[z] ); }
	return r;
    }

  if( tid.isString){return document.getElementById( tid  ); }

  if(tid.isArray){
	var  mx=tid.length;var  r=[];
	 for(var z=0;z<mx;z++){  r[z]=document.getElementById( tid[z] ); }
	return r;
    }
}//end el



function els(em){ return document.getElementById(em).style; }






//{return (   (!!tid.nodeName)?tid:document.getElementById( tid  )    )}

function names(n){return document.getElementsByName(n)}


function getElementsByClass( class2find ){
var allTags=document.getElementsByTagName("*");
var tagListLength=allTags.length;
var goodTags=[];

for ( var index=0; index < tagListLength; index+= 1 ){

    if ( allTags[index].className.indexOf(class2find) > -1 ){
    
        goodTags[goodTags.length]=allTags[index];

    }//end if- good tag?

} // next index

return goodTags;
}//end function getElementsByClass




function Esc(s) //uri escape a string or array
{return encodeURIComponent(s)}

function 	Self()	{return arguments.length>1?arguments:arguments[0];}
function 	This(r) {return r}

var funName=function(n){ return n.toString().split("(")[0].substr(9)}

var systemColors = ["activeborder","activecaption","appworkspace","background","buttonface","buttonhighlight","shadow","buttontext","captiontext","graytext","highlight","highlighttext","inactiveborder","inactivecaption","inactivecaptiontext","infobackground","infotext","menu","menutext","scrollbar","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","window","windowframe","windowtext"]



function getParent(elm, tagname){ //accepts string or elm, tagname or # of parent nodes
if(elm.isString){elm=el(elm);}

tops: for(var z=0; z<99;z++){
	var t=(elm.parentNode?elm.parentNode:(elm.parentElement?elm.parentElement:elm))
	if  (! t.tagName) { return elm; }
	if  (! tagname) { return t; }

	if(tagname.isNumber){
		 if(z==tagname){ return t;  } 
 		elm=t;
		continue tops;
        }

	if (t.tagName.toLowerCase().match(tagname.toLowerCase()) ){ return t; }
  	elm=t;
	}//next
}//end get parent

function  obLen(ob){ var  i=0;   for(var z in ob){if(ob.hasOwnProperty(z))i++};	return i};
function  obSub(ob){ var r=[]; var i=0; for(var z in ob){if(ob.hasOwnProperty(z))r[i++]=z};return r};


function obVals(ob){ 

var r=[]; var i=0; for(var z in ob){if( ob && ob.hasOwnProperty && ob.hasOwnProperty(z))  r[i++]=ob[z]};return r};


function obMap(ob){ var r=[]; var i=0; for(var z in ob){if(ob.hasOwnProperty(z))r[i++]=[z,ob[z]]};return r};
function obFilter(ob,p){ var r=[];var i=0; for(var z in ob){if(ob.hasOwnProperty(z))r[i++]=ob[p]};return r};


//'dangerous' versions - they hit prototypes, but can also rake the DOM.
function  obSubx(ob){ var r=[]; var i=0; for(var z in ob){r[i++]=z};return r};
function  obValsx(ob){ var r=[]; var i=0; for(var z in ob){r[i++]=ob[z]};return r};
function  obMapx(ob){ var r=[]; var i=0; for(var z in ob){r[i++]=[z,ob[z]]  };return r};
function  obSetx(ob, f){ var r=[]; var i=0; for(var z in ob){r[i++]=f(z);};return r};
function  obLetx(ob, f){ for(var z in ob){void(f(z));}return;};
function  obGetx(ob, c){ var r=[]; var i=0;for(var z in ob){ r[i++]=ob[z][c] }; return r;}

function  obSubl(ob){ var r=[]; var i=0; for(var z=0; z<ob.length;z++){r[z]=z};return r};
function  obValsl(ob){ 
//obValsl.log.push(String(ob));
 try{
if(ob && ob.length){ var r=[], i=0, mx=ob.length; 

for(var z=0; z<mx;z++){ r[z]=ob[z] || undefined ;   }

}//end if

}catch(yy){alert(yy) }

return r   };

obValsl.log=[];

function obMapl(ob){ var r=[]; var i=0; for(var z=0;z<ob.length;z++){if(ob.hasOwnProperty(z))r[i++]=[z,ob[z]]};return r};

function obTypes(ob, filtered) {
    var r = [];
    var i = 0;
    if (filtered) {
        for (var z in ob) {
            if (ob.hasOwnProperty(z)) {
                var toz = ob[z].type;
                try {
                    r[i++] = [toz , z , String(ob[z]) ];
                } catch (rr) {
                    r[i++] = [toz , z , "[ (Private Object) ]" ];
                }
            }
        }
    } else {
        for (var z in ob) {
            var toz = ob[z].type;
            try {
                r[i++] = toz + " : " + z + ":	" + String(ob[z]);
            } catch (rr) {
                r[i++] = toz + " : " + z + ":	" + "[ (Private Object) ]";
            }
        }
    }
    return r;
}


function obTypesHt(ob, filtered) {
    var r = [];
    var i = 0;
    if (filtered) {
        for (var z in ob) {
            if (ob.hasOwnProperty(z)) {
                var toz = ob[z].type;
                try {
                    r[i++] = [toz, z, String(ob[z])];
                } catch (rr) {
                    r[i++] = [toz, z, "[ (Private Object) ]"];
                }
            }
        }
   
   } else {
	   
	   
        for (var z in ob) {
            var toz = ob[z].type;
            try {

switch (toz){
case "date":      r[i++] =( z + ":	" + String(ob[z])).big().HT({title:"Date"}).outerHTML     ; break;
case "object":  

if(typeOf(ob[z])=="function"){

    r[i++] =( z + ":\t"+("&nbsp;".repeat(7)))+(String(ob[z])).textArea().HT({title:"Function", style:"color:green"}).outerHTML     ;

}else {

    r[i++] =( z + ":\t"+("&nbsp;".repeat(7))+String(ob[z])).bold().HT({title:typeOf(ob[z]), style:"color:blue"}).outerHTML     ;

}//end if
 break;

case "number":      r[i++] =( z + ":	" + String(ob[z])).big().HT({title:"Number"}).outerHTML     ; break;
case "array":      r[i++] =( z + ":	" +ob[z].toSource() ).underline().HT({title:"Array"}).outerHTML     ; break;
case "string":      r[i++] =( z + ":	" + String(ob[z])).fixed().HT({title:"String", style:"color:red"}).outerHTML     ; break;
case "function":      r[i++] =( z + ":	" + String(ob[z])).bold().HT({title:"Function", style:"color:blue"}).outerHTML     ; break;
default:      r[i++] = toz + " : " + z + ":	" + String(ob[z]); break;
         
}

  } catch (rr) {
             
switch (toz){
case "date":      r[i++] =z.toString().big().HT({title:"Date"}).outerHTML     ; break;
case "object":      r[i++] =z.toSource().bold().HT({title:"Object", style:"color:green"}).outerHTML     ; break;
case "number":      r[i++] =String(z).big().HT({title:"Number"}).outerHTML     ; break;
case "string":      r[i++] =String(z).fixed().HT({title:"String", style:"color:red"}).outerHTML     ; break;
default:      r[i++] = toz ; break;
         
}



            }
        }
    }
    return r.join("<br>\n")
}



function obSub2(ob, filtered) {
    var r = [];
    var i = 0;

if(filtered){
    for (var z in ob) {
	     if (ob.hasOwnProperty(z) ) {
		var toz=ob[z].type;
		try{     r[i++] = toz +" : "+z+":\t"+ String(ob[z])} catch(rr){r[i++] = toz +" : "+z+":\t"+"[ (Private Object) ]"}
	    }//end if has own prop
}//next
}else{ //unfiltered
    for (var z in ob) {
		var toz=ob[z].type;
		try{     r[i++] = toz +" : "+z+":\t"+ String(ob[z])} catch(rr){r[i++] = toz +" : "+z+":\t"+"[ (Private Object) ]"}
}//next
}//end if filtered?
    return r;
}



function tags(elm, tid) //fetches a collection of tags of namestr = tid
{
if(tid){
	if(elm.isString){elm=el(elm)}
	return obValsl(elm.getElementsByTagName(tid));
}//end if  tid
	return obValsl(document.getElementsByTagName(elm));
}


function dateParse (s) {var d = new Date();d.setTime(Date.parse(s)); return d.toUTCString()} //keep for compat
function parseDate(s) {
if(s.match(/^\s?\d{4}-\d{2}-\d{2}T\d{2}\:\d{2}:\d{2}Z\s?$/g)){  

("2003-12-13T18:30:02Z")

//return (new date(s.slice(0,4),s.slice(5,2), s.slice(8,2),   )) )



}
    var d = new Date();
try{ d.setTime(Date.parse(s))}catch(t){
var td=s.replace(/[-_\\.]/gm, "/").replace(/T!h+/," ")
    d.setTime(Date.parse(td))}
    return d;
}



function array2ob(r, delm){ var o={};
var mx=r.length; var z=0; var tl=[];
for (var z=0;z<mx;z++)
{var  tl=r[z].split(delm);  if(tl[0]) o[tl[0]]=tl.slice(1);
}return o;}//end array2ob



function	rayCol(t,c){ var r=[] ; var mx=t.length; for (var z=0; z<mx; z++){ r[z]=t[z][c] }; return r;}
	
var Group2= function (f, List) 
{var z=0; var Ray=[];var  len=List.length ;
		for (var z=0;z<len;z++){
				if(f(List[z])){ Ray[Ray.length]=f(List[z], z, List)}
					}
return Ray;			//.length>1? Ray: Ray[0];
}//end group
Group2.info="applies a function(f) to an array and returns result...(shared scope)"

function foxParse(js, bSqueeze, bSort, retType){
var info="<i>js is the code as a string or object- if bSqueeze: it will be minimized, else unminimized- and retType is how you wan't it returned: specify a function to accept it, or use the default string ret</i>";
var buffer; var tBuffer;
	var fWrap=function(c){return "function SANDBOX(){\n\n"+c+"\n\n};" ;   }
	var tSource=fWrap(js.toString());
		
	eval( tSource  );
	
		if(!!bSqueeze) { //compress it!
			var tBuffer=SANDBOX.toSource()//.replace(/\n/gm, "\n\n");
			if(!!bSort)	buffer=obVals(tBuffer.toString().split(/\n/gm)).slice(1,-1).sort().join("\n");			
			if(!bSort)	buffer=obVals(tBuffer.toString().split(/\n/gm)).slice(1,-1).join("\n");			
			
			}else{ //don't compress
						tBuffer= SANDBOX.toString()//.replace(/\n\n/gm, "\n");
			var funcRay=obVals(tBuffer.toString().split(/\n\n/gm))
						//buffer= (funcRay.length>1) ?: (funcRay.sort().join("\n\n"); 
			if(!!bSort)buffer=(funcRay.slice(1,-1)).sort().join("\n\n") 
			if(!bSort)buffer=(funcRay.slice(1,-1)).join("\n\n") 
		}//end if - clean or compress?

    return (!!retType) ? retType(buffer) : buffer ;
}//end function   foxParse
	   

// #######  end handler section
//  ####################   DHTML -DOM access, html functions, presentation functions, bigger ones are in jfx.js


function setAttribs(elm, ob) {
    for (var z in ob) {
        if (ob.hasOwnProperty(z)) {
	    	 try{elm[z]=ob[z];} 
    	    	catch(er){ elm.setAttribute( z, ob[z])}
      	}//endif
    }//nxt
return elm;
}//end setAtrribs

function setAttribStr(elm, ob) {
    var r = [];
    var i = 0;
    for (var z in ob) {
   if (ob.hasOwnProperty(z)) {
                r[i++] = z + "="  +'"'+  ob[z] + '"';
      }//endif
    }//nxt
telm=elm.split(">")
    return (telm[0] +"  "+r.join("  ") +" >"+ telm.splice(1,999).join(">"))
}//end setAtrribStr




function xItem(ob, ind) {
    var vi = "turns an object into xml leaves";
    var b = []; var tb; var  toz;

      for (var z in ob) {

       if (ob.hasOwnProperty(z)) {
          var sVar = (function(){

 var  tb = "";
       var  zo = ob[z];
       var  toz = typeof zo;
        if (toz == "object") {
            if (zo.isArray) {    toz = "array";           }
            if (zo.isDate ) {    toz = "date";           }
        }
        switch (toz) {
          case "string":
            if (zo.contains("<")) {
//               tb = "<![CDATA[" + zo + "]]>";
		 tb = zo.stripComments();
            } else {
               var  tb = zo.stripComments();
            }
            break;
          case "boolean":
            tb = zo.toJSONString();
            break;
          case "array":
            tb = "\n" + xItem(zo, "\t");
            return tb;
            break;
          case "object":
            tb = "\n" + xItem(zo.copyOf(),"\t");
            return tb;
            break;
          case "date":
            tb = zo.toString();
            break;
          case "number":
            tb = zo.toString();
            break;
          case "function":
            tb = ''; //"***";
		break;
          default: 
			 tb = '';   ;  // zo.toString() + " **DEF**" + zo.type;
        }
        return (ind ? ind : "") + tb;}());

		if(tb){            b[b.length] = "	" + sVar.tag(ob[z].isFunction ? "item" : z.toString()) + ""; }
        }
    }
    return b.join("\n");
}



function xItemOld(ob){ 
var vi="turns an object into xml leaves"
 var b = [];
    for (var z in ob) {
     if (ob.hasOwnProperty(z))b[b.length] = "\t<" + z + ">" + ob[z] + "</" + z + ">";
	}
return b.join("\n");
}//end function xItem


function xItem2(ob){ 
var vi="turns an object (named by ob) into xml -valid branch named after ob "
 var b = []; n=ob; ob=this[ob]
    for (var z in ob) {
    if (ob.hasOwnProperty(z))  b[b.length] = "\t<" + z + ">" + ob[z] + "</" + z + ">";
	}
return "<"+n+">\n"+  b.join("\n\t") + "\n<\/"+n+">\n"
}//end function xItem2




function obTable(ob7) // get a shortcut array of an oject's 'childnodes'
{//returns a  3 col array, [name, typeof, value]
var bn=-1
var BuF=[]
for(var z in ob7)
{
if(typeof ob7[z]!=="function"){
// bn++;
BuF[BuF.length]=[z, typeof ob7[z], ob7[z] ] }//end if
}
return  BuF
}//end function obLen

function obTablex(ob7) // get a shortcut array of an oject's 'childnodes'
{//returns a  3 col array, [name, typeof, value]
var bn=-1
var BuF=[]
for(var z in ob7)
{
if(typeof ob7[z]!=="function"){
// bn++;
BuF[BuF.length]=[z, typeof ob7[z], ob7[z] ].join("|") }//end if
}
return  BuF
}//end function obLen



function rndcol() //random no from 0-255 used for style color
{
var r = (parseInt(Math.random()*254) +1).toString(16);
return r;
}


function kill(tr)//removes a node
{	tr.parentNode.removeChild(tr);}



function mkTag(tgnam, ndTxt, domid, exatt, clas, styl, blnDom) //make an HTML tag using arguments
{
     if(blnDom)
	{
	    var itm = document.createElement(tgnam);
   	    if(clas.length){itm.className=clas}
 	    if(styl.length){itm.setAttribute('style', styl) }
    	    if(domid){itm.id=domid; itm.name=domid }
                      if(exatt.length){ itm.setAttribute(exatt.split("=")[0], exatt.split("=")[1])   } //need to build a atty parser and feed to this...
 	   itm.innerHTML=ndTxt;
        return itm
                }
         else //return string ^default
           {
	 var  b="<"
    	b=b+tgnam+" "
    	if(clas){b=b+" class='" +clas +"' "} else {clas=""}
    	if(styl){b=b+" style='" +styl +"' "}  else {styl=""}
    	if(domid){b=b+" id='" + domid +"' " +"name='" + domid +"' " }  //else {domid=serial(5)+"01"}
    	if(exatt){b=b+exatt} else {exatt=""}
   	 b=b+">"+ndTxt+"</"+tgnam+">"
    return b;
             }//end if
} //End Function 'mkTag

function showme(s)   // show/hide toggle
{ 
var elmt = el(s)
var els=elmt.style;
if (els.display && els.display !='none'){
	elmt._sty_disp_bk=els.display?els.display:'none';
	elmt.style.display = 'none' }
 else {elmt.style.display=elmt._sty_disp_bk||'block' ;
 		return 1;}
}  //end function 'showme


function hide(s) {  // hides an element, and removes spacing
 if(s.split){s=el(s);} 
  s.style.display = "none"; 
}



function show(s)   // shows an element
{  if(s.split){s=el(s);} 
    s.style.display = 'block'
}  //end function 'show



function flicker(elm){

	if(elm.type=='string'){elm=el(elm)};
var fTimes=[4535,2323,5465,222,664,8763,645,897,43,345,879,5645,454,9897,3534,6575,2314]
tf=fTimes[Rnd(fTimes.length)]

var oTimes=[55,123,265,22,64,763,45,97,4,35,89,245,154,197,313,665,214]
tt=oTimes[Rnd(fTimes.length)]

setTimeout( function(){ elm.style.color="#000" 
						setTimeout(  
								function(){ elm.style.color="#ccc";}, tf); flicker(elm) }, tt  )

}//end flicker




function txt(l){
var t=document.createElement("textarea")
t.rows=10;t.cols=50;
t.value=l.innerHTML.toString().replace(/\<br\s?\/?\>/img,"\n")
l.ondblclick=null;

t.onblur=function(){t.parentNode.innerHTML=t.value.toString().replace(/[\n]/g,"<br>")
	l.ondblclick=function(){txt(l)}; 
 }

l.innerHTML="<input type='button' value='done'><br>"
l.appendChild(t);
t.focus()
}
txt.old="";





function getColor(g){help(pickColor(g), 45, "Choose a Color"); return}


function getcss(target) //gets the style for a DOM element. 
{
	try {	return 	target.style.cssText}  catch (e) {return target.getAttribute("style")}
}//end function 


function getstyle(obj,cAttribute){ //returns the JSS-value of computedStyle of obj.cAttribute
	if (obj.currentStyle){
		this.getstyle=function(obj,cAttribute){return obj.currentStyle[cAttribute]};
	}else{
	//var curVal=document.defaultView.getComputedStyle(obj, null)[cAttribute]
		this.getstyle=function(obj,cAttribute){return document.defaultView.getComputedStyle(obj, null)[cAttribute]}
	}//end else dom-ie
	return getstyle(obj,cAttribute)
}






function setcss(target, text) //sets the style for a DOM element from a sting, no 
{
try {	 target.style.cssText = text	} 
catch (e) { target.setAttribute("style", text)};
}//end function 



function lilWindow(ur) 
{  openCleanWindow.win = window.open(ur, " ",
    "width=600,height=400,marginwidth=0,marginheight=0,resizable=1,scrollbars=1")
}




 //do these work? we have better versions on the toolbar...
function fontUp()
{ 	tags("*").group(function(a){  a.style.fontSize=(parseInt((a.style.fontSize?a.style.fontSize:12))+1) * 1.1 + "pt";    })
	
}
function fontDown()
{ 	tags("*").group(function(a){  a.style.fontSize=(parseInt((a.style.fontSize?a.style.fontSize:12))+1) * 0.9 + "pt";    })
	
}


function wrapit(iStr,tLen,delm)//formats a string for word wraping of tLen cols
{
if(!delm)delm='\n';if(!tLen)tLen=iStr.length
var bs='';var mx=iStr.length
for(i=0;i<mx;i+=tLen)
{bs+=iStr.slice(i,i+tLen)+delm;}
return bs.slice(0,(bs.length-delm.length));}


function upPos(telm, lf, tp){
    upPos.its[telm]=[lf,tp]
};	upPos.its=[];



function textBox(stx)//uses dialog to dipaly a string in a textbox
{
dialog("<textarea onfocus='this.select()' row=22 cols=80 >"+stx+"<\/textarea>", "Copy the text below")
return;
}

if( IE) { 	this.xy = function (e,v) { return (v?(event.clientY+document.body.scrollTop):(event.clientX)); }
	}else{	this.xy=function (e,v) { return (v?(e.pageY):(e.pageX)); }
}//end if ie

var stop2=false;
/*
function drag(d,e) {
	var vi="usage: drag(this,event)"
	var ds=d.style;
	if(!ds.position){ds.position='absolute'; ds.left=ds.left?ds.left:xy(e)+"px"; ds.top=ds.top?ds.top:xy(e,1)+"px"}
	d.style.cursor="move";
	stop2=0;
	var oX=parseInt(d.style.left),oY=parseInt(d.style.top),eX=xy(e,0),eY=xy(e,1),tX,tY,stop2 ;
		function dragI(e) { 			
				if(!stop2) { ds.top=(xy(e,1)+oY-eY+'px'); ds.left=(xy(e)+oX-eX+'px'); }		
				 }//end dragI
				document.onmousemove=dragI;
				document.onmouseup=function(){ 
						stop2=1;
						ds.cursor="crosshair";
						if(parseInt(ds.left)<1){ds.left="1px";}
						if(parseInt(ds.top)<1){ds.top="1px";}
						if(setCookie){ setCookie(d.id, [ds.left,ds.top].toSource() ); }
//					 d.title= ds.left+" , "+ds.top+"  | "+upPos(d.id, ds.left, ds.top)
						document.onmousemove=''; 
						document.onmouseup=''; 
				}//end mouseup
		
return false;
}//end drag





function dnd(elm) {
    if (elm.type == "string") {
        elm2 = el(elm);
    } else {
        elm2 = elm;
    }

if(!elm2.id){ elm2.id=serial(5); }

void(elm2.style.cursor="crosshair");

//void(elm2.style.position = "absolute");

var ds7 = elm2.style;
    if (!ds7.position) {
        ds7.position = "absolute";
        ds7.left = elm2.offsetLeft+ "px";
        ds7.top = elm2.offsetTop+ "px";
    }
//make to ignore right clicks
//also add auto serializing id if none at time of instanciation

if(getCookie){  var od=  getCookie(elm2.id); if(od){oP=eval(od);  ds7.left=oP[0]; ds7.top=oP[1] }  }

    elm2.onmousedown = function () {  drag(this, event);};
//	return elm2;
}


*/





function dnd(elm) {
if(!window.App){App={}; }

if(!App.dndTags){ App.dndTags={}; }
if(!App.Z){ App.Z=12000; }
    if (elm.type == "string") {
        elm2 = el(elm);
    } else {
        elm2 = elm;
    }
    if (!elm2.id) {
	var tgn=elm2.tagName.toLowerCase();
	if(!App.dndTags[tgn] ){ App.dndTags[tgn]=0;
		}else{App.dndTags[tgn]++;}
	elm2.id=tgn+App.dndTags[tgn];
	}//end if id
    void (elm2.style.cursor = "crosshair");
    var ds7 = elm2.style;
    if (!ds7.position) {
        ds7.position = "absolute";
        ds7.left = elm2.offsetLeft + "px";
        ds7.top = elm2.offsetTop + "px";
    }
    if (getCookie) {
        var od = getCookie(elm2.id);
        if (od) {
            oP = eval(od);
            ds7.left = oP[0];
            ds7.top = oP[1];
        }
    }
	drag.items[elm2.id]=[parseInt(ds7.left), parseInt( ds7.top)];
    elm2.onmousedown = function () { this.style.zIndex=(App.Z++);  drag(this, event); return true;};
}//end dnd

//text
function drag(d, e) {
    var vi = "usage: drag(this,event)";

if(e.target!=d){ return true; }


    var ds = d.style;
    if (!ds.position) {
        ds.position = "absolute";
        ds.left = ds.left ? ds.left : xy(e) + "px";
        ds.top = ds.top ? ds.top : xy(e, 1) + "px";
    }//end if  positioned
	d.style.cursor = "move";
	d.buc=  d.style.borderColor;
	ds.borderColor=drag.hlColor;
	d.oldOpac=parseFloat(ds.opacity) || 1;
	ds.opacity=".7";
	stop2 = 0;
	var oX = parseInt(d.style.left), oY = parseInt(d.style.top), eX = xy(e, 0), eY = xy(e, 1), tX, tY, stop2;

   	 function dragI(e) {
	        if (!stop2) {
	            ds.top = xy(e, 1) + oY - eY + "px";
	            ds.left = xy(e) + oX - eX + "px";
	        }
	    }  // end internal drag movement handler
	
    document.onmousemove = dragI;
    document.onmouseup = function () {
    		stop2 = 1;
		    ds.cursor = "crosshair";
		  ds.opacity=1//d.oldOpac || 1;
		    if (parseInt(ds.left) < 1) {
		        ds.left = "1px";
		    }//end if 'negative left'
		    if (parseInt(ds.top) < 1) {
		        ds.top = "1px";
		    }//end if 'over the top'
		
		if(drag.snap){
			
			var dsl=parseInt(ds.left);
			var dst=parseInt(ds.top);
			
			var tfactor=  parseInt(dsl % drag.snap);
			var toff=(   (parseInt(drag.snap / 2) > tfactor)? tfactor : (tfactor * -1) )
			ds.left = (dsl - toff) + "px"
			
			var tfactor=  dst % drag.snap ;
			var toff=(   (parseInt(drag.snap / 2) > tfactor)? tfactor : (tfactor * -1) )
			ds.top= dst - toff+ "px"
			
		}//end if snap
		
		    if (setCookie) {
		        setCookie(d.id, [ds.left, ds.top].toSource());
		    }//end if setCookie
			drag.items[d.id]=[parseInt(ds.left), parseInt(ds.top)];
			var ocolr = d.buc || "transparent" ;
			if(ocolr === drag.hlColor){ ocolr = "transparent"; }
		    d.style.borderColor=  ocolr
		
		    document.onmousemove = "";
		    document.onmouseup = "";
		  document.body.focus();
	}//end internal onmouseup
    return false;
}//end function  drag
drag.snap=10;
drag.items={};
drag.hlColor="#f6f7a5"

function nodrag(e2){

   document.onmousemove ="";

    stop2 = 1;

if(e2){ 
e2.style.cursor="default";
e2.onmousedown="";
e2.style.zIndex=App.Z++;


}//end if
return true;
}
if(!window.App){ window.App= {z:9990 }; }






function fadeout(te)
{
  if (te.type != "string") {
        te= te.id;
    }

fadeO=function ()
 {var xb=fadeO.xbg;
  if (xb > .2){	
    xb=xb-.17;
//    fadeO.oss.opacity=xb
	setOpacity(fadeO.oel, xb * 100)
    setTimeout(fadeO, 15)	
    fadeO.xbg=xb;} else { setOpacity(fadeO.oel, 1); fadeO.oss.display='none'}
  }
 fadeO.oss=el(te).style;
 fadeO.oel=el(te);
 fadeO.org=getstyle(el(te),"opacity");
 el(te).setAttribute("oldOp",fadeO.org);
 fadeO.xbg=el(te).oldOp?el(te).oldOp:1;
 fadeO.oss.opacity=fadeO.xbg;
 fadeO()
} //end function fadeout



function fadein(te)
{
  if (te.type != "string") {
        te= te.id;
    }

fadeI=function ()
 {var xb=fadeI.xbg;
  if (xb < fadeI.org){	
    xb+=.09;
//    fadeI.oss.opacity=xb
setOpacity(fadeI.oel, xb * 100)
   setTimeout(fadeI, 20)	
    fadeI.xbg=xb;
} else { fadeI.oel.style.opacity = '1'}


  }

  fadeI.oel=el(te);
  fadeI.oss=el(te).style;
   fadeI.org=el(te).getAttribute("oldOp")?el(te).getAttribute("oldOp"):1;
   //fadeI.oss.opacity
   //el(te).oldOp=fadeI.oss.opacity;
 fadeI.oss.opacity=.01
 fadeI.oss.display="block"
 fadeI.xbg=.01
 fadeI()
} //end function fadein




function setOpacity2(elm, per) { 
  var g = elm.split ? el(elm) : elm;
   if(!IE) g.style.opacity =  (per / 100)  ; 
   if(IE)  g.style.filter = "alpha(opacity="+(per)+")";
}


function fadeI(elm){
var g = elm.split ? el(elm) : elm;
if(!g.id){ g.id=serial(8); }
for(var i = 1; i< 111; i+=18)
    setTimeout( "setOpacity2('"+g.id+"', "+i+")"  , i * 10   )
}

function fadeO(elm){
var g = elm.split ? el(elm) : elm;
if(!g.id){ g.id=serial(8); }
for(var i = 100; i>-12; i-=18)
    setTimeout( "setOpacity2('"+g.id+"', "+i+")"  , (100-i) * 10   )
}






// -	END DHTML -	-	-	-	-	--	-	
//#######################################################


//888888888888888     DATA Conversions             8 8    8 8 8 8 8 8  8 8 8 8 8 8 8 8 8 8 8 8 8 8 8  8 8 8 8 8 8 8 8 8 8 8 8 8

 var daysLong = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
 var daysShort = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
 var monthsShort = ["Jan", "Feb", "Mar", "Apr","May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
 var monthsLong = ["January", "February", "March", "April","May", "June", "July", "August", "September","October", "November", "December"];


function tag(nd, tx, atts)
{
   return ["<",nd," ",atts," >",tx,"<\/",nd,">"].join("")
}


function watchIE(id, fn){ //an implementation of mozilla's watch function for IE by dandavis
	if(window["bu"+id]!=window[id]){ 
			var Old=window["bu"+id];
			var New=window[id];
			window["bu"+id]=New;
			fn(id,Old,New);
	}//end if changed
	var cmd="watchIE(\""+id+"\", "+fn+")";
	setTimeout(cmd, 125);
return;
}//end function watch2 
if(!window.watch){watch=watchIE};
//function watcher(id, oldval, newval) { document.title=id+"= "+newval; }
//watch("test", watcher);


function ndVal(nd){ //gets the text of any node in any browser
   if(nd.nodeValue){return nd.nodeValue};
   return (nd.innerText?nd.innerText:nd.textContent)
}



function foxEsc(s, url){
var vi="escapes string for javascript. url is boolean: optimize for URL storage? for [LinkApps, Bookmarklets, Favolets]"
return (url? s.toSource().replace(/\'/g,"~*@#%").replace(/\"/g,"'").replace(/\~\*\@\#\%/g,'"').slice(12,-2) : s.toSource().slice(12,-2))
}


function dataUrl(data, mimeType){ // turns a string into a url that appears as a file. (to ff/op/saf)
   encType= (!!btoa) ? ";base64" : ""; var b;
   var esc = (!!encType) ? function(d){return btoa(d);} : function(d){return escape(d);};
   if(!mimeType){mimeType= (data.nodeName) ? "text\/html" :"text\/plain";};	
   b="data:"+mimeType+";charset=utf-8"+encType+",";
   
  	if ("string number date boolean function".indexOf(typeof data) > -1){ b+=esc(data.toString()); return b; };  
  	if ( data.constructor==Array){b+= esc( data.join("") );	return b;  };
	if(typeof data=="xml"){b+=esc(data.toSource()); return b;} //FF2 xml frag/doc
		//for more complicated data, attempt to determine the format.
	if(typeof data=="object"){ 
		  if(!!data.value && !!data.value.length){b+=esc(data.value); return b;}; //input tags w/content
		  if(!!data.innerHTML){b+=esc(data.innerHTML); return b;} //HTML tag
		  if(!!data.length){ 		//weird stuff like nodelists
			var G=function(ob){r=[]; i=0; 
				for(i;i<ob.length;i++){
				if(dataUrl(ob[i])) r[i]=dataUrl(ob[i]);} return r;};//end g
		    return	(b+G(data));}//end if object w/length	
		  if(!! eval(data.toSource()) ){b+=esc(data.toSource()); return b;}; //JSON
	  }//end if object 
 return;
}  //end function dataUrl

function dataUrlStr(data){ return ("data:text\/html,"+escape(data));}




function escXML(s) {
  return ('' + s).replace(/&/g, '&amp;').replace(/</, '&lt;').
    replace(/>/, '&gt;').replace(/\"/g, '&quot;')  }

/*function escHT(t)  //escape string (t) for HTML
{   var tt= document.createTextNode(t); 
 var d= document.createElement('div');
    d.appendChild(tt);
    return d.innerHTML;
}*/

function escHT(t)  //escape string (t) for HTML
{  
    return (new Option(t)).innerHTML;
}



function escJS(tes)
{
var tes2=tes.replace(/([\r\n])/gm, "")
var qw= tes2.replace(/(["'\f\b\n\t\r\/\\])/gm, "\\$1");
return qw
}










function escJS2(tes) { //v2
    var qw = tes.replace(/(["'\f\b\t\\])/gm, "\\$1");
    return  qw2= qw.replace(/([\r\n])/gm, "\\n");  }
	
	




function makeJS(tx, vnam) //JSON encode into an array, based upon lines
{
     if(!vnam){vnam="NewRay"};
var b="var ";
    if (typeof tx == 'string')
	{b="var "+vnam+"="+tx.toJSONString()}
 if (typeof tx == 'undefined')
	{b="//undefined - tx?"}

  if (typeof tx == 'array' | typeof tx == 'object' )
	{	b+=vnam+" = [\n"

	var tmpray=[]
	var max=tx.length
		for (var i = 0; i < max; i++)
			 {
//			if(tx[i]){
	tmpray[i]=tx[i].toJSONString()+","
//}
			}
			tmpray[max]="" //tmpray[max]
			
		b+=tmpray.join("\n").slice(0,-2)+"]"
	} //end if -ar
   return b;
}  //  End Function 'makeJS


 function  decodeJson( inJson)
   {
     return eval( "(" + inJson + ")" )
   } //End Function  'decodejson


function cTime(i)  //adds zero to int. if needed for time display
{
if (i<10) 
  {i="0" + i}
  return i
}//end cTime

function TimeStr() //like a digital clock
{
	var dt= new Date();
return cTime(dt.getHours())+":"+cTime(dt.getMinutes())+":"+cTime(dt.getSeconds())
}




function timer() //current UTC  time
{
var az=new Date();
return az.getTime();
}
timer.toString=function(){return timer();}
Timer = timer




function mkXML(text) //turns xml string into XMLDOM
{
    if (typeof DOMParser != "undefined") {
          return (new DOMParser()).parseFromString(text, "text/xml");
    }
    else if (typeof ActiveXObject != "undefined") {
     	var doc = new ActiveXObject("MSXML2.DOMDocument");      
        doc.loadXML(text);            
        return doc;                   
    }
    else {
        var url = "data:text/xml;charset=utf-8," + encodeURIComponent(text);
        var request = new XMLHttpRequest();
        request.open("GET", url, false);
        request.send(null);
        return request.responseXML;
    }
};



// end CONVERSION section
// ##	#########	#####	########	###### Data Transports 




function newajax()	   //create a dual browser XHR object
{ 
  var ox=null
    if (window.XMLHttpRequest)
	{ox=new XMLHttpRequest()}
    else if (window.ActiveXObject)
	{ox=new ActiveXObject("Microsoft.XMLHTTP") }
return ox
} //End Function  'newajax





function addScript(u){ var sc2=document.createElement('script'); sc2.src=u;  document.getElementsByTagName('*')[1].appendChild(sc2) }





function synAj(turl, op, VAR2, mimeT)  	//synchronous file grabber. if {xml} then ret=xml else ret= Text
{				
if (!VAR2){VAR2=null;} //enable lazy binding...

var	XHRt = newajax()
//	
//if (op=="BINGET"){XHRt.open("GET", turl, false)};
//if (op=="GET"){XHRt.open(op, turl, false)};
if (op !="POST"){XHRt.open(op, turl, false)};


XHRt.setRequestHeader('Content-Type', mimeT?mimeT:'text/html')
XHRt.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
XHRt.setRequestHeader('Content-Length', String(VAR2).length)


if (op=="POST")
     {		 
	 XHRt.setRequestHeader("Content-type",  mimeT?mimeT:"application/x-www-form-urlencoded");
	XHRt.setRequestHeader("Connection", "close");	
	XHRt.setRequestHeader("Content-length", VAR2.length);	
	XHRt.open("POST", turl, false)
	};

//	
      XHRt.send(VAR2); 

switch (op)
{
case "GET":
	if(!! XHRt.status.toString().match(/404/)){return false;}
	if (VAR2!="xml"){
			var buff=XHRt.responseText ? XHRt.responseText.toString().Ob() : "";
			buff.status=XHRt.status;
//			buff.xml=XHRt.responseXML
			buff.head=XHRt.getAllResponseHeaders();
			buff.xob=XHRt;
			return buff;
		
		
		}else{
			return XHRt.responseXML
			};
	break;

case "BINGET":
	 return XHRt.ResponseBody;
	break;

case "PUT":
			var buff=XHRt.status.toString().Ob();
			buff.status=XHRt.status;
			buff.head=XHRt.getAllResponseHeaders();
			buff.xob=XHRt;
			return buff;


	 return ;
	break;


case "HEAD":
     if(VAR2)	{    return XHRt.getResponseHeader(VAR2);   }
	   else	{   return XHRt.getAllResponseHeaders();  }
	break;

case "POST":
	return XHRt.responseText;
	break;

default:
	return  XHRt.status;
	break;
}  //end switch

} //end synch ajax function








function sPutXML(turl, VAR2)  	//xml file writer - send text, not a document...
{				
	XHRt = newajax()
	XHRt.open('PUT', turl, false);
	XHRt.setRequestHeader('Content-Type', 'text/xml')
	XHRt.send(VAR2); 
 return XHRt.status;
} //end synch XML ajax function





function aGet(turl, callback)  	//asynch file getter- pass a function
{	var  XHRt = newajax()
		XHRt.onreadystatechange=function(){
            if(XHRt.readyState == 4 && XHRt.status == 200 ){  callback(XHRt.responseText) }
           }
        XHRt.open('GET', turl, true);
	XHRt.setRequestHeader('Content-Type', 'text/html')
	XHRt.send(''); 
 return XHRt;
} //end synch XML ajax function


function aPut(turl, data, optionalBlnType) {
    var XHRt = newajax();
    XHRt.onreadystatechange = function () {if (XHRt.readyState == 4 && XHRt.status == 200) { void(0); }};
    XHRt.open("PUT", turl, true);
	// XHRt.setRequestHeader('Content-Type',  optionalBlnType? optionalBlnType :  sHead(window.location.href,"Content-Type")||'text/html')
XHRt.setRequestHeader('Content-Type',  optionalBlnType? optionalBlnType :  sHead(turl,"Content-Type")||'text/html')
    XHRt.send(data);
    return XHRt;
}



function sGet(turl, parm,  mType)  
	{ return synAj(turl, "GET", parm, mType) || "";  }

function sHead(turl, parm)  
	{ return synAj(turl, "HEAD", parm);  }

function sDel(turl)  
	{ return synAj(turl, "DELETE", "");  }

function sPut(url, st, mType)  
	{ return synAj(url, "PUT", st, mType );  }

function sPost(turl, param, mType)
	{ return synAj(turl, "POST", parm, mType);  }
	

function sAppend(turl, data, mType) {
 try{
	var bb4=synAj(turl, "GET", "", mType);
	}	catch(rr){
			var bb4="";
			   };
	if(!bb4)return; 
 return synAj(turl, "PUT", bb4+data, mType);
}

function sCopy(turl) {
 try{
	var bb4=synAj(turl, "GET", "");
	var mType = bb4.head.split("\n").find("Content-Type")[0].split(": ")[1];
	}	catch(rr){
			var bb4="";
			   };
	if(!bb4)return; 
 return synAj(turl, "PUT", bb4, mType);
}


function sBin(url, param) {
	if(!!document.all){
			function binGet(turl, parm)  { return synAj(turl, "BINGET", parm);  }
	   return binGet(url,param)
	
	} else {
//		req.responseText
	//t=[req.responseText,req.getAllResponseHeaders() ];

	void(netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"));
	var req = new XMLHttpRequest();
	req.open('GET',url,false);
	req.overrideMimeType('text/plain; charset=x-user-defined');
	req.send(null);
	if (req.status != 200) return '';
	var t=new String();
	var ff=[];
	t=req.responseText;
	for(z=0;z<t.length;z++){ff[z]= String.fromCharCode(t.charCodeAt(z) & 0xff);}
	var b=ff.join("")
	return b;
	}//end if // XBROWSER COMPAT
}//end sBin2



function folderSize(u, deep){ //webDAV folder size getter if deep then recursive total
var xx='<?xml version="1.0" encoding="utf-8" ?>   <D:propfind xmlns:D="DAV:">    \
     <D:prop> <D:getcontentlength/>  </D:prop>   </D:propfind>'
  r= newajax();
    r.open("PROPFIND", u, false);
  r.setRequestHeader("depth", (deep?"infinity":"1"));
    r.send(xx);
w= obValsl(r.responseText.match(/\<D\:getcontentlength\>([\w]+)\<\/D\:getcontentlength\>/gmi)).group("return parseInt(a.slice(20,-21))")
return w.sum()
}//end function folderSize






function bin2dataUrl(url){ //virtual file
var b = sBin(url);var ff=[];
t=sHead(url, "Content-Type")
	  return dataUrl(b, t)
}//end bin2dataUrl

//virtual file/ as a link
function file2link(url){ //html href text is filename, links to dataUrl of filecontents 
c=url.link(bin2dataUrl(url))
return c
}



function svfile(fName, uStr) //saves a file
{
   var fnm= myServer+"as/"+fName
    sPut(fnm, uStr);

return;
}//end function 'svfile

function qfile(fName) //gets the head of a file
{   var fnm= myServer+"as/"+fName;
	var rt=  sHead(fnm);
	return rt
}//end function 'qfile


function apfile(fName, uStr) //appends a file
{
   var fnm= myServer+"as\/"+fName
   var tt=sGet(fnm, "txt");
//   var jnk=sDel(fnm);
   var jnk3=sPut(fnm, tt+ uStr);
return;
}//end function 'apfile


function ldfile(fName) //loads a file
{
   var fnm= myServer+"as/"+fName
   var tt= synAj(fnm, "GET", "HTML")
 return tt;
}  //end function 'ldfile


function head2Ob(st){	vi="turns file headers into json on a string or the current doc";
	if(!st){ st=sHead(window.location); }
	o={};
	var b=st.split(/\n/g).group(function(a){
		v= a.split(/:\s?/g); 
		o[v[0].toLowerCase()]=(v[1]?v[1]:'') 
	   });
   return o;
}//end head2Ob





function mkDir(d){

 var XHRt = newajax();
XHRt.open("MKCOL", d, false);
 XHRt.send();
return XHRt.status;
}//end mkdir



function rmDir(d){

 var XHRt = newajax();
XHRt.open("DELETE", d, false);
 XHRt.send();
return XHRt.status;

}//end rmdir



   function sOptions() {
	        var XHRt = newajax();
	        XHRt.open("OPTIONS", ".", false);
                XHRt.send("");
	        return XHRt.getResponseHeader("Allow").split(/\W+/g)
	    }







/*  webdav propfind - looking for files example - returns an array of filenames in the called directory Xbrowser edition - kinda chunky. e4x version avail  */

function davdir(p) {
    r = "<D:propfind xmlns:D=\"DAV:\">        <D:allprop/>  </D:propfind>";
   function mr(d) {
        var XHRt = newajax();
        XHRt.open("PROPFIND", d, false);
        XHRt.setRequestHeader('Content-Type', 'text/xml')
        XHRt.setRequestHeader('Depth', '1')
        XHRt.send(r.toString());
        return XHRt.responseText;
    }

    g = mkXML(mr(p));
    o = obValsl(g.getElementsByTagName("response"));
    return o.group(function (a, b, c) {
w = "{ name: " + obValsl(a.getElementsByTagName("displayname"))[0].textContent.quoted();
//try {w += ",	 date: "  + new Date(obValsl(a.getElementsByTagName("getlastmodified"))[0].textContent);} catch (yy) {}
try {w += ",	 date: " + obValsl(a.getElementsByTagName("creationdate"))[0].textContent.quoted();} catch (yy) {}
try {w += ",	 type: " + obValsl(a.getElementsByTagName("getcontenttype"))[0].textContent.quoted();} catch (yy) {}
try {w += ",	 size: " + obValsl(a.getElementsByTagName("getcontentlength"))[0].textContent;} catch (yy) {}w += " }";return eval("("+w+")");});
}		
//davdir("https:\/\/netfiles.uiuc.edu/dldavis2/pub/as/").lf()





function davHead(u){
   request = newajax()
   request.open("PROPFIND", u, false);
   request.setRequestHeader("depth", "0"  );
 request.send("");

db3=request.responseXML.documentElement;
function T(nd){ try{t3=db3.getElementsByTagName(nd)[0]; return t3?t3.textContent:"";}catch(yy){};	}
cr={};
cr.href=T("href");
cr.title=T("displayname");
cr.pubDate=parseDate(T("getlastmodified"));
cr.fileType=T("getcontenttype");
cr.size=parseInt(T("getcontentlength"));
return cr
}




 function davlock(u) {
dd='<?xml version="1.0" ?>                                            	 	 \n\
<D:lockinfo xmlns:D="DAV:">                                       	 	 \n\
   <D:lockscope><D:local/></D:lockscope>                          	 	 \n\
   <D:locktype>                                                   	 	 \n\
      <D:transaction><D:groupoperation/></D:transaction>          	 	 \n\
   </D:locktype>                                                  	 	 \n\
   <D:owner>                                                      	 	 \n\
      <D:href>'+window.location.href.toString()+'</D:href> 	 	 \n\
   </D:owner>                                                     	 	 \n\
</D:lockinfo>                                                     	 	 \n\
'  //	 end  danpack

 
        var XHRt = newajax();
        XHRt.open("LOCK",u, false);
        XHRt.setRequestHeader("Content-Type", "text/xml");
	 XHRt.setRequestHeader("Content-Length",  dd.length.toString()  );
        XHRt.send(dd);
        return (XHRt.responseXML?XHRt.responseXML:(XHRt.status+"\n"+XHRt.responseText))
    }//end davlock



function partialGet(U,rng) {
    X = !window.XMLHttpRequest ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest;
    X.open('GET');
    X.setRequestHeader('Content-Type', 'text/html')
X.setRequestHeader('Range',"bytes="+rng)
    X.send(V ? V : '');
return X.responseText;}

			

function fileInfo(url){
sHead(url).split("\n")
return [b.find("ontent-Typ").toString().after(":"), parseDate(b.find("Last-Modif").toString().after(":")),parseInt(b.find("Content-Length").toString().after(":"))]
}//end fileInfo



	   
function fetch(urel) //ASP redirected -for xdomain dls
{
  var rett=sGet("ldfile.asp?src="+urel, "")
return rett
}

function load(filename)  //IE FSO file Loader
{  
          var fso, file;
          fso = new ActiveXObject('Scripting.FileSystemObject');
          file = fso.OpenTextFile(filename, 1, false);
          var name = file.readAll();
          file.Close();
	return name;
} 

function save(filename, sData) //IE FSO file Saver
{  
          var fso, file;
          fso = new ActiveXObject('Scripting.FileSystemObject');
          file = fso.CreateTextFile(filename, 2, false);
          file.write(sData);
          file.Close();
	return file;

} 



if(!IE){


window.load=function(filename){

	return sGet(filename);

}


}




function save(filename, sData) //IE FSO file Saver
{  
          var fso, a
          fso = new ActiveXObject('Scripting.FileSystemObject');
          file = fso.CreateTextFile(filename, 2, false);
          file.write(sData);
          file.Close();
	return file;

} 




function File(strPath){
		t={}; p=strPath;
		t.value=sGet(p);
		t.path=p;
		t.orig=t.value;
		t.save=function(strText){if(strText){t.value=strText;}; return sPut(p, t.value);}
		t.reload=function(){t.value=sGet(p); return t.value;}
		t.revert=function(){t.value=t.orig; return t.value;}
		t.update=function(){return sPut(p, t.value); }
		t.saveAs=function(paf){if(!paf){return}; t.path=paf; return sPut(paf, t.value);}
		t.erase=function(){ res33=confirm("Are you sure you want to delete "+t.path+"?\n\n"); if (res33){return sDel(p)}; }
		t.toString=function(){return t.value;}
	t.help=(function(){return obSub(t).join("\t\t<br>\n")}())
return t;
}//end File





function ldDW(f,s){ //dreamweaver snippet loader, block style
    base = sGet(f);
    if (!s) {
        s = "";
    }
    if (base.match(/\<\!\[CDATA\[/g) > 1) {
        tt = mkXML(base);
        t = tt.documentElement.textContent;
        return t;
    } else {
        t = base.match(/\<\!\[CDATA\[.+\]\]\>+/gm).join("").split(/\<\!\[CDATA\[/g).join("").replace(/\]\]\>/g, "*&^%").split("*&^%").splice(0, 2);
        return t[0] + s + t[1];
    }
}//end ldDW


function fileSize(url){ var s=sHead(url); return (s.slice(s.indexOf("Content-Length:")+16).split("\n")[0])  }
function fileDate(url){ var s=sHead(url); return parseDate(s.slice(s.indexOf("Last-Modified:")+15).split("\n")[0])  }
function fileType(url){ var s=sHead(url); return (s.slice(s.indexOf("Content-Type:")+14).split("\n")[0])  }




function setCookie(nm, valu) {
	var e2=(new Date(2019,1,1)).toGMTString();
    document.cookie = nm + "=" + escape(valu) + "; expires=" + e2
       }

function getCookie(k){
var  d = (document.cookie ||"");
var pairs=d.split(k+"=")
if(pairs && pairs[1]){ return unescape(pairs[1].split(";")[0]) }
}



/*
function CB() //sets or read clipboard in IE accepts 1 arg to set, returns cb when empty
{
if (arguments.length)     {window.clipboardData.setData('Text', arguments[0])}
else 	{ return window.clipboardData.getData('Text')}
 }//end CB
*/
// only show in IE: <!--[if IE]>	<![endif]-->
// dont show in IE:  <![if !IE]>      <![endif]>


/* text version */
function CBtxt(f) {var bP = typeof f == "undefined";if (window.clipboardData) {if (!bP) {window.clipboardData.setData("Text", f);return;}return window.clipboardData.getData("Text");} else {FT = "text/unicode";CI = Components.interfaces;Cb = CI.nsIClipboard;C = Components;Cs = CI.nsISupportsString;Cm = "@mozilla.org";Cmw = Cm + "/widget/clipboard;1";try {netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");e = C.classes[Cmw].createInstance(Cb);var clip = C.classes[Cmw].getService(Cb);} catch (e2) {return;}try {b = C.classes[Cm + "/widget/transferable;1"].createInstance(CI.nsITransferable);} catch (e3) {return;}b.addDataFlavor(FT);if (typeof f == "undefined") {clip.getData(b, clip.kGlobalClipboard);var str = {};var strLength = {};b.getTransferData(FT, str, strLength);if (str) {str = str.value.QueryInterface(Cs);}if (str) {f = str.data.substring(0, strLength.value / 2);}return f;}o = C.classes[Cm + "/supports-string;1"].createInstance(Cs);o.data = f;b.setTransferData(FT, o, f.length * 2);try {t = CI.nsIClipboard;} catch (e4) {return;}e.setData(b, null, t.kGlobalClipboard);return;}return;}




function CB(f) { if(!f){f=undefined; }
    var bP = typeof f == "undefined";
    if (window.clipboardData) {
        if (!bP) {
            window.clipboardData.setData("Text", f);
            return;
        }
        return window.clipboardData.getData("Text");
    } else {
       var FT = "text/unicode";
       var  CI = Components.interfaces;
       var  Cb = CI.nsIClipboard;
       var  C = Components;
       var  Cs = CI.nsISupportsString;
       var  Cm = "@mozilla.org";
       var  Cmw = Cm + "/widget/clipboard;1";
        try {
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
           var  e = C.classes[Cmw].createInstance(Cb);
            var clip = C.classes[Cmw].getService(Cb);
        } catch (e2) {
            return;
        }
        try {
          var   b = C.classes[Cm + "/widget/transferable;1"].createInstance(CI.nsITransferable);
        } catch (e3) {
            return;
        }
        
	b.addDataFlavor("text/html")//end if wanting html
	b.addDataFlavor(FT);
//        if (typeof f == "undefined" ) {
        if (!f) {
            clip.getData(b, clip.kGlobalClipboard);
            var str = {};
	    var bestFlavor={}
            var strLength = {};
            b.getAnyTransferData (bestFlavor, str, strLength);
            
  if ( bestFlavor.value == "text/html" ||
        bestFlavor.value == "text/unicode" ) {

	if (str) {
                str = str.value.QueryInterface(Cs);
            }
            if (str) {
                f = str.data.substring(0, strLength.value / 2);
            }
	}
   return f;
        }
       var  o = C.classes[Cm + "/supports-string;1"].createInstance(Cs);
        o.data = f;
        b.setTransferData(FT, o, f.length * 2);
        try {
         var    t = CI.nsIClipboard;
        } catch (e4) {
            return;
        }
        e.setData(b, null, t.kGlobalClipboard);
        return;
    }
    return;
}


function IO(U, V) {
//LA MOD String Version. A tiny ajax library.  (c)2007, DanDavis
    var X = !window.XMLHttpRequest ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest();
    X.open(V ? 'PUT' : 'GET', U, !1);
    X.setRequestHeader('Content-Type', 'text/html')
    X.send(V ? V : '');
return X.responseText;}


Store = { useAjax: "" , providers: {}  };

Store.providers.mozStore = function mozStore(key,val){
if (val){ globalStorage[document.domain][key]=val; } else {
				try{		var tm= globalStorage[document.domain][key].toString();
					} catch(rr){ tm=""};
		  return tm;	
		} //end if 2nd argument (get?)
return;//retrun falsy for set and get blank
 }//End mozStore

	Store.providers.w3Store=function w3Store(sKey, sVal){
		if(typeof sVal !='undefined' ){ //save it
			setCookie(sKey, sVal);
		} else { //load it
		   return getCookie(sKey); 
		}//endif S || L?
	  return;
	}		//end function w3Store

Store.providers.ieStore = function ieStore(sKey, sVal){

	try{
	if(sVal){ //save it
		var outBuffer=escape( String(sVal)  );
		eIESTORE[sKey]= outBuffer ; 
		eIESTORE.save("Linck");	
	} else { //load it
//	   return unescape(eIESTORE.getAttribute(sKey));    
	   return unescape(eIESTORE[sKey]);    
	}//endif S || L?
  return;

}catch(tt){
return unescape(eIESTORE[sKey]);  

}
}	//end function ieStore

Store.providers.RestStore = function ajaxStore(sKey, sVal){
		var keyName=escape( String(sKey)  );
	if(sVal){ //save it
		var outBuffer= String(sVal);
 	  	IO(keyName, outBuffer);
	   return;
	} else { //load it
	   return  IO(keyName);    
	}//endif S || L?
}//end restStore

Store.providers.ajaxStore = function ajaxStore(sKey, sVal){
//mkDir("\/pub\/REST")  //first time builder
// IO( "\/pub\/REST\/" + "keyChain"+ ".dat", "{}");  


		var keyName=escape( String(sKey)  );
	if(sVal){ //save it
		var outBuffer= String(sVal);
 	  	IO( "\/pub\/REST\/" + keyName+".dat", outBuffer);
	   return;
	} else { //load it
	   return  IO( "\/pub\/REST\/" + keyName + ".dat");    
	}//endif S || L?
}//end ajaxStore


Store.providers.aspStore = function aspStore(sKey, sVal){
	
	function zGet(key, val) {var kx="/pub/store2.asp?key=" +escape( key )+( val ? "&val="+escape( val ) : ""); return sGet(kx);}

	var keyName=escape( String(sKey)  );
	if(sVal){ //save it
		var outBuffer= String(sVal);
 	  	zGet(keyName, outBuffer);
	   return;
	} else { //load it
	   return  String(zGet(keyName));    
	}//endif S || L?
}//end aspStore -raw value version



//now choose which one to use:
if(IE){
	(function(){//add a stylesheet class to enable IE's userData persistance method of local storage
		aCSS(" .userData {behavior:url(#default#userdata);} ")
		var Static=document.createElement("input");
		var Q=function(z,x){Static.setAttribute(z,x)};  //  Quickset shortcut
			Q("type", "hidden");
			Q("id", "eIESTORE");
			Q("value", "0");
			Q("className", "userData");
			Q("style", "  behavior:url(#default#userdata)  ")
		
		tags("head")[0].appendChild(Static);
		try{eIESTORE.load("Linck")}catch(r){} 	//loads oxml frtom elm sDest
		window.foxStore=Store.providers.ieStore;
	}())//end static node creation
}//end if ie


if( (!window.globalStorage) && (!IE)  ){ //opera and safari get reverted to cookies
//				until flash or something better comes along
	window.foxStore=Store.providers.w3Store
}//end not ie or ff local storage avail

if( window.globalStorage  ){ //firefox
	window.foxStore=Store.providers.mozStore
}//end not ie or ff local storage avail

Store.foxStore=foxStore;

if(Store.useAjax){
	window.foxStore=Store.providers.ajaxStore
}//end if use ajax only

Store.GET=function GET (key){ return foxStore(key);   }
Store.SET=function SET (key, value){ return Store.saveSetting (key, value);   }


// registry functions

Store.listSettings = function listSettings(){
    var ob=eval(foxStore("keyChain")) || {};
   return ob.subs();
}//end listSettings

Store.getSetting = function getSetting(key){
    var ob=eval(foxStore("keyChain"))[key] || {};
    ob.value= foxStore(key) ;
    ob.name=key;
ob.toString=function(){ return ob.value}
  return ob;
}//end getSetting

Store.saveSetting =  function saveSetting(key, val){
	var ts= val.toSource();
	var ob=eval(foxStore("keyChain")) || {}
	ob[key]={ name: key, size: ts.length, date: now(), type: typeOf(val) }
	foxStore(key, val);
        foxStore("keyChain", ob.toSource() )
   return ob;
}

Store.copySetting = function copySetting(keyOrig, keyNew){
	if(!keyNew){ return 0; }
    var val = foxStore(keyOrig) ;
	var ts= val.toSource();
	var ob2=eval(foxStore("keyChain")) || {}
	ob2[keyNew]={ name: keyNew, size: ts.length, date: now(), type: typeOf(val) }
	foxStore(keyNew, val );
        foxStore("keyChain", ob2.toSource() )
   return 1;
}

Store.getSettings = function getSettings() {
    var ob = eval(foxStore("keyChain")) || {};
    return ob;
}


Store.findSettings = function findSettings(keys) {
	var key=String(keys).toLowerCase();
	var ob = eval(foxStore("keyChain")) || {};
	var hits=[]; var hitCount=0;
         ob.subs().group( function(a){
			var it = String(a).toLowerCase(); 
			if(it.indexOf(key)>-1){
			ob[it].toString=function(){ return foxStore(it);}
		hits[hitCount++]=ob[it];}
	         });
  return hits;}

Store.deleteSetting = function deleteSetting(key){
	var ob=eval(foxStore("keyChain")) || {}
	delete ob[key]
	foxStore(key, "deleted on "+now().toShort() );
        foxStore("keyChain", ob.toSource() )
   return;
}

  Store.backupSettings =  function backupSettings() {
        var kc = foxStore("keyChain");
        var ob = eval(kc);
        if (!ob) {
            return "nothing to backup";
        }
        var n = ob.subs();
        n.group(function (a) {ob[a].value = foxStore(a);});
        return ob.toSource();
    }//end busettings


Store.restoreSettings = function restoreSettings(ob) {
	if(!ob){return "nothing to restore; pass backup text or object";}
	if(typeof ob==='string'){ob=eval(ob);}
	if(typeof ob!=='object'){return "error parsing restore code";}
	var n=ob.subs();
	n.group(function(a){	
			   foxStore(a, ob[a].value);
			   delete ob[a].value;
			});
	foxStore("keyChain", ob.toSource());
    return ob.toSource()
}


Store.getFeed =  function getStoreAsFeed() {
        var bc = Store.findSettings("");
	function tagmaker(a) {
        var buff = "<item>\n	" + ["<title>", a.name, "</title>", "<description>", a.toSource(), "</description>", "<pubDate>", a.date.toGMTString(), "</pubDate>", "<length>", a.size, "</length>"].join(" ") + "</item>\n";
        return buff;
    }  
	var b = bc.map(tagMaker).join("\n").tag("channel").tag("rss", {version:"2.0"});
        return dataUrl(b, "text/xml");
    }

Store.cb=  function StoreCB() {
        var base = CB();
        if (base) {
            var title = prompt("Enter a name for this information", "Untilted-" + serial(5));
            if (title) {
                Store.SET(title, base);
            }
        }
    }//end storeCB



Store.synchTo= function (strProvider){
//var providers={ gs:Store.mozStore, cookie: Store.w3Store  } 
var curProvider= window.foxStore;
var tempProvider = Store.providers[strProvider];
if(!tempProvider){ return new Error("Choosw from a valid provider: "+providers.subs().toSource() ); }
var bu=Store.backupSettings();
	window.foxStore=tempProvider ;
Store.restoreSettings(bu);
	window.foxStore=curProvider;
}//end transfer settings



/* todo for registry

//a synch/repub function that basically backups, changes providers, and restores  using:




fix find setting to return an array instead of an object.
now it has to be done like: Store.findSettings("eric9").map()[0][1].date


add encryption options -props of foxStore
-amend all the object handling code to add crypt attrib (prop)
-high - prompt for password in both saveSetting, and getSetting, ob.crypt = 1 : ob.crypt=0;
-auto - serial(256), save w/foxStore. foxStore.passWord= foxStore("___passWord"); used in save and get
-custom -  a custom password is saved as in auto, same routine applies as above basically, subbing user pw for auto serial
-a setup function, done in prompt boxes to set auto, custom, high.

-a custom filter function for load/save - btoa, atob , escape/unescape, etc... 

-a remote html file that uses QS to capture up to 2kb from anywhere. capture selection, ship to file, save locally.
-a help-based file manager, like the dir/index system, for managing the registry. - perhaps i can mount index.html with keys

-a way to open as an excel spreadsheet (tsv/csv) -sweep .toString() on .value
- an rss feed, template value> rss items - build new feed in background, publish - live feed (optional)

- a migrate function to move from one provider to another.

Make each setting an object, give protos to make table row, options
build a webdav- propfind response template. - makes into the xml response of a search.

-versioning -  an append/ only one ones that changed tracker - saves to files to permit manual rollback
-a simple asp,php replacement to foxStore using sGet and some type of xml or json database on server.
   -modularize it to allow several back-ends, set by a prop: php, flash,email,ajax(json + rest) ftp/dav(rest interface)
-toini proto? perhpas would be usefull for some cross compat with executables.

-edit foxStore to watch for keyChain, buffer to a var, server var for reads, use for writes, also gs on save
editor: if loading, optionally paste into text, rather than replace it.
*/
//end registry function section











/*some ie commands:
CopiedTxt = document.selection.createRange();
 CopiedTxt.execCommand("Copy");
document.Form1.txtArea.focus();
   PastedText = document.Form1.txtArea.createTextRange();
   PastedText.execCommand("Paste");
*/


//*###########################  END TRANSPORTS   ############################
//	-   -   -   - 	UTILITIES   - 	-		-	-	-	-	-	-	-		-	-


function stall(x){for(w=0; w<(x*999); w++){var r=w};}  //  x=approx #of milliseconds to wait




function hscroll(callBack){tt="<div id=\"hscroll1\" title=\"0 %\"   onscroll=\" "+callBack+"(this.title) \" style=\"position:relative; height:16px; overflow:auto; width:170px; border:2px solid #red; color:#FFFFFF; background-color:#FFFFFF\" onMouseMove=\'t=Math.min(parseInt( (this.scrollLeft \/ this.scrollWidth ) * 105), 100) ;this.title=t+\" %\";\' ><pre style=\"font-size:50px;\">"+
(function(){tt=[]; for(z=0;z<150;z++){tt[z]="&nbsp;"}; return(tt.join(" ")) }())+"<\/pre><\/div>"; return tt}



function showSrc(d){
if(IE){return;}
c="view-source:"+dataUrlStr(d, "text\/html")
dd="".tag("iframe",{height: "100%", width: "100%", src: c})
void(dialog(dd,33))
}

function showSnip(d){
	if(IE){return;}
	c=dataUrlStr(d, "text\/html")
	dd="".tag("iframe",{height: "100%", width: "100%", src: c})
	void(dialog(dd,33))
}



function showUrl(d){
if(IE){return;}
	dd="".tag("iframe",{height: "100%", width: "100%", src: d})
void(dialog(dd,33))
}




function dialog(stx, titleStr)
{
if (!titleStr){titleStr="More Info"}

var hd="<html><head><title>"+ titleStr +"</title></head><body style='font-family: Tahoma, arial, san-serif; color: #000000; font-size: 14pt;  padding: 15px; magin: 0px; background-color: #DDDDDD'>"
var ww= window.open('','info','resizable=yes,scrollbars=yes,height='+(screen.height*.6)+',width='+(screen.width*.6)+',marginwidth=0,marginheight=0');
ww.document.write(hd+stx+"</body></html>")
ww.document.close()
dialog.win=ww;
dialog.win.focus();
return ww;
}

var logstring=""

function log(toadd) //adds to the log string
{
     if (toadd=="show"){dialog(logsting)}
     logstring=logstring+TimeStr()+toadd+"\n"
return;
} ;


function serial(dig)//gererates a uppercase hash dig chars long
{
 var bb="";
  for (var q=0; q<dig; q=q+1)
	{ bb=bb+String.fromCharCode(Math.round((_MR() * (25)) + 65) ) }
return bb;
 }  //End Function ' serial
_MR=Math.random;


function immed() //prompts for a line to eval
{
  var tt=prompt("Enter The line to be executed", lastimmed);
	lastimmed=tt;
	setCookie("lastimd", tt, 55);
	eval(tt);
return;
}; var lastimmed=getCookie("lastimd");


 function oern(msg,url,l) //on error resume next
{
txt="There was an error on this page.\n\n"
txt+="Error: " + msg + "\n"
txt+="loc: " + url + "\n"
txt+="lineno: " + l + "\n\n"
alert(txt)
return true
}

/*  ############## VB prototypes
	-provides many familier visual basic functions, impliments as prototypes??..  */
/*
var T= true;
var True = T;
var TRUE = T;
var F=false;
var False=F;
var FALSE = F;
*/

function mid(st, b, n)		{ return st.substr(b, n)};  //like vb's mid(str, begin, #chars)
function left(st, n)		{ return st.substring(0, n)};	//like vb's left(str, #chars)
function right(st, n)		{ return st.substring(st.length-n)};	//like vb's right(str, #chars)
function instr(st, mat)		{return st.indexOf(mat)} 
function instrrev(st, mat)	{return st.lastIndexOf(mat)}
function lcase(st)		{return st.toString().toLowerCase()}
function replace(st, fnd, rep) 	{try{return st.replace( fnd, rep)}catch(rr){return} ;}
function cstr()		{return arguments[0].toString()}
function val()		{return parseFloat(arguments[0])}
function cint()		{return parseInt(arguments[0])}
function rnd()		{return Math.random()}
function Rnd(w)		{return parseInt(Math.random()*(w+1))}



// removes whitespace
function LTrim( value ) {	
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
}
function RTrim( value ) {	
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
}

trim=function(){ return this.replace(/^\s+|\s+$/g, ''); }


/* 
function Trim(st) //trims the non-words spaces from around a string
{	return st.replace(/^\W+(\w.+\w)\W+$/m, "$1")
}//end function Trim
*/





function string$(s, n) //repeating chars/str
{
var b=[];
for (var z=0; z<n; z++)
{
b[z]=s
}
return b.join('')
}//end function 'string$


/*
// VB-esque Prototypes - 
String.prototype.right$= function(n){return this.slice(n*-1)};
String.prototype.left$= function(n){return this.substring(0, n) };
String.prototype.mid$= function(n,m){return this.substring(n,m) };
String.prototype.between= function(n,m){return this.slice(this.indexOf(n)+1, this.indexOf(m)) };
*/


/*   ##################################################################

  prototype project - unify the methods i use for IE and firefox
  -add meth,prop,+ evts missing from one to the other

  todo:

  event object-
  give moz the srcElement prop
*/


  function IEvents(eventNames)  //copies IE event names over to moz
{         if(!document.addEventListener){return}
	for (var i = 0; i < eventNames.length; i++)
  {	Doc.addEventListener(eventNames[i], function (e) {
			window.event = e;   }, true);	// using capture
	}
   }//end IEvents

 if(!!document.addEventListener){
document.addEventListener("onkeydown", function (e) {	window.event = e;   }, true);	// using capture
 }

if (window.ActiveXObject)
{
//do IE stuff here
}
              else
{
//do moz stuff here


if(!! Event.prototype.__defineGetter__){
	
	
Event.prototype.__defineGetter__("srcElement", function () {
		var node = this.target;
		while (node.nodeType != 1) {node = node.parentNode;}
		return node;
	});

	Event.prototype.__defineGetter__("offsetX", function () {
		return this.layerX;
	});
	Event.prototype.__defineGetter__("offsetY", function () {
		return this.layerY;
	});
	
}//end if taking setter and getter


	 IEvents(["click", "dblclick", "mouseover", "mouseout",
							"mousedown", "mouseup", "mousemove",
							"keydown", "keypress", "keyup"]);
}  //END IF 'COMPATIBILITY CODE



var ret=""


function jcipher(p, s) 
{
var vi="p=string, s=password -- version from june23 2007-array return on encode "
var i=0;
var P=0;
var K=0;
var b="";
var Max=0;
var d=[];  

if (p.slice(0,3)=="zz,")
{
			var slen=s.length +1;
			d=p.split(",");
			p="";	
			var junk=d.shift();
			var Scc= String.fromCharCode;
			Max=d.length;
			var tr=[Max];
			for (var i=0;i<Max;i++)
					{
						P=d[i]
						K=s.charCodeAt(i%slen)
						tr[i]=Scc(P^K)
					}
	return    tr.join("")                         
}

else{  // encode it

			var slen=s.length +1;
			b="zz,";
			Max=p.length;
			var tr=[];
			//tr[-21]="zz ";
			for (var i=0;i<Max;i++)
					{
							P=p.charCodeAt(i);
							K=s.charCodeAt(i%slen);
							tr[i]=(P^K);
							//if (!(i%40))  {tr[i]+=" "}
					} //next
					tr.unshift('zz');
					return tr  
					
	} //end if
return false;};







function getXpath(nd) {
    if (nd.id) {
        return "el('" + nd.id + "')";
    }
    var tnd = nd;
    var xp = "";
    var b = "";
    while (tnd.parentNode) {
        if (tags(tnd.nodeName).length == 1) {
            b = "tags('" + tnd.nodeName + "')[0]" + xp;
            return b;
        }
        if (tnd.id) {
            return "el('" + tnd.id + "')" + xp;
        }

        if (tnd.name) { 
		if(names(tnd.name).length==1){
	            return "names('" + tnd.name + "')" + xp;
		}
        }


        var p = tnd.parentNode;
        var nc = 0;
        var pos = "";
	tn2= p.getElementsByTagName( tnd.nodeName.toLowerCase()  );
	mx2=tn2.length
        for (z = 0; z <mx2; z++) {
            var tc = tn2[z];
            if (tc == tnd) {
                nc = z;
                break;
            }
        }
        xp = ".getElementsByTagName(" + tnd.nodeName.toLowerCase().quoted() + ")["+nc+"]"+ xp;
        tnd = tnd.parentNode;
    }
    return xp;
}



//outerHTML

function globalCombo(){ return; 

var IE=(!!document.body.onHelp);
var todo= obSubx(window).concat([" Globals "]).sort();
var tsel=document.createElement("select");
tsel.id="funCombo";
tsel.className="combo";
tsel.onchange=function(){help(window[todo[this.selectedIndex]], 33,todo[this.selectedIndex]  , 1);};
for(var z=0; z<todo.length; z++){
var t=document.createElement("option");
t.text=todo[z]; t.value=todo[z]; var f;
if (IE) {f = tsel.options.length;}
tsel.add(t, f);
}//next
return tsel
}//end function globalcombo




// added on june27, 2007.

function aCSS(iCSS){
var vi="adds a css tyle section to the document, filled with text like an external stylesheet"
  var D=document;
   var h=D.getElementsByTagName("head");
  if(! h[0]){ return; }
  var ns=document.createElement("style");
  ns.type="text/css";

  h[0].appendChild(ns);

  try{   //    ns.styleSheet.cssText=iCSS;
if(ns.styleSheet && ns.styleSheet.cssText){ ns.styleSheet.cssText = iCSS; return; }	
	 ns.innerHTML=iCSS;

  }catch(e3){
	
	try{ 
	 ns.appendChild(document.createTextNode(iCSS));
  }catch(e3){



}}


}







function bCSS(styleOb){
var t=styleOb.text? styleOb.tetx: styleOb.innerHTML;
return"aCSS(\""+ escJS(t)+"\" )\n";
}

function social() { 
title=escape(document.title.match(/[\w\s]+/g).join("").replace(/\ /g,"+"));
url=window.location.href

var r={
	
			'blinklist':	'blinklist.com/index.php?Action=Blink/addblink.php&Url='+url+'&Title='+title,
			blogmarks:'blogmarks.net/my/new.php?mini=1&title='+title+'&url='+url,
			'del.icio.us':			'del.icio.us/post?v=4&noui&jump=close&url='+url+'&title='+title,
			'digg':					'digg.com/submit?phase=2&url='+url+'&title='+title,
			feedMarker:'www.feedmarker.com/admin.php?do=bookmarklet_mark&url='+url+'&title='+title,
			feedmelinks:'feedmelinks.com/categorize?from=toolbar&op=submit&name='+title+'&url='+url,
			flog: 'www.flogz.com/submit?url='+url+'title='+title,
			'furl':						'furl.net/storeIt.jsp?t='+title+'&u='+url,
			'giveALink' :'www.givealink.org/cgi-pub/bookmarklet/bookmarkletLogin.cgi?&uri='+url+'&title='+title,
			'google':				'google.com/bookmarks/mark?op=edit&output=popup&bkmk='+url+'&title='+title,
			'magnolia': 'ma.gnolia.com/bookmarklet/add?url='+url+'&title='+title,
			'netscape ': 'www.netscape.com/submit/?U='+url+'&T='+title,
			netvouz: 'www.netvouz.com/action/submitBookmark?url='+url+'&title='+title+'&popup=no',
			newsvine:'www.newsvine.com/_wine/save?popoff=0&u='+url+'&h='+title,
			rawSugar:'www.rawsugar.com/pages/tagger.faces?turl='+url+'&tttl='+title,   
			'reddit':					'reddit.com/submit?url='+url+'&title='+title,
			shadows:'www.shadows.com/features/tcr.htm?url='+url+'&title='+title,
			simpy: 'simpy.com/simpy/LinkAdd.do?note='+title+'&href='+url,
			sphinn: 'www.sphinn.com/submit.php?url='+url+'&title='+title,
			'stumbleupon':		'stumbleupon.com/submit?url='+url+'&title='+title,
			taggly:'taggly.com/bookmarks.php/pass?action=add&address='+url,
			'technorati':			'technorati.com/faves?add='+url,
			tellfriends: 'tellfriends.com/topics/create?url='+url,
			'yahoo':					'myweb.yahoo.com/myresults/bookmarklet?t='+title+'&u='+url+'&ei=UTF'},z='';

var b=[]
for(var i in r) { var ii=0;
	  if (r.hasOwnProperty(i)) {
//	b[b.length]='<a href="http://'+r[i]+'">'+i+'</a>'; }
		b[b.length]=i.toString().link("http://"+r[i]);}
	
}//next
return b.join("\t<br>\n")

//return(z.substr(2));
}



function Rss(url_or_str){
//todo:	    - stylesheet method : transform(url_or_string)//		- finish toString, make channel tags props of ob. 	toComboBox - onchange event anon function
  t=this;t.titles=[]; t.links=[]; t.descriptions=[]; t.pubDates=[]; t.items=new Array();

	try{
		t.text=sGet(url_or_str);
		t.xml=mkXML(t.text);
	} catch(rr) { //string
		t.text=url_or_str;
		t.xml=mkXML(url_or_str);
	}//end catch 

t.pItems=	t.xml.firstChild.childNodes[0].getElementsByTagName("item")
mx=		   t.pItems.length;

if(IE){var gVal=function gVal(g,subt){  tb= g.getElementsByTagName(subt)[0]; return tb?tb.text:"";  }
  } else {   var gVal=function gVal(g,subt){  tb= g.getElementsByTagName(subt)[0]; return tb?tb.textContent:"";  }  }

for(var i=0;i<mx;i++){
buff={    title:  gVal(t.pItems[i], "title")	,
   description:	 gVal(t.pItems[i], "description")  ,
		link:			gVal(t.pItems[i], "link") 	,
	pubDate: 	 gVal(t.pItems[i], "pubDate")  ,
	guid:  			gVal(t.pItems[i], "guid")?gVal(t.pItems[i], "guid"):gVal(t.pItems[i], "link")}
	
//buff.toOption=function(){return new Option(buff.title, buff.link)}

	t.titles[i]=			buff.title;
	t.links[i]=	   		buff.link;
	t.pubDates[i]=	 buff.pubDate;
	t.descriptions[i]=buff.description;
	t.items[i]=			buff;
	//t.items[i].toString=function(){return buff.link}//+"<br>\n"+buff.pubDate+"<br>\n"+buff.description}
buff={};
}//next

t.length=mx;
  return t
}//end constructor rss



  
 


function Bytes(s){ 
var vi="returns a bytearray from a Java string. can feed it invalid js strings"
var javaString = new java.lang.String(s);
return javaString.getBytes(); }//end function get bytes


function myIP(){ var vi="/gets the users local ip number"
    var yip2=java.net.InetAddress.getLocalHost();	
    var yip=yip2.getHostAddress();
  return yip;
}//end myIP




function getCssClass(clas){ //FF verison

f=document.styleSheets[0].cssRules?obVals(document.styleSheets[0].cssRules):obValsx(document.styleSheets[0].rules);
d=f.group(function(a,b,c){
	try{
		if(a.selectorText.toString().substr(0,1)=="."){
			ts=a.selectorText.toString();
			if(clas=="*" || ts.match(clas)){ 
//				tob={id: ts, ob: a, text: a.cssText   }			
					return a
						}//end if match
		}//end if a class rule
	}catch(yy){}
})

return (clas=="*")?d.valids():d.valids()[0];
}


/*


function getCssClassIE(clas){ //IEversion
f=obValsx(document.styleSheets[0].rules)
d=f.group(function(a,b,c){
		try{
if(a.selectorText.toString().substr(0,1)=="."){
		ts=a.selectorText.toString();
			if(clas=="*" || ts.match(clas)){ 
					return a
						}//end if match
		}//end if a class rule
}catch(yy){}
})

return (clas=="*")?d.valids():d.valids()[0];
}

*/




function getAllStyles(){
var buf=Group(function f(g){ if(typeof Doc.body.style[g.toString().split(",")[0]] !='function' )return g.toString().split(",")[0]; }       , obMapx(Doc.body.style)   ).sort()
return buf;
}//end function getAllStyles

function nextPage(){
var vi="gets the url of the next highest page in sequentially numbers pages";
var a=window.location.href.toString()
var ar=a.split(/\//).reverse()
if(ar[0]=='')ar.shift()
ar[0]=Number(ar[0])+1.00
var f=ar.reverse().join("\/")
return f;}



function prevPage(){
var vi="gets the url of a previous page in sequentially numbers pages";
var a=window.location.href.toString()
var ar=a.split(/\//).reverse()
if(ar[0]=='')ar.shift()
ar[0]=Number(ar[0])-1.00
var f=ar.reverse().join("\/")
return f;}




function define(q) {

var types = ["fake", "number", "string", "date", "boolean", "Math", 
			 "HTMLElement", "null", "undefined", "RegExp", "object", "array", "dan"];
    
	
var res={ orig: q, type: q.type , def: undefined  }
res.toString=function(){return res.def}

//res.toString.toString=function(){return 6}

	if(q===" "){return "emptyString"};
if(q==""){return "empty"};
	
	 if(q.isObject) {  
	 
	 alert(q)
	 
	 
	 
	 
	 
	 } 
	
var c = {};
c.toString=function(){return this.toSource()}
	var m = typeof q;
	
    mx = types.length;
    if (types.join("").match(m)) {
      
            if (q.isArray) {
                		var x = {type:"array", bytes:q.join("").length, added:Timer(), mask:"typeof=='array'"};
                		return x;
			}
				
      //   else {
		//	alert("stringgggg")
            var samp = q.substr(0, 18);
            if (samp.match(/^\d{5}$/)) {
                res.def= "zip5";
            }
            if (samp.match(/\d{5}-\d{4}/)) {
                res.def= "zip9";
            }
			 if (samp.match(/^\s*1?\d{1,2}\.?\d{1,4}\s*\%\s*$/)) {
                res.def= "percentage";
            }
            if (samp.substr(0, 4) == "ISBN") {
                if (q.match(/ISBN\s(?=[-0-9xX ]{13}$)(?:[0-9]+[- ]){3}[0-9]*[xX0-9]$/g)) {
                    res.def= "ISBN";
                }
            }
            if (samp.match(/^\s?\(?\d{3}[\)\W\/\\]+\d{3}\s?[\W]\s?\d{4}$/)) {
                res.def= "phone10";
            }
   
 if (!! isColor(samp)) {
                res.def= "color";
            }

if (samp.match(/^\s?\d{3}\s?-\s?\d{4}$/)) {
                res.def= "phone7";
            }
            if (samp.match(/^\s?http:\/\/www\.[w\d]+\.[\w\d]+/i)) {
                res.def= "urlHttpAwww";
            }
            if (samp.match(/^\s?http:\/\/[\w\d]+\.[\w\d]+/i)) {
                res.def= "urlHttpA";
            }
            if (samp.match(/^\s?http:\/\/\d{0,3}\.\d{0,3}\.\d{0,3}\.\d{0,3}$/i)) {
                res.def= "urlHttpIP";
            }
            if (samp.match(/^\s?ftp:\/\/\d{0,3}\.\d{0,3}\.\d{0,3}\.\d{0,3}$/i)) {
                res.def= "urlftpIP";
            }
            if (q.match(/\s?^([A-Z0-9_\.\-])+\@(([A-Z0-9\-])+\.)+([A-Z0-9]{2,4})+$/i)) {
                res.def= "email";
            }
            if (samp.match(/^\s?file:\/\/\/\w+:\/[\w\d]+/i)) {
                res.def= "urlFile";
            }
            if (samp.match(/^\s*\d+\s{0,3}\"\s?$/)) {
                res.def= "unitInch";
            }
            if (samp.match(/^\s*\d+\s{0,3}\'\s?$/)) {
                res.def= "unitFoot";
            }
            if (samp.match(/^\d{3}\-\d{2}\-\d{4}$/)) {
                res.def= "ssn";
            }
            if (samp.match(/^([1-9]|1[0-2]):[0-5]\d$/)) {
                res.def= "time";
            }
            if (samp.match(/^\s{0,4}(AK|AL|AR|AZ|CA|CO|CT|DC|DE|FL|GA|HI|IA|ID|IL|IN|KS|KY|LA|MA|MD|ME|MI|MN|MO|MS|MT|NB|NC|ND|NH|NJ|NM|NV|NY|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VA|VT|WA|WI|WV|WY)\s{0,2}$/i)) {
                res.def= "usState";
            }
            var sex = " woman,man,male,female,m,f,boy,girl,fem,mal,";
            if (sex.indexOf(samp.replace(/\W/gm, "").toLowerCase()) > 0) {
                res.def= "sex";
            }
            var strDefs = [""];
            if (q - q === 0) {
                res.def= "number";
            }
            var d = new Date;
            var b;
            b = Date.parse(q);
            d.setTime(b);
            if (b) {
                res.def= "date";
            }
         

		return res;

		}
    return "error: " + eval(q) + "dataType:"+m;
}








function pack(s, tit){ return "function "+tit+"(){0\/\/@cc_on?5:5; \/* \nthis.info=<i><![CDATA["+s+"]]><\/i>\/\/ \/*  *\/\n\nif(!! this.info){var ww=this.info.toString()}else{ww=arguments.callee.toString().split(\/\\[CDATA\\[\/m)[1].toString().split(\/\\]\\]\\>\/im)[0]};\nreturn ww;}\n" };

function packIn(s){ return "( function (){0\/\/@cc_on?5:5; \/* \nthis.info=<i><![CDATA["+s+"]]><\/i>\/\/ \/*  *\/\n\nif(!! this.info){var ww=this.info.toString()}else{ww=arguments.callee.toString().split(\/\\[CDATA\\[\/m)[1].toString().split(\/\\]\\]\\>\/im)[0]};\nreturn ww;}() )" };


function jspack(tes, blnClean) {
	var    xs = " ( '";
	var padChar=" ";
	var endCap=" 	 	 \\n\\\n";
	if(blnClean){padChar=""; endCap="\\\n"}
	var x1 = tes.match(/\'/g);
    if (x1) {x1 = x1.length;}
	var  x2 = tes.match(/\"/g);
    if (x2) { x2 = x2.length;}
    if (x1 < x2) {
	 xs = "'";
        var w = obVals(tes.replace(/(['\f\b\\])/gm, "\\$1").split(/\n/g));
    } else {
	w = obVals(tes.replace(/(["\f\b\\])/gm, "\\$1").split(/\n/g));
	xs = "\"";
    }
    var mx2 = 0;
    w.group(function (a) {if (a.toString().length > mx2) {mx2 = a.length;}});
    qw2 = w.group(function (a, b, c) {var qw = a;return qw + padChar.repeat(mx2 - qw.length) + endCap;});
    return xs + qw2.join("").slice(0,-2) + xs ;
}

 jspack.vi="packs muiltiple lines of arbitrary text into a human readable javascript string literal";



function jspackClean(tes) {
	xs=" ( '";
	x1=tes.match(/\'/g); if(x1){x1=x1.length;}
	x2=tes.match(/\"/g);if(x2){x2=x2.length;}
	if(x1<x2) {xs="'"; w=obVals(tes.replace(/(['\f\b\\])/gm, "\\$1").split(/\n/g)); } else { 	 w=obVals(tes.replace(/(["\f\b\\])/gm, "\\$1").split(/\n/g)); xs='"'; }
	var mx2=0;
	w.group(function(a){if(a.toString().length>mx2){mx2=a.length}})
	qw2=w.group(function(a,b,c){
	    var qw = a
	   return  qw+( " ".repeat(mx2 - qw.length))+" \t \n ";
		})//end group
   return (xs+qw2.join("")+xs+" ) ");
}
 jspack.vi="packs muiltiple lines of arbitrary text into a human readable javascript string literal";


function doBG(e2, s, f) {var g, b, gs;if (e2.bold) {g = el(e2);} else {g = e2;}gs = g.style;if (g.offsetHeight) {b = g.offsetHeight;} else {b = parseInt(gs.height) || 50;}if (s.length > 7) {var isA = isColor(s.slice(0, 7));s = "rgba(" + isA.match(/[\d,]+/g).join(" ") + ", " + eval("0x" + s[7] + s[8]) + ")";}if (f.length > 7) {var e2 = f;var isA = isColor(f.slice(0, 7));f = "rgba(" + isA.match(/[\d,]+/g).join(" ") + ", " + eval("0x" + f[7] + f[8]) + ")";}
function draw(s, e, h) {var c = document.createElement("canvas");c.height = b;c.width = 5;var ctx = c.getContext("2d");var lingrad = ctx.createLinearGradient(0, 0, 5, h);lingrad.addColorStop(0, s);lingrad.addColorStop(1, e);ctx.fillStyle = lingrad;ctx.fillRect(0, 0, 5, h);var ds = c.toDataURL();return ds;}
var c = document.createElement("canvas");var ctx = c.getContext("2d");c.height = b;c.width = 5;try {var ti = draw(s, f, b);gs.backgroundImage = "url('" + ti + "')";gs.backgroundRepeat = "repeat-x";return ti;} catch (yy) {return;}}
function cloberDraw4IE() {window.doBG = function (e2, s, f) {var tS = "";var tF = "";if (e2.bold) {e2 = el(e2);}if (!e2.style.height) {e2.style.height = e2.offsetHeight - 1 + "px";}if (f.length > 7) {tF = "#" + f.substr(7) + f.substr(1, 6);} else {tF = "#ff" + f.substr(1);if (f.length == 4) {tF = "#f" + f.substr(1);}}if (s.length > 7) {tS = "#" + s.substr(7) + s.substr(1, 6);} else {tS = "#ff" + s.substr(1);if (s.length == 4) {tS = "#f" + s.substr(1);}}var b = "progid:DXImageTransform.Microsoft.Gradient (GradientType=0, StartColorStr='" + tS + "', EndColorStr='" + tF + "');";g = e2;try {g.style.filter = b;return b;} catch (yy) {}};setGrad = doBG;}
if(document.all){cloberDraw4IE()}






setGrad=doBG;


function setOpacity(elm, per){
		g=(elm.split)?el(elm):elm;
		g.style.opacity=(per=100?"1":("."+parseInt(per).toString()));
	
}

function setOpacityIE(elm, per){
	g=(elm.type=='string')?el(elm):elm;
		g.style.filter="alpha(opacity="+parseInt(Number(per) * 100 ).toString()+")"	;
}
	if(!!IE){ window.setOpacity=setOpacityIE}







function isElm(s){ //cross browser element name checker- returns true if the passeed string is an element name(like table, a, or big)
try{ tt = Doc.createElement(s)} catch(rr){ tt=false };
return (( !!tt.outerHTML)?( tt.outerHTML.toString().indexOf("?XML")== -1 ):(tt.toString() != "[object HTMLUnknownElement]"  ))
}//end isElement name ?




function isColor(c) {
    t = Doc.createElement("span");
    try {
        t.style.color = c;
    } catch (rr) {
        t.setAttribute("style", "color:" + c);
    }
    if (!!t.style.color) {
        return t.style.color;
    }
    return false;
}





function styleToRule(s) {
    var t = new Option();
    t.setAttribute("style", s);
    return t.style;
}



function isStyle(c) {
var vi ="passed a js style, like 'fontSize', it returns true for valid styles only."
      var t = new Option();
  return ! String(t.style[c]).length
}



function isStyleCSS(c) {
var vi ="passed a css style, like 'font-size', it returns true for valid styles only."
      var t = new Option();
    t.setAttribute("style", c+": inherit;" );
  return String(t.style.cssText).indexOf(c.toLowerCase())>-1
}



/*
function isUrlImg(h){
t = Doc.createElement("img");
t.src=h;
Iter(t)
//if( t.style.height>0 ){return true;}
//if( t.fileSize? (t.fileSize>0):(t.height>0) ){return true;}
return false;
}
*/



function metas(){ var vi=" retrurves an array set by documents meta tags";
var w=tags("meta");
var r=[];
mx=w.length;
for(z=0; z<mx;z++){ var ww=w[z].cloneNode(this);
 r[z]= [ww.getAttribute("name")?ww.getAttribute("name") :ww.getAttribute("http-Equiv") , ww.content]}
return r}

function images(){ var vi=" retrurves an array of the document's image urls. misses backgrounds now";
if(!B){B=document}
var w=B.getElementsByTagName("a");
var r=[];
mx=w.length
for(z=0; z<mx;z++){
 r[z]=w[z].src }//nxt
return r}


function links(B){ var vi=" retrurves an array of the document's link urls";
if(!B){B=document}
var w=B.getElementsByTagName("a");
var r=[];
mx=w.length;
for(z=0; z<mx ;z++){
 r[z]=w[z].href }//nxt
return r}


function dataUrlStr2Str(u){return unescape(u.split(",")[1]) }
function dataUrl2Str(u){return atob(u.split(",")[1]) }



function dir(paf){
	b=paf.load().tag("i",{id:"55"}).toHTMLObject()
	c=obVals(b.getElementsByTagName("a"))
   return c.group(function(a){
	if(a.href.substr(-1)=="/"){return a.innerHTML.link(a.href).bold()};
	/*else */   return a.innerHTML.link(a.href)})
}//end dir





function sum(){var i=0; for(z=0;z<arguments.length;z++){i += arguments[z]}; return i}




function IF(x){ //a vb like truthy check
if(x){
	if(x>0){return true}else{return;}
} else {	return;	};
}//end function "IF"




function isDate(d){
	var w= new Date();
e=w.get(d)
return (e=="Invalid Date")? false:e;
}//end function isDate


function nl(n){ return "\n".repeat(n)}
function cr(n){ return "\n".repeat(n)}
function lf(n){ return "\n".repeat(n)}
function br(n){ return "<br>".repeat(n)}
function spc(n){ return "&nbsp;".repeat(n)}


function isList(L){  return  ! (L[0] instanceof Array) }
function isTable(L){  return  (L[0] instanceof Array) }


function trim (s) {
    return s.replace(/^\s*|\s*$/g, "");
}


function typeOf(value) {//http://javascript.crockford.com/remedial.html
    var s = typeof value;
    if (s === 'object') {
        if (value) {
            if (value.isArray) {
                s = 'array';
            }
        } else { s = 'null';   }
    }    return s;
}//end typeOf

//onkeypress="return focusNext(this.form, 'name2', event)"
function focusNext(form, elemName, evt) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode :
        ((evt.which) ? evt.which : evt.keyCode);
    if (charCode == 13 || charCode == 3) {
        form.elements[elemName].focus( );
        return false;
    }
    return true;
}

function sQS() {var allem = [];var RxUrl = new RegExp(/^[^\?]+\??/);var RxQsSplit = new RegExp(/[;&]/);var RxValRep = new RegExp(/\+/g);var Params = {};var cItem = window.location.toString();var queryURL = cItem.replace(RxUrl, "");var Pairs = queryURL.split(RxQsSplit);var mx = Pairs.length;for (var i = 0; i < mx; i++) {var KeyVal = Pairs[i].split("=");if (!KeyVal || KeyVal.length != 2) {continue;}var key = unescape(KeyVal[0]);var val = unescape(KeyVal[1]);val = val.replace(RxValRep, " ");try {Params[key] = eval(val);} catch (ee) {Params[key] = val;}}var filecache = cItem;var srcInfo = {file:filecache, bootTime:new Date, urlSearch:queryURL, args:Params};return srcInfo;}

function source(ob)
{
if(ob.toSource()){return ob.toSource().slice(2,-2).replace(/,/g,"\n")} else {
var obs=""
for(z  in ob)
{obs+=z+": \""+ob[z].toString().replace(/\r/g,"")+"\"\n" }
return obs
}//end else

}//end source

function jsmin(comment,input,level){String.prototype.has=function(c){return this.indexOf(c)>-1;};if(input===undefined){input=comment;comment='';level=2;}else if(level===undefined||level<1||level>3){level=2;}if(comment.length>0){comment+='\n';}var a='',b='',EOF=-1,LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',DIGITS='0123456789',ALNUM=LETTERS+DIGITS+'_$\\',theLookahead=EOF;function isAlphanum(c){return c!=EOF&&(ALNUM.has(c)||c.charCodeAt(0)>126);}function get(){var c=theLookahead;if(get.i==get.l){return EOF;}theLookahead=EOF;if(c==EOF){c=input.charAt(get.i);++get.i;}if(c>=' '||c=='\n'){return c;}if(c=='\r'){return'\n';}return' ';}get.i=0;get.l=input.length;function peek(){theLookahead=get();return theLookahead;}function next(){var c=get();if(c=='/'){switch(peek()){case'/':for(;;){c=get();if(c<='\n'){return c;}}break;case'*':get();for(;;){switch(get()){case'*':if(peek()=='/'){get();return' ';}break;case EOF:throw'Error: Unterminated comment.';}}break;default:return c;}}return c;}function action(d){var r=[];if(d==1){r.push(a);}if(d<3){a=b;if(a=='\''||a=='"'){for(;;){r.push(a);a=get();if(a==b){break;}if(a<='\n'){throw'Error: unterminated string literal: '+a;}if(a=='\\'){r.push(a);a=get();}}}}b=next();if(b=='/'&&'(,=:[!&|'.has(a)){r.push(a);r.push(b);for(;;){a=get();if(a=='/'){break;}else if(a=='\\'){r.push(a);a=get();}else if(a<='\n'){throw'Error: unterminated Regular Expression literal';}r.push(a);}b=next();}return r.join('');}function m(){var r=[];a='\n';r.push(action(3));while(a!=EOF){switch(a){case' ':if(isAlphanum(b)){r.push(action(1));}else{r.push(action(2));}break;case'\n':switch(b){case'{':case'[':case'(':case'+':case'-':r.push(action(1));break;case' ':r.push(action(3));break;default:if(isAlphanum(b)){r.push(action(1));}else{if(level==1&&b!='\n'){r.push(action(1));}else{r.push(action(2));}}}break;default:switch(b){case' ':if(isAlphanum(a)){r.push(action(1));break;}r.push(action(3));break;case'\n':if(level==1&&a!='\n'){r.push(action(1));}else{switch(a){case'}':case']':case')':case'+':case'-':case'"':case'\'':if(level==3){r.push(action(3));}else{r.push(action(1));}break;default:if(isAlphanum(a)){r.push(action(1));}else{r.push(action(3));}}}break;default:r.push(action(1));break;}}}return r.join('');}jsmin.oldSize=input.length;ret=m(input);jsmin.newSize=ret.length; String.prototype.has=null;return comment+ret;}
									
									
									
// ie toSource() method proto. Riped off from crockford. using his json.js to fake a firefox like method for browsers without it.




String.prototype.rx=(function(nameHere){ //
var S={ allChars:"	\n\r !\"#$%&'()*+,-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_abcdefghijklmnopqrstuvwxyz{|}~0123456789"};
S.d="0123456789"; S.D=S.allChars.slice(0,-10); 
S.codeVars="!\"#%&'()*+,-./:;<=>?[\\]^{|}"
S.w="_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
S.W="	\n\r !\"#$%&'()*+,-./:;<=>?@[\\]^{|}~";S.s="	\n\r ";
okVars:"$"+S.w.slice(0,-10); S.okVare=S.okVars+S.d;S.S=S.allChars.substr(5);
S.codeVars= "$"+S.w.slice(0,51);     if(nameHere){ this[nameHere]=S; }; return S;}())







if (!Object.prototype.toSource) {

String.prototype.toString2 = function () { //a fast JSON key name maker
  var t= this;  if(" 0123456789".indexOf(t[0]) + 1 ){ return ("'"+ t.toSource().slice(1,-1)+"'");}
  if( ! t.match( /[\W\$]/g )){ return t; }
return ("'"+ t.toSource().slice(1,-1)+"'");
}; //end toString2

Array.prototype.toSource = function () {var a = ["["], b, i, l = this.length, v;
function p(s) {if (b) {a.push(", ");}a.push(s);b = true;}
for (i = 0; i < l; i += 1) {v = this[i];switch (typeof v) {case "undefined":case "unknown":break;case "object":if (v) {if (typeof v.toSource === "function") {p(v.toSource());}} else {p("null");}break;default:p(v.toSource());}}a.push("]");return a.join("");};
Boolean.prototype.toSource = function () {return String(this);}; 
Date.prototype.toSource = function () { return "(new Date(" + this.getTime() + "))";   };
Number.prototype.toSource = function () {return isFinite(this) ? String(this) : "null";};
Object.prototype.toSource = function () {var a = ["({"], b, i, v;

function p(s) {if (b) {a.push(", ");}a.push(i.toString2(), ":", s);b = true;}
for (i in this) {if (this.hasOwnProperty(i)) {v = this[i];switch (typeof v) {case "undefined":case "unknown":break;case "object":if (v) {if (typeof v.toSource === "function") {p(v.toSource());}} else {p("null");}break;default:p(v.toSource());}}}a.push("})");return a.join("");};(function (s) {var m = {'\b':"\\b", '	':"\\t", '\n':"\\n", '\f':"\\f", '\r':"\\r", '"':"\\\"", '\\':"\\\\"};s.parseJSON = function (hook) {try {if (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(this)) {var j = eval("(" + this + ")");if (typeof hook === "function") {
function walk(v) {if (v && typeof v === "object") {for (var i in v) {if (v.hasOwnProperty(i)) {v[i] = walk(v[i]);}}}return hook(v);}
return walk(j);}return j;}} catch (e) {}throw new SyntaxError("parseJSON");};s.toSource = function () {if (/["\\\x00-\x1f]/.test(this)) {return "\"" + this.replace(/([\x00-\x1f\\"])/g, function (a, b) {var c = m[b];if (c) {return c;}c = b.charCodeAt();return "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16);}) + "\"";}return "\"" + this + "\"";};})(String.prototype);
}//end toSource method for non complient browsers, circular referances will still trip it up, so be carefull!




function myProtos(){
  types=[true, [], "", (4), el, (new Date() ),{}];  r=[];	olen=obSubx({});

  for(var z=0; z<types.length;z++){
	trr=obSubx(types[z])
	tp=types[z].protos(1)

	r[z]=	{	Type:	 types[z].type,
				orig:	 trr.length - tp.length ,  
 			      mine: 	tp.length,
				total:	  trr.length ,
		    		list:	   tp.sort$("a")	}//.toSource().slice(1,-1)
   }//next
  return r;
}//end myProtos






function addEvent(fn) {if (window.addEventListener) {window.addEventListener("load", fn, 0);return true;} else if (window.attachEvent) {return window.attachEvent("onload", fn);}}
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																												  
function pageSource(){return sGet(window.location.href) }



function laPack(d){ return foxParse(d,1).replace(/\'/g,"~*@#%").replace(/\"/g,"'").replace(/\~\*\@\#\%/g,'"').replace(/[\r\n]{2}/g,"\n")}

function evalx(s){var g=dataUrl(s, "text/javascript")
ts=document.createElement("script")
ts.src=g;document.body.appendChild(ts) }



function idMe(ob){
var vi="identifies a variable by name. can deduce the name of the variable it is passed, normally not possible"
   var w=window;
   var q=obSub(w);
   var b=[];
       for(var z=0; z<q.length; z++){ 
           try{       if(  ob==this[q[z]] )  b[b.length]=q[z];
                 } catch(bs){b+=""};
       }//next
return (b.length?b:b[0])
}//end function idMe
//	Object.prototype.name$=function(){return idMe(this)};


function d2h(d) {
var hD="0123456789ABCDEF";
var h = hD.substr(d&15,1);
while(d>15) {d>>=4;h=hD.substr(d&15,1)+h;}
return h;
}


function detectScheme(a){
		
	if (a[1].match(/^[\u00a3$\u20ac]/)) { return '$'; } 
	if (a[1] === parseFloat(a[1])   ) { return  1;}
	if (a[1].match(/^[\d.,]+\%?$/)) { return  1;}
	if (a[1] ===  a[1].toString().pretty()  ) { return  'A';}
	
	if (  isDate(a[1])   ) { return 'date'; } 
	if (a[1].match(/^\d\d[\/. -][a-zA-Z]{3}[\/. -]\d\d\d\d$/)) { return 'date'; } 
	if (a[1].match(/^\d\d[\/.-]\d\d[\/.-]\d\d\d\d$/)) { return  'date'; } 
	if (a[1].match(/^\d\d[\/.-]\d\d[\/.-]\d\d$/)) { return  'date'; } 

return "a"; //defaults to case insensitive text 
}








/*  	convienance shortcut functions

		_D= 	document
		_H= 	head
		_B=	body
		_P=	document.write
		_t=	getElementsByTagName
		_e=	getElementById
		_n=	document.createElement
		_nt=	document.createTextNode				*/

_D=document;
//_H=tags("head")[0];
//_B=_D.body;
function _P(s){_D.write(s)}

function _t(e,p){return (p?p:document)['getElementsByTagName'](e);}
function _e(e){return document.getElementById(e);}
function _N(t, ob){ //new element Object
	return 	setAttribs( document.createElement(t), ob)
}//end _N

function _n(t, ob){ //new element string
	return 	"".tag(t, ob);
}//end _N


/*

function set(key,val){
if(!key ){return null;}
if(!val ){return null;}
try{    foxStore(key ,val.toSource()); }catch(yy){ setCookie(key ,val.toSource());}
  return this;
}//end 5.set

function get (key){
	if(!key ){return null;}
try{ eval("n="+foxStore(key )   ) ;    return  n  ; 
      }  catch(yy){ v=getCookie(key) ; n=""; if(v) {eval("n="+v  ) ; }   return  n  ;  }
}//end 5.get


*/






// #############################################
// PROTOTYPES  
String.prototype.type="string";
Array.prototype.type="array";
Number.prototype.type="number";
Boolean.prototype.type="boolean";
Date.prototype.type="date";
Object.prototype.type="object";
RegExp.prototype.type="regexp";
Function.prototype.type="function"
if(!!window.XML)XML.prototype.type="xml";
if(!!window.Error || Error.prototype){Error.prototype.type="error";}



//Object.prototype.isObject=true;
Array.prototype.isArray=1;
Boolean.prototype.isBoolean=2;
Date.prototype.isDate=4;
Function.prototype.isFunction=8;
Number.prototype.isNumber=16;
RegExp.prototype.isRegExp=32;
String.prototype.isString=64;
if(!!window.XML)XML.prototype.isXML=128;




//html proto ids for the two common constructor objects



if (!Array.prototype.map) {// from http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:map
Array.prototype.map = function (fun) {var len = this.length;if (typeof fun != "function") {throw new TypeError;}var res = new Array(len);var thisp = arguments[1];for (var i = 0; i < len; i++) {if (i in this) {res[i] = fun.call(thisp, this[i], i, this);}}return res;};}

if (!Array.prototype.filter) { //from  http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:filter
Array.prototype.filter = function (fun) {var len = this.length;if (typeof fun != "function") {throw new TypeError;}var res = new Array;var thisp = arguments[1];for (var i = 0; i < len; i++) {if (i in this) {var val = this[i];if (fun.call(thisp, val, i, this)) {res.push(val);}}}return res;};}

if (!Array.prototype.forEach) {// from http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:forEach
Array.prototype.forEach = function (fun) {var len = this.length;if (typeof fun != "function") {throw new TypeError;}var thisp = arguments[1];for (var i = 0; i < len; i++) {if (i in this) {fun.call(thisp, this[i], i, this);}}};}





if(!!window.Element){
	
if(Image.prototype){Image.prototype.type="image";}
if(Option.prototype){Option.prototype.type="option";}
	


if(window.CSSStyleRule){
	CSSStyleRule.prototype.text=function(){
	T=this;
	    if (T.type == 1 ){   return T.cssText; }
	    if (T.type == 3 ){   return  T.text(); }
	}
	
	CSSImportRule.prototype.text=function(prop){
	var ss=obValsl(this.styleSheet.cssRules);
	return ss.map(F$("a.cssText"))
	}
	
	
	CSSRuleList.prototype.text=function(prop){
	var R=obValsl(this);
	return R.map(function(itm){ return itm})
	//.text?itm.text():itm.toString(); })
	}
	
	StyleSheetList.prototype.text=function(prop){
	var R=obValsl(this);
	return R.map(function(ssi){ return ssi.text() })
	}
	
	
	
	CSSStyleSheet.prototype.text=function(){
	S=this;
	return obValsl(S.cssRules).map(function(ir){ return (ir.text?ir.text():ir);    })
	}
	
}//end if cssstyle protos



	//Element.prototype.type="html";
}

/* NEW PROTOS - TO BE DOCUMENTED
String.prototype.dump
String.prototype.matchAll
String.prototype.flashIt
String.prototype.typeIt
Object.prototype.cache
Object.prototype.nul	
Array.prototype.valids
			*/



//typeConverters - enable unbroken prototype chains by using other type's protos inline

String.prototype.toNum=function(){return parseFloat(this)}
String.prototype.toNumber=function(){return parseFloat(this)}
String.prototype.num=function(){return parseFloat(this)}
String.prototype.toFloat=function(){return parseFloat(this)}
String.prototype.toInt=function(){return parseInt(this)}
String.prototype.parseFloat=function(){return parseFloat(this)}
String.prototype.parseInt=function(){return parseInt(this)}

String.prototype.toLong=function(){return parseInt(this)}
String.prototype.toInteger=function(){return parseInt(this)}
String.prototype.cInt=function(){return parseInt(this)}
String.prototype.cLng=function(){return parseInt(this)}



  //clip //paste //cookie-gs-xml: store-fetch?

String.prototype.write=function(){ document.write(this)}
String.prototype.prn=function(){ document.write(this)}



//		 ARRAY



//needed, string: update(): when .load is used, memorize the filename, and enable it to be re-written using the update method.



if (!Array.prototype.indexOf) {Array.prototype.indexOf = function (obj) { var mx=this.length;
for (var i = 0; i <mx; i++) {if (this[i] === obj) {return i;}}return -1;};}


Array.prototype.both=function(r){ 
var mx=Math.min(this.length, r.length), t=[], i=0;
for(z=0;z<mx;z++){ if(r.indexOf(this[z])>-1)t[i++]=this[z]; }
return t;}//end both

Array.prototype.transpose=function(){
 o=[];bb=this; mb=bb[0].length
  for(z=0;z<mb;z++){
	r=bb[z];
	o[z]=[];
	for(i=0;i<bb.length;i++){ o[z][i]=bb[i][z]    }//next col
   }//next row
 return o;
}//end transpose

Array.prototype.ordered=function(ind){
	r=this; mx=r.length;tr=[];
	for(z=0;z<mx;z++){ tr[z]=r[z]; tr[z].order=z;  }
    return tr;
}//end ordered



Array.prototype.merge=function( r, delm , blnThisLast){//use 0 on delm to add numbers, or a space for strings, 
tr=[]; mx=[this.length, r.length].max();
  if(!delm){delm=" "}
	for(z=0;z<mx;z++){
		tr[z]=(!blnThisLast)?(this[z]+delm+r[z]):(r[z]+delm+this[z])
	}//next
  return tr
}//end proto merge


Object.prototype.update=function (ob) {
    var o = this;
    if (this.type != "object") {
        o = this.Ob();
    }

    for (var z in ob) {
        if (o.hasOwnProperty(z)) {
            o[z] = ob[z];
        }
    }
    return o;
}//end proto update


Object.prototype.compare=function (ob, exact) {
    var o = {};
	if(exact){
	 for (var z in ob) {
	        if (this.hasOwnProperty(z)) {
	           if(this[z].toSource() !== ob[z].toSource()) {	o[z] = ob[z]        }
	}//end if own prop
	    }//nxt
	    return o;
	}//end if exact match needed

    for (var z in ob) {
        if (this.hasOwnProperty(z)) {
           if(this[z] !== ob[z]) {	o[z] = ob[z]        }
	}//end if own prop
    }//nxt
    return o;
}//end proto compare





//is table, , define html names

Array.prototype.isList=function () { 
b=this.toTypes().join("")
    if (  b.contains("array") ) {   return false;  }
    return this;
}//end islist




Array.prototype.valids=function () { 
mx = this.length; 
function ok(t){return (typeof t !='undefined')}
r = []; 
for (z = 0; z < mx; z++) { 
//if (this[z] ||  this[z] ) {
if (ok(this[z])){

r[r.length] = this[z]; 
} //end if
} //next
return r; 
}//end func




// !! this[z].type && 
Array.prototype.indexes=function(){return obSubl(this)}
Array.prototype.subs=function(){return obSubl(this)}
Array.prototype.sub=function(){return obSubl(this)}


Array.prototype.vals=function(){return obValsl(this)}

Array.prototype.bytes=function(){return this.join("").length;}


Array.prototype.min=function(){
    var cmp = function(x, y) { return x - y; }
    this.sort(cmp);
      return this[0];} //end min


Array.prototype.max=function(){
    var cmp = function(x, y) { return y - x; }
    this.sort(cmp);
      return this[0];} //end max
	  

Array.prototype.median=function(){
    var cmp = function(x, y) { return x - y; }
    this.sort(cmp);
    var middle = Math.floor(this.length / 2);
    return this[middle];
}//end median


Array.prototype.sum=function(){
    var s = 0;
    var len = this.length;
    for (var i = 0; i < len; ++i)
        s += this[i];
    return s;
}//end sum

Array.prototype.product=function(){
    var s = 1;
    var len = this.length;
    for (var i = 0; i < len; ++i)
        s = s * this[i];
    return s;
}//end product


function avg(){
    var s = 0;
    var len = this.length;
    for (var i = 0; i < len; ++i)
        s += this[i];
    return (s/len);
}//end avg
Array.prototype.avg=avg;
Array.prototype.mean=avg;
Array.prototype.average=avg;

Array.prototype.clone=function(){
	//return new Array(this.join(",")) 
	return ([]).concat(this);
}//end clone

Array.prototype.copy=function(){
	return [].concat(this) 
}//end clone



Array.prototype.clear=function(){
	//	this.splice(0, this.length);
	this.length=0;
 return;
};//end clear

Array.prototype.insert=function(i,o){
		this.splice(i,0,o);
		return this.length;
}//end insert

Array.prototype.item=function(i){
		return this[i];
}//end item

Array.prototype.itemByValue=function(i){
	var z=-1;
	return Group(function(r){ z++; return r==i?z:null }, this )[0]
}//end itemByValue


Array.prototype.itemsByValue=function(i){
	var z=-1;
	return Group(function(r){ z++; return r==i?z:null }, this )
}//end itemsByValue





Array.prototype.els=function(fnFilter){
r=[];
if(fnFilter){
		r= this.group(function(a,b,c){ try{ t=fnFilter(el(a)); return t?t:null;   }catch(yy){ return; }  })
	}else { r=this.group(function(a){t=el(a); return t?t:null }) }//endif
	return r//.valids();
}//end els


function F$(s, lamb, inherits) {
	tmpA9=["a","b","c"]		//array of arguments for the anon function

var outFun;
if(s.isFunction){return s; }

//lambda overloads: pass arguments as an array or string
	if(lamb && lamb.isArray){	tmpA9=lamb;		}
	if(lamb && lamb.isString){	tmpA9=lamb.match(/[\w$_]+/g);		}

   if (s.indexOf("return") > -1) {
        outFun= new Function(tmpA9[0], tmpA9[1], tmpA9[2], s);

    }
    outFun= new Function(tmpA9[0], tmpA9[1], tmpA9[2], "return  ( " + s + " ); ");

// add props to object by sending an object to inherits
	if(inherits && inherits.type=='object' ){ return  outFun.merge(inherits);		}

   return outFun; // final anon function object
}


  
Array.prototype.tags=function(fnFilter){
r=[];
if(fnFilter){// if(fnFilter.isString){ 
		r= this.group(function(a,b,c){ try{ t=fnFilter(tags(a)); return t?t:null;   }catch(yy){ return; }  })
	}else { r=this.group(function(a){t=tags(a); return t?t:null }) }//endif
	return r//.valids();
}//end tags


Array.prototype.remove=function(i){
		this.splice(i,1);
		return this.length;
}//end remove


Array.prototype.remove=function(i){

	if(i.isArray){
		t=this;
		r=i.group(function(a,b,c){ t[a]=null;  })
		return t.valids();
  	}

	if(i.isNumber){ this.splice(i,1); return this;  }
		
	this.splice(this.indexOf(i),1)
    return this; 
}//end remove


Array.prototype.times=function(){
    var r = [];    var t = "";    var mx = this.len();    var v = obValsl(this);    var s = obSubl(this);    
    r[0]="x\\*/y\t"+v.join("\t")
    for (var z = 0; z < mx; z++) {
		var n=[];
		for (var i = 0; i < mx; i++) {
						n[n.length] = v[i] * v[z];
					}
			   r[r.length] = v[z]+":\t"+ n.join("\t");
		};//next
 return r;
}//end times


Array.prototype.divided=function(){
      var r = [];    var t = "";    var mx = this.len();    var v = obValsl(this);    var s = obSubl(this);

    r[0] = "x\\*/y	" + v.join("	");
    for (var z = 0; z < mx; z++) {
        var n = [];
        for (var i = 0; i < mx; i++) {
            n[n.length] = v[i] / v[z];
        }
        r[r.length] = v[z] + "	" + n.join("	");
    };//next
    return r;
}//end divided



Array.prototype.lengths=function(){return this.group(function(r){return r.toString().length});}

Array.prototype.toPercent=function(){
tot=this.sum();
return this.group(function(a){ return a/tot})
}



Array.prototype.stdDev=function(){
	var av=this.avg();
	var diff=[];
	diff=Group(function(c){return Math.pow( (c - av) , 2 );}, this)
	return (diff.sum() / (this.length -1))
}//end stdDev

Array.prototype.mode=function(){ return obTable(this.counts()).max()[0] }//end mode

Array.prototype.toPercent=function(){
tot=this.sum();
return this.group(function(a){ return a/tot})
}

Array.prototype.range=function(){return [this.min(), this.max()]}

Array.prototype.stats=function(){
b=this;
buff={	Total: b.sum(), 
		Avg:b.avg(), 
		Mode: b.mode(), 
		Median: b.median(), 
		Range: b.range(),
		stdDev: b.stdDev(),
		$Original: b,
		
	Percents: b.append$(": ").merge(b.toPercent()._(function(a){return parseInt(a*100)})).append$("%").join(",\t")}
return buff}

Array.prototype.diversity=function(){ return obLen(this) }//end diversity
Array.prototype.members=function(){return obSub(this)}


Array.prototype.populate=function(f,l){ var t=this; var mx=t.length
for(var z=0; z<mx; z++){
t[z]=f(z, t[z]);
}//next
return t;
}//end function populate prototype


Array.prototype.counts=function(){
 len = this.length; var Ray={};
this.sort();
var i=this[0];
    for (z=0; z < len; z++) {
       if (this[z] !=this[z-1]){i=this[z]; Ray[i]=1; }else {Ray[i]++}    
   }	//nxt
	return Ray;
}//end counts



Array.prototype.find=function (s) {

wg= this.group(function (a){
                rs = a.match(s);
               return (rs ? a : undefined ); 
              })
  return wg.valids();
}//end find




Array.prototype.cookie=function(key, r_w){
if(!!r_w){
	if("zreadgetload".match(r_w)){return eval(	getCookie(key)  );}
	if("zwritersaveputsetlet".match(r_w)){return setCookie(key ,  this.toSource() )}
}//end if 2nd arg, operation not specified , now goto  auto detect mode below
if(!!this.length){return setCookie(key ,  this.toSource()   ); 	//save a populated array
} else { 	return eval(	getCookie(key)  ); 			//load an empty object
}//end else
return;
}




Array.prototype.unique=function(){
var r=this; var t=[]; var mx=r.length;
for(var z=0;z<mx;z++){  if(  t.indexOf(r[z])==-1){t[t.length]=r[z]}  }//next
return t
}

Array.prototype.append$=function(s){   return this.group (function(g){return g+s;})  }
Array.prototype.prepend$=function(s){   return this.group(function(g){return s+g;})  }






 Array.prototype.group=function (function2beRun) {

 function F$(s) {
        if (s.indexOf("return") > -1) {
            return new Function("a", "b", "c", s);
        }
        return new Function("a", "b", "c", "return  ( " + s + " ); ");
    }

    if (function2beRun.isRegExp) {
        z7g = function2beRun;
        function2beRun = function (tempRegString334) {vA6 = tempRegString334.toString().match(z7g);return vA6 ? vA6.join("") : null;};
    }
    if (function2beRun.isArray) {
        g3s2 = function2beRun;
        function2beRun = function (anRay4) {zt2r = [];zt2r.mxi = g3s2.length;for (zt2r.i = 0; zt2r.i < zt2r.mxi; zt2r.i++) {zt2r[zt2r.length] = anRay4[g3s2[zt2r.i]];}return zt2r;};
    }
    if (function2beRun.isString) {
        function2beRun = F$(function2beRun);
    }



    z565daBackUp = "";
    if (!!this.rk5) {
        z565daBackUp = this.rk5;
        this.rk5 = [];
    } else {
        this.rk5 = [];
    }
//main code
    this.rk5.mx = this.length;
    _09 = this.rk5;
    for (_09.z = 0; _09.z < _09.mx; _09.z++) {
        if ( this[_09.z] !== undefined) {
            _09[_09.length] = function2beRun(this[_09.z], this, _09.z);
        }
    }
    if (z565daBackUp) {
        this.rk5 = z565daBackUp;
    }
    return _09;
}










Array.prototype.getProp=function(p){//for array of objects, it fetches the same property of each object
	mx=this.length;
	r=[];
	for(var z=0;z<mx;z++){if(!! this[z][p].type) r[r.length]=this[z][p]};
	return r
}//endgetp



Array.prototype._=function(p){
	mx=this.length;	r=[];

		//for array of objects, it fetches the same property of each object
		if(p.type=='function'){ 
			for(var z=0;z<mx;z++){ 
			tt=	p.call( this, this[z] , z , this)
			if(!!tt.type){r[r.length]=tt;}
			}
		return r;
		}//end if function
		
	if(p.type=='regexp'){
						for(var z=0;z<mx;z++){ r[z]=this[z].match(p)}; 
		}//end if regexp - match each element


	if(p.type=='object'){
						for(var z=0;z<mx;z++){ r[z]=  p }; 
		}//end if object -  HMMM  what ti do here?

	if(p.type=='array'){
		mxi=p.length;
						for(var i=0;i<mxi;i++){
							r[r.length]=  this[ p[i] ]
						}//next i - map index			
		}//end if array - gather each of the index referenced by the array p map it...


	if(p.type=='string'){
//			for(var z=0;z<mx;z++){if(!! this[z][p].type) r[r.length]=this[z][p]};  replacng because xml dom iteration is broken

//	for(var z=0;z<mx;z++){if(!! this[z][p]) r[r.length]=this[z][p]};  // trying something i should have done intitally? 	\/
																		for(var z=0;z<mx;z++){if(typeof this[z][p] !="undefined") r[r.length]=this[z][p]}; 

}//end if string - get ob prop
		
	if(p.type=='number'){ //integer - array oindex
			for(var z=0;z<mx;z++){ r[z]=this[z][p]}
		} //end if number -get array index
if(!! p.type){return r}



}//endgetp shadow, _

Array.prototype.toTypes=function(){
return this.group(function(a){return a.type})	
}


Array.prototype.random=function(){
	return this[Rnd(this.length-1)];
}




Array.prototype.lf=function(noSorting){
if(noSorting){ return this.join("\n") }
return this.sort().join("\n");
}



Array.prototype.toExcel=function(){
	if (isList(this)){return this.join("\n");}
	if (isTable(this)){return this.group(function(g){return g.join("\t")}).join("\n");}
}//end toExcel



Array.prototype.population=function(){ //returns an object of indexes- their occourances as an integer value.
var r=this; var t=r.unique().sortNumber(); var mx=r.length;var tob={};
	for(var z=0;z<t.length;z++){ tob[t[z]]=0 }
	for(var z=0;z<mx;z++){  tob[r[z]]+=1 }//next
return tob
}


Array.prototype.populationChart=function(){ //builds a simple ascii line graph of an array's frequency
var r=this; var b=r.population();
s=r.min(); e=r.max(); var t=[];
var tob= obMap(b).reverse().sortNumber()
for(z=0;z<tob.length;z++){tob[z][1]=("|").repeat(tob[z][1])}
return tob.sort().join("\n")
}//end chart


Array.prototype.chart=function(){ //builds a simple ascii line graph of a numerical array's values
var r=this; var b=r.toPercent();
var t=[]; s=r.sum();
//var tob= obMap(b).reverse().sortNumber()
//for(z=0;z<b.length;z++){t[z]=r[z]+": "+("|").repeat(parseInt(b[z] * 100) )}

for(z=0;z<b.length;z++){t[z]=r[z]+":\t"+("|").repeat( parseInt((r[z] / s)*100)  )}

return t.sort().join("\n")
}//end chart



Array.prototype.chartHT=function(){ //builds a simple ascii line graph of a numerical array's values
var r=this; var b=r.toPercent();
colors="red,blue,#3f3,yellow,orange,violet,aliceblue,navy,pink,canary".repeat(88).split(",")
var t=[]; s=r.sum();
//var tob= obMap(b).reverse().sortNumber()
//for(z=0;z<b.length;z++){t[z]=r[z]+": "+("|").repeat(parseInt(b[z] * 100) )}

for(z=0;z<b.length;z++){t[z]=String(r[z]).tag("div","background-color:"+colors[z]+"; width: "+( parseInt((r[z] / s)*100) * 5  )+"px ")}

return t.sort().join("\n")
}//end chart

Array.prototype.toCombo=function(f){ 

var b="\n<select size='1' "+ ( f?("onchange='"+f.toString()+"'"):(" ") )+" class='autoCombo'>\n\t<option>";
	return b+this.join("<\/option>\n\t<option>")+"<\/option>\n<\/select>\n"
}//end function 'toCombo


   

Array.prototype.toList=function(f){ 
var b="\n<select size='"+this.length+"' "+ ( f?("onchange='"+f.toString()+"'"):(" ") )+" class='autoCombo'>\n\t<option>";
	return b+this.join("<\/option>\n\t<option>")+"<\/option>\n<\/select>\n"
}//end function 'toList

Array.prototype.toUL=function(){ 
var b="\n<ul class='autoUL'>\n\t<li>";
	return b+this.join("<\/li>\n\t<li>")+"<\/li>\n<\/ul>\n"
}//end function 'toUL


Array.prototype.toOL=function(){ 
var b="\n<ol class='autoOL'>\n\t<li>";
	return b+this.join("<\/li>\n\t<li>")+"<\/li>\n<\/ol>\n"
}//end function 'toOL

function wrapHT(r, tg) //no loop HTML builder for array data
		{var tt=[]; tt[0]="<"+ tg+">";
			 	tt[3]="<\/"+tg+">\n"
				tt[2]=r.join(tt[3]+tt[0])
		return tt.join("");
		}//end wrap array

Array.prototype.toTags2=function(tg){
	var tt=[]; tt[0]="<"+ tg+">";
 		tt[3]="<\/"+tg+">\n"
		tt[2]=this.join(tt[3]+tt[0])
	return tt.join("");
}//end toTags

Array.prototype.toTags=function(tg){ return wrapHT(this, tg);}

Array.prototype.toTr=function(){
//if(isList(this))
return "\n<tr class='autoTR' >\n"+wrapHT(this, "td")+"<\/tr>\n"
}//end function toTr()


Array.prototype.toTable=function(){
if(1) {
	var hd="<table class='autoTable' cols='"+this[0].length+"' cellpadding='0' cellspacing='0' style='direction:ltr'>\n";
	var ft="</table>";
	var mx=this.length;
	var rws=[];
	for(z=0;z<mx;z++){ 
		tw="\t"+this[z].toTr(); rws[z]=tw?tw:"";
		//"\t<tr class='autoTR' >\n"+wrapHT(this[z], "td")+"<\/tr>\n";
	}//next

	return (hd+rws.join("")+ft);
	
}//end if tablularData




}//end function toTable()


Array.prototype.toTable2=function (atts) {
r=this;
    if (isTable(r)) {
	var hd = "<table class='autoTable' cols='" + r[0].length + "' cellpadding='0' cellspacing='0' style='direction:ltr'>\n";
        var ft = "</table>";
        var mx = r.length;
        var rws = [];
        for (z = 0; z < mx; z++) {
            rws[z] = r[z].toTr();
        }
buff=hd + rws.join("") + ft

//    if (atts) {        setAttribs(buff.HT(), atts);    }
return buff.HT(atts).outerHTML
    }
}



Array.prototype.toTbList=function(){
return "<table class='autoTabList' > \n<tr><tr class='autoTR' ><td>\n"+this.join("\t<\/td><\/tr><tr><td>")+"\n<\/td><\/tr>\n<\/table>\n"
}//end function toTblist()


Array.prototype.prompt=function(tit){
bs=""; r=""
	if(isList(this)){
		bs=prompt((tit?tit+"\n\n":"")+this,this.toSource().slice(1,-1))
		eval("r=[ "+ bs +" ]")
		if (r.type=="array"){return r} else { return bs.toArray()}
	}
  prompt((tit?tit+"\n\n":"")+this.join("\n"), this.toSource())
return this;
}//end array.prompt


Array.prototype.alert=function(tit){
	prompt((tit?tit+"\n\n":"")+this.join("\n"), this.toSource())
  return this;
}


Array.prototype.fill=function(v){t=this; mx=t.last(); for(z=0;z<mx;z++){t[z]=v;}; return t;}

//Array.prototype.group=function(f){
//mx=this.length;
//var r=[];
//for(z=0;z<mx;z++){r[z]=f(this[z],this,z)}
//return r;}

Array.prototype.apply=function(f){
mx=this.length;
for(z=0;z<mx;z++){f(this[z],this,z)}}


Array.prototype.last=function(n){return this[this.length -(n?n+1:1)]; }


Array.prototype.toTally=function(){
	bs=this.vals();
return bs.group(function(v){return [v +"\t",(v).toTally()] })
}



Array.prototype.shuffle=function(){
var that= ([]).concat(this); var mx=that.length;
var r=[]; var mx2 = mx-1;
for(var i=0; i< mx; i++){
		var slot= Rnd(mx2 - i );
		r[i]=that.splice(slot  , 1);
	}
   return r;
}//end shuffle




Array.prototype.sortNumber=function () {
return this.sort(function (a, b) { 
return a != b ? parseFloat(a) - parseFloat(b) : 0 })}

Array.prototype.sortMoney=function () {
return this.sort(function(a, b) {
return a != b ? parseFloat(a.replace(/[^\d.]/g, "")) - parseFloat(b.replace(/[^\d.]/g, "")) :0; })}

Array.prototype.sortText=function () {
return this.sort(function (a, b) {
return (a !=b) ? (b.toLowerCase() < a.toLowerCase()?1:-1):0; })}

Array.prototype.sortTextAuto=function () {
return this.sort(function (a, b) {
return (a !=b) ? (b.toString().toLowerCase() < a.toString().toLowerCase()?1:-1):0; })}


/*Array.prototype.sortDate=function () {
return this.sort(function(a, b) { 
return a < b ? -1 : a > b ? 1 : 0; })}  */

Array.prototype.sortDate=function () {
this.help="sorts an array by date.";

return this.sort(function(a, b) { 
a=parseDate(a); b=parseDate(b);
return a < b ? -1 : a > b ? 1 : 0; })}



Array.prototype.sort$=function (scheme) { //scheme =1 of ['$', 'a', 'A',1, date, null] ~=[money,case-insensitive, case-senesitive, numerical, auto]

if(!scheme){ scheme=detectScheme(this) };
	switch(scheme){
			case  '$':			return this.sortMoney();		break;
			case  'a':			return this.sortTextAuto();		break;
			case  'date':	return this.sortDate();		break;
			case  'A':		return this.sort();					break;
			case  1:			return this.sortNumber();	break;
			default:			return this.sort();											}//end switch

return this;
}//end proto sort$






//Array.prototype.sortDate.toString=function () { var e=Array.prototype.sortDate.toString; return "\n\n\/\/"+Array.prototype.sortDate().help+"\n\n"+e}

/*
Array.prototype.LUT=function(){
var t="["+ this.group(function(a,b,c){return  { index:b , type: typeOf(c), ob: c, val: c[b], valType:typeOf(c[b])  }.toSource() }   ).join(",\n")+"]"
t=eval("t="+t)
t.toString=t.toSource;
return t;}
*/


Array.prototype.next= function next(n) {var t = this;if (typeof t.cItem === 'undefined') {t.cItem = -1;}this.cItem += n ? n : 1;if (t.cItem >= t.length) {t.cItem = -1;return;}return t[t.cItem];}
Array.prototype.prev=function prev(n) {var t = this;if (typeof t.cItem === 'undefined') {t.cItem = t.length;}t.cItem -= n ? n : 1;if (t.cItem < 0) {t.cItem = t.length;return;}return t[t.cItem];}




Array.prototype.current=function(num){
   return num?this.cItem:this[this.cItem];}
//Array.prototype.this = Array.prototype.current

Array.prototype.labeled=function(){
  mx=this.length; r=[];
  for(z=0;z<mx;z++){
     r[z]=z+":"+this[z];
  }//next
 return r;
}


Array.prototype.protoMap=function () {
function obMap2(ob) {var r = [];var i = 0;for (var z in ob) {if (ob.hasOwnProperty(z)) {r[i++] = z + "=" + ob[z];}}return r;}  
  p = obMap2(Array.prototype);
var hd="Array.prototype."
    return hd+ p.sort().join("\n\n"+hd);
}
//Array.prototype.protoMap.toString=function(){return (Array.prototype.protoMap()) } ;

/*
Array.prototype.appendTo=function (masterArray){
	masterArray.push(this);
   return masterArray;
}
*/






Array.prototype.protosOld=function(){
	p=obSub(Array.prototype);
//	p.toString=this.p();
t=p.sort().join("\n")
//t.toString=function(){return this.protos() } ;
return t  }
//Array.prototype.protos.toString=function(){return ("[\""+ Array.prototype.protos().split("\n").join("\",\"")+"\"]") } ;



//Array.prototype.help=function(){ var w= Array.prototype.protos().split("\n").toCombo("alert(Array.prototype[this.value].toString() )" ).toString(); dialog(w, "Array Prototypes"); return  w }



/*
//table colum proto
var b=tags("table")[1]
b.colum=function(c){
return Group(function(cll){return cll.cells?cll.cells[c].outerHTML: ""},   obValsx( b.rows)  )
}*/


//STRING PROTOS
String.prototype.Ob=function (){ return new String(this) }//makes a string object that can accept protos


//turn urls into <A> links


String.prototype.wrap=function(colLen,delm)//formats a string for word wraping of colLen cols
{if(!delm)delm='-\n';if(!colLen)colLen=this.length
var bs='';var mx=this.length
for(i=0;i<mx;i+=colLen)
{bs+=this.slice(i,i+colLen)+delm;}
return bs.slice(0,(bs.length-delm.length));}

String.prototype.wordWrap=function(cols){
   var lr= this.split(/\ /g);
    var buff=[]; 
    var mx=lr.length;
    var tl=""
  for( var i = 0; i< mx; i++){
    var tlen=tl.length;
    var it = lr[i];
    if( tlen + it.length > cols ){
        buff.push(tl+"\n");
        tl=it+" ";        
      } else {
        tl += it+" ";
    }//end if
}//nxt
buff.push(tl);

return buff.join("");

}//end wrap




String.prototype.compress=function(){return  jsmin(this,2); }


String.prototype.htComment=function(){
	return ("<"+"!--"+this+"--"+">");
}



String.prototype.prepend=function(tx){
   return 	( tx + this);
}//end proto prepend

String.prototype["F$"]=function(args){ return F$(this, args) }


String.prototype.ascii=function(){mx=this.length; r=[]; for(z=0;z<mx;z++){r[z]=this.charCodeAt(z)}; return r;}
String.prototype.hex=function(){mx=this.length; r=[]; for(z=0;z<mx;z++){r[z]=this.charCodeAt(z).toString(16)}; return r;}

String.prototype.witness=function(){return this.ascii().sum()}

String.prototype.toArray=function(){return this.split(/[\W]+/gm)}

String.prototype.abbr=function(len){return this.slice(0,len-3)+"..."}
String.prototype.repeat=function(times){ var b = [];
    for (var z = 0; z <times; z++) { b[z] = this;}
    return b.join("");}

String.prototype.substitute=function(r){O=this; for(z=0;z<r.length;z++){ 
//if(!r[0][0]){r=[r]};
tre=new RegExp( r[z][0], "gm");
O=O.replace(tre,r[z][1]) };
return O}

String.prototype.template=function(r){O=this; for(z=0;z<r.length;z++){ 
var p="\\*+"+r[z][0]+"\\*+"
var tre= new RegExp( p, "igm");
O=O.replace(tre,r[z][1]) };
return O}

/**************************************  Jonas Raoni Soares Silva  http://www.joninhas.ath.cx**************************************/
String.prototype.rot13 = function(){ //v1.0
	return this.replace(/[a-zA-Z]/g, function(c){
		return String.fromCharCode((c <= "Z" ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26);
	});
};




String.prototype.addScript=function(){return addScript(this)}




String.prototype.cookie=function(key, r_w){
if(!!r_w){
if("zreadgetloadR0".match(new RegExp(r_w,"igm") )){return eval(	getCookie(key)  );}
if("zwritesaveputsetletW1".match(new RegExp(r_w,"igm"))){return setCookie(key ,  this.toSource() )}
}	//end if 2nd arg, operation not specified , now goto  auto detect mode below
if(!!this.length>0){return setCookie(key ,  this.toSource()   ); 	//save a string with length
} else { 	return 	getCookie(key); 			//load an empty object
}//end else
return;
}






String.prototype.el=function(){ el(this);}
String.prototype.tags=function(){return tags(this);}



String.prototype.bytes=function(){return this.length;}


String.prototype.split2=function(spltr){ return obValsl(this.split(spltr)); }




String.prototype.toBoolean=function(){	if (" true 1 yes positive checked affirmative si verdad + y ".indexOf(this)>-1){return true};	return false; }



//  HTML CONSTRUCTORS FROM STRINGS

  String.prototype.HT = function(atts){
     t = document.createElement("span");
    t.innerHTML = this.toString();
	r=t.firstChild;
    if (atts) {        setAttribs(r, atts);    }
    return r;
}

  String.prototype.HT$ = function(atts){	  return setAttribStr(this, atts)	}


String.prototype.input=	function(typ, attrOb){
	var b="<input type='"+(typ?typ:"text")+"' ";
if(attrOb){
	var tr=obMap(attrOb);
	for(var z=0; z<tr.length; z++){
		b+= tr[z][0]+"=\"";
		b+= tr[z][1]+"\" ";		
	}//nxt
}//end if
	b+=" value=\""+this+"\" ";
   return b+" \/>" 
}








String.prototype.inpText=		function(){


var tid=serial(3);
	var buff= "<label for='"+tid+"' >"+this+"<\/label> "+this.input("text", {size: 14, id:tid, name:"text2", title: "" }) 
return buff;
}





if(!IE){ eval('                                                                                                                                    	 	 \n\
                                                                                                                                    	 	 \n\
String.prototype.inpButton=	function(){return this.input("button", {class:"",  id:"button1", name:"button1", title: " ", onclick:"void(0);" }) }         	 	 \n\
String.prototype.inpHidden=	function(){return this.input("hidden", { id:"hidden1", name:"hidden1" }) }                              	 	 \n\
String.prototype.inpSubmit=	function(){return this.input("submit", { name: "submit1"  }) }                                          	 	 \n\
String.prototype.inpCheck=	function(){return this.input("checkbox", { class:"",id:"check1", name:"check1"  }) }                     	 	 \n\
String.prototype.inpRadio=	function(){return this.input("radio", {class:"", id:"radio", name:"radio01" }) }                         	 	 \n\
String.prototype.inpFile=	function(){return this.input("hidden", { class:"", id:"hidden1", name:"hidden1" }) }                      	 	 \n\
String.prototype.button=	function(){return this.input("button", {class:"", onclick:"", id:"button1", name:"button1", title: "" }) } 	 	 \n\
                                                                                                                                    	 	 \n\
' ) }



if(IE){

String.prototype.inpButton=	function(){return this.input("button", {className:"",  id:"button1", name:"button1", title: "", onclick:"void(0);" }) }
String.prototype.inpHidden=	function(){return this.input("hidden", { id:"hidden1", name:"hidden1" }) }
String.prototype.inpSubmit=	function(){return this.input("submit", { name: "submit1"  }) }
String.prototype.inpCheck=	function(){return this.input("chsckbox", { className:"",id:"check1", name:"check1"  }) }
String.prototype.inpRadio=	function(){return this.input("radio", {className:"", id:"radio", name:"radio01" }) }
String.prototype.inpFile=	function(){return this.input("hidden", { className:"", id:"hidden1", name:"hidden1" }) }
String.prototype.button=	function(){return this.input("button", {className:"", onclick:"", id:"button1", name:"button1", title: "" }) }

}










String.prototype.inputSmall=	function(){return "<input  size=\"3\" style=\"border:0px\" value=\""+this+"\" type=\"text\">" }
String.prototype.toHiddenInput=function(){ return "<input type=\"hidden\" id=\"hidden1\" name=\"hidden1\" value=\""+String(this)+"\" />"; }

String.prototype.toHiddenText=function(){ return "<textarea  id='text1' name='text1' rows='5' cols='10'  style='font-size:10%; position:absolute; left:-110px; top: -100px; width:1px; height:1px; visibility:hidden; display:none; z-index:-99'>"+String(this)+"<\/textarea>"; }
String.prototype.toFullScreenText=function(){ return  "<textarea  id='t2' name='t2' rows='50' cols='110'  style='font-family:Tahoma, sans-serif; font-size:110%; position:absolute; left:0px; top: 0px; width:100%; height:100%;'>"+  String(this) +"<\/textarea>"; }


String.prototype.textArea=		function (){return "<textarea rows='10' cols='80' >"+this+"</textarea><br>" }
String.prototype.toTA=	function(){return  "<textarea name=\"ta1\" title=\"\"  rows=\"5\" style=\"font-size: 100%\"  cols=\"20\" tabindex=\"0\">" + this +  "<\/textarea>"  }
String.prototype.inpTA=			function(){return this+  "<textarea id=\"ta1\" title=\"\"  rows=\"5\" cols=\"50\"  style=\"font-size: 100%\"   tabindex=\"0\"><\/textarea>"  }


String.prototype.linkSelf=function(){ return this.link(this)}


String.prototype.div=function(){return  "<div>" + this +  "<\/div>"  }
String.prototype.span=function(s){ return "<span"+(s?(" style='"+s+"'"):(""))+" >" + this +  "<\/span>"   }
String.prototype.underline=	function(){ return  "<u>"+this+"<\/u>" }

/*
make constructors for ht take take a few params
-str or dom return, S.I.C., autodetect the type of arg, assign based upon that?
	-how about default to sic, or if (A1=ob){ A2=!!string? }
*/




String.prototype.dump=function(elm){if(elm.type=='string'){elm=el(elm)}; if(elm.value){elm.value=this} else {elm.innerHTML=this}; return this; }

String.prototype.matchAll=function(){ 
	a=arguments;  mx=a.length; t=this.toString();
		for(z=0; z<mx;z++){ 
				 if(! t.match(a[z]) ){ return false}
	 	}
return true;
}//

String.prototype.typeIt=function(elm){
   wds=this.split(/\ /g)
var mx=wds.length;
for(z=0;z<mx;z+=1){
         setTimeout( "el('"+elm+"').value ='"+wds.slice(0,z+1).join(" ")+"'", z * 175)
   }//nxt
    return this;
}



String.prototype.flashIt=function(elm){
   wds=this.split(/\ /g)
var mx=wds.length;
for(z=0;z<mx;z+=1){
         setTimeout( "el('"+elm+"').value ='"+wds[z]+"'", z * 120)
   }//nxt
    return this;
}


String.prototype.tag=function( strTagName,  obAtrribs, A3, A4, A5  ){ //tagname, attrib object, str?  || tagname, STYLE, ID, CLASS. STR?
	var ret=[];
	var retString=true;		//default to a string return 
	
	if(obAtrribs && obAtrribs.type==='object'){
		ret[0] =("<"+strTagName	+">"+this+"<\/"+strTagName+">\n").HT$(obAtrribs);
		if(!!A3){retString = false };
	} else { //  \/SIC version
		ret[0]   = "<"+strTagName		
		ret[1]	=	obAtrribs?(' style="'+obAtrribs+'" '):null;
		ret[2]	=	A3?(' id="'+A3+'" '):null;
		ret[3]	=	A4?(' class="'+A4+'" '):null;
		ret[4]=	">"+this+"<\/"+strTagName+">\n"
		if(!!A5){retString = false };
	}//end if A2=ob?
	
	return retString?ret.join(""):ret.join("").HT();		//return the string or object
	
}//end tag


/*
String.prototype.krunch
String.prototype.partition
String.prototype.words
String.prototype.vertical
String.prototype.nl2br
String.prototype.htmlspecialchars
*/

//stirng builder protos


String.prototype.push=function(str2Add){
if( ! this.push.buildR){this.push.buildR=[];	}

this.push.buildR[this.push.buildR.length]=str2Add;
  return this;
}//end push

String.prototype.build=function(blnClr){
if(blnClr){t= this.push.buildR.join("");  this.push.buildR=[]; return t; }
  return ( this.push.buildR.join("") );
}//end build






String.prototype.krunch=function(){return this.replace(/[\n]+/g,"\n")}


//breaks up a string at regular intervals, optionaly rejoin the string using delm.
String.prototype.partition=function(n,delm){r=this.split(''); mx=r.length; tr=[]; i=0; for(z=0;z<mx; z+=n){  tr[i++]=this.substr(z,n)   }return delm?tr.join(delm):tr;}//optional delimiter else array return

//puts each word of a string in a new array element.
String.prototype.words=function(n,delm){ return this.split(/\W/g)}

//puts each letter of a string on a new line
String.prototype.vertical=function(){r=this.split('') ;  return r.join("\n") } 

String.prototype.nl2br=function(){return (this.replace(/[\n\r]+/g,"<br>"))}
	String.prototype.htmlspecialchars = function(){return escHT(this)}



String.prototype.between= function(n,m){t=this; s=(t.indexOf(n))+n.length;  return t.slice(s, t.indexOf(m)) };
String.prototype.after= 		function(delm){t=this; s=(t.indexOf(delm))+delm.length;  return t.substr(s) };
String.prototype.before= 	function(delm){s=(this.indexOf(delm)-1); return this.slice(0,s) };
String.prototype.trim= 		function(){return trim(this); }
String.prototype.left=			function(p){return this.slice(0,p);}
String.prototype.right=		function(p){return this.substr(p);}
String.prototype.mid=			function(l,r){return this.slice(r,l);}
String.prototype.inStr=		function(s){return this.search(s);}
String.prototype.inStrRev=	function(s){return this.lastIndexOf(s);}
String.prototype.getWordCount=function(s){return this.split(/\w\s/g).length ;}


String.prototype.commentOut=	function(){return "\/"+"*"+this+"*"+"\/" }
String.prototype.escJS=				function(){ return escJS(this) }
String.prototype.escHT=				function(){ return escHT(this) }

String.prototype.quoted=			function(){ return "\""+ escJS2(this) +"\"";}
//String.prototype.quoted=			function(){ return "\""+ escJS(this) +"\"";} 	//orig - messed up linebreaks


String.prototype.bin=		function(){ return  window.btoa(this); }
String.prototype.asc=		function(){ return  window.atob(this); }
String.prototype.esc=		function(){ return  escape(this); }//shadow of escape
String.prototype.escape=	function(){ return  escape(this); }
String.prototype.eval=		function(){ return  eval( this ); }
String.prototype.alert=		function(){   alert( this );return this; }
String.prototype.prompt=	function(){   a=prompt( this,this );return a?a:this; }
//String.prototype.cipher=	function(key){ return  jcipher(this, key?key:document.domain;) }
String.prototype.anon=			function(){ return  "(function(){ "+this+"}() ) " }



String.prototype.getAvgLength=			function(){ return ( this.length/ this.split(/\w\s/g).length);}
String.prototype.getLineCount=			function(){ return (this.split(/\n/gm).length - 1); }
String.prototype.getSentanceCount=	function(){return (this.split(/\\w./gm).length - 1); }
String.prototype.getVowelCount=		function(){return (this.match(/[aeiou]/gim).length);}
String.prototype.getDigitCount=			function(){return (this.split(/\d/gm).length - 1);}
String.prototype.getSpaceCount=		function(){return (this.split(/\s/gm).length - 1);}
String.prototype.getMarkupChars=		function(){return (this.match(/[\<\>\\\/\"\']/gim).length);}
String.prototype.toEval=	function(){ return  "eval( "+  this + " )\n"; }
String.prototype.toTry=	function(){ return  " try{ "+  String(this) + "}catch(Er){void(null)};" }





String.prototype.indent=function(firstLine){
var buff=this.split(/[\n\r]/g)
c=buff.group(function(a,b,c){if(c==0 && firstLine ){return  a}else{return "\t"+a};  })
return c.join("\n")
}


String.prototype.join=function(){return this;};

String.prototype.dataUrl=function(){    return "data:text/plain," + escape(this); }

String.prototype.stripComments= function(){
//	tt=this.replace(/\<\!\-+[\d\D\n\r\s]+\-+\>/gm,"");
//	t=tt.replace(/\/\*[\d\D\n\r\s]+\*\//gm, ""); 
	return  this.replace(/\/\*.+?\*\//gm, "");
}


function addCss(v){return sGet(v).packIn()}//end 



//make customized versions for css and scripts - use acss and doc.write/addscript/set bod.tag innerHTML
String.prototype.packIn = function(){
    return "(function(){//@cc_on; /*  \nthis.info=<i><![CDATA[" + this.stripComments() + "]]></i>// /*  */\n\nif(!! this.info){var ww=this.info.toString()}else{ww=arguments.callee.toString().split(/\\[CDATA\\[/m)[1].toString().split(/\\]\\]\\>/im)[0]};\nreturn ww;}() )";
}

String.prototype.packCSS = function(){
    return "aCSS((function(){//@cc_on; /*  \nthis.info=<i><![CDATA[" + this.stripComments() + "]]></i>// /*  */\n\nif(!! this.info){var ww=this.info.toString()}else{ww=arguments.callee.toString().split(/\\[CDATA\\[/m)[1].toString().split(/\\]\\]\\>/im)[0]};\nreturn ww;}() ) )";
}

String.prototype.toCdata = function(){
return "<![C"+"DATA[" + this + "]]>"
}



String.prototype.pretty=function () {
    var qw = this.split(/[\ ]/g); mx=qw.length;
    for (z=0;z<mx;z++) { qw[z] = qw[z].substr(0, 1).toUpperCase() + qw[z].slice(1).toLowerCase(); }
    return qw.join(" ");
}
 
 String.prototype.toHTMLObject = function(atts){
    var t = document.createElement("span");
    t.innerHTML = this.toString();
    if (atts) {        setAttribs(t, atts);    }
    return t;
}

 
 
String.prototype.crc=function(){return crc32(this);}
 String.prototype.define = function(){ return define(this); }
  String.prototype.help = function(){ help(this, 55); return this; }
  String.prototype.reverse = function(){ return (this.split("").reverse().join("")); }

 
 String.prototype.isEmpty=function(){return (!! this.length==0)}
String.prototype.contains=function(s){return (this.indexOf(s) > -1)  }
String.prototype.toTitleCase=function(){return this.pretty()}


//String.prototype.self=function(){return this}
//String.prototype.many=function(n){t=this; r=new Array(8); return r.fill(t); }


String.prototype.toArray=function () {
 if (this.match("\n")) {
        r = this.split("\n").group(function (a, c, b) {if (a.match(/\t/g)) {return a.split(/[\W]+/gm);} else {return 6;}});
    } else {
tc=this.match(/[\t]+/g)//.length;
cc=this.match(/[\,]+/g)//.length;

if(tc?tc.length:0<cc?cc.length:0){ r = this.split(/\t/g) }else{r=this.split(/\,/g) ; }
    }
    return r;

}


String.prototype.toCSSRule=function(){
 return (styleToRule(this)  )
}


String.prototype.var2=function(ob2){
return (this.tag('var', ob2));}

String.prototype.demo=function(){
	return this.tag("textarea", {name:"demoText"});
}


String.prototype.load=function(url){
 try{return sGet(this)}catch(rr){return rr};
}


String.prototype.save=function(url){
try{
 try{return sPut(url, this)}catch(rr){void(0)}
 try{return sPut(this, url)}catch(rr){void(0)}
}catch(rr){return;}
}//end proto save



String.prototype.protoMap=function () {
function obMap2(ob) {var r = [];var i = 0;for (var z in ob) {if (ob.hasOwnProperty(z)) {r[i++] = z + "=" + ob[z];}}return r;}  
  p = obMap2(String.prototype);
var hd="String.prototype."
    return hd+ p.sort().join("\n"+hd);
}




//NUMBER PROTOS
Number.prototype.isPositive=function(){return this>0?true:false;}	
Number.prototype.isNegative=function(){return this<0?true:false;}	
Number.prototype.isPos=function(){return this>0?true:false;}	
Number.prototype.isNeg=function(){return this<0?true:false;}	
Number.prototype.isInt=function(){return !(String(this).indexOf("."));}	
//Number.prototype.isInt=function(){return !!(parseInt(this)==this);}	
Number.prototype.cos=function(){return Math.cos(this)}
Number.prototype.abs=function(){return Math.abs(this)}
Number.prototype.acos=function(){return Math.acos(this)}
Number.prototype.asin=function(){return Math.asin(this)}
Number.prototype.atan=function(){return Math.atan(this)}
Number.prototype.log=function(){return Math.log(this)}
Number.prototype.exp=function(){return Math.exp(this)}
Number.prototype.ceil=function(){return Math.ceil(this)}
Number.prototype.pow=function(x){return Math.pow(this,x)}
Number.prototype.floor=function(){return Math.floor(this)}
Number.prototype.round=function(){return Math.round(this)}
Number.prototype.sqrt=function(){return Math.sqrt(this)}
Number.prototype.sin=function(){return Math.sin(this)}
Number.prototype.tan=function(){return Math.tan(this)}
Number.prototype.areaSq=function(){return Math.pow(this, 2)}
Number.prototype.square=function(){return Math.pow(this, 2)}
Number.prototype.cube=function(){return Math.pow(this, 3)}
Number.prototype.areaCir=function(){return (Math.pow(this,2) * Math.PI)  }







Number.prototype.factors=function(){
		var mx=parseInt(Math.sqrt(this))+1; var facts=[];
	for(z=1; z<mx;z++){facts[z]= [z, (this/z)]      }
	return facts//.sort()//.join("\n")
}	//end factors

Number.prototype.factorsInt=function(){
	var mx=parseInt(Math.sqrt(this))+1; var facts=[];
	for(z=1; z<mx;z++){if(parseInt(this/z)==(this/z)  ) facts[z]= [z, (this/z)]      }
	return facts.sort()//.join("\n")
}	//end factorsInt

Number.prototype.isPrime=function(){
	if(!this.isInt() || this<2) return false;
return this.factorsInt().length==2?true:false;}	

function isPrime(x){
	if(! x.isInt() || x<2) return false;
return x.factorsInt().length==2?true:false;}	


Number.prototype.factorsPrime=function(){
	var mx=parseInt(Math.sqrt(this))+1; var facts=[];
	for(z=1; z<mx;z++){if(isPrime(z)  ) {facts[z]= [z, (this/z)]  }    }//nxt
	return facts.sort()//.join("\n")
}	//end factorsPrime


				Number.prototype.gcd=function(x){return Math.tan(this)}
				Number.prototype.lcm=function(x){return Math.tan(this)}	


Number.prototype.div=function(x){return (this / x)}	
Number.prototype.multi=function(x){return (this * x)}	
Number.prototype.add=function(x){return (this+x)}	
Number.prototype.subtract=function(x){return (this-x)}	
Number.prototype.diff=function(x){return  (this-x)}	
Number.prototype.signTxt=function(){return this>0?"positive":"negative";}	
Number.prototype.signSymb=function(){return this>0?"+":"-";}	
Number.prototype.sign=function(){return this>0?1:(this==0?0:-1);}	

Number.prototype.eval=function(x){return eval(x)}	
Number.prototype.toHex=function(){return this.toString(16);}	
Number.prototype.toBin=function(){return this.toString(2);}	
Number.prototype.toOct=function(){return this.toString(8);}	
Number.prototype.bitDepth=function(){return this.toString(2).length;}	

Number.prototype.random=function(){return Math.random(); }


//Math.floor(Math.random() * 6);

var WeightOb = {dram:1.771845, ounce:28.3495231, pound:373.2417, usTonLong:1016046.9088, usTonShort:907184.74, gram:1, carat:0.2054125447, pennyWeight:1.55517384, milligram: 0.001, centigram: 0.01, kilogram: 1000, hectogram: 100, decagram: 10, decigram:0.01, microgram: 0.000001} //gram
var LengthOb= {inch: 12, inches: 12, foot: 1, feet: 1, yard:1/3,mile: 1/5280.2,miles: 1/5280.2, fathom: 1/6, nauticalMiles:0.868421, nanometer:(1/ 3.28084)*100000000 , micron:(1/ 3.28084)*1000000, micrometer:(1/ 3.28084)*1000000,millimeter:(1/ 3.28084)*1000, centimeter:(1/ 3.28084)*100, meter:(1/ 3.28084), kilometer: (1/ 3.28084)/1000}//foot
var TimeOb = { second: (((1/24)/60)/60), minute: ((1/24)/60), hour: 1/24, day:1, week:7, month:30.4, season:(365.24/4), year:365.24, century:(365.24*100), millennium:(365.24*1000)} //day

Number.prototype.weight=function(s,e){return (this * WeightOb[s] ) / ( WeightOb[e])}
Number.prototype.length=function(s,e){return (this * LengthOb[e] ) / ( LengthOb[s])}
Number.prototype.time=function(s,e){return (this * TimeOb[s] ) / ( TimeOb[e])}

//Number.prototype.toString=function(){return this.toLocaleString()}

Number .prototype.toTally=function(){
	o="|"; m="|||||  "; gs=parseInt(this / 5)
	og=(this % 5)
return m.repeat(gs)+o.repeat(og) }

Number.prototype.bytes=function(){return 8;}



//Number.prototype.self=function(){return this}
//Number.prototype.many=function(n){t=this; r=new Array(8); return r.fill(t); }


Number.prototype.toLetters=function(){
	if (this<26){return Number.prototype.toLetters.letss[this]} //bail  if under 26 (for speed)
	lets=Number.prototype.toLetters.letss //"ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("") 	
	gs = parseInt(this / 26);
	og = this % 26 
	return (lets[gs]+lets[og])
}//end toLetters
Number.prototype.toLetters.letss="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("") 	

Number.prototype.protoMap=function () {
function obMap2(ob) {var r = [];var i = 0;for (var z in ob) {if (ob.hasOwnProperty(z)) {r[i++] = z + "=" + ob[z];}}return r;}  
  p = obMap2(Number.prototype);
var hd="Number.prototype."
    return hd+ p.sort().join("\n"+hd);
}


	
// ########  FUNCTION PROTOTYPES	
Function.prototype.delay=function(ms){
that=this;
args = Array.prototype.slice.apply(arguments, [1]);
setTimeout(function(){that.apply(1,args)}, ms)
}

Function.prototype.Name=function(){return String(this).split("(")[0].substr(9)}
																			   
Function.prototype.bytes=function(){return String(this).length;}	   
																			   





//#### Boolean protos

Boolean.prototype.confirm=function(sPrompt){return (!! confirm(sPrompt) ) }
Boolean.prototype.toNumber=function(){return  (!!this?1:0 ) }
Boolean.prototype.toNum=function(){return  (!!this?1:0 ) }
Boolean.prototype.toTF=function(){return  (!!this?'T':'F' ) }
Boolean.prototype.totf=function(){return  (!!this?'t':'f' ) }
Boolean.prototype.toEs=function(){return  (!!this?'Verdad':'Falso' ) }


// ###### DATE PROTOS
function now(){return (new Date())}
now.toString=function(){return now()}

Date.prototype.load=function(s){
    var d = new Date;
    var td = s.replace(/[-_\\.]/gm, "/").replace(/T!h+/, " ");
    d.setTime(Date.parse(td));
 return d;
 }//end date getr

Date.prototype.now=function(){return ( new Date() ) }



Date.prototype.bytes=function(){return 4;}
Date.prototype.getDayName=function(){return daysLong[this.getDay()]}
Date.prototype.getMonthName=function(){return monthsLong[this.getMonth()]}

Date.prototype.since=function(){  
var n=new Date()
n=n.getTime(); 
var d=this.getTime(); 
return (n-d)  }

//y.value=(td.since() / (1000 * 60 * 60 * 24 *365.24 )  ) //years since i was born

Date.prototype.until=function(){  
var n=new Date()
n=n.getTime(); 
var d=this.getTime(); 
return (d-n)  }

Date.prototype.diff=function(comp){  
var n=new Date()
n=comp.getTime(); 
var d=this.getTime(); 
return (d-n)  }

Date.prototype.toISOString=function(){  
function f(n) {return n < 10 ? "0" + n : n;}
return  this.getFullYear() + "-" + f(this.getMonth() + 1) + "-" + f(this.getDate()) + "T" + f(this.getHours()) + ":" + f(this.getMinutes()) + ":" + f(this.getSeconds()) ;}

Date.prototype.toShort=function(){   //2007-07-21 06:17:59 
function f(n) {return n < 10 ? "0" + n : n;}
return this.getFullYear() + "-" + f(this.getMonth() + 1) + "-" + f(this.getDate()) + " " + f(this.getHours()) + ":" + f(this.getMinutes()) + ":" + f(this.getSeconds()) ;}



Date.monLens=[31,28,31,30,31,30,31,31,30,31,30,31]
Date.monDays=[31,59,90,120,151,181,212,243,273,304,334,365]

Date.prototype.toJulian=function(){ 
     return  (monDays[this.getMonth()-1] + this.getDate() );
}


Date.prototype.toDateLong=function(){  return this.toLocaleString().split(/\d+\d?\:/)[0]} //Saturday, July 21, 2007
Date.prototype.toQuick=function(){  return this.toLocaleString().split("y, ")[1]} //July 21, 2007 6:18:15 AM 
Date.prototype.toDate=function(){  return this.toISOString().split("T")[0]}  //2007-07-21
Date.prototype.toTime=function(){  return this.toISOString().split("T")[1] } //06:17:26

//Date.prototype.self=function(){return this}
//Date.prototype.many=function(n){t=this; r=new Array(8); return r.fill(t); }

/* not finished -  need date wedge protos like .addDay(n), .addHour(n), .addMS()
Date.prototype.timer=function(tit, message){
  bs=message?(  tit+"\n"+message  ):(  "Timer Alert!\n"+tit );
  setTimout(   function(){alert(bs);}  ,  this.until()  )
return this;
}
*/


Date.prototype.format=function(form){   
  function f(n) {        return n < 10 ? "0" + n : n;    }
  var d = form;
    d = d.replace("MM", f(this.getMonth() + 1));
    d = d.replace("M", this.getMonth() + 1);
    d = d.replace("DD", f(this.getDate()));
    d = d.replace("D", this.getDate());
    d = d.replace("YYYY", this.getFullYear());
    d = d.replace("YY", f(this.getYear() - 100));
    d = d.replace("HH", f(this.getHours()));
    d = d.replace("H", this.getHours());
    d = d.replace("mmmm", monthsLong[this.getMonth()]);
    d = d.replace("mmm", monthsShort[this.getMonth()]);
    d = d.replace("mm", f(this.getMinutes()));
    d = d.replace("m", this.getMinutes());
    d = d.replace("dddd", daysLong[this.getDay()]);
    d = d.replace("ddd", daysShort[this.getDay()]);
    return d;
}




//##################3 OBJECT PROTOS
//JSON protos
Object.prototype.len=function(){return obLen(this)}
Object.prototype.map=function(){return obMap(this)}
Object.prototype.mapx=function(){return obMapx(this)}
Object.prototype.subs=function(){return obSub(this)}
Object.prototype.subx=function(){return obSubx(this)}
Object.prototype.vals=function(){return obVals(this)}
Object.prototype.filter=function(prop){return obFilter(this,prop)}
Object.prototype.valsx=function(){return obValsx(this)}

Object.prototype.ratios=function(){
    var r = [];
    var t = "";
    var mx = this.len();
    var v = obVals(this);
    var s = obSub(this);
    for (var z = 0; z < mx; z++) {
        for (var i = 0; i < mx; i++) {
            r[r.length] = s[i] + " / " + s[z] + "  =  	" + v[i] / v[z];
        }
    }
    return r;
}//end ratios

Object.prototype.borrow=function(prop, val, del4){
	that=this;
	oldv= that[prop];
	that[prop]=val;
	setTimeout(function(){that[prop]=oldv;}, del4);
return this;
}


Object.prototype.merge=function (ob) {
    var o = this;
    if (this.type != "object") {
	o=this.Ob();
    }

    var i = 0;
    for (var z in ob) {
        if (ob.hasOwnProperty(z)) {
            o[z] = ob[z];
        }
    }
    return o;
}

Object.prototype.appendTo=function (masterOb){
	if(masterOb.isArray){ 	masterOb.push(this); 	return masterOb;}
	if(masterOb.isString){ 	return masterOb.concat(this.toString()); }
	if(masterOb.isFunction){ return masterOb(this); }
	if(typeOf(masterOb)=='object'){ 	return masterOb.merge(this);	 }

   return masterOb+this;
}



Object.prototype.Ob=function () {
  return new window[this.constructor.name]  (this)
}




Object.prototype.iter=function (keysOnly) {
    return  Iterator( this , keysOnly);
}



// UNIVERSAL OBJECT PROTOS - UNIQUE GLOBAL PROTOTYPES FOR ALL OBJECTS
//			(these should now be considered reserved labels: [self, many, copyOf, exec, toText, protos ]


Object.prototype.set=function(key){
	if(!key ){return null;}
try{    foxStore(key ,this.toSource()); }catch(yy){ setCookie(key ,this.toSource());}
  return this;
}//end {}.set

Object.prototype.getMe=function(key){
	if(!key ){return null;}
try{ eval("n="+foxStore(key )   ) ;    return  n?n:this; 
      }  catch(yy){ d=getCookie(key); n=""; if( d){  eval("n="+d   )} ;    return  n?n:this;    }
}//end {}.get



/*
Array.prototype.set=function(key){
	if(!key ){return null;}
try{    foxStore(key , this.toSource()   ); }catch(yy){ setCookie(key , escape(this.toSource())   );}
  return this;
}//end [].set

Array.prototype.get=function(key){
if(!key ){return null;}
try{                        return   eval( foxStore(key )); 
      }  catch(yy){ return   eval(unescape(getCookie(key )) ) ;  }
}//end [].get




String.prototype.set=function(key){
if(!key ){return null;}
try{    foxStore(key , (this)   ); }catch(yy){ setCookie(key , (this)   );}
  return this;
}//end "".set

String.prototype.get=function(key){
if(!key ){return null;}
    d=foxStore(key ); if (!d){ d=  getCookie(key ) ;  }
	return d?d:this; 
}//end "".get



Number.prototype.set=function(key){
	if(!key ){return null;}
try{    foxStore(key ,this); }catch(yy){ setCookie(key ,this);}
  return this;
}//end 5.set

Number.prototype.get=function(key){
	if(!key ){return null;}
try{                        return    foxStore(key ); 
      }  catch(yy){ return   getCookie(key )  ;  }
}//end 5.get





*/


Object.prototype.self=function(){return this}
Object.prototype.copyOf=function(){t=this; r=[t]; return r[0]; }


Object.prototype.cache=function(){ f=this; this.cache=f; return this;}
Object.prototype.nul=function(){ return null;}


Object.prototype.many=function(n){t=this; r=new Array(n); return r.fill(t); }
Object.prototype.exec=function(js){t=this; eval(js); return t; }


Object.prototype.toText=function(str){		
		if(this.type=='array'){return this.join("");}
	 	if(this.type !="object" ){   return this.toString()} //not array, must be jso or html
		if(this.nodeName){return this.outerHTML}
		if(this.type=='object'){return this.toSource();}
return String(this); //last ditch fallback
}//end toText


Object.prototype.perm=function(key){
	  if(!key){  
		try{if(this.isString){ return window.perm[this] }}catch(yy){} ; return; 
	  }//end if key
	 b=this.toSource();
   return rSet(key, b);
}//end perm



//for debuging objects, not super usefull because it returns psuedo source (which is good for testing...)
Object.prototype.cStr=function(){return "({\t"+this.map()._(function(a){return a.join(":")}).sort$('a').join(",\n\t ")+"\t })"
}//end proto cStr(ob)



Object.prototype.protos=function(str){
    p = obSub(this.constructor.prototype);
    hit = this.constructor.prototype[p[p.indexOf(str)]];
    if (hit) {        return hit;    }
    return str ? p.sort() : p.sort().join("\n");
}//end protos	




// DEFUALT UNIVERSALS - SOME TYPES OVERIDE THESE
Object.prototype.group2=function(f){
	var t= obSub(this); mx=t.length; r=[];
 for (z = 0; z < mx; z++) {
        if (this[t[z]]) {
            r[r.length] = f(this[t[z]],t[z],this);
        }
    }
return r; }
	
Date.prototype.protoMap=function () {
function obMap2(ob) {var r = [];var i = 0;for (var z in ob) {if (ob.hasOwnProperty(z)) {r[i++] = z + "=" + ob[z];}}return r;}  
  p = obMap2(Date.prototype);
var hd="Date.prototype."
    return hd+ p.sort().join("\n"+hd);
}






// ###################### HTML PROTOS

var ff2= !! window.globalStorage;





var csvrow=function(){
var t=[];  var  trw=this.cells; var  mx=trw.length;
	for(var z=0; z<mx;z++)
		{  t[t.length]=trw[z].innerHTML.toString().quoted()};
return t.join(",  ")+"\n" }

var csvtable=function(){
var t=[];  var  trw=this.rows; var  mx=trw.length;
	for(var z=0; z<mx;z++)
		{  t[t.length]=trw[z].csv()};
return t.join("") }


var arrayrow=function(){
var t=[];  var  trw=this.cells; var  mx=trw.length;
	for(var z=0; z<mx;z++)
		{  t[z]=trw[z].innerHTML.quoted()};
return eval("["+ t.join(",")+"]") }

var arraytable=function(){
var t=[];  var  trw=this.rows; var  mx=trw.length;
	for(var z=0; z<mx;z++)
		{  t[z]=trw[z].array().toSource()};
var tmp=eval("["+ t.join(",\n")+"]")
return tmp }


var jsontable=function(){
var t=[];  var  trw=this.rows; var  mx=trw.length;
var th=trw[0].array();
	for(var z=1; z<mx;z++)
		{  var tr=trw[z].array();
var mx2=tr.length;
var tc=[];
for(i=0;i<mx2;i++){  tc[i]=th[i]+":"+tr[i].quoted()   } //next i
t[t.length]="{"+tc.join(",\t")+"}"
}//next z
tmp="["+ t.join(",\n")+"]"
return eval(tmp) }


var textArray=function(){
var ops=this.options, t=[], mx=ops.length, c, tmp;
for(z=0;z<mx;z++){t[z]=ops[z].text.quoted();}
tmp="["+t.join(",\n")+"]"
return eval(tmp);}

var valueArray=function(){
var ops=this.options, t=[], mx=ops.length, c, tmp;
for(z=0;z<mx;z++){t[z]=ops[z].value.quoted();}
tmp="["+t.join(",\n")+"]"
return eval(tmp);}


var arrayselect=function(){
var ops=this.options, t=[], mx=ops.length, c, tmp;
for(z=0;z<mx;z++){
t[z]="["+ops[z].text.quoted()+","+ops[z].value.quoted()+"]";
}
tmp="["+t.join(",\n")+"]"
return eval(tmp);}

var jsonselect=function(){
var ops=this.options, t=[], mx=ops.length, c, tmp;
for(z=0;z<mx;z++){
t[z]="{ text:"+ops[z].text.quoted()+", value: "+ops[z].value.quoted()+"}";
}
tmp="["+t.join(",\n")+"]"
return eval(tmp);}


var tableColumn = function (b,c){
if(c.toString().match(/\D+/)){var tc=c; c=b.rows[0].array().indexOf(tc)}
return  Group(function(cll){return cll.cells?cll.cells[c].outerHTML: ""}, obValsl(b.rows))}


function doHTMLProtos(){

if(ff2){
HTMLTextAreaElement.prototype.toString=function(){return this.value}
HTMLInputElement.prototype.toString=function(){return this.value}
HTMLTableCellElement.prototype.toString=function(){return this.textContent}
//HTMLSelectElement.prototype.toString=function(){var w=this.options[this.selectedIndex]; return w.value?w.value:w.text}

//HTMLOptionsCollection.prototype.toArray=function(){ return this.vals().group( function(c){return [c.text,c.value]} )  }


if(!! window.Element){
	
if(!! HTMLDivElement && HTMLDivElement.prototype && HTMLDivElement.prototype.__defineSetter__){


eval('Element.prototype.__defineGetter__("className", function () {return this.class});Element.prototype.__defineSetter__("className", function (v) {this.class=v } );') //must eval to pacify IE's parser...


Element.prototype.__defineGetter__("innerText", function () {return this.textContent.toString()});


if (!document.body.designMode){
	Element.prototype.__defineGetter__("outerHTML", function () {
	var nd=document.createElement("b");
	//nd.appendChild(this.cloneNode(true));
	nd.appendChild(this);
	//nd.innerHTML=this
	return nd.innerHTML	});
	 
}//end if firefox3 outerhtml hiding


}//end if
}//end if accepting getters/setters


HTMLTableElement.prototype.column=function(col){ return tableColumn(this,col)}; 
HTMLTableRowElement.prototype.csv=function(){return csvrow.call(this)}; 
HTMLTableElement.prototype.csv=function(){return csvtable.call(this)}; 
HTMLTableRowElement.prototype.array=function(){return arrayrow.call(this)}; 
HTMLTableElement.prototype.array=function(){return arraytable.call(this)}; 
HTMLTableElement.prototype.json=function(){return jsontable.call(this)}; 
HTMLSelectElement.prototype.textArray=function(){return textArray.call(this)}; 
HTMLSelectElement.prototype.valueArray=function(){return valueArray.call(this)}; 
HTMLSelectElement.prototype.array=function(){return arrayselect.call(this)}; 
HTMLSelectElement.prototype.json=function(){return jsonselect.call(this)}; 
}else{
	if(IE && 0 ){	//turned off for a while........
	tags("tr").group(function(p){ p.csv=csvrow });
	tags("tr").group(function(p){ p.array=arrayrow });
	tags("table").group(function(p){ p.array=arraytable });
	//tags("table").group(function(p){ p.column=tableColumn });
	tags("table").group(function(p){ p.json=jsontable });
	tags("table").group(function(p){ p.csv=csvtable });
	tags("select").group(function(p){ p.textArray=textArray });
	tags("select").group(function(p){ p.valueArray=valueArray });
	tags("select").group(function(p){ p.array=arrayselect });
	tags("select").group(function(p){ p.json=jsonselect });
}//end if IE

}//end if ie/ff


}//end function doHTMLProtos

addEvent(doHTMLProtos)





//CONSTRUCTORS

function ListBox(items){
	var t=this;
	t.items=items;
function chop5(rr){return rr.toList().split("\n").slice(2,-2).join("\n")}
	

	t.add=function(r){
		if(r.type=='array'){  
				r.group(function(a){ return t.items[t.items.length]=a}  )
			}else{		
					var w=[];
					for(z=0; z<arguments.length;z++){w[z]=arguments[z]}
				w.group(function(a){t.items[t.items.length]=a})
			}//end if
		  return t.items
		};
	t.remove=function(r){t.items.remove(r) };
	t.clear=function(){t.items=[];};
	t.load=function(r){t.items=[]; t.items.push(r)};
	t.length=function(){return t.items.length};
	  t.length.toString=function(){return t.items.length};
	t.getRange=function(s,f){return chop5( t.items.copyOf().splice(s,f) ) }
	t.item=function(n){return chop5( [t.items[n]].copyOf() )}
	t.sort=function(){t.items=t.items.sort$(); return t.items}
	t.loadFile=function(u){buff=sGet(u).toArray(); t.items=buff; return t.items}
	t.addUser=function(strPrompt, def){bb=prompt(strPrompt?strPrompt:"Adding a new Item.\nEnter new item below:\n", def?def:""); if(bb)t.add([bb])}
	t.toString=function(){return t.items.toList()};
	return t;
}



function Table (r, ob){
var t=this;
t.createdAt=new Date();
t.lastUpdate=new Date();
t.array=r;
t.ob=ob
if(r.type !="array"){r=r.toArray() } //coerce an array from passed data
t.toExcel=r.toExcel
t.toArray=function(){return t.array};
t.toCsv=function(){return t.toSource().slice(1,-1);  }

t.ht=(function(){return t.array.toTable2(t.ob).HT()}())
t.title=t.ht.title?t.ht.title:"";
t.id=t.ht.id?t.ht.id:"autoTable"+"".eval(Table.count++)+Table.count;
t.ht.id=t.id;
t.cellCount=function(){return t.array.group(function(v,o,i){return v.length}).sum() }
t.cellCount.toString=function(){return t.cellCount()}
tob={   length:t.array.length }
tob.toString=function(){ return r}

t.rows=tob
t.rows.count=t.rows.length;

//t.getRows=function(){return t.array}

t.getRow=function(row){return (parseInt(row)>=0)?t.array[row]:t.array[t.array.length+row];}
t.getCol=function(col){ return t.array.group(function(a,b,c){return a[col]?a[col]:null;}     ) }


t.update=function(){if(!!el(t.id)){ var w=el(t.id).parentNode; var bb=String(t); w.innerHTML="";w.innerHTML=bb ;    } }


//t.rows.toString=function(){g=t.array.toSource(); eval("tg="+g); return tg; }
t.add=function(r){
		if(!!r[0][0]){		r.apply(function(w){ t.array.push(w)} )
		}else{
		t.array.push(r); 
			}//end if
		t.rows.length=t.array.length;
		t.rows.count=t.rows.length;
		t.lastUpdate=new Date();
		t.update()
		return t.array }

t.toString=function(){return t.array.toTable2(t.ob) };

return t;
}
Table.count=0;





var      httpStat={};
hb=' <a rel="xref" href="rfc2616-sec10.html#sec10.'
Stat= { "100":{ href: hb+'"1.1">10.1.1</a>',  string : 'Continue' },
           "101":{ href: hb+'"1.2">10.1.2</a>',  string : 'Switching Protocols' },
           "200":{ href: hb+'"2.1">10.2.1</a>',  string : 'OK' },
           "201":{ href: hb+'"2.2">10.2.2</a>',  string : 'Created' },
           "202":{ href: hb+'"2.3">10.2.3</a>',  string : 'Accepted' },
           "203":{ href: hb+'"2.4">10.2.4</a>',  string : 'Non-Authoritative Information' },
           "204":{ href: hb+'"2.5">10.2.5</a>',  string : 'No Content' },
           "205":{ href: hb+'"2.6">10.2.6</a>',  string : 'Reset Content' },
           "206":{ href: hb+'"2.7">10.2.7</a>',  string : 'Partial Content' },
           "300":{ href: hb+'"3.1">10.3.1</a>',  string : 'Multiple Choices' },
           "301":{ href: hb+'"3.2">10.3.2</a>',  string : 'Moved Permanently' },
           "302":{ href: hb+'"3.3">10.3.3</a>',  string : 'Found' },
           "303":{ href: hb+'"3.4">10.3.4</a>',  string : 'See Other' },
           "304":{ href: hb+'"3.5">10.3.5</a>',  string : 'Not Modified' },
           "305":{ href: hb+'"3.6">10.3.6</a>',  string : 'Use Proxy' },
           "307":{ href: hb+'"3.8">10.3.8</a>',  string : 'Temporary Redirect' },
           "400":{ href: hb+'"4.1">10.4.1</a>',  string : 'Bad Request' },
           "401":{ href: hb+'"4.2">10.4.2</a>',  string : 'Unauthorized' },
           "402":{ href: hb+'"4.3">10.4.3</a>',  string : 'Payment Required' },
           "403":{ href: hb+'"4.4">10.4.4</a>',  string : 'Forbidden' },
           "404":{ href: hb+'"4.5">10.4.5</a>',  string : 'Not Found' },
           "405":{ href: hb+'"4.6">10.4.6</a>',  string : 'Method Not Allowed' },
           "406":{ href: hb+'"4.7">10.4.7</a>',  string : 'Not Acceptable' },
           "408":{ href: hb+'"4.9">10.4.9</a>',  string : 'Request Time-out' },
           "409":{ href: hb+'"4.10">10.4.10</a>',  string : 'Conflict' },
           "410":{ href: hb+'"4.11">10.4.11</a>',  string : 'Gone' },
           "411":{ href: hb+'"4.12">10.4.12</a>',  string : 'Length Required' },
           "412":{ href: hb+'"4.13">10.4.13</a>',  string : 'Precondition Failed' },
           "413":{ href: hb+'"4.14">10.4.14</a>',  string : 'Request Entity Too Large' },
           "414":{ href: hb+'"4.15">10.4.15</a>',  string : 'Request-URI Too Large' },
           "415":{ href: hb+'"4.16">10.4.16</a>',  string : 'Unsupported Media Type' },
           "416":{ href: hb+'"4.17">10.4.17</a>',  string : 'Requested range not satisfiable' },
           "417":{ href: hb+'"4.18">10.4.18</a>',  string : 'Expectation Failed' },
           "500":{ href: hb+'"5.1">10.5.1</a>',  string : 'Internal Server Error' },
           "501":{ href: hb+'"5.2">10.5.2</a>',  string : 'Not Implemented' },
           "502":{ href: hb+'"5.3">10.5.3</a>',  string : 'Bad Gateway' },
           "503":{ href: hb+'"5.4">10.5.4</a>',  string : 'Service Unavailable' },
           "504":{ href: hb+'"5.5">10.5.5</a>',  string : 'Gateway Time-out' },
           "505":{ href: hb+'"5.6">10.5.6</a>',  string : 'HTTP Version not supported' } }
		   
		   



	
	/*
	
	
	

if( navigator.userAgent.toLowerCase().indexOf('msie') != -1 ) {
this.xy = function (v) { return (v?(event.clientY+document.body.scrollTop):(event.clientX+document.body.scrollTop)); }
}else{
this.xy=function (e,v) { return (v?(e.pageY):(e.pageX)); }
}//end if ie

function dragOBJ(d,e) {
function drag(e) { if(!stop) { d.style.top=(tX=xy(e,1)+oY-eY+'px'); d.style.left=(tY=xy(e)+oX-eX+'px'); } }
var oX=parseInt(d.style.left),oY=parseInt(d.style.top),eX=xy(e),eY=xy(e,1),tX,tY,stop;
document.onmousemove=drag;
document.onmouseup=function(){ stop=1; document.onmousemove=''; document.onmouseup=''; };

}

// HTML

<div style="position: relative; top: 0; left: 0" onmousedown="dragOBJ(this,event); return false;">test</div>

*/



// CLOSING ARGUMENTS

/*
//function cScope() {
//function obSubxx(ob) {var r = [];var i = 0;for (var z in ob) {if (ob.hasOwnProperty(z)) { try{ r[i++] = z;}catch(yy){}    }


//}return r;}
//return obSubxx(window);}

//window.globals=cScope();




function fs(p){
g=obMap(p).group(function(a,b,c){  
if(a[1].type=='object'){return (a[0].toString().tag("legend")+"^^  "+fs(a[1])).tag("fieldset") } 
return a[1].toString() }) .join("")
return g;}

//f=fs(posts)
//CB(f)


*/

/*	Dom2JsonML.js
	Created: 2007-02-15-2235
	Released under an open-source license:
	http://jsonml.org/License.htm*/

if("undefined"===typeof window.JsonML){window.JsonML={};}
JsonML.convertElement=function(elem){if(!elem){return null;}
var i;switch(elem.nodeType){case 1:var jml=[elem.tagName];var a=elem.attributes;var att={};var hasAttrib=false;for(i=0;i<a.length;i++){if(a[i].specified){if(a[i].name==="style"){att["style"]=elem.style.cssText?elem.style.cssText:a[i].value;}else if("string"===typeof a[i].value){att[a[i].name]=a[i].value;}
hasAttrib=true;}}
if(hasAttrib){jml.push(att);}
if(elem.hasChildNodes()){for(i=0;i<elem.childNodes.length;i++){var c=elem.childNodes[i];c=JsonML.convertElement(c);if(c){jml.push(c);}}}
return jml;case 3:return elem.nodeValue;default:return null;}};



Array.prototype.toNodes=function(filter){var am={rowspan:"rowSpan",colspan:"colSpan",cellpadding:"cellPadding",cellspacing:"cellSpacing",tabindex:"tabIndex",accesskey:"accessKey",hidefocus:"hideFocus",usemap:"useMap",maxlength:"maxLength",readonly:"readOnly",contenteditable:"contentEditable"};function aa(el,a){for(var an in a){if(!an||typeof(a[an])!=="string"){continue;}if(an.toLowerCase()==="style"){if("undefined"!==typeof el.style.cssText){el.style.cssText=a[an];}else{el.style=a[an];}}else if(an.toLowerCase()==="class"){el.className=a[an];}else if(am[an.toLowerCase()]){el.setAttribute(am[an.toLowerCase()],a[an]);}else{el.setAttribute(an,a[an]);}}}function ac(el,c){var ct,tb;if(c){if(el.tagName.toLowerCase()==="table"&&el.tBodies){ct=c.tagName?c.tagName.toLowerCase():null;if(ct&&ct!=="tbody"&&ct!=="thead"){tb=el.tBodies.length>0?el.tBodies[el.tBodies.length-1]:null;if(!tb){tb=document.createElement("tbody");el.appendChild(tb);}tb.appendChild(c);}}else{el.appendChild(c);}}}function p(jml){if(!jml){return null;}if(typeof(jml)==="string"){return document.createTextNode(jml);}if(!(jml instanceof Array)||jml.length<1||typeof(jml[0])!=="string"){throw new Error("toNodes");}var t=jml[0];var x=(t.toLowerCase()==="script");var el=x?null:document.createElement(t);for(var i=1;i<jml.length;i++){if(!x){if(jml[i]instanceof Array||typeof(jml[i])==="string"){ac(el,p(jml[i]));}else if(typeof(jml[i])==="object"){aa(el,jml[i]);}}}return(el&&"function"===typeof filter)?filter(el):el;}return p(this);};String.prototype.toNodes=function(filter){var jml;try{jml=this.parseJSON();}catch(ex){return null;}return(jml instanceof Array)?jml.toNodes(filter):null;};



function el2js(e){ return JsonML.convertElement(e)}




//these two are for comment transport
function splitup(t){  return t.toString().split(/\[CDATA\[/m)[1].toString().split(/\]\]\>/im)[0]}
function gC(ths,args){if(!! ths.i){	return ths.i.toString();}else{ return splitup(args.callee)};}


var bootuptime=( (new Date()).getTime()  - startuptime22 )





Array.prototype.popCombo=function t(elm){
e=elm.options
this.group('e[z]=new Option( a,a); ')
}







Array.prototype.toSource2=function(){ return this.join(",\n"); }
String.prototype.toSource2=function(){return this.toSource().slice(12,-2)}
Number.prototype.toSource2=function(){ return "("+this+")"}
Boolean.prototype.toSource2=function(){ return String(this) }
Date.prototype.toSource2=function(){ return 'new Date("'+ String(this) + '")' }

Object.prototype.toSource2=function(){ return this.toSource().replace(/new \w+\(/,"").slice(1,-2)  } //.innerHTML || (this.toJSONString ? this.toSource2() : this.toSource() ) }




Object.prototype.view=function () {
  	  var t = obMap(this).group(function (a) {
	    var tofu=typeOf( a[1] )
	if(a[1] && a[1].getTime){ tofu="date" }
	function RT(a){
	    return [a[0], ":\t {", obMap(a[1]).map(function(aa){ return aa[0]+" :\t"+aa[1].toSource2() }).join(",\n\t\t") ].join("   ")+"\t}"
	}
	
	switch(tofu){
		case "undefined": return undefined; 
		case "array":
		   	return [a[0], " : [",  a[1].join(",\n\t\t   "), "]" ].join(""); break
			case "function":
			return a[0]+ " : "+ a[1].toString() 
		case "function":
		   	//return [a[0], " : [",  a[1].join(",\n\t\t   "), "]" ].join(""); break
			return  a[0]+ " : "+ String(a[1])  ; break
		case "object":
		       if( instanceOf(a[1], window.Element)){return a[1].toSource2(); }
			 return RT(a)
		default:
		    	tuu= [a[0], " : ",  a[1].toSource2() ].join(" "); break
		}//end case
		
	return tuu
	}).join("\t,\n\t");
if(! this.isArray){
   return " {\t" + t + "\t}";
} else {
	return " [\t" + t + "\t]";
}//end if
}//end .view





/*
Object.prototype.view=function (withProtos, remark) {
    if (withProtos) {
        t = obMapx(this).group(function (a) {return [a[0], "	: ", a[1] ? a[1].toJSONString() : a[1]].join(" ");}).join(",\n");
    } else {
        t = obMap(this).group(function (a) {

tofu=typeof a[1]

if( tofu=="object"){
	if( tofu.isDate){ tofu="" }
}

if( tofu=="object"){

	if(a[1].push){
		tuu= [a[0], ":\t [", obMap(a[1]).map(function(aa){
			return aa[1].toSource2() }).join(",\n\t\t\t") ].join("   ")+"\t]"
	}else {
		tuu= [a[0], ":\t {", obMap(a[1]).map(function(aa){
			return aa[0]+" :\	"+aa[1].toSource2() }).join(",\n\t\t\t") ].join("   ")+"\t}"

	}//end if array or object

} else {

	tuu= [a[0], "	: ", a[1] ? a[1].toSource2() : a[1].toString() ].join("  ");

}

return tuu
}).join("\t,\n\n	");
    }
    return " {  " + (remark ? "//" + remark + "\n	" : "	") + t + "	 	}";
}
*/


Object.prototype.toFunction=function (remark) {
        t = obMap(this).group(function (a) {
		return ["t."+a[0], " = ", a[1].isDate ? a[1].toSource() : a[1].toJSONString()].join(" ");}).join(";\n	");
    return " (function(){" +(remark?("\n    \/\/"+remark+"\n\t"):"\t")+"t={};\n\t"  + t + ";\n   return t;\t\t}())" ;
}//end toFunction




Object.prototype.toURL=function () {
var u= undefined;
        t = obMap(this).group(function (a) { if(u==a){ return "" }
if(typeof a == 'function'){ if(!a.name){return "";}else {a=a.name;}}
return [ "&", escape(a[0]), "=", escape(String(a[1]))].join(""); }).join("") +" ";
return "?" + t.slice(1,-1)
}//end toUrl



Array.prototype.toFunction=function (remark) {
        t = obMap(this).group(function (a) {
		return ["t["+a[0].quoted()+"]", " = ", a[1].isDate ? a[1].toSource() : 	a[1].toJSONString() ].join(" ");}).join(";\n	");
    return " (function(){" +(remark?("\n    \/\/"+remark+"\n\t"):"\t")+"t={};\n\t"  + t + ";\n   return t;\t\t}())" ;
}//end toFunction




Object.prototype.pick=function (withProtos) {
if(withProtos.type=='object'){withProtos=withProtos.subs()}
if(withProtos.isString){withProtos=withProtos.split(/[;,|\t]{1}/g) }


	t = {};
   o=this;
    withProtos.group(function (a, b, c) {t[a] = o[a];});
    return t;
}












Object.prototype.Tee=function(dest){	//splits this, sends to dest and right-side
	T=this;
	  if(dest){	
		if(dest.match(/\=T;?$/g)){     eval( dest+";" );  }
		if(dest.match(/\=;?$/g)){     eval( dest+"T;" );  }
		if(!dest.match(/\=/g)){     eval( dest+"=T;"   );  }
	   }
    return  T;
}



function img2dataUrl(sr, blnDialog, blnHTM) {
osrc="";
talt=" none "

if(sr.src){ osrc=sr.src;talt=(sr.alt?sr.alt:talt)}
if(sr.length){osrc=sr;}

  var img2 = new Image();
  img2.src =osrc;

  var img = new Image();
  img.src =osrc;


cc=document.createElement("canvas") 
cc.height=img.height
cc.width=img.width
cc.getContext('2d').drawImage(img,0,0,img.width/2,(img.height *(img.height/img.width)));

i2=new Image(img.width, img.height )
i2.src= cc.toDataURL();
i2.alt=talt;
i2.setAttribute("lowsrc", osrc );

g=document.createElement("span")
g.appendChild(i2);
if(blnDialog){ dialog(g.innerHTML.escHT().tag("pre")+"<br \/>"+g.innerHTML) }
if(blnHTM){ return g.innerHTML; }
return cc.toDataURL();
  
}







function getAllCss() { 	
	buff="";
	for(zz=0; zz< document.styleSheets.length;zz++){
		 ss = document.styleSheets[zz];
		try{
			 if(!ss.disabled && (ss.media.mediaText !="print") ) {buff+= obValsl(ss.cssRules).vals()._("cssText").join("\n\n\n").replace(/\;/gim, ";\n   ").replace(/\{/gim, "{\n   "); }//end if
			
			ss.disabled=true;
			ss.text=""
		}catch(YY){}
		
	}//next stylesheet
	 ts=document.createElement("style");
ts.type= "text\/css"
	ts.innerHTML=buff;
	tags("head")[0].appendChild(ts);
return buff.tag("style" ,{type: "text\/css"})
}





function help(hstr, secs, tit, asTxt) {

var b="<span style=\"display: none;\" id=\"hlp2\">                  <div style=\"border: 3px outset activeborder; padding: 0px; background-color: aliceblue; color: rgb(128, 0, 0); z-index: 973; position: fixed; left: 100px; min-height: 23%; width: 50%; top: 10%;\" name=\"config\" id=\"config\" onmousedown=\"drag(this,event)\">        <div style=\"text-align: left; color: captiontext; background-color: activecaption; font-weight: bold;\" onmousedown=\"hide(\'cont\'); this.style.cursor=\'move\'; \" onmouseup=\"show(\'cont\');this.style.cursor=\'default\';\" id=\"stp\">&nbsp;      <a id=\"dialogclose1\" style=\"font-size: 37px; color: captiontext; cursor: pointer; font-weight: bold;\" title=\" Close \" onclick=\" \	clearTimeout(helptim);  hide(\'hlp2\') \" onmousemove=\"document.onmousemove =\'\'; \">X <\/a>&nbsp;&nbsp;&nbsp;                    <b style=\"font-size: 30px;\" id=\"helpTitle\">**TITLE**<\/b> <br><br><\/div>\	<div style=\"\" id=\"cont\" name=\"cont\" onmousemove=\"document.onmousemove =\'\'; \"><\/div>    <\/div><br><br><\/span> "

if(!el('hlp2')){  document.body.appendChild(b.HT());  aCSS("#dialogclose1:hover  {color: Red; font-weight: bold; background-color: rgb(96, 96, 96); }");}




    if (window.helptim) {
        clearTimeout(helptim);
    }
    var usecs = 7500;
    if (secs) {
        usecs = secs * 1000;
    }
    if (!tit) {
        tit = "help";
    }
    if (asTxt) {
        hstr = "<textarea rows='16' cols='110'>" + hstr + "</textarea>";
    }
    el("helpTitle").innerHTML = tit;
    el("cont").innerHTML = hstr;
    helptim = setTimeout("showme('hlp2')", usecs);
    show("hlp2");
return hstr;
}






function toInp(e,t){var v="";
var parts=["<input type='","text","' class='"+typeof e+"' onchange='"+t+"=this.value' value='"+e+ " '","", " \/>"]
 switch (typeof e){
case "string" : 
b=parts; b[3]=" size=\"22\" title=\""+define(e)+"\" style=\"border:2px solid yellow\" "
if(define(e)=="color"){b=[colorDrop(t+"=(this.options[this.selectedIndex].style.backgroundColor)"),""]}
if(define(e)=="percentage"){b=[hscroll(t+"=")]}

break;
case "number" : b=parts; b[3]=" size=\"4\" style=\"border:2px solid green\" "; break;
case "boolean" : b=parts;b[1]="checkbox"; b[2]=b[2].replace("onchange='", "onchange='this.value=this.checked; ");  b[3]=((e)?" 'checked' ":""); break;
}//end eswitch
return b.join("")
}//end function to Inp




function varinfo(hb, tit){ var c=[]; var h=eval(hb);
//todo: run each through define,  datepicker for dates, slider for percents, font combo for fonts
 for (var z in h){
try{ if ( 'functionundefinedobject'.indexOf(typeof h[z])==-1 ) {
c[c.length]=tit+"."+z+"="+toInp(h[z], tit+"."+z)}
}catch(ee){
void(0)              }//end catch
}//end if
return "<FIELDSET><LEGEND>"+tit+"</LEGEND><UL><li> "+ c.sort().join("\t<\/li><br><li>")+" <\/li><\/UL></FIELDSET> ";}//endf varinfo


function primaryDrop(){

sc="#ff0000,#cc00af,#ad00ee,#7308a5,#0000ff,#00aeae,#007000,#00ff00,#ffff00,#feb300,#ff7f00,#ff2600".split(/\,/g)
return sc.group(function(a){return a.tag("option", {style:"background-Color:"+a}) }).join("\n").tag("select",{size: 1})
}





imgClass={

resize:  function (img,w,h) {
 var     canvas = document.createElement('CANVAS');
      canvas.setAttribute('width',w);
      canvas.setAttribute('height',h);
var      ctx = canvas.getContext('2d');
      ctx.drawImage(img,0,0,w,h);
  return canvas.toDataURL()
},

setOpacity: function (img, intPercent) {
//if(parseInt(intPercent)>1){ intPercent=parseInt(intPercent/100); }
var      canvas = document.createElement('CANVAS');
      canvas.setAttribute('width',img.width);
      canvas.setAttribute('height',img.height);
   var   ctx = canvas.getContext('2d');  
      ctx.globalAlpha = intPercent;
      ctx.drawImage(img,0,0, img.width, img.height);
  return canvas.toDataURL()
},

crop: function (img,dx, dy, dWidth, dHeight) {
    var canvas = document.createElement("CANVAS");
    canvas.setAttribute("width", dWidth);
    canvas.setAttribute("height", dHeight);
    document.body.appendChild(canvas);
    var ctx = canvas.getContext("2d");
    ctx.drawImage(img, dx, dy , dWidth, dHeight, 0,0 , dWidth, dHeight);
    return canvas.toDataURL();
},

rotate: function (img,deg) {


function d2g(g){
var r=( g / 360)
return Math.PI*(2*r)
}

    var canvas = document.createElement("CANVAS");
      canvas.setAttribute('width',img.width);
      canvas.setAttribute('height',img.height);
	var      ctx = canvas.getContext('2d');
	ctx.rotate(d2g(deg)) 
      ctx.drawImage(img,0,0,w,h);
    return canvas.toDataURL();
}












}//end img class



Array.prototype.cb=function(t){
if(t || !t ){
	CB(this.join(""));
return this;
}
}//end ray.cb


String.prototype.cb=function(t){
if(t || !t ){
	CB(String(this));
return String(this);
}
}//end ray.cb


Object.prototype.call2=function(function2PassThisTo){
	if(!function2PassThisTo){ return this ; }
   return (window[function2PassThisTo](this));

}//end ray.cb




function vbTimer(intInterval, fnCode){
var t=({}).Ob();
if(!intInterval){intInterval=30000;}
t.lastfire=now().getTime()
privateTimer=parseInt(intInterval);
t.timeOut=0;
t.enabled=true;
t.count=0;
//t.timerEvent=function(){}
t.initTime=now().getTime();
t.userFun=fnCode;
t.__defineGetter__("interval", function() { if( ! t.enabled){return 0;}
		return (privateTimer- (now().getTime() - t.lastfire)) });
t.__defineSetter__("interval", function(intMilliseconds) { privateTimer=intMilliseconds; });

t.timerEvent=function(a,b,c){
	t.count++;
	t.lastfire=now().getTime();
	clearTimeout(t.timeOut);
if(t.enabled){ t.timeOut=setTimeout(arguments.callee, privateTimer); }
//t.interval=
 F$(fnCode)(a,b,c);
}

t.timeOut=setTimeout(t.timerEvent, privateTimer);
t.watch("enabled", function(p,o,n){
		if(n){ t.timeOut=setTimeout(t.timerEvent, privateTimer);  return n;  }  else {
		clearTimeout(t.timeOut); return n;
	}//end if
	  })//end watch 
return t;
}//s2=new vbTimer(8000, "document.title=now().toString()")


//handy protos




        if (!Object.prototype.toJSONString) {
            Array.prototype.toJSONString = function () {var a = [], i, l = this.length, v;for (i = 0; i < l; i += 1) {v = this[i];switch (typeof v) {case "object":if (v) {if (typeof v.toJSONString === "function") {a.push(v.toJSONString());}} else {a.push("null");}break;case "string":case "number":case "boolean":a.push(v.toJSONString());default:;}}return "[" + a.join(",") + "]";};
            Boolean.prototype.toJSONString = function () {return String(this);};
            Date.prototype.toJSONString = function () {
function f(n) {return n < 10 ? "0" + n : n;}
return "\"" + this.getFullYear() + "-" + f(this.getMonth() + 1) + "-" + f(this.getDate()) + "T" + f(this.getHours()) + ":" + f(this.getMinutes()) + ":" + f(this.getSeconds()) + "\"";};
            Number.prototype.toJSONString = function () {return isFinite(this) ? String(this) : "null";};
            Object.prototype.toJSONString = function () {var a = [], k, v;for (k in this) {if (this.hasOwnProperty(k)) {v = this[k];switch (typeof v) {case "object":if (v) {if (typeof v.toJSONString === "function") {a.push(k.toJSONString() + ":" + v.toJSONString());}} else {a.push(k.toJSONString() + ":null");}break;case "string":case "number":case "boolean":a.push(k.toJSONString() + ":" + v.toJSONString());default:;}}}return "{" + a.join(",") + "}";};
            (function (s) {var m = {'\b':"\\b", '	':"\\t", '\n':"\\n", '\f':"\\f", '\r':"\\r", '"':"\\\"", '\\':"\\\\"};s.parseJSON = function (filter) {var j;
function walk(k, v) {var i;if (v && typeof v === "object") {for (i in v) {if (v.hasOwnProperty(i)) {v[i] = walk(i, v[i]);}}}return filter(k, v);}
if (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]+$/.test(this.replace(/\\./g, "@").replace(/"[^"\\\n\r]*"/g, ""))) {j = eval("(" + this + ")");if (typeof filter === "function") {j = walk("", j);}return j;}throw new SyntaxError("parseJSON");};s.toJSONString = function () {if (/["\\\x00-\x1f]/.test(this)) {return "\"" + this.replace(/([\x00-\x1f\\"])/g, function (a, b) {var c = m[b];if (c) {return c;}c = b.charCodeAt();return "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16);}) + "\"";}return "\"" + this + "\"";};})(String.prototype);
        }
		




Object.prototype.S$=function(L){
that=this;
switch ( that.type ){



case "string": return that; break;

case "function": 
	//if (!!that.hasOwnProperty(z)) { return that.toString(); }; 
	return that.toString();
	break;


case "array": return that.group(F$("a.S$")).join("\n"); break;

case "number": return String(that); break;

case "date": return that.toLoacaleString(); break;

case "xml": return (L=='xml'?that.toXMLString():String(that.toString())); break;

case "boolean": return String(that); break;

case "regexp": return that.toSource(); break;

case object: 

/*
if( instanceOf ( that, Element )){ 
  return that.nodeName
//+"\t"+(that.id||that.className||that.name||that.style||that.href||that.title)+(that.innerHTML || that.value || that.nodeValue)
  }

*/

return that.view();


///var  buf= that.map().join("\n");if(buf.length>3){return buf;}; return that.toSource();	


break;

default:

return that.toSource()

}//end switch

} //end S$


//http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Property_Inheritance_Revisited:Determining_Instance_Relationships
function instanceOf(object, constructor) {
if(! object.__proto__){return 'mozilla only'; }
   while (object != null) {
      if (object == constructor.prototype)
         return true;
      object = object.__proto__;
   }
   return false;
}

















function davsort(ray, key, descend){
	var outR=[];
	
	if(key=='size'){outR= ray.sort(function(a,b){  return a.size - b.size });  }
	
	if(key=='name'){outR= ray.sort(function(a,b){ 
	
		if(a.name == b.name){	return 0;}
		 return ( a.name.toLowerCase() > b.name.toLowerCase()) ? 1:-1
		});  }
	
	if(key=='date'){outR= ray.sort(function(a,b){  return b.date.getTime() - a.date.getTime()});  }
	
	if(descend){ return outR.reverse() }
return outR;
}//end sort dav


var parm=""



function Path(){
	var tob={href: window.location.href.toString() }
	tob.domain=document.domain;
	var lr=tob.href.toString().split(/[\/\\]/g)
	var tqs=window.location.search
	tob.qs=(tqs?tqs:"");
	tob.file=lr.last();
	tob.path=lr.slice(0,-1).join("\/")+"\/";
	tob.witness=(tob.path+tob.file ).witness();
	tob.mod=parseDate( document.lastModified)
	tob.char=document.characterSet;
	tob.ext=tob.file.match(/(?:\.)[\d\w]{0,4}/)[0]
    return tob;
}//end Path - info object




Object.prototype.vbType= function (typeName) {var jsOb = [Date, String, Array, Object, RegExp, Boolean, Number, Error];
function obMap(ob){ var r=[]; var i=0; for(var z in ob){if(ob.hasOwnProperty(z))r[i++]=[z,ob[z]]};return r};
function getVB(v) {var bType = typeof v;var vbTypes = {number:"Double", 'function':"", object:""};if (parseInt(v) === v) {return "Long";}if ("undefined string date number boolean ".indexOf(bType)) {if (vbTypes[bType]) {var j = vbTypes[bType];return j[0].toUpperCase() + j.substr(1);}if (v.getTime) {return "Date";}if (bType === "object") {return "Variant";}}return bType[0].toUpperCase() + bType.substr(1);}
t = obMap(this).map(function (a) {tofu = typeof a[1];if (a[0] == "prototype") {return "";}if (tofu == "function") {return "";}if (tofu == "object") {if (a[1].getTime) {tofu = "Date";}if (a[1].pop) {return [a[0] + "( " + (a[1].length + 1) + " ) ", "as", "Variant"].join("  ");}}if (tofu == "object") {tuu = [a[0], "as", "Variant"].join("  ");} else {tuu = [a[0], "as", getVB(a[1])].join("  ");}return tuu;}).sort().join("\n	").replace(/\n\t\n\t/gm, "");var tpName = typeName || String(this.type);var hd = "\nPublic Type " + tpName + "\n	";var buf = hd + t + "\nEnd Type	'" + tpName + "\n";return buf || new Error(buf);}




//    8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888



//synAj.S$().cb()

function newajs() {
    var ox = null;  
        ox = new JSHttpRequest();
    return ox;
}

function synAjs(turl, op, VAR2, mimeT) {
    var XHRt = newajs();
 XHRt.open(turl,op, false);
        XHRt.onreadystatechange=VAR2;
    XHRt.send(VAR2);      
}



function jsXget(turl, callback) {
    return synAjs(turl, "GET", callback);
}


function jsXput(turl, callback) {
    return synAjs(turl, "PUT", callback);
}




function qualifyPath(paf){
   var i = new Image();
   i.src=paf;
return i.src;
}//end qualifypath






function domainOK(paf){
	var tlc=window.location;
	var myDomain = tlc.hostname || tlc.host;
	var paf3= qualifyPath( paf );
	var pafDomain = paf3.split(/^https?\:\/\//)[1].split(/\//)[0];
return myDomain == pafDomain;
}



function pickIncludeElement(){




}


function getFeed(feed, callback) {
 var src = "http://pipes.yahoo.com/pipes/9oyONQzA2xGOkM4FqGIyXQ/run?&_render=json&_callback="+callback+"&feed="+feed;
if(feed.match && feed.match(/pipes\.yahoo\.com/)){ src= feed + "?_render=json&_callback="+callback; }

   JSget(src);
}

function sQS(s) {var allem = [];
var RxUrl = new RegExp(/^[^\?]+\??/);
var RxQsSplit = new RegExp(/[;&]/);
var RxValRep = new RegExp(/\+/g);
var Params = {};
if(!s){s=window.location.toString();}
//if(!s){s=String(Request.queryString());}
var cItem = s;var queryURL = cItem.replace(RxUrl, "");
var Pairs = queryURL.split(RxQsSplit);
var mx = Pairs.length;
for (var i = 0; i < mx; i++) {
var KeyVal = Pairs[i].split("=");
if (!KeyVal || KeyVal.length != 2) {continue;}
var key = unescape(KeyVal[0]);
var val = unescape(KeyVal[1]);
val = val.replace(RxValRep, " ");
try {Params[key] = eval(val);} catch (ee) {Params[key] = val;}}
var filecache = cItem;
var srcInfo = {file:filecache, bootTime:new Date, urlSearch:queryURL, args:Params};
return srcInfo;}


function JSget(turl) {
//if(! el("xJs")){ 
var xJs= document.createElement("script");
    xJs.type = "text/javascript";
//    xJs.id="xJs";
    var h= tags("head");
    if(h && h[0]){ h[0].appendChild(xJs);}
//}//end if first request
    xJs.src = turl;
    return xJs;
}


function cssGet(turl) {
if(! el("xCSS")){ 
var xCSS= document.createElement("style");
    xCSS.type = "text/css";
    xCSS.id="xCSS";
    var h= tags("head");
    if( h && h[0]){ h[0].appendChild(xCSS);}
}//end if first request
    xCSS.src = turl;  
    return xCSS;
}


xhrState="XML_READY_STATE_UNINITIALIZED,XML_READY_STATE_LOADING,XML_READY_STATE_LOADED,XML_READY_STATE_INTERACTIVE,XML_READY_STATE_COMPLETED".split(",")





function Include(u, dest){
	if( dest && dest.nodeName){
		var ndNam=dest.nodeName.toUpperCase();
		switch(ndNam){
		    case 'TEXTAREA': aGet(u, function(a){ dest.value=a;}); break;
		    case 'INPUT': aGet(u, function(a){ dest.value=a;}); break;
		    case 'IFRAME': aGet(u, function(a){ dest.src=dataUrl(a, "text\/html");}); break;
		    default:  aGet(u, function(a){ dest.innerHTML=a;}) ; break;
		}//end switch
	   return;
	}//end if html target 
	if(u.match(/[\w]+\.js/gi)){ JSget(u); return; }
	if(u.match(/[\w]+\.css/gi)){ aCSS(IO(u)); return; } //go ahead and SYNCH get any stylesheets, for mistypes in ff safety....
   return;	
}//end Include





function followDots(dots){//returns an array of the path (dots): followDots[0]=global, followDots.length=# of dots in path expression; an object path
   var d=dots.split(/\./g).group(function(a,b,c){ 
        var leftSide=b.slice(0,c);
        if(leftSide || 5 ){
               return (c? (leftSide.join(".") + "." + a   ) : leftSide + a) ;
         }//end if left side
     })//end group
var p = d.group(" return eval(a) ")
   return p;
}//end follow dots


function followDots2(dots){
  return eval(dots);
}//end follow dots

Function.prototype.asText = function(){
  var that3 = arguments.caller || arguments.callee.caller || this || window ;
    return that3.toSource().slice(14, -2)   
}






function Group (uF, L ) {  // built 12-18-07
var that=this;  //lambda -::"/p/u/g" protos/undefineds/globalScope?
  	that._scope = arguments.caller || arguments.callee.caller || this ;

var argType = uF.constructor;
var u = "undefined";

if (argType == Array && typeof L == 'function') {  that=[].concat(argType); argType=L; }

    if (argType == RegExp) {
        var z7g = uF;
        uF= function (tempRegString334) {var vA6 = tempRegString334.toString().match(z7g); if(vA6) return (vA6.length ? vA6:vA6[0] ) || undefined;};
     if(L) uF= function (tempRegString334) {var vA6 = String(tempRegString334).match(z7g); if(vA6) return tempRegString334  || undefined;};
    }

    if (argType == String) {
        uF= F$(uF, L );
    }


    var _09 = [];
    var u="undefined";
    _09.mx = that.length;
    _09.goods=-1;
if( typeof L !== u){ //thow away all undefineds
  
    for (_09.z = 0; _09.z < _09.mx; _09.z++) {
        var ii=that[_09.z];
        if ( ii || typeof ii !== u) {
            var itemRespose = uF.apply( ii, [ ii, that, _09.z ] );
            if( itemRespose || typeof itemRespose !== u ){ _09[_09.goods++]=itemRespose; }
        }
    }

 } else { //include undefineds slots?  yes below

 for (_09.z = 0; _09.z < _09.mx; _09.z++) {
        var ii=that[_09.z];
        if (typeof ii !== u) {
            var itemRespose = uF.apply( ii, [ ii, that, _09.z ] );
            if( itemRespose || typeof itemRespose !== u ){ _09[_09.length]=itemRespose; }
        }
    }

}//end if including undefined slots
  
    return _09;
}



Function.prototype.getProps=function(aa){ //gets native prototypes 
	var buff=  that.prototype.mapx().map(F$("  return  (typeof c[a[0]] =='undefined') ? a[0] : undefined ;")).valids()
   return buff;
}




function F$(s, lamb) {  //makes anon functions from strings. use lamb to change the name of arguments.   lstUp: 12-18-07
    tmpA9 = ["a", "b", "c"];
    var returnPattern= ( /\Wreturn\W/ );
    var outFun = "";
    var A = arguments;
    var u = "undefined";
    var argType = typeof s;
    if (argType == "function") {
        s._from = A.callee.caller || this || window;
        s._scope = arguments.callee;
        return s;
    }
    if (lamb) {
        var vi = "over-ride the argument names";
        var lambType = lamb.constructor;
        if (lambType === Array) {
            tmpA9 = lamb;
        }
        if (lambType === String) {
            tmpA9 = lamb.match(/[\w$_]+/g);
        }
    }

    if (s.match && s.match(returnPattern)) { //shorthand function strings
        outFun = new Function(tmpA9[0], tmpA9[1], tmpA9[2], s );
    } else { //handle snipps
    var codeOk = "";
    var badCode = false;
    try {
        codeOk = eval(s);
    } catch (yy) {
        codeOk = "";
    }
    if (typeof codeOk === u) {
        codeOk = "";
        badCode = true;
    }
        if (badCode) {
            outFun = new Function(tmpA9[0], tmpA9[1], tmpA9[2], "try{ var SNIP= " + s + ";\n\n	return SNIP;\n	}catch(_y45y){return _y45y;} ");
        } else {
            outFun = new Function(tmpA9[0], tmpA9[1], tmpA9[2], " return " + s + "; ");
        }
    }//end if return included...

  //  outFun._scope = arguments.callee;
  //  outFun._from = A.caller || A.callee.caller || this || window;

    return outFun;
};


 function trace(){   
    var that = arguments.caller || arguments.callee.caller || this || window ;
  return that
} //end me2

function F$2(s, lamb) {  //makes anon functions from strings.  short version.   lstUp: 12-18-07
    var tmpA9 = ["a", "b", "c"];
    var outFun = "";
    var A = arguments;
    var u = "undefined";
      if (lamb) {     if (lamb.constructor === Array) { tmpA9 = lamb; }  else {  tmpA9=A; }  }
    if (s.match && s.match(/\W?return[ (;]/)) { //shorthand function strings
        outFun = new Function(tmpA9[0], tmpA9[1], tmpA9[2], s );
    } else { //handle snipps
        outFun = new Function(tmpA9[0], tmpA9[1], tmpA9[2], " return " + s + "; ");
    }//end if return included...
//    outFun._from = A.callee;
 //   outFun._scope = A.caller || A.callee.caller || this || A.callee || window;
    return outFun;
};








//try{ var w=window.broken.fakeprop; } catch(yy){ alert(yy.toSource()) } 


/*

Object.prototype.me=function(a){   
    var that = arguments.caller || arguments.callee.caller || window ;
  return this.call(that, a?(a.pop?a:[a]):null );
} //end me




Object.prototype.boss=function(a){   
    var that = arguments.caller || arguments.callee.caller || this || window ;
  return that
} //end me2



*/


function cleanHTML( ht ){ var cach=newDoc(ht); return cach.firstChild.text; }  


Function.prototype.asText = function(){
  var that3 = arguments.caller || arguments.callee.caller || this || window ;
    return that3.toSource2()//.slice(14, -2)   
}


String.prototype.asText = function(){
    return this.toSource2()//.slice(12, -2) ;
}





//var w=[dateStr(), dateStr(1107953814993), dateStr(1981,5,5,5) ]


/*

*/

function Email(msgTo , Subject , Message ) {
      var temp = "mailto:" + msgTo + "?subject=" + Message + "&body=" + Message
 return temp;
}






Array.prototype.packCode=function(comp){
var o="";
var that=this;

if(comp){
	o=that.group("a.toSource()").join(";\n\t") ;
  }else {
	o=that.group("a.toString()").join(";\n\t") ;
 }//end if
  return o
}


var cfg={ url: ".",  
  destination: "auto",
       format: "auto", 
       status: "uninitialized",
         done: "false",
      onError:  function(){cfg.status='fail';},
       serial: serial(8) }




function Ranges2(item){
var A=arguments;
//if(this.prototype){that=this;}else{

var Othat = A.caller || A.callee.caller || this
var that = new F$2(" return (Othat.prototype ? Othat : this );",Othat)()()._scope

//}

var aType = item.constructor;


if (aType == Array){
 var rngItems=[].concat(A[0]);
     rngItems.current=0;
that.add=function(items){ return rngItems.concat(items); }
that.remove=function(item){ delete rngItems[item]; return 0; }
that.list=function(){ return rngItems; }
that.toString=function(){ return that.list() }
that.type="Ranges2";
    return that.rngItems;

}

return that.rngItems;
}
 



//https://netfiles.uiuc.edu/dldavis2/pub/jmod.js
//editing: jmod.js

function dlU(u, targ){


CB(u);
var cblen= CB().length;
callback=function(a){ if(a) targ(a);}

// targ.apply(dlU,[tcb]); 

function chkCB(){ 
	var tcb=CB(); 
	if(tcb.length != cblen|| dlU.cnt++ > 100 ){ dlU.cnt=0; 
	} else { 	setTimeout(chkCB, 333 )}
		}//end chkcb
		chkCB.cnt=0;
		chkCB.old=cblen;	
		el("iframe1").src=dataUrl("b475'$^#FE%R$C", "x-application/fetch"  )
chkCB()
}
//y.value=dlU("http://www.google.com/search?json+feeds", function(a){ el("text2").value=a} )



//rss chann:[ "language", "copyright", "managingEditor", "webMaster", "pubDate", "lastBuildDate", "category", "generator", "docs", "cloud", "ttl", "image", "rating", "textInput", "skipHours", "skipDays"]

//rss item["title", "link", "description     ", "author", "category", "comments", "enclosure", "guid", "pubDate", "source"]






Array.prototype.toOptions = function(selElm){

if(!selElm){

return this.map(function(a8){  return (new Option(a8[0], a8[1])  ); }); 


}

if(selElm.isString){selElm=el(selElm); }
selElm.options.length=0;
this.map(function(a8,b){ selElm.options[b]=new Option(String(a8)); }); 
}





function rotate(elm){
var b=[9676,9680,9679,9681];
if(elm.length){elm=el(elm);}
elm.innerHTML= "dan &#"+b[(  rotate.i++ % 4 )]+";"
rotate.to=setTimeout(function(){rotate(elm)}, 333)
}rotate.i=0; rotate.to="";



String.prototype.off=function(n){
	
	var r= n ? this : btoa(this)
	var o=[];
	var mx=r.length;
	var sc=String.fromCharCode;
	var tos= n || 33333;
	for(var i=0; i< mx;i++){    o[i]=sc(r.charCodeAt(i) + tos ) }
//   return  n ?  atob(o.join(""))  : o.join("")

   return  n ?  o.join("")  : o.join("")
}


















function launchObjectViewer(){
	var g= oldScripts.map(function(a){return a.src}).filter(function(a){return ! a.match("pub") }).map(function(a,b,c){return "&F"+b+ "="+escape(a)}).join(""); 
	window.open("http://192.168.0.111/pub/globals.htm?"+g);
}

//launchObjectViewer()




Function.prototype.delayUntil = function delayUntil (exp) {
    that = this;
    args = Array.prototype.slice.apply(arguments, [1]);
    if(eval(exp)){ that.apply(this, args); 
    } else {
    setTimeout(function(){ that.delayUntil(exp);}, 100);
    }//end if ready
}




function Object2(k,v){var _345 = {}; _345[k]=v; return _345; }

Object.prototype.copyOf = function () { return eval(this.toSource()) }

Object.prototype.pop=function (key) {if(!key){return new Error("key is undefined");} 
	var buff= this[key]; delete this[key]; return buff;}

Object.prototype.push=function (key,val) {if(!key){return new Error("key is undefined");} 
this[key]=val; return obLen(this)||1 }


function getWindowState() {var S = window.screenLeft;if (typeof S === "undefined") {S = window.screenX;}S = parseInt(S);if (S < -4000) {return "minimized";}if (S > -8 && S < 1) {return "maximized";}return "restored:  " + S;}



if(Image.prototype){

Image.prototype.area=function(){
return this.height * this.width
}
}


Object.prototype.toTr=function(){
	return this.vals().toTr();
}

Object.prototype.toTable=function(){
	var b=[this.vals()[0].subs()].concat(this.vals());
	return b.toTable();
}

/*

(function (){
var injs= tags("script").filter(function(a){return a.src && a.src.indexOf("jmod.js")>0 })[0]

if(injs){ try{ eval(injs); } catch (tt){}

}())


*/


function evalMe(str){
if(!evalMe.last){ evalMe.last = ""; }
if(!str){str= prompt("Enter some code below\n\n", evalMe.last)}
if(str){evalMe.last = str; 
	var val = String(eval(str));
	var resp =prompt("Code:\n"+str+"\n========\nEvaled to:\n"+val, str);
	if(resp){return evalMe(resp); }
}
}//end evalMe


String.prototype.delayUntil =function( condition) {
that = F$(this); 
args = Array.prototype.slice.apply(arguments, [1]);
if (eval(condition)) {
		that.apply(this, args);
	} else {
		setTimeout( function () { that.delayUntil(condition);}, 100);}
}//end delyuntil

String.prototype.delayUntil =function( condition) {
that = F$(this); 
args = Array.prototype.slice.apply(arguments, [1]);
if (eval(condition)) {
		that.apply(this, args);
	} else {
		setTimeout( function () { that.delayUntil(condition);}, 100);}
}//end delyuntil


function form2ob(frm){
   var tob={};
   var fe = frm.elements;
   var mx = fe.length;
   for(var i = 0; i< mx; i++){
       tob[fe[i].name || fe[i].id || " " ] = escape(fe[i].value);
   }
   return tob;
 }



Array.prototype.flatten=function(){
var r= this;
var o=[];
function flt(a){ 
   if(a.isArray){  
            a.map(function(aa){o.push(aa); })
        }else {  o.push(a); }
}
r.map(flt);

return o;
}


function upgradeOnEnters(){
	var t = tags("input").filter(function(a){ return a.getAttribute("onenter");});
t.map(function(a){

	a.onkeyup = function (e) { 
				if(!e){ e = window.event; }
					//document.title=e.keyCode
				if (e.keyCode==13 ){  eval( a.getAttribute("onenter") ); return true;  } 
			 }

})

}


function jss2css(jss){//converts a style property from camelcase to css dash case
var b  =document.createElement("b");
b.style[jss.split(/\W/)[0]] = "inherit";
return b.style.cssText.split(/:/)[0]
}


function grep(sKeys, scopeV){ //finds keys
  if(!scopeV){ scopeV = this; }
return obSub(scopeV).find(sKeys)
}

function grepTag(tagName , condition){
    var c = condition || "";
    var tg = tagName || "*";
    var t = tags(tg);
    tf = function (a){  return eval(c) }
    return t.filter(tf);
}

function isGlobal(that){	 //determines if function is called from  (call|apply|prototype), or global context
//use in functions like:  isGlobal(this)
if(!window.isGlobal.tid){
    window.isGlobal.tid=(new Date()).getTime() +"globalVariable";
    window[window.isGlobal.tid]=1;
}//end if prexisting global
    return !! that[window.isGlobal.tid]
}
 
Object.prototype.toTr=function(){
return this.vals().toTr();
}

Object.prototype.toTable=function(){
var b=[this.vals()[0].subs()].concat(this.vals());
return b.toTable();
}

String.prototype.eval=function(s){ //a lambda like overloading for string evaluations, allows for virtual protos
if(s){      
    if(s[0]=='.'){ return  eval('this'+s) ;}
    if(typeof window[s] == 'function' ){ return  eval( s +this.toSource() ) ;}
    return eval(s);
}else {
 return window[this] || eval(this) ;
}//end if s
}

    function comatize(n) {
        var t = String(n).split("");
        if (n > 999999) {
            return t.slice(0, t.length - 6).join("") + "," + t.slice(-6, -3).join("") + "," + t.slice(-3).join("");
        }
        if (n > 999) {
            return t.slice(0, t.length - 3).join("") + "," + t.slice(-3).join("");
        }
        return n;
    }







 //	</script> </pre></body></html>