function getEmailLink(){
var _1="mailto:?subject=check out my calculation&body=Hi, I found this website and thought you might like it http://www.geocities.com/wowhtml/";
return _1;
}
function editDescription(){
hideItem("readdescription");
showItem("editdescription");
loadDescription();
}
function cancelDescription(){
showItem("readdescription");
hideItem("editdescription");
}
function updateDescription(){
setDescription(document.getElementById("descriptiontextarea").value);
showItem("readdescription");
hideItem("editdescription");
}
function getDescription(){
return InstaCalc.description;
}
function setDescription(_2){
var x=document.getElementById("descriptiontext");
InstaCalc.description=_2;
x.innerHTML=txt2html(InstaCalc.description);
}
function html2txt(_4){
_4=_4.replace(/<a href="(https?:\S*)"[^>]*>([^<]*)<\/a>/ig,"[$2]($1)");
_4=unescapeHTML(_4);
return _4;
}
function txt2html(_5){
_5=escapeHTML(_5);
_5=_5.replace(/\[([^\]]*)\]\s*[(](https?:\S*)[)]/ig,"<a href=\"$2\" target=\"_blank\">$1</a>");
return _5;
}
function escapeHTML(_6){
return _6.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g," <br/> ");
}
function unescapeHTML(_7){
return _7.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/\s?<br[\/]?>\s?/ig,"\n");
}
function loadDescription(){
var x=document.getElementById("descriptiontext");
var y=document.getElementById("descriptiontextarea");
y.value=html2txt(x.innerHTML);
InstaCalc.description=html2txt(x.innerHTML);
}
function createDeliciousLink(){
var _a="&tags=instacalc";
var _b="&title=InstaCalc:%20";
var _c="&noui&jump=close&v=4";
createURL();
var _d="http://del.icio.us/jshell.com?url="+InstaCalc.absolutepermalink.replace(/&/g,"%26")+_b+_a+_c;
return _d;
}
function createEmbedURL(){
createURL();
return InstaCalc.embedlink;
}
function updateToDataLinks(){
var i;
for(i=0;i<document.links.length;i++){
var _f=document.links[i];
if(_f.href.match(/.*v=.[.].$/)){
_f.href="javascript:loadDataFromURL(\""+_f.href+"\")";
}
}
}
function fixURL(str){
if(str.match(/v=0.6/g)){
}
}
function setupPage(){
setStatus("Ready to go! Just type a calculation.");
hideItem("editdescription");
if(InstaCalc.description==""){
setDescription("");
InstaCalc.description="";
hideItem("readdescription");
showItem("editdescription");
}else{
setDescription(InstaCalc.description);
showItem("description");
}
selectFirstRow();
recalculate();
}
function loadChartLibraries(){
if(!chartsLoaded()){
var i;
$import("javascripts/mochikit/MochiKit.js");
$import("javascripts/plotkit/excanvas.js");
$import("javascripts/plotkit/PlotKit_Packed.js");
}
}
function chartsLoaded(){
if(typeof (EasyPlot)=="function"&&typeof (MochiKit)!="undefined"){
return true;
}else{
return false;
}
}
function loadChartCallback(fn){
I.chartCallback=fn;
self.clearTimeout(I.libTimeout);
if(chartsLoaded()){
setStatus("libraries loaded:"+new Date().toString());
if(typeof (I.chartCallback)=="function"){
I.chartCallback();
}
return true;
}else{
I.libTimeout=self.setTimeout("loadChartCallback(I.chartCallback)",600);
setStatus("callback:"+new Date().toString());
return false;
}
}
function populateCommands(){
var d=$("command-dropdown");
var _14=d.options[d.selectedIndex].value;
hideAllItems(commandDivs);
showItem(_14);
}
function append(str){
var i=getSelectedRow();
var _17=getInput(i);
_17.value+=str;
recalculate();
selectRow(i);
}
function prepend(str){
var i=getSelectedRow();
var _1a=getInput(i);
_1a.value=str+_1a.value;
recalculate();
selectRow(i);
}
function addText(str){
if(isVisible("cellrows")){
insertAtCursor(getInput(getSelectedRow()),str);
recalculate();
return;
var i=getSelectedRow();
var _1d=getInput(i);
var _1e=caret(_1d);
var tmp=_1d.value;
var _20=tmp.slice(0,_1e);
var end=tmp.slice(_1e);
_1d.value=_20+str+end;
recalculate();
}
if(isVisible("inputtextarea")){
insertAtCursor($("inputtextarea"),str);
updateScratchpad();
return;
var _1d=$("inputtextarea");
var tmp=_1d.value;
var _1e=caret(_1d);
var _20=tmp.slice(0,_1e);
var end=tmp.slice(_1e);
_1d.value=_20+str+end;
updateScratchpad();
}
}
function updateScratchpad(){
for(var i=0;i<I.cells;i++){
getInput(i).value="";
}
loadCellsFromStringNewline($("inputtextarea").value);
$("textoutput").innerHTML="";
recalculate();
loadOutput();
}
function loadScratchpad(str){
$("inputtextarea").value=str;
}
function addScratchpadRows(n){
var _25=$("inputtextarea").value;
}
scratchpadTimeout=null;
scratchpadRefresh=100;
function updateScratchpad2(){
self.clearTimeout(scratchpadTimeout);
var _26=$("inputtextarea").value.split("\n");
var _27=_26.length;
if(_27>I.maxCells){
var _28=$("inputtextarea").value;
var _29=_26.slice(0,I.maxCells).join("\n");
$("inputtextarea").value=_29;
setStatus("Whoa there, that's a lot of cells. Try making a new page.");
}else{
if(_27>I.cells){
var _2a=(I.maxCells-_27>10)?10:I.maxCells-_27;
createScratchpad(_27+_2a);
addMultipleCells(_2a);
}
}
if(_27>20){
var _2b=(_27)/I.maxCells;
scratchpadRefresh=50+_2b*100;
}else{
scratchpadRefresh=50;
}
scratchpadTimeout=self.setTimeout("updateScratchpad()",scratchpadRefresh);
}

