// be2 Javascript functions (client side)
//     $Id: be2.js,v 1.4 2003/08/04 18:52:06 csnyder Exp $

function spellcheck(myform,myfield) {
	//window.alert(document.cookie);
	be2word= /be2word=([^;\s]+)/i;
	cooks= document.cookie.match(be2word);
	speller= window.open('','spellcheckWindow','scrollbars=yes,width=600,height=400,status=yes');
	var formHead= "<html><head><title>Spellcheck</title></head><body onload='window.focus()'><form name='spellcheck' action='/index.popup?method=spellcheck' method='post' ><h3>Spellcheck this text:</h3><textarea name='text' cols='60' rows='10'>";
	var formKey= "</textarea><input type='hidden' name='key' value='" + cooks[1] + "' />";
	var formTail= "<input type='hidden' name='myform' value='" + myform + "' /><input type='hidden' name='myfield' value='" + myfield + "' /><br /><input type='submit' name='submit' value='check' /></form><br /><a href='javascript:window.close();'>Close window</a></body></html>";
	speller.document.write(formHead);
	text= document[myform][myfield].value;
 	speller.document.write(text);
	speller.document.write(formKey);
	speller.document.write(formTail);
	speller.document.close();
	}

function republish(location) {
	dotpos= location.lastIndexOf( "." );
	filename= location.substring( 0 , dotpos );
	publisher= window.open(filename+'.popup?method=uplinkSelect','republishWindow','scrollbars=yes,width=600,height=400,status=yes');
	}
	
function popup(location) {
	mypopup= window.open(location,'be2popup','scrollbars=yes,width=650,height=460,status=yes');
	}

function toggleimport() {
	o= document.getElementById("importopen");
	c= document.getElementById("importclosed");
	//window.alert(o.style.display);
	if (o.style.display=="none" || o.style.display=="" ) {
		c.style.display= "none";
		o.style.display= "block";
		}
	else {
		c.style.display= "block";
		o.style.display= "none";
		}
	}
