//---fired prior to each example call and user svg "RESET" onclick---

var ResetRequest=false

function reset()
{
	ResetRequest=true //---stops example sequences set at true on example selection----
	//---do this prior to swapping out clones
	if(CurrentActiveView=="example1")
	 {
		example1_discStatusSpan.innerHTML="An XML file is sending data packets, reflecting the status of community and their discs. The incoming data is shown above in the Source textarea.<cemter><span class=small style='font-style:italic'>(This community has 240 discs)</span></center>"
		stopData_Example1()
		startData_Example1Button.disabled=true
		stopData_Example1Button.disabled=true

		if(document.frames.importFrame.UpdateInterval!=null)
			clearInterval(document.frames.importFrame.UpdateInterval)
	 }

	Universe.currentScale=1
	Universe.currentTranslate.x=0
	Universe.currentTranslate.y=0

	svgSpan.style.visibility="visible"
	establishObjects()

	if(activeRow)
	{
		activeRow.style.backgroundColor=activeBG
	}
	activeRow=null
	scriptBlockValue.value=prettyIndent(initScript.text)

	//---all examples default reset---
   	sourceTypeSpan.innerText="SVG Source  "
	sourceValue.style.backgroundColor="palegoldenrod"
	codeTypeSpan.innerText="Javascript Functions  "
	scriptBlockValue.style.backgroundColor="khaki"
    ScriptExpandHt=null
	SourceExpandHt=null



	reduceSource()
	reduceScript()
	ScriptExpandHt=null
	SourceExpandHt=null
	SourceExpandCheck=false
	ScriptExpandCheck=false

	exampleTitleSpan.style.visibility="visible"
	reduceScriptCheck.style.visibility="visible"
	expandScriptCheck.style.visibility="visible"
	reduceSourceCheck.style.visibility="visible"
	expandSourceCheck.style.visibility="visible"
	exampleTitleSpan.innerHTML=""

	//----Basics Reset---
	The_Spiral_PathClockwiseButton.disabled=true
	The_Spiral_PathCounterclockwiseButton.disabled=true

	Spiral_VariablesSpiralPointsSelect.selectedIndex=4
	Spiral_VariablesSeparationSelect.selectedIndex=5
	Spiral_VariablesRevsSelect.selectedIndex=4
	Spiral_VariablesSpiralPointsSelect.disabled=true
	Spiral_VariablesSeparationSelect.disabled=true
	Spiral_VariablesRevsSelect.disabled=true

	Radial_LinesSpiralPointsSelect.disabled=true
	Radial_LinesSpiralPointsSelect.selectedIndex=4

	Spiral_ChordsBackButton.disabled=true
	Spiral_ChordsForwardButton.disabled=true

	SVG_3D_SpiralSelect.disabled=true
	SVG_3D_SpiralSelect.selectedIndex=0

	Spiral_3D_EffectSelect.disabled=true
	Spiral_3D_EffectSelect.selectedIndex=0

	Reverse_ViewingBackButton.disabled=true
	Reverse_ViewingFrontButton.disabled=true


	 searchSelect.disabled=true
	 searchSelect.selectedIndex=0
	 ZoomSlider.value=0
	 backSortButton.disabled=true
	 frontSortButton.disabled=true
	 quickReferenceSpan.style.visibility="hidden"

	statusClickButton.disabled=true
	statusValue.value="Normal"

	appTable.disabled=true
	appViewResultButton.disabled=true
	appDiscValue.value=240
	appScaleValue.value=.25
	appCenterValue.value="165,165"
	appAngleValue.value=4
	appTwistValue.value=.4
	appSepValue.value=56
	appRevValue.value=1.98
	appViewResetButton.disabled=true

	randomDataChangeButton.disabled=true
	sortOnStatusCheck.checked=false



	if(CurrentActiveView=="example2")
	{
		svgSpan.style.overflow=""
		svgSpan.style.width=300*FactorW
		svgSpan.style.height=300*FactorW
		example2_thumbSpan.style.width=1
		example2_thumbSpan.style.height=1
		example2_thumbSpan.style.overflow="hidden"
		parent.example2_colorSelect.disabled=true
		parent.example2_elemSelect.disabled=true
		parent.example2_goButton.disabled=true
		example2_thumbSpan.innerHTML=""
		example2_foundSpan.innerHTML="A search/thumbnail algorithm scans the community files and finds the communities with the most status/discs that match the search criteria. A representative portion of the community is returned for its thumbnail."+
		"<center><span class=small>There are over 400 serpentined data communities with more than a  1000 data discs in each. </span></center>"
	}

	CurrentActiveView=null

}

function establishObjects()
{
	var currentSVG=God.childNodes.item(0)
	God.removeChild(currentSVG)
	God.appendChild(CloneSVG)
	//---re establish objects---
    Universe=God.documentElement;
    Galaxy=God.getElementById("Galaxy");
    Spiral=God.getElementById("Spiral");
    SpiralText=God.getElementById("SpiralText");
    Heaven=God.getElementById("Heaven");
	CloneSVG=Universe.cloneNode(true)
	sourceValue.value=printNode(Universe)
}


