trying='';
destinationHTML='';
quickchecker='';
answer='no';


function deleter() { 
	if (veryoldword!='') {
		reset_stream();
		connections=connections-1;
		trying='out.asp?testthis='+veryoldword+'&oldword='+oldword; 
		if (document.layers) {
			hiddenLyr.load(trying, available_width);}
		else {
			if (document.all) {
				eval('parent.ieContent.document.frames["ieframe"].document.location = trying');}
			else {
				eval("ns7input.src = trying");}
		}
		timedresponse();
	}
	else {
		onscreen();
		helpscreen();}
}



function top10(val) { 
	lil_counter=0;
	if (theword.indexOf('cunt')!= -1 || theword.indexOf('bastard')!= -1 || theword.indexOf('shit')!= -1 || theword.indexOf('fuck') != -1|| theword.indexOf('wank') != -1|| theword.indexOf('piss') != -1) { output(2);}
	else {
		if (val==10) {trying='blank.html';}
		else {
// amend for local			if (cycle) {
	trying='in.asp?testthis='+theword+'&oldword='+oldword+'&veryoldword='+veryoldword+'&ancient='+ancient;
//}
 //			else{
//	trying='http://donovan.au.com/testing/association.php?testthis='+theword+'&oldword='+oldword+'&veryoldword='+veryoldword+'&ancient='+ancient;}

		}

	if (document.layers) {hiddenLyr.load(trying, available_width);}
	else {
		if (document.all) {eval('parent.ieContent.document.frames["ieframe"].document.location = trying');}
		else {eval("ns7input.src = trying");}
		}
	if (val!=10) {timedresponse();}
	}
}

function loademup(targetdiv) { // only relevant for ie and ns6+, call made from .asp

	destinationHTML=eval(targetdiv+'HTML');
	if (document.all) {
		eval('parent.destinationHTML.innerHTML = parent.ieContent.document.frames["ieframe"].document.body.innerHTML');}
	else {
		eval("hiddenHTML.innerHTML = window.frames.ieframe.document.getElementById('body').innerHTML");}
	top10(10);  // clears the possibility of errors on refresh - cant remember why...
}


function timedresponse() {

	if (quickchecker=="spellingerror") {
		stoptime();  
		output(12);
		counter=0;
		quickchecker='';
	}
	else

	if (quickchecker=="finished") {
		stoptime();  
		if (answer=="no") {bad_result();}
		else
		if (answer=="done") {
			newentry=newentry-1;
			newword=false;
			nu_connection=false;
			counter=0;
			screenresult='';
			veryoldword=ancient;
				oldword=fin_l;
					ancient=lastsuccess;
						lastsuccess=oldword;
			helpscreen();
			onscreen();
		}
		else
		if (answer=="yes" && mainLyr.visibility.indexOf('hid') != 0) {
			if (oldword) {ancient=oldword;}
			else 
			{ancient=theword;}		
			output(6);
			lil_counter=rnd;

			sumtotal='<font class="operatic">'+sumtotal+'</font>'+(ancient&&consecutive>1?'<a href=# onmouseover="window.status=\'start a new thread with &quot;'+ancient+'&quot; \'; return true;" onmouseout="window.status=\'\'; return true;" onclick="ancient=\'\';veryoldword=\'\';oldword=\'\';lastsuccess=\''+ancient+'\';submitter(); return false;"><font color=goldenrod>'+ancient+'</font></a> &#187; ':'<font color='+(cycle?'ivory>chase mode:':'firebrick>new thread:')+'</font> ')+'<a href=# onmouseover="window.status=\'start a new thread with &quot;'+theword+'&quot; \'; return true;" onmouseout="window.status=\'\'; return true;" onclick="ancient=\'\';veryoldword=\'\';oldword=\'\';lastsuccess=\''+theword+'\';submitter(); return false;"><font color=red>'+theword+'</font></a><br>';

			if ((consecutive/100)==Math.round(consecutive/100)) {reset_stream();}
			show_stream();
			if (cycle){cycletimer = setTimeout("submitter()", 3500);}
		}
	quickchecker='';
	answer='no';
}
else

{
testtimer = setTimeout("timedresponse()", 500);}
}


function stoptime() {clearTimeout(testtimer);}





////// ******* clipping etc ///////////

function clipLayer(layer,array,index) {
    var cRight = array[index].right;
    var cLeft = array[index].left;
        layer.left = array[index].move;
    if(document.layers) 
{layer.clip.right = cRight; layer.clip.left =  cLeft;}
 else 
{layer.clip = 'rect(0 ' + cRight + ' 108 ' + cLeft + ')';}
}

function clipValues(bright,left,move) {
    this.right = bright;
    this.left = left;
    this.move = move;
}