var Dummy

IMAGE01 = "on.gif"  
IMAGE02 = "off.gif"
function imgover(imgname){imgname.src = IMAGE01}
function imgout(imgname){imgname.src = IMAGE02}

//setInterval('KeepAlive()', 300000);
//Begin Remote Scripting functions
	RSSource = "rscript.asp"
	function myCallback(returnstring){document.write(returnstring);}
	function Notify(returnstring){alert(returnstring)} 
	function rsExecute(funName,Parms){jsrsPOST = false;jsrsExecute(RSSource, myCallback, funName,Parms);}
	function AdminShow(returnstring){document.getElementById("adminfoot").innerHTML = returnstring;}
	
	

	
	
//Forum Functions
		function Post()
		{validate(document.getElementById("newpost"));}

		function delForum(varID)
		{
			if(confirm('You are about to delete this forum and all messages, Continue?'))
				{jsrsExecute(RSSource,myCallback ,'DelForum', varID);}
			window.location="forumadmin.asp";
		}
// Content Functions
		function delFAQ(varID)
		{
			if(confirm('You are about to delete this content section, Continue?'))
				{jsrsExecute(RSSource,Notify ,'DeleteFAQ', varID);}
			window.location="admin.asp";
		}
		
		function delChapter(varID,varFAQ)
		{
			if(confirm('You are about to delete this content section, Continue?'))
				{jsrsExecute(RSSource,Notify ,'DeleteChapter', varID);}
			varLocation = "http://www.am-tech.org/chapters.asp?faq_fldAuto="+varFAQ;
			window.location=varLocation
		}

		function delQuestion(varID,varChapter)
		{	
			if(confirm('You are about to delete this item, Continue?'))
				{jsrsExecute(RSSource,Notify ,'DeleteQuestion', varID);}
			varLocation = "http://www.am-tech.org/questions.asp?chapter_fldAuto="+varChapter;
			window.location=varLocation
		}

		function UpdateQuestion(qID)
		{	
		//alert(document.getElementById('answer').value);
		var Parms = (qID,document.getElementById('answer').value);
			if(confirm('You are about to change this item, Continue?'))
				{jsrsExecute(RSSource,Notify ,'UpdateQ', Parms);}
			//varLocation = "http://www.am-tech.org/questions.asp?chapter_fldAuto="+varChapter;
			//window.location=varLocation
			ToggleDisplay('Edit');
		}

//End Remote Scripting functions
//onSubmit=""return Confirm('What you are about to do.')""
function Confirm(strAction){if(confirm(strAction)){return true;}else{return false;};}
function Hide(obj){document.getElementById(obj).style.display = "none";}
function Show(obj){document.getElementById(obj).style.display = "block";}
function ToggleDisplay(obj)
{
	if (document.getElementById(obj).style.display == "none")
		document.getElementById(obj).style.display = "block";
	else
		document.getElementById(obj).style.display = "none";
}

//Generic Form Validation
//Usage: <Form id="Formid" action="" method="post" onsubmit='return validate(this,"RequiredField1,RequiredField2,...");'>
function validate(objForm,objFields) 
{
   var aryFields = objFields.split(/,/);
   for (i=0; i<aryFields.length; i++) 
	   {	
		if (objForm.document.getElementById(aryFields[i]).value == "")
		{
			alert("The field " + aryFields[i] + " is required. Thank you.");
			objForm.document.getElementById(aryFields[i]).focus();
			return (false);
		}
		}
	return (true);
}

